From: Guillaume Pellerin Date: Fri, 22 Jan 2016 13:45:26 +0000 (+0100) Subject: add quiz validation to progression X-Git-Tag: 2.8.1-pro~241 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=996e6bc645a7c694a054d9a884f338bbfbf5300c;p=teleforma.git add quiz validation to progression --- 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: