Skip to content

Commit

Permalink
pick first matching question when creating previous links
Browse files Browse the repository at this point in the history
In theory this should not happen but this is to resolve some data issues
with initial scorecards.
  • Loading branch information
struan committed Jul 1, 2024
1 parent ff7f1de commit 1586e1c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions crowdsourcer/management/commands/link_questions.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,9 @@ def get_questions(self, session):
questions = defaultdict(dict)

for section in Section.objects.filter(marking_session=session):
for question in Question.objects.filter(section=section):
questions[section.title][question.number_and_part] = question
for question in Question.objects.filter(section=section).order_by("pk"):
if questions[section.title].get(question.number_and_part) is None:
questions[section.title][question.number_and_part] = question

return questions

Expand Down

0 comments on commit 1586e1c

Please sign in to comment.