From 996e6bc645a7c694a054d9a884f338bbfbf5300c Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Fri, 22 Jan 2016 14:45:26 +0100 Subject: [PATCH] add quiz validation to progression --- teleforma/context_processors.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/teleforma/context_processors.py b/teleforma/context_processors.py index fb84e5e1..6a47a3a9 100644 --- a/teleforma/context_processors.py +++ b/teleforma/context_processors.py @@ -60,6 +60,12 @@ def seminar_progress(user, seminar): if answer: progress += question.weight + quiz_weight = 3 + quiz_validations = QuizValidation.objects.filter(user=user, quiz=seminar.quiz, validated=True) + total += quiz_weight + if quiz_validations: + progress += quiz_weight + if total != 0: return int(progress*100/total) else: -- 2.39.5