diff options
author | Prabhu Ramachandran | 2017-03-03 18:34:57 +0530 |
---|---|---|
committer | GitHub | 2017-03-03 18:34:57 +0530 |
commit | aede1c3736077387d63eacd20c2c39d8875e605d (patch) | |
tree | 12fbd9103d86b9c67c3a6b7698368f312dfbc86c /yaksh/templates | |
parent | 27fa11322e4b6ca2477a5979884e8e77388d8705 (diff) | |
parent | 3c1abece2c1ba60c561c8e9258aef6e9e7525eba (diff) | |
download | online_test-aede1c3736077387d63eacd20c2c39d8875e605d.tar.gz online_test-aede1c3736077387d63eacd20c2c39d8875e605d.tar.bz2 online_test-aede1c3736077387d63eacd20c2c39d8875e605d.zip |
Merge pull request #230 from adityacp/show_remain_time_monitor
Show remaining time of students in monitor
Diffstat (limited to 'yaksh/templates')
-rw-r--r-- | yaksh/templates/yaksh/monitor.html | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/yaksh/templates/yaksh/monitor.html b/yaksh/templates/yaksh/monitor.html index b84f050..d2c89ce 100644 --- a/yaksh/templates/yaksh/monitor.html +++ b/yaksh/templates/yaksh/monitor.html @@ -12,7 +12,16 @@ $(document).ready(function() { $("#result-table").tablesorter({sortList: [[5,1]]}); - }); + var papers_length = "{{papers|length}}"; + for (var i=0; i < papers_length; i++){ + var time_left = $("#time_left"+[i]); + var time = time_left.text(); + var hh = Math.floor(time / 3600); + var mm = Math.floor((time - (hh * 3600)) / 60); + var ss = time - (hh * 3600) - (mm * 60); + time_left.text(hh + ":" + mm + ":" + ss) + } +}); </script> {% endblock %} @@ -60,7 +69,7 @@ $(document).ready(function() <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"> +<table id="result-table" class="tablesorter table table table-striped"> <thead> <tr> <th> Name </th> @@ -70,7 +79,7 @@ $(document).ready(function() <th> Questions answered </th> <th> Marks obtained </th> <th> Attempts </th> - <th> Status </th> + <th> Time Remaining </th> </tr> </thead> <tbody> @@ -80,10 +89,11 @@ $(document).ready(function() <td> {{ paper.user.username }} </td> <td> {{ paper.user.profile.roll_number }} </td> <td> {{ paper.user.profile.institute }} </td> - <td> {{ paper.get_answered_str }} </td> + <td> {{ paper.get_answered_str }} </td> <td> {{ paper.marks_obtained }} </td> <td> {{ paper.answers.count }} </td> - <td> {{ paper.status }} </td> + <td id="time_left{{forloop.counter0}}"> {{ paper.time_left }} </td> + </div> </tr> {% endfor %} </tbody> |