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

Readable code now disabled by default.

parent 68872e76
Branches
Tags 0.3.2
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
......
......@@ -4,7 +4,7 @@ from setuptools import setup
setup(
name='hektor',
version='0.3.1',
version='0.3.2',
description='A QTI-XML/XLS to JSON converter for humans',
author='Jan Maximilian Michal',
author_email='mail@janmax.org',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment