improve stats handling
This commit is contained in:
+17
-1
@@ -2162,7 +2162,7 @@ class ExamViews(View, LoginRequiredMixin):
|
||||
exam.stats_min = min(user_scores_list)
|
||||
exam.stats_max = max(user_scores_list)
|
||||
|
||||
# exam.stats_graph = fig_html
|
||||
exam.stats_graph = fig_html
|
||||
|
||||
user_data = {}
|
||||
for u in cids:
|
||||
@@ -2225,6 +2225,22 @@ class ExamViews(View, LoginRequiredMixin):
|
||||
template_variables,
|
||||
)
|
||||
|
||||
def exam_stats(self, request, exam_id):
|
||||
exam = get_object_or_404(self.Exam, pk=exam_id)
|
||||
|
||||
if not exam.exam_mode:
|
||||
raise Http404("Packet not in exam mode")
|
||||
|
||||
template_variables = {
|
||||
"exam": exam
|
||||
}
|
||||
|
||||
return render(
|
||||
request,
|
||||
"exam_stats.html",
|
||||
template_variables,
|
||||
)
|
||||
|
||||
|
||||
class GenericViewBase:
|
||||
def __init__(self, app_name, QuestionObject, UserAnswerObject, ExamObject):
|
||||
|
||||
Reference in New Issue
Block a user