-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgrade.py
22 lines (19 loc) · 875 Bytes
/
grade.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import traceback
def grade_all(name, begin, end, funcs):
grade = 0
for q in range(begin, end):
func = funcs["grade_Q%d" % q]
try:
if func():
print("============Q%d passed!============\n" % q)
grade += 1
else:
print("============Q%d failed!============\n" % q)
except Exception as e:
print("============Q%d failed!============" % q)
print(traceback.format_exc())
print("Local Testing: %d functions passed" % grade)
print("*************************************************************")
print("* You may receive 0 points unless your code tests correctly *")
print("* in CI System. Please commit and push your code to start. *")
print("*************************************************************")