]> git.parisson.com Git - teleforma.git/commitdiff
add qutoas script counter
authorGuillaume Pellerin <yomguy@parisson.com>
Fri, 1 Aug 2014 19:30:46 +0000 (21:30 +0200)
committerGuillaume Pellerin <yomguy@parisson.com>
Fri, 1 Aug 2014 19:30:46 +0000 (21:30 +0200)
teleforma/exam/models.py
teleforma/exam/templates/exam/quotas.html
teleforma/exam/templates/exam/script_form.html

index 181b8048d1c7041c104d109ce10ce9e60b15d00b..75af0ae13ab13cf8598c6bb0a8510e0cc079ab94 100644 (file)
@@ -131,11 +131,15 @@ class Quota(models.Model):
     def __unicode__(self):
         return ' - '.join([unicode(self.corrector), self.course.title, str(self.value)])
 
+    @property
+    def count(self):
+        return self.corrector.corrector_scripts.filter(Q(status=2) | Q(status=3) | Q(status=4) | Q(status=5)).count()
+
     @property
     def level(self):
         if self.value:
             if self.value != 0:
-                level = 100*self.corrector.corrector_scripts.filter(Q(status=2) | Q(status=3) | Q(status=4) | Q(status=5)).count()/self.value
+                level = 100*self.count/self.value
                 return level
             else:
                 return 0
index 6786d84d406468a10da23ecc782ec34ab00a2278..f71b6e24c818ad15c515cf63cc2d6ef4dda9b8b5 100644 (file)
@@ -23,6 +23,7 @@
     <th>{% trans "date end"%}</th>
     <th>{% trans "Value"%}</th>
     <th>{% trans "Level"%} (%)</th>
+    <th>{% trans "Marked"%} (%)</th>
     </tr>
     </thead>
     <tbody id="spacing" class="script-list">
@@ -34,6 +35,7 @@
      <td>{{ quota.date_end }}</td>
      <td>{{ quota.value }}</td>
      <td>{{ quota.level|floatformat }}</td>
+     <td>{{ quota.count }}</td>
     </tr>
     {% endfor %}
     </tbody>
index 607d6a9234bb10202a7e4dd6d097a6ca4189fd06..57a31d06702360590ba94cc550a80e3979bc05e9 100644 (file)
@@ -60,7 +60,7 @@
     </form>
     <br />
     <center>
-    <a href="#" id="submit_button" class="component_icon button icon_ok">{% trans "Submit" %}</a>
+    <a href="#" id="submit_button" class="component_icon button icon_next">{% trans "Submit" %}</a>
     <img id="loading" src="{{STATIC_URL}}teleforma/images/loading.gif" style="vertical-align:middle" alt="loading" />
     </center>
     <br /><br />