]> git.parisson.com Git - teleforma.git/commitdiff
add quiz progress
authorGuillaume Pellerin <yomguy@parisson.com>
Thu, 10 Dec 2015 14:10:16 +0000 (15:10 +0100)
committerGuillaume Pellerin <yomguy@parisson.com>
Thu, 10 Dec 2015 14:10:16 +0000 (15:10 +0100)
teleforma/templates/quiz/question.html
teleforma/templatetags/teleforma_tags.py

index 1a8d9cc35fefc0ef8f23f8cbcd7956dafc84adec..b65eea530a07952fdb3a1cf1a4a2cc70837341b7 100644 (file)
@@ -1,6 +1,6 @@
 {% extends "quiz/base.html" %}
 {% load i18n%}
-
+{% load teleforma_tags %}
 {% load quiz_tags %}
 
 {% comment %}
     <li>{% trans "Seminar" %} : {{ seminar_progress }}%
      <div id="progressbar-seminar"></div>
     </li>
-    <li>{% trans "Quiz" %} : {{ progress }}
+    <li>{% trans "Quiz" %} : {{ progress|quiz_progress }}%
      <div id="progressbar-answer"></div>
     </li>
 
index 9b2eaa2fb05797a8076ae761e77c2c1731499971..5b3ddd61b8f7ac5dd32365f4a808ce7291c37da8 100644 (file)
@@ -321,3 +321,9 @@ def integer(value):
         return int(value)
     else:
         return 0
+
+@register.filter
+def quiz_progress(progress):
+    return int(progress[0]*100.0/progress[1])
+
+