summaryrefslogtreecommitdiff
path: root/stats/templates/view_lesson_tracking.html
blob: ef5c9aefee6fe7ca6658a585d5ca30e89048ecc5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
{% extends "manage.html" %}
{% load static %}
{% block title %} Lesson Views {% endblock %}
{% block script %}
<script type="text/javascript" src="{% static 'yaksh/js/jquery.tablesorter.min.js' %}">
</script>
<script type="text/javascript">
    function get_time_in_seconds(time) {
        var time = time.split(":");
        var hh = parseInt(time[0]);
        var mm = parseInt(time[1]);
        var ss = parseInt(time[2]);
        return hh * 3600 + mm * 60 + ss;
    }

    $(document).ready(function() {
        $("#stats-table").tablesorter({});
    });
</script>
{% endblock %}
{% block content %}
<div class="container">
    {% with objects.object_list as trackings %}
    <center>
        <h3>Statistics for {% with trackings|first as entry %} {{entry.lesson}} {% endwith %}</h3>
    </center>
    <a class="btn btn-primary" href="{% url 'yaksh:lesson_statistics' course_id lesson_id %}">
        <i class="fa fa-arrow-left"></i>&nbsp;Back
    </a>
    <br><br>
    {% include "yaksh/paginator.html" %}
    <br>
    <h4><strong>{{total}} student(s) viewed this lesson</strong></h4>
    <table class="table table-responsive" id="stats-table">
        <thead>
            <tr>
                <th>Sr No.</th>
                <th>Student Name&nbsp;<i class="fa fa-sort"></i></th>
                <th>Last access on&nbsp;<i class="fa fa-sort"></i></th>
                <th>Started on&nbsp;<i class="fa fa-sort"></i></th>
                <th>Current Duration&nbsp;<i class="fa fa-sort"></i></th>
                <th>Video Duration&nbsp;<i class="fa fa-sort"></i></th>
                <th>Percentage Watched&nbsp;<i class="fa fa-sort"></i></th>
                <th>Watched Once Completely&nbsp;<i class="fa fa-sort"></i></th>
                <th>Total Time Spent&nbsp;<i class="fa fa-sort"></i></th>
            </tr>
        </thead>
        {% for track in trackings %}
            <tr>
                <td>{{ forloop.counter0|add:objects.start_index }}</td>
                <td>{{track.user.get_full_name}}</td>
                <td>{{track.get_last_access_time}}</td>
                <td>{{track.creation_time}}</td>
                <td>{{track.get_current_time}}</td>
                <td>{{track.get_video_duration}}</td>
                <td>{{track.get_percentage_complete}}</td>
                <td>{{track.get_watched}}</td>
                <td>{{track.time_spent}}</td>
            </tr>
        {% endfor %}
    </table>
    {% endwith %}
    <br>
    {% include "yaksh/paginator.html" %}
</div>
{% endblock %}