summaryrefslogtreecommitdiff
path: root/example/src/check_students.py
diff options
context:
space:
mode:
authorLan Hui <1348141770@qq.com>2021-07-14 15:05:47 +0800
committerLan Hui <1348141770@qq.com>2021-07-14 15:05:47 +0800
commit9375d5536c060eaa6c132f7533f8486abfd04074 (patch)
tree6d88340bb70f9adec6f5a469686609e5777f8160 /example/src/check_students.py
Upload Jin Xiongrong's work -- https://gitee.com/dragondove/storode; fix UnicodeDecodeError
Diffstat (limited to 'example/src/check_students.py')
-rw-r--r--example/src/check_students.py60
1 files changed, 60 insertions, 0 deletions
diff --git a/example/src/check_students.py b/example/src/check_students.py
new file mode 100644
index 0000000..782eb22
--- /dev/null
+++ b/example/src/check_students.py
@@ -0,0 +1,60 @@
+# @req 0e96
+import operator
+from myutil.get_student_number import get_student_number
+
+# main
+
+# @req 0e96 37
+student_no = [
+ '201532120139',
+ '201632120134',
+ '201632120140',
+ '201632120149',
+ '201632120150',
+ '201632120152',
+ '201632120161',
+ '201730210234',
+ '201732120133',
+ '201732120134',
+ '201732120135',
+ '201732120136',
+ '201732120137',
+ '201732120140',
+ '201732120141',
+ '201732120142',
+ '201732120143',
+ '201732120146',
+ '201732120147',
+ '201732120151',
+ '201732120152',
+ '201732120157',
+ '201732120159',
+ '201732120161',
+ '201732120164',
+ '201732120165',
+ '201732120166',
+ '201732120167',
+ '201732120168',
+ '201732120170',
+ '201732120173',
+ '201732120174',
+ '201732120175',
+]
+
+
+assignments = ['assignment-submissions.txt', 'assignment-submissions2.txt']
+
+result = [] # @req unkw
+for n in student_no:
+ count = 0
+ for fname in assignments:
+ lst = get_student_number(fname)
+ if n in lst:
+ count += 1
+
+ result.append((n, count))
+
+for t in sorted(result, key=operator.itemgetter(1)):
+ n = t[0]
+ count = t[1]
+ print('%s\t%d' % (n, count))