From 5a3ac0adc9102bb37689c2e622178c7447875c7f Mon Sep 17 00:00:00 2001 From: Tue Herlau <tuhe@win.dtu.dk> Date: Wed, 13 Jan 2021 21:25:11 +0100 Subject: [PATCH] 2021 coming up --- unitgrade/unitgrade_helpers.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/unitgrade/unitgrade_helpers.py b/unitgrade/unitgrade_helpers.py index e336a3a..c19e5cc 100644 --- a/unitgrade/unitgrade_helpers.py +++ b/unitgrade/unitgrade_helpers.py @@ -130,11 +130,11 @@ def evaluate_report(report, question=None, qitem=None, passall=False, verbose=Fa if not hidden: print(ss, end="") sys.stdout.flush() - from timeit import timeit - timeit() + import time + start = time.time() (current, possible) = item.get_points(show_expected=show_expected, show_computed=show_computed,unmute=unmute, passall=passall) q_[j] = {'w': iw, 'possible': possible, 'obtained': current, 'hidden': hidden, 'computed': str(item._computed_answer)} - tsecs = np.round(timeit(), 2) + tsecs = np.round(time.time-start, 2) # q.possible += possible * iw # q.obtained += current * iw @@ -144,7 +144,7 @@ def evaluate_report(report, question=None, qitem=None, passall=False, verbose=Fa print(ss) ws, possible, obtained = upack(q_) - possible = int(ws @ possible) + possible = int(ws @ possible) obtained = int(ws @ obtained) obtained = int(myround(int((w * obtained) / possible ))) if possible > 0 else 0 score[n] = {'w': w, 'possible': w, 'obtained': obtained, 'items': q_, 'hidden': q_hidden} -- GitLab