From f8004073055ecd3955e0fbd4d3f2409f09107fc6 Mon Sep 17 00:00:00 2001 From: "robinwilliam.hundt" <robinwilliam.hundt@stud.uni-goettingen.de> Date: Thu, 7 Mar 2019 17:06:44 +0100 Subject: [PATCH] Changed importer such that exam is mandatory --- util/importer.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/util/importer.py b/util/importer.py index 5289b87d..eb5c1703 100644 --- a/util/importer.py +++ b/util/importer.py @@ -253,10 +253,9 @@ def do_load_submission_types(): def do_load_module_descriptions(): print(''' - This loader imports descriptions of modules in an exam. This step is purely - optional -- Grady works just fine without these information. If you want to - distinguish students within one instance or give information about the - grading type you should provide this info. + This loader imports descriptions of modules in an exam. This information + is used to distinguish students within one instance or give information + about the grading type. CSV file format: module_reference, total_score, pass_score, pass_only @@ -377,8 +376,9 @@ def do_load_submissions(): file = i('Get me the file with all the submissions', 'submissions.json', is_file=True) - exam_obj = {} - if ExamType.objects.all(): + if not ExamType.objects.all(): + raise Exception('Modules need to be loaded before submissions.') + else: exam_query_set = ExamType.objects.all() print('Please select the corresponding module') print('You have the following choices:\n') -- GitLab