diff --git a/dojo_plugin/pages/course.py b/dojo_plugin/pages/course.py index 7c66f8a0f..4cb7ac02c 100644 --- a/dojo_plugin/pages/course.py +++ b/dojo_plugin/pages/course.py @@ -308,13 +308,25 @@ def view_all_grades(dojo): average_grade = sum(grade["overall_grade"] for grade in grades) / len(grades) if grades else 0.0 average_letter_grade = get_letter_grade(dojo, average_grade) + average_grade_summary = f"{average_letter_grade} ({average_grade * 100:.2f}%)" + average_grade_details = [] + cumulative_count = 0 + for letter_grade in dojo.course["letter_grades"]: + count = sum(1 for grade in grades if grade["letter_grade"] == letter_grade) + cumulative_count += count + percent = f"{count / len(grades) * 100:.2f}%" if grades else "0.00%" + cumulative_percent = f"{cumulative_count / len(grades) * 100:.2f}%" if grades else "0.00%" + average_grade_details.append({ + "Grade": letter_grade, + "Count": count, + "Percent": percent, + "Cumulative Percent": cumulative_percent, + }) grade_statistics = { - "Average": f"{average_letter_grade} ({average_grade * 100:.2f}%)", + "Average": (average_grade_summary, average_grade_details), } - for letter_grade in dojo.course["letter_grades"]: - count = sum(1 for grade in grades if grade["letter_grade"] == letter_grade) - grade_statistics[letter_grade] = f"{count} ({count / len(grades) * 100:.2f}%)" + students = {student.user_id: student.token for student in dojo.students} diff --git a/dojo_theme/templates/grades_admin.html b/dojo_theme/templates/grades_admin.html index d2274c54d..752defb24 100644 --- a/dojo_theme/templates/grades_admin.html +++ b/dojo_theme/templates/grades_admin.html @@ -63,10 +63,31 @@
{{ column }} | +
{{ value }} | + {% endfor %} +