Skip to content

Commit

Permalink
remove dropout questionnaires from average calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
fekoch committed Nov 25, 2024
1 parent 7164fd7 commit 1fa6eb3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions evap/results/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -388,12 +388,12 @@ def calculate_average_distribution(evaluation):
if not evaluation.can_staff_see_average_grade or not evaluation.can_publish_average_grade:
return None

# todo@felix: remove dropout questionnaires from calculation
# will contain a list of question results for each contributor and one for the evaluation (where contributor is None)
grouped_results = defaultdict(list)
for contribution_result in get_results(evaluation).contribution_results:
for questionnaire_result in contribution_result.questionnaire_results:
grouped_results[contribution_result.contributor].extend(questionnaire_result.question_results)
if questionnaire_result.questionnaire.type != Questionnaire.Type.DROPOUT: # dropout questionnaires are not counted
grouped_results[contribution_result.contributor].extend(questionnaire_result.question_results)

evaluation_results = grouped_results.pop(None, [])

Expand Down

0 comments on commit 1fa6eb3

Please sign in to comment.