diff options
author | mahesh | 2017-10-05 01:00:15 +0530 |
---|---|---|
committer | mahesh | 2017-10-05 01:09:05 +0530 |
commit | dbacd863cfe3294a1f10f326710c65cfb591c6b2 (patch) | |
tree | 1e3a1acf1b33af6c6a25b95398319b44559addec | |
parent | 8ea7f10a84af44af37a5478c389fa040723542ec (diff) | |
download | online_test-dbacd863cfe3294a1f10f326710c65cfb591c6b2.tar.gz online_test-dbacd863cfe3294a1f10f326710c65cfb591c6b2.tar.bz2 online_test-dbacd863cfe3294a1f10f326710c65cfb591c6b2.zip |
Update grade user UI
-rw-r--r-- | yaksh/templates/yaksh/grade_user.html | 22 | ||||
-rw-r--r-- | yaksh/views.py | 2 |
2 files changed, 20 insertions, 4 deletions
diff --git a/yaksh/templates/yaksh/grade_user.html b/yaksh/templates/yaksh/grade_user.html index 52f319c..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.summary }}</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/views.py b/yaksh/views.py index c4ddcd1..6abfa2b 100644 --- a/yaksh/views.py +++ b/yaksh/views.py @@ -597,7 +597,7 @@ def check(request, q_id, attempt_num=None, questionpaper_id=None): else: user_answer = request.POST.get('answer') if not user_answer: - msg = "Please submit a valid option or code" + msg = "Please submit a valid answer." return show_question( request, current_question, paper, notification=msg ) |