Skip to content
Snippets Groups Projects
Commit 6b8b30f2 authored by tuhe's avatar tuhe
Browse files

updates

parent 228776fa
No related branches found
No related tags found
No related merge requests found
......@@ -10,8 +10,5 @@ colorama
numpy
scikit_learn
snipper
<<<<<<< HEAD
importnb # Experimental notebook inclusion feature. May not be required.
=======
requests # To read remote files for automatic updating.
>>>>>>> c157b3d262cc96db218ca37a4f96005cfec0d138
......@@ -172,7 +172,9 @@ def evaluate_report(report, question=None, qitem=None, passall=False, verbose=Fa
detail['status'] = 'error'
else:
raise Exception("Status not known.")
detail = {**detail, **msg}#['message'] = msg
nice_title = s.title
detail = {**detail, **msg, 'nice_title': nice_title}#['message'] = msg
details[key] = detail
# q_[s._testMethodName] = ("pass", None)
......
......@@ -128,8 +128,8 @@ class Report:
if not url.endswith("/"):
url += "/"
snapshot_file = os.path.dirname(self._file()) + "/unitgrade_data/.snapshot"
print("Sanity checking time using snapshot", snapshot_file)
print("and using self-identified file", self._file())
# print("Sanity checking time using snapshot", snapshot_file)
# print("and using self-identified file", self._file())
if os.path.isfile(snapshot_file):
with open(snapshot_file, 'r') as f:
......@@ -140,15 +140,15 @@ class Report:
if self.url.startswith("https://gitlab"):
# Try to turn url into a 'raw' format.
"https://gitlab.compute.dtu.dk/tuhe/unitgrade_private/-/raw/master/examples/autolab_example_py_upload/instructor/cs102_autolab/report2_test.py?inline=false"
# "https://gitlab.compute.dtu.dk/tuhe/unitgrade_private/-/raw/master/examples/autolab_example_py_upload/instructor/cs102_autolab/report2_test.py?inline=false"
# url = self.url
url = url.replace("-/tree", "-/raw")
print(url)
# print(url)
# "https://gitlab.compute.dtu.dk/tuhe/unitgrade_private/-/tree/master/examples/autolab_example_py_upload/instructor/cs102_autolab"
# "https://gitlab.compute.dtu.dk/tuhe/unitgrade_private/-/raw/master/examples/autolab_example_py_upload/instructor/report2_test.py?inline=false"
# "https://gitlab.compute.dtu.dk/tuhe/unitgrade_private/-/raw/master/examples/autolab_example_py_upload/instructor/cs102_autolab/report2_test.py?inline=false"
raw_url = urllib.parse.urljoin(url, os.path.basename(self._file()) + "?inline=false")
print("Is this file run in local mode?", self._is_run_in_grade_mode())
# print("Is this file run in local mode?", self._is_run_in_grade_mode())
if self._is_run_in_grade_mode():
remote_source = requests.get(raw_url).text
with open(self._file(), 'r') as f:
......@@ -430,12 +430,12 @@ class UTestCase(unittest.TestCase):
# file = inspect.getfile(self.__class__)
import importlib, inspect
found_reports = []
print("But do I have report", self._report)
print("I think I am module", self.__module__)
print("Importlib says", importlib.import_module(self.__module__))
# print("But do I have report", self._report)
# print("I think I am module", self.__module__)
# print("Importlib says", importlib.import_module(self.__module__))
# This will delegate you to the wrong main clsas when running in grade mode.
for name, cls in inspect.getmembers(importlib.import_module(self.__module__), inspect.isclass):
print("checking", cls)
# print("checking", cls)
if issubclass(cls, Report):
for q,_ in cls.questions:
if q == self.__class__:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment