summaryrefslogtreecommitdiff
path: root/yaksh
diff options
context:
space:
mode:
authoradityacp2020-12-03 14:32:15 +0530
committeradityacp2020-12-03 14:32:15 +0530
commite461b7c71d3d33f7e1cde4415ae35733078f4070 (patch)
tree8c193ad48b882cae31c32501a7a197f2df083b30 /yaksh
parent3a442d0142aac2bb6f1d5379e1d533b9b8fc6da6 (diff)
downloadonline_test-e461b7c71d3d33f7e1cde4415ae35733078f4070.tar.gz
online_test-e461b7c71d3d33f7e1cde4415ae35733078f4070.tar.bz2
online_test-e461b7c71d3d33f7e1cde4415ae35733078f4070.zip
Show graphs for the lesson video statistics
Diffstat (limited to 'yaksh')
-rw-r--r--yaksh/templates/yaksh/show_lesson_statistics.html6
-rw-r--r--yaksh/templatetags/custom_filters.py2
2 files changed, 4 insertions, 4 deletions
diff --git a/yaksh/templates/yaksh/show_lesson_statistics.html b/yaksh/templates/yaksh/show_lesson_statistics.html
index a7c2ebd..dfce52c 100644
--- a/yaksh/templates/yaksh/show_lesson_statistics.html
+++ b/yaksh/templates/yaksh/show_lesson_statistics.html
@@ -1,7 +1,7 @@
{% extends "manage.html" %}
{% load static %}
{% load custom_filters %}
-{% block title %} Lesson Statistics {% endblock %}
+{% block title %} Lesson Quiz Stats {% endblock %}
{% block pagetitle %} Statistics for {{lesson}} {% endblock %}
{% block script %}
<script type="text/javascript" src="{% static 'yaksh/js/jquery.tablesorter.min.js' %}">
@@ -135,8 +135,8 @@
<div class="progress" style="width: 30%">
{% if percent %}
<div class="progress-bar bg-success" role="progressbar" aria-valuenow="{{percent}}"
- aria-valuemin="0" aria-valuemax="100" style="width:{{percent}}%">
- <b style="color: white;">{{percent}}%</b>
+ aria-valuemin="0" aria-valuemax="100" style="width:{{percent|floatformat}}%">
+ <b style="color: white;">{{percent|floatformat}}%</b>
</div>
{% else %}
<b style="color: black;">0%</b>
diff --git a/yaksh/templatetags/custom_filters.py b/yaksh/templatetags/custom_filters.py
index 91681c2..7eba939 100644
--- a/yaksh/templatetags/custom_filters.py
+++ b/yaksh/templatetags/custom_filters.py
@@ -209,5 +209,5 @@ def get_tc_percent(tc_id, data):
def get_lesson_views(course_id, lesson_id):
course = Course.objects.get(id=course_id)
return TrackLesson.objects.filter(
- course_id=course_id, lesson_id=lesson_id
+ course_id=course_id, lesson_id=lesson_id, watched=True
).count(), course.students.count()