summaryrefslogtreecommitdiff
path: root/yaksh/templates
diff options
context:
space:
mode:
authorPalaparthy Adityachandra2020-11-18 18:45:21 +0530
committerGitHub2020-11-18 18:45:21 +0530
commit544c796a8b55e742975c6714b5bc0208a198df95 (patch)
tree3d1a43b712b0bbae35df087360403118066193e0 /yaksh/templates
parenta00348278009bcfdafaba9ba7e10383036b601f3 (diff)
parent5f02880d022053ed07ed218fd52d9e436f6455ee (diff)
downloadonline_test-544c796a8b55e742975c6714b5bc0208a198df95.tar.gz
online_test-544c796a8b55e742975c6714b5bc0208a198df95.tar.bz2
online_test-544c796a8b55e742975c6714b5bc0208a198df95.zip
Merge pull request #800 from adityacp/improve_video_tracking
Improve video tracking and lesson statistics
Diffstat (limited to 'yaksh/templates')
-rw-r--r--yaksh/templates/yaksh/course_added_modules.html34
-rw-r--r--yaksh/templates/yaksh/courses.html20
-rw-r--r--yaksh/templates/yaksh/show_lesson_statistics.html41
-rw-r--r--yaksh/templates/yaksh/show_video.html2
4 files changed, 73 insertions, 24 deletions
diff --git a/yaksh/templates/yaksh/course_added_modules.html b/yaksh/templates/yaksh/course_added_modules.html
index d420b95..80d87c0 100644
--- a/yaksh/templates/yaksh/course_added_modules.html
+++ b/yaksh/templates/yaksh/course_added_modules.html
@@ -1,3 +1,4 @@
+{% load custom_filters %}
{% if is_modules %}
{% block pagetitle %} <center> <h3>Course Modules</h3> </center> {% endblock %}
<a href="{% url 'yaksh:add_module' course.id %}" class="btn btn-primary btn-lg">
@@ -49,7 +50,8 @@
<table class="table table-responsive-sm">
{% for unit in units %}
<tr>
- <td>
+ <td>{{forloop.counter}}</td>
+ <td width="25%">
{% if unit.type == "quiz" %}
{% if unit.quiz.is_exercise %}
<a href="{% url 'yaksh:edit_exercise' course.id module.id unit.quiz.id %}">
@@ -69,12 +71,12 @@
{% if quiz.questionpaper_set.get.id %}
<a href="{% url 'yaksh:designquestionpaper' course.id quiz.id quiz.questionpaper_set.get.id %}" class="btn btn-primary">
<i class="fa fa-edit"></i>
- Edit Question Paper
+ Question Paper
</a>
{% else %}
<a href="{% url 'yaksh:designquestionpaper' course.id quiz.id %}" class="btn btn-success">
<i class="fa fa-plus-circle"></i>
- Add Question Paper
+ Question Paper
</a>
{% endif %}
{% endwith %}
@@ -95,6 +97,14 @@
</td>
<td>
{% if unit.type == "quiz" %}
+ ----
+ {% else %}
+ {% get_lesson_views course.id unit.lesson.id as views %}
+ {{views.0}} views out of {{views.1}}
+ {% endif %}
+ </td>
+ <td>
+ {% if unit.type == "quiz" %}
{% if unit.quiz.questionpaper_set.get.id %}
<a href="{% url 'yaksh:show_statistics' unit.quiz.questionpaper_set.get.id course.id %}" class="btn btn-outline-primary">
<i class="fa fa-line-chart"></i>
@@ -104,9 +114,23 @@
----
{% endif %}
{% else %}
- <a href="{% url 'yaksh:lesson_statistics' course.id unit.lesson.id %}" class="btn btn-outline-primary">
- <i class="fa fa-line-chart"></i>&nbsp;Statistics
+ <div class="btn-group" role="group" aria-label="Button group with nested dropdown">
+ <button type="button" class="btn btn-outline-primary">
+ <i class="fa fa-line-chart"></i>
+ Statistics
+ </button>
+ <div class="btn-group" role="group">
+ <button id="btnGroupDrop1" type="button" class="btn btn-outline-primary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"></button>
+ <div class="dropdown-menu" aria-labelledby="btnGroupDrop1" style="">
+ <a class="dropdown-item" href="{% url 'stats:view_lesson_watch_stats' course.id unit.lesson.id %}">
+ Video Views
+ </a>
+ <a class="dropdown-item" href="{% url 'yaksh:lesson_statistics' course.id unit.lesson.id %}">
+ Quiz Submissions
</a>
+ </div>
+ </div>
+ </div>
{% endif %}
</td>
</tr>
diff --git a/yaksh/templates/yaksh/courses.html b/yaksh/templates/yaksh/courses.html
index 151e1fb..38c106c 100644
--- a/yaksh/templates/yaksh/courses.html
+++ b/yaksh/templates/yaksh/courses.html
@@ -106,6 +106,17 @@
<div class="card border-primary">
<div class="card-header" style="height: 150px">
{{course.name}}
+ <div>
+ {% if user.id != course.creator.id %}
+ <span class="badge badge-pill badge-warning">
+ Allotted Course
+ </span>
+ {% else %}
+ <span class="badge badge-pill badge-primary">
+ Created Course
+ </span>
+ {% endif %}
+ </div>
</div>
<div class="card-body">
<div class="row">
@@ -119,15 +130,6 @@
</div>
<hr>
<div class="row">
- <div class="col-md-5">
- <span class="badge badge-pill badge-info">
- {% if user.id != course.creator.id %}
- Allotted Course
- {% else %}
- Created Course
- {% endif %}
- </span>
- </div>
<div class="col-md-3">
{% if course.active %}
<span class="badge badge-pill badge-success">
diff --git a/yaksh/templates/yaksh/show_lesson_statistics.html b/yaksh/templates/yaksh/show_lesson_statistics.html
index 0c35e40..a7c2ebd 100644
--- a/yaksh/templates/yaksh/show_lesson_statistics.html
+++ b/yaksh/templates/yaksh/show_lesson_statistics.html
@@ -1,7 +1,31 @@
{% extends "manage.html" %}
+{% load static %}
{% load custom_filters %}
{% block title %} Lesson Statistics {% endblock %}
{% block pagetitle %} Statistics for {{lesson}} {% endblock %}
+{% block script %}
+<script type="text/javascript" src="{% static 'yaksh/js/jquery.tablesorter.min.js' %}">
+</script>
+<script type="text/javascript">
+ $(document).ready(function() {
+ $.tablesorter.addWidget({
+ id: "numbering",
+ format: function(table) {
+ var c = table.config;
+ $("tr:visible", table.tBodies[0]).each(function(i) {
+ $(this).find('td').eq(0).text(i + 1);
+ });
+ }
+ });
+ $("#stats-table").tablesorter({
+ headers: {
+ 0: { sorter: false }
+ },
+ widgets: ['numbering']
+ });
+ });
+</script>
+{% endblock %}
{% block content %}
<div class="container-fluid">
<br>
@@ -11,11 +35,6 @@
<i class="fa fa-arrow-left"></i>&nbsp;Back
</a>
</div>
- <div class="col-md-4">
- <a class="btn btn-outline-dark" href="{% url 'stats:view_lesson_watch_stats' course_id lesson.id %}">
- <i class="fa fa-line-chart"></i>&nbsp;Video Statistics
- </a>
- </div>
</div>
<br>
{% if data %}
@@ -161,16 +180,18 @@
<br><br>
{% endif %}
{% include "yaksh/paginator.html" %}
- <table class="table table-responsive">
+ <table class="table table-responsive" id="stats-table">
+ <thead>
<tr>
<th>Sr No.</th>
- <th>Student Name</th>
- <th>Email</th>
- <th>Latest Submission</th>
+ <th>Student Name&nbsp;<i class="fa fa-sort"></i></th>
+ <th>Email&nbsp;<i class="fa fa-sort"></i></th>
+ <th>Latest Submission&nbsp;<i class="fa fa-sort"></i></th>
</tr>
+ </thead>
{% for data in objects.object_list %}
<tr>
- <td>{{ forloop.counter0|add:objects.start_index }}</td>
+ <td>{{ forloop.counter }}</td>
<td>{{data.student__first_name}} {{data.student__last_name}}</td>
<td>{{data.student__email}}</td>
{% get_answers data.toc_id data.student_id as user_answer %}
diff --git a/yaksh/templates/yaksh/show_video.html b/yaksh/templates/yaksh/show_video.html
index 0151f6b..b4f5628 100644
--- a/yaksh/templates/yaksh/show_video.html
+++ b/yaksh/templates/yaksh/show_video.html
@@ -9,6 +9,8 @@
var contents_by_time = JSON.parse('{{ contents_by_time|safe }}');
var loc = 0;
var video_time = [];
+ var markers = [];
+ var track_count = 0;
</script>
<script type="text/javascript" src="{% static 'yaksh/js/show_toc.js' %}">
</script>