Skip to content
Snippets Groups Projects
Commit ddb373b6 authored by robinwilliam.hundt's avatar robinwilliam.hundt
Browse files

Fixed bug in anonymisation function

The function `do_anonymous` in `hektor.py` was dependant upon the iteration order of a dictionary being the same as the insertion order. This is an implementation detail of CPython3.6 and should not be relied upon.
parent 4faddf13
No related branches found
No related tags found
No related merge requests found
Pipeline #78303 passed
......@@ -227,11 +227,11 @@ def do_anonymous(students: Dict[str, Union[str, List]]):
reverser = {get_random_xkcd_identifier(): s for s in students}
students_anonymous = [{
'fullname': ' '.join(w[0].capitalize() + w[1:]
for w in r.split(DELIMITER)),
'identifier': r,
'username': r,
for w in pseudo_identifier.split(DELIMITER)),
'identifier': pseudo_identifier,
'username': pseudo_identifier,
'submissions': student['submissions']
} for r, student in zip(reverser, students)]
} for pseudo_identifier, student in reverser.items()]
with open(args.personal_secret_table, 'w') as out:
print('key;previous identifier;fullname', file=out)
......
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