diff options
author | maheshgudi | 2017-03-08 14:44:18 +0530 |
---|---|---|
committer | maheshgudi | 2017-03-08 14:44:18 +0530 |
commit | 433cc099527acfc7e5146c06f848c283a806f8b5 (patch) | |
tree | cfe7e8016cb0518f21f537e1677c102017b8c96f /yaksh/templates | |
parent | 211c12eb1c2002945e228e0f33cd45d494df74ff (diff) | |
parent | aede1c3736077387d63eacd20c2c39d8875e605d (diff) | |
download | online_test-433cc099527acfc7e5146c06f848c283a806f8b5.tar.gz online_test-433cc099527acfc7e5146c06f848c283a806f8b5.tar.bz2 online_test-433cc099527acfc7e5146c06f848c283a806f8b5.zip |
Merge branch 'master' of https://github.com/fossee/online_test into fill_in_the_blanks
Diffstat (limited to 'yaksh/templates')
-rw-r--r-- | yaksh/templates/user.html | 2 | ||||
-rw-r--r-- | yaksh/templates/yaksh/monitor.html | 20 | ||||
-rw-r--r-- | yaksh/templates/yaksh/question.html | 15 |
3 files changed, 24 insertions, 13 deletions
diff --git a/yaksh/templates/user.html b/yaksh/templates/user.html index 1707305..0d1f980 100644 --- a/yaksh/templates/user.html +++ b/yaksh/templates/user.html @@ -16,7 +16,7 @@ <div class= "collapse navbar-collapse" id="navbar"> <ul class="nav navbar-nav navbar-right"> <li><a href="{{ URL_ROOT }}/exam/viewprofile"> {{ user.get_full_name.title }} </a></li> - <li><a style='cursor:pointer' onClick='location.replace("{{URL_ROOT}}/exam/logout/");'> <span class="glyphicon glyphicon-log-out">Logout </span></a></li> + <li><a style='cursor:pointer' id='logout' onClick='location.replace("{{URL_ROOT}}/exam/complete/");'> <span class="glyphicon glyphicon-log-out">Logout </span></a></li> </ul> </div><!-- /.navbar --> </div><!-- /.container --> 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> diff --git a/yaksh/templates/yaksh/question.html b/yaksh/templates/yaksh/question.html index bfc90a8..0106bac 100644 --- a/yaksh/templates/yaksh/question.html +++ b/yaksh/templates/yaksh/question.html @@ -89,7 +89,10 @@ function call_skip(url) } </script> <script> - $(document).ready(function(){ + + var init_val = '{{ last_attempt|escape_quotes|safe }}'; + var global_editor = {}; + $(document).ready(function(){ // Codemirror object, language modes and initial content // Get the textarea node var textarea_node = document.querySelector('#answer'); @@ -115,17 +118,15 @@ function call_skip(url) }; // Initialize the codemirror editor - var editor = CodeMirror.fromTextArea(textarea_node, options); + global_editor.editor = CodeMirror.fromTextArea(textarea_node, options); // Setting code editors initial content - editor.setValue('{{ last_attempt|escape_quotes|safe }}') + global_editor.editor.setValue(init_val); function reset_editor() { - editor.setValue('{{ last_attempt|escape_quotes|safe }}'); - editor.clearHistory(); + global_editor.editor.setValue(init_val); + global_editor.editor.clearHistory(); } - - }); </script> |