diff options
Diffstat (limited to 'yaksh/templates')
-rw-r--r-- | yaksh/templates/yaksh/grade_user.html | 22 | ||||
-rw-r--r-- | yaksh/templates/yaksh/question.html | 32 |
2 files changed, 38 insertions, 16 deletions
diff --git a/yaksh/templates/yaksh/grade_user.html b/yaksh/templates/yaksh/grade_user.html index 9cdfb1a..2038210 100644 --- a/yaksh/templates/yaksh/grade_user.html +++ b/yaksh/templates/yaksh/grade_user.html @@ -9,6 +9,14 @@ {% block script %} <script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"></script> +<script src="{{ URL_ROOT }}/static/yaksh/js/jquery.tablesorter.min.js"></script> +<script type="text/javascript"> +$(document).ready(function() +{ + $("#marks_table").tablesorter({sortList: [[2,1]]}); +}); + +</script> {% endblock script %} {% if course_details %} @@ -108,17 +116,25 @@ Status : <b style="color: green;"> Passed </b><br/> {% if paper.answers.count %} <h4> Report </h4><br> -<table class="table table-bordered"> +<table class="tablesorter table table-striped table-bordered" id ='marks_table'> + <thead> + <tr> + <th>Question Id</th> <th>Questions</th> <th>Marks Obtained</th> + </tr> + </thead> + <tbody> {% for question, answers in paper.get_question_answers.items %} {% with answers|last as answer %} <tr> - <td>{{ question.id }}</td> + <td>{{question.id}}</td> + <td><a href="#question_{{question.id}}">{{ question.summary }}</a></td> <td>{{ answer.answer.marks }}</td> </tr> {% endwith %} {% endfor %} + </tbody> </table> @@ -135,7 +151,7 @@ Status : <b style="color: green;"> Passed </b><br/> {% for question, answers in paper.get_question_answers.items %} <div class = "well well-sm"> <div class="panel panel-info"> - <div class="panel-heading"> + <div class="panel-heading" id="question_{{question.id}}"> <strong> Details: {{forloop.counter}}. {{ question.summary }} <span class="marks pull-right"> Mark(s): {{ question.points }} </span> </strong> diff --git a/yaksh/templates/yaksh/question.html b/yaksh/templates/yaksh/question.html index 3a3066c..eb6eb3d 100644 --- a/yaksh/templates/yaksh/question.html +++ b/yaksh/templates/yaksh/question.html @@ -53,7 +53,7 @@ function updateClock(){ var ss = ('0' + t.seconds).slice(-2); if(t.total<0){ - + document.forms["code"].submit(); clearInterval(timeinterval); return null; @@ -77,10 +77,7 @@ function validate(){ $("#upload_alert").modal("show"); return false; } - else - { - send_request(); - } + return true; } function call_skip(url) @@ -155,32 +152,44 @@ lang = "{{ question.language }}" <div class="panel-body"> {% if question.type == "mcq" %} {% for test_case in test_cases %} - <input name="answer" type="radio" value="{{ test_case.options }}" />{{ test_case.options|safe }} <br/> + {% if last_attempt and last_attempt|safe == test_case.options|safe %} + <input name="answer" type="radio" value="{{ test_case.options }}" checked /> + {{ test_case.options|safe }} <br/> + {% else %} + <input name="answer" type="radio" value="{{ test_case.options }}" /> + {{ test_case.options|safe }} <br/> + {% endif %} {% endfor %} {% endif %} {% if question.type == "integer" %} Enter Integer:<br/> - <input name="answer" type="number" id="integer" /> + <input name="answer" type="number" id="integer" value={{ last_attempt|safe }} /> <br/><br/> {% endif %} {% if question.type == "string" %} Enter Text:<br/> - <textarea name="answer" id="string"></textarea> + <textarea name="answer" id="string">{{ last_attempt|safe }}</textarea> <br/><br/> {% endif %} {% if question.type == "float" %} Enter Decimal Value :<br/> - <input name="answer" type="number" step="any" id="float" /> + <input name="answer" type="number" step="any" id="float" value={{ last_attempt|safe }} /> <br/><br/> {% endif %} {% if question.type == "mcc" %} {% for test_case in test_cases %} - <input name="answer" type="checkbox" value="{{ test_case.options }}"> {{ test_case.options|safe }} + {% if last_attempt and test_case.options|safe in last_attempt|safe %} + <input name="answer" type="checkbox" value="{{ test_case.options }}" checked/> {{ test_case.options }} <br> + {% else %} + <input name="answer" type="checkbox" value="{{ test_case.options }}"> + {{ test_case.options}} + <br/> + {% endif %} {% endfor %} {% endif %} {% if question.type == "upload" %} @@ -241,6 +250,3 @@ lang = "{{ question.language }}" </div> </div> {% endblock main %} - - - |