diff --git a/setup.py b/setup.py index 280a3e6a21aa3f00039bbc64d8f809503fdce959..a26c5b46abfe697c00cee0de0e110b98379b7eb8 100644 --- a/setup.py +++ b/setup.py @@ -10,6 +10,5 @@ setup( author_email='tuhe@dtu.dk', description='A lightweight student evaluation framework build on unittest', include_package_data=True, - install_requires=['jinja2', 'tabulate', 'sklearn', 'compress_pickle', ], - # package_data={'', ['*.dat']},#'cs101courseware_example/Report1_resources_do_not_hand_in.dat', 'cs101courseware_example/Report2_resources_do_not_hand_in.dat')}, + install_requires=['jinja2', 'tabulate', 'sklearn', 'compress_pickle', "pyfiglet", "numpy"], ) diff --git a/unitgrade/__init__.py b/unitgrade/__init__.py index 9a6c1d840a6b208b343aa532a26f47f3e6a43891..105478029035f1b487a9e058aa645379af599c84 100644 --- a/unitgrade/__init__.py +++ b/unitgrade/__init__.py @@ -1,4 +1,4 @@ -__version__ = "0.0.8" +__version__ = "0.0.9" import os import compress_pickle diff --git a/unitgrade/unitgrade_helpers.py b/unitgrade/unitgrade_helpers.py index ed2c391ecbdd6f731b89a52b5a5ac6b224bfef80..4db4c2b7695559a25b7b48d20ed888ba4e4e57d7 100644 --- a/unitgrade/unitgrade_helpers.py +++ b/unitgrade/unitgrade_helpers.py @@ -1,9 +1,7 @@ import numpy as np from tabulate import tabulate from datetime import datetime -import pickle import pyfiglet -import unitgrade from unitgrade import Hidden, myround, msum, mfloor from unitgrade import __version__ @@ -30,13 +28,13 @@ Note this scripts does not grade your report. To grade your report, use: > python report1_grade.py Finally, note that if your report is part of a module (package), and the report script requires part of that package, the -m option for python may be useful. -As an old, suppose the report file is Documents/course_package/assignment1_dp.py, and `course_package` is a python package. Change directory to 'Documents/` and execute: +For instance, if the report file is in Documents/course_package/assignment1_dp.py, and `course_package` is a python package, then change directory to 'Documents/` and run: > python -m course_package.report1 see https://docs.python.org/3.9/using/cmdline.html """, formatter_class=argparse.RawTextHelpFormatter) -parser.add_argument('-q', nargs='?', type=str, default=None, help='Only evaluate this question (old: -q 2)') +parser.add_argument('-q', nargs='?', type=str, default=None, help='Only evaluate this question (e.g.: -q 2)') parser.add_argument('--showexpected', action="store_true", help='Show the expected/desired result') parser.add_argument('--showcomputed', action="store_true", help='Show the answer your code computes') parser.add_argument('--unmute', action="store_true", help='Show result of print(...) commands in code') @@ -63,7 +61,6 @@ def evaluate_report_student(report, question=None, qitem=None, unmute=None, pass unmute = args.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: @@ -89,7 +86,7 @@ def upack(q): # ws, possible, obtained = (np.asarray(x).squeeze() for x in zip([(i['w'], i['possible'], i['obtained']) for i in q.values()])) # return ws, possible, obtained -def evaluate_report(report, question=None, qitem=None, passall=False, verbose=False, show_expected=False, show_computed=False,unmute=False): +def evaluate_report(report, question=None, qitem=None, passall=False, verbose=False, show_expected=False, show_computed=False,unmute=False, show_help_flag=True): now = datetime.now() # show_expected = True ascii_banner = pyfiglet.figlet_format("UnitGrade", font="doom") @@ -100,7 +97,7 @@ def evaluate_report(report, question=None, qitem=None, passall=False, verbose=Fa s = report.title if report.version is not None: s += " version " + report.version - print("Evaluating " + s, "(use --help for options)") + print("Evaluating " + s, "(use --help for options)" if show_help_flag else "") print(f"Loaded answers from: ", report.computed_answers_file, "\n") table_data = [] nL = 80