From 0be2f9e1c121df386308d8ffd4304701c9f8bb58 Mon Sep 17 00:00:00 2001
From: Tue Herlau <tuhe@win.dtu.dk>
Date: Wed, 13 Jan 2021 21:16:51 +0100
Subject: [PATCH] 2021 coming up

---
 .../__pycache__/unitgrade.cpython-36.pyc      | Bin 11514 -> 11574 bytes
 .../unitgrade_helpers.cpython-36.pyc          | Bin 5424 -> 5460 bytes
 unitgrade/unitgrade_helpers.py                |  21 +++++++++++-------
 3 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/unitgrade/__pycache__/unitgrade.cpython-36.pyc b/unitgrade/__pycache__/unitgrade.cpython-36.pyc
index e06afc97e8a0e65c9dcb389f7959e83085e93cfc..650192ef2a15d66101d9b6ed2d8900ed8fe6506d 100644
GIT binary patch
delta 284
zcmewrxh;y*n3tDJQs7_wlZ~8gn)Pf93=FIc3=GZ;3=G933=9nE47H3EDK!jP49yHK
z46zZlOf^hdj46!GjJ3=uOtmaE%qh&-EJYDuQ4o(+oS~VimbHczMVvJSEDjM%VXI}S
zVJYUTVa#HxVQOY%WGLhdXGmesVwSF9Y-S8*(B$y@#i;65#LU3J@Qbmgh>?MTA!Kr$
zrmP=ZQ4|9M!!5SFoXot`;#-V4x0nl(OQM(xb8aza7I82zFhB@S5G$U6fq{vUfuUH8
z0mNcq<YVMwWMSlB6kwELWMO1s+<ZgRgppBnGOzY|MuEw9wc{9PO}5e5&8*JB2LLXB
BK5zg4

delta 220
zcmdlM^(&Ion3tE!iT7W;!bVOu&3YCF1_lszW?*0__G4gRNN1>Jtgx$L$YN+_aAAlw
zs%5HS%3@4mY-X%wu3=7L%4R7tt6{2PPGJ^jkYq?<%w{SwE99$T%wnoxYG!0)DC7%g
zNMXrhu3>Cu3}(<|_4~zGQ^d@`!0?irfq|jOn}LBrlcmUjfq~%`OIqgSotnG?EJaZu
zE?ZtsW?pLXEyl_BH6=tD85tOg`4|`&7#LX?`53tvB^a5QH;ZVQFfs~G_S8Pl$TL||
QCysIE<O-eL%xWCm0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KpDoW=vs75ol$SWJuu?XJ}?(WGE3x;Rk80
zVcq<PZ3UCqE&kN9#GKN^lGOO3)Pnq?k|J3K28PK8Ic3;yu@)3%=9Nso%jw9-Ia!`d
ze6lrHFr&`oel7_nCZ);ixqdPRPhQEL%^0{@l;;XFW7OnV{H2U>n-c_V85sj6&lBut
zG?=U>l)@Ioz`#)CF?ohiBV*WPDPd3PD5k>rTZ~z^STajeb8j(amfvD3F22Q-no|@o
zxlY)eRiA-@A!_n2;dV9<OOtuBhlnm?_~bGX8^*-Rn?-B|Qb8u#fCx7bp+8A9kXep{
F698iIaEt%|

diff --git a/unitgrade/unitgrade_helpers.py b/unitgrade/unitgrade_helpers.py
index 3087c2d..e336a3a 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}
-- 
GitLab