-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmanage.py
27 lines (23 loc) · 854 Bytes
/
manage.py
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
from Util import nbmanager
import sys
def main(argv):
if len(argv) == 2 and argv[0] == 'generate':
assignment_id = argv[1]
ret = nbmanager.generate(assignment_id)
print(ret)
elif len(argv) == 3 and argv[0] == 'autograde':
assignment_id = argv[1]
user_id = argv[2]
ret = nbmanager.autograde(assignment_id, user_id)
print(ret)
elif len(argv) == 3 and argv[0] == 'get_submission':
assignment_id = argv[1]
user_id = argv[2]
ret = nbmanager.get_submission(assignment_id, user_id)
print(ret)
else:
print('usage: manage.py generate <assignment_id>')
print(' manage.py autograde <assignment_id> <user_id>')
print(' manage.py get_submission <assignment_id> <user_id>')
if __name__ == '__main__':
main(sys.argv[1:])