summaryrefslogtreecommitdiff
path: root/example/src/check_students.py
blob: 782eb226102efb6a4491fbe83c3b42b4d507bd16 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
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))