]> git.parisson.com Git - teleforma.git/commitdiff
add quiz validation to progression
authorGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Fri, 22 Jan 2016 13:45:26 +0000 (14:45 +0100)
committerGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Fri, 22 Jan 2016 13:45:26 +0000 (14:45 +0100)
teleforma/context_processors.py

index fb84e5e1d651153d5dc2e50b85a2859217d94e8a..6a47a3a93a7f02508cc0285eb7147c3707445fa4 100644 (file)
@@ -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: