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
Branches
No related tags found
1 merge request!2Fixed bug in anonymisation function
......@@ -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.
Please register or to comment