From 6b8b30f231c29495713bd3b100dde1e2afdf8617 Mon Sep 17 00:00:00 2001
From: Tue Herlau <tuhe@dtu.dk>
Date: Fri, 3 Jun 2022 18:43:37 +0200
Subject: [PATCH] updates

---
 requirements.txt           |  5 +----
 src/unitgrade/evaluate.py  |  4 +++-
 src/unitgrade/framework.py | 18 +++++++++---------
 3 files changed, 13 insertions(+), 14 deletions(-)

diff --git a/requirements.txt b/requirements.txt
index 5d7e63e..49a5436 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -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
+requests # To read remote files for automatic updating.
diff --git a/src/unitgrade/evaluate.py b/src/unitgrade/evaluate.py
index ab805b8..9c4392b 100644
--- a/src/unitgrade/evaluate.py
+++ b/src/unitgrade/evaluate.py
@@ -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)
diff --git a/src/unitgrade/framework.py b/src/unitgrade/framework.py
index 7ff3bdf..f1d16b8 100644
--- a/src/unitgrade/framework.py
+++ b/src/unitgrade/framework.py
@@ -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__:
-- 
GitLab