diff --git a/unitgrade/__pycache__/unitgrade.cpython-36.pyc b/unitgrade/__pycache__/unitgrade.cpython-36.pyc index e06afc97e8a0e65c9dcb389f7959e83085e93cfc..650192ef2a15d66101d9b6ed2d8900ed8fe6506d 100644 Binary files a/unitgrade/__pycache__/unitgrade.cpython-36.pyc and b/unitgrade/__pycache__/unitgrade.cpython-36.pyc differ diff --git a/unitgrade/__pycache__/unitgrade_helpers.cpython-36.pyc b/unitgrade/__pycache__/unitgrade_helpers.cpython-36.pyc index 67d4c848842dfb3200eed7be396d9e59b3640d57..b1ef9dc6b9b3154d2cebad1295e20b940d1909eb 100644 Binary files a/unitgrade/__pycache__/unitgrade_helpers.cpython-36.pyc and b/unitgrade/__pycache__/unitgrade_helpers.cpython-36.pyc differ diff --git a/unitgrade/unitgrade_helpers.py b/unitgrade/unitgrade_helpers.py index 3087c2d9ecf19c6b18fb491a0a066dcdb5fd6e6f..e336a3a571bcd0555d30ceb589664e199a962fc0 100644 --- a/unitgrade/unitgrade_helpers.py +++ b/unitgrade/unitgrade_helpers.py @@ -48,7 +48,7 @@ parser.add_argument('--passall', action="store_true", help='Automatically pass # const=sum, default=max, # help='sum the integers (default: find the max)') -def evaluate_report_student(report, question=None, qitem=None, unmute=None): +def evaluate_report_student(report, question=None, qitem=None, unmute=None, passall=None): args = parser.parse_args() if question is None and args.q is not None: question = args.q @@ -61,8 +61,10 @@ def evaluate_report_student(report, question=None, qitem=None, unmute=None): if unmute is None: unmute = args.unmute - - results, table_data = evaluate_report(report, question=question, qitem=qitem, verbose=False, passall=args.passall, show_expected=args.showexpected, show_computed=args.showcomputed,unmute=unmute) + if passall is None: + passall = args.passall + print(args.unmute, unmute) + results, table_data = evaluate_report(report, question=question, qitem=qitem, verbose=False, passall=passall, show_expected=args.showexpected, show_computed=args.showcomputed,unmute=unmute) if question is None: print("Provisional evaluation") @@ -128,18 +130,21 @@ 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() (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) + # q.possible += possible * iw # q.obtained += current * iw if not hidden: - if current == possible: - print(f"PASS") - else: - print(f"*** FAILED") + ss = "PASS" if current == possible else "*** FAILED" + ss += " ("+ str(tsecs) + " seconds)" + 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}