Skip to content

Commit

Permalink
Improved the stat average calculation.
Browse files Browse the repository at this point in the history
  • Loading branch information
ruslanbaidan committed Mar 26, 2024
1 parent 576abc3 commit ba87267
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions stats/stats_logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,19 +134,16 @@ def get_finished_surveys_list(start_date, end_date):
surveys_users_results["survey_users"][user_id]["details"][
"total_score"
] = round(total_points_number * 100 / total_questions_score)
total_overall_score = (
total_overall_score
+ surveys_users_results["survey_users"][user_id]["details"][
"total_score"
]
)
total_overall_score += surveys_users_results["survey_users"][user_id][
"details"
]["total_score"]

return {
"start_date": str(start_date),
"end_date": str(end_date),
"total_overall_score": str(total_overall_score),
"total_average_score": str(round(
"total_overall_score": total_overall_score,
"total_average_score": round(
total_overall_score / surveys_users_results["surveys_total_number"]
)),
),
"surveys_users_results": surveys_users_results,
}

0 comments on commit ba87267

Please sign in to comment.