diff options
-rw-r--r-- | yaksh/templates/yaksh/monitor.html | 9 | ||||
-rw-r--r-- | yaksh/templatetags/custom_filters.py | 10 |
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() |