summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoradityacp2017-02-28 11:46:01 +0530
committeradityacp2017-02-28 11:46:01 +0530
commit28c4036a1c112f3e0e1bce2e1c0a0663aae21d11 (patch)
treef3fbb8120a1ae62b6b4fa40197614b3b748deea4
parentb001bc98db69e1ef1926b0f2103bf5a291682f93 (diff)
downloadonline_test-28c4036a1c112f3e0e1bce2e1c0a0663aae21d11.tar.gz
online_test-28c4036a1c112f3e0e1bce2e1c0a0663aae21d11.tar.bz2
online_test-28c4036a1c112f3e0e1bce2e1c0a0663aae21d11.zip
Show remaining time of students in monitor
-rw-r--r--yaksh/templates/yaksh/monitor.html17
1 files changed, 13 insertions, 4 deletions
diff --git a/yaksh/templates/yaksh/monitor.html b/yaksh/templates/yaksh/monitor.html
index b84f050..fbcca9c 100644
--- a/yaksh/templates/yaksh/monitor.html
+++ b/yaksh/templates/yaksh/monitor.html
@@ -12,6 +12,14 @@
$(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 date = new Date(null);
+ date.setSeconds(time_left.text());
+ var result = date.toISOString().substr(11, 8);
+ time_left.text(result)
+ }
});
</script>
@@ -60,7 +68,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 +78,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 +88,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>