summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormaheshgudi2017-01-03 17:57:01 +0530
committermaheshgudi2017-01-03 17:57:01 +0530
commit25eb8d10045e1af6ab7c282b8df0b008223be545 (patch)
treecd83157c0b2d89e431ad7d481367cb2c7ef738f1
parentfeeb605573357fd8056f103b1043e192838bb23d (diff)
downloadonline_test-25eb8d10045e1af6ab7c282b8df0b008223be545.tar.gz
online_test-25eb8d10045e1af6ab7c282b8df0b008223be545.tar.bz2
online_test-25eb8d10045e1af6ab7c282b8df0b008223be545.zip
added completed and inprogress papers' status in monitor
-rw-r--r--yaksh/templates/yaksh/monitor.html9
-rw-r--r--yaksh/templatetags/custom_filters.py10
2 files changed, 18 insertions, 1 deletions
diff --git a/yaksh/templates/yaksh/monitor.html b/yaksh/templates/yaksh/monitor.html
index 7a3297b..0ad6401 100644
--- a/yaksh/templates/yaksh/monitor.html
+++ b/yaksh/templates/yaksh/monitor.html
@@ -1,4 +1,5 @@
{% extends "manage.html" %}
+{% load custom_filters %}
{% block pagetitle %} Quiz results {% endblock pagetitle %}
@@ -49,6 +50,14 @@ $(document).ready(function()
{% if papers %}
<p>Number of papers: {{ papers|length }} </p>
+{% completed papers as completed_papers %}
+ {# template tag used to get the count of completed papers #}
+ <p>Papers completed: <b> {{ completed_papers }} </b></p>
+
+{% inprogress papers as inprogress_papers %}
+ {# template tag used to get the count of inprogress papers #}
+ <p>Papers in progress:<b> {{ inprogress_papers }} </b></p>
+
<p><a href="{{URL_ROOT}}/exam/manage/statistics/question/{{papers.0.question_paper.id}}">Question Statisitics</a></p>
<p><a href="{{URL_ROOT}}/exam/manage/monitor/download_csv/{{papers.0.question_paper.id}}">Download CSV</a></p>
<table id="result-table" class="tablesorter table">
diff --git a/yaksh/templatetags/custom_filters.py b/yaksh/templatetags/custom_filters.py
index 9d7b939..f610cc6 100644
--- a/yaksh/templatetags/custom_filters.py
+++ b/yaksh/templatetags/custom_filters.py
@@ -10,4 +10,12 @@ def escape_quotes(value):
escape_single_quotes = value.replace("'", "\\'")
escape_single_and_double_quotes = escape_single_quotes.replace('"', '\\"')
- return escape_single_and_double_quotes \ No newline at end of file
+ return escape_single_and_double_quotes
+
+@register.assignment_tag(name="completed")
+def completed(answerpaper):
+ return answerpaper.filter(status="completed").count()
+
+@register.assignment_tag(name="inprogress")
+def inprogress(answerpaper):
+ return answerpaper.filter(status="inprogress").count()