Skip to content
Snippets Groups Projects
Verified Commit a43082d0 authored by Jan Maximilian Michal's avatar Jan Maximilian Michal
Browse files

Readable code now disabled by default.

parent 68872e76
No related branches found
No related tags found
No related merge requests found
Pipeline #
......@@ -97,7 +97,6 @@ def setup_argparse():
parser.add_argument(
'-r', '--readable-code',
action='store_true',
default=True,
help='make student code readable by inserting artificial line breaks')
args = parser.parse_args()
......@@ -166,10 +165,22 @@ def do_verify(structured_data: Dict[str, Any]) -> Dict[str, Any]:
assert 'students' in structured_data, 'No students found'
assert 'tasks' in structured_data, 'No tasks found'
def assert_task(task):
assert 'type' in task, 'Task has no type'
assert 'title' in task, 'Task must have a title'
try:
base_assert()
students = structured_data['students']
number_of_submissions = len(structured_data['tasks'])
tasks = structured_data['tasks']
number_of_submissions = len(tasks)
for task in tasks:
try:
assert_task(task)
except AssertionError as err:
raise err
for student in students:
try:
......
......@@ -69,10 +69,10 @@ def process_results(tree, qti=(), **kwargs):
id2user = {user['active_id']: user for user in users}
for user in users:
user['submissions'] = []
for question in questions:
solutions = process_solutions(tree, question)
for question_key, question in questions.items():
solutions = process_solutions(tree, question_key)
for user_id, solution in solutions.items():
id2user[user_id]['submissions'].append({'type': question,
id2user[user_id]['submissions'].append({'type': question['title'],
'code': solution,
'tests': {}})
return users
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment