diff options
author | ankitjavalkar | 2020-08-27 14:42:48 +0530 |
---|---|---|
committer | GitHub | 2020-08-27 14:42:48 +0530 |
commit | 632b906a8f0bf038b61783588fcd4423a6df8a09 (patch) | |
tree | 6434974072db341e7463290808936b4a70485751 | |
parent | 7b6297ca80b0ec5bc86cfaf3971d7a50064d930d (diff) | |
parent | d8b7314c38a0a1ae4e0cfea9399e943b94366c5b (diff) | |
download | online_test-632b906a8f0bf038b61783588fcd4423a6df8a09.tar.gz online_test-632b906a8f0bf038b61783588fcd4423a6df8a09.tar.bz2 online_test-632b906a8f0bf038b61783588fcd4423a6df8a09.zip |
Merge pull request #745 from ankitjavalkar/qstats
Fix column header and display question details
-rw-r--r-- | yaksh/templates/yaksh/statistics_question.html | 109 |
1 files changed, 107 insertions, 2 deletions
diff --git a/yaksh/templates/yaksh/statistics_question.html b/yaksh/templates/yaksh/statistics_question.html index 58fd8db..9a54501 100644 --- a/yaksh/templates/yaksh/statistics_question.html +++ b/yaksh/templates/yaksh/statistics_question.html @@ -19,12 +19,117 @@ {% if question_stats %} <p><b>Total number of participants: {{ total }}</b></p> <table class="table table-bordered table-responsive-sm"> - <tr class="bg-light yakshred"><th>Question</th><th>Type</th><th>Total</th><th>Answered</th></tr> + <tr class="bg-light yakshred"><th>Question</th><th>Type</th><th>Total</th><th>Answered Correctly</th></tr> {% for question, value in question_stats.items %} - <tr><td>{{ question.summary }}</td><td>{{ question.type }}</td><td>{{value.1}}</td><td>{{ value.0 }} ({% widthratio value.0 value.1 100 %}%)</td></tr> + <tr> + <td>{{ question.summary }} + <button class="btn btn-primary" type="button" data-toggle="collapse" data-target="#collapse_question_{{question.id}}" aria-expanded="false" aria-controls="collapseExample"> + More + </button> + <div class="collapse" id="collapse_question_{{question.id}}"> + <div class="card card-body" style="width: 18rem;"> + <strong> + Summary: + </strong> + <p> + {{ question.summary }} + </p> + <strong> + Description: + </strong> + <p> + {{ question.description }} + </p> + <strong> + Points: + </strong> + <p> + {{ question.points }} + </p> + <strong> + Type: + </strong> + <p> + {{ question.type }} + </p> + {% if question.type in 'mcq mcc' %} + <strong> + Test Cases: + </strong> + <p> + <ol> + {% for tc in question.testcase_set.all %} + <li> + {{ tc.mcqtestcase.options }} + {% if tc.mcqtestcase.correct %} + <span class="badge badge-primary">Correct</span> + {% endif %} + </li> + {% endfor %} + </ol> + </p> + {% endif %} + </div> + </div> + </td> + <td>{{ question.type }}</td> + <td>{{value.1}}</td><td>{{ value.0 }} ({% widthratio value.0 value.1 100 %}%)</td> + + + </tr> {% endfor %} </table> {% endif %} + + <!-- The Modal --> + <div class="modal" id="question_detail_modal"> + <div class="modal-dialog"> + <div class="modal-content"> + + <!-- Modal Header --> + <div class="modal-header"> + <h4 class="modal-title">Question Details</h4> + <button type="button" class="close" data-dismiss="modal">×</button> + </div> + + <!-- Modal body --> + <div class="modal-body"> + <table> + <tr> + <td>Summary</td> + <td>{{ question.summary }}</td> + </tr> + <tr> + <td>Description</td> + <td>{{ question.description }}</td> + </tr> <tr> + <td>Type</td> + <td>{{ question.type }}</td> + </tr> <tr> + <td>Points</td> + <td>{{ question.points }}</td> + </tr> + <tr> + {% for tc in question.testcase_set.all %} + tc + {% endfor %} + <br><br> + </tr> + </table> + </div> + + <!-- Modal footer --> + <div class="modal-footer"> + <button type="button" class="btn btn-danger" data-dismiss="modal">Close</button> + </div> + + </div> + </div> + </div> + + </div> + </div> + <!-- end Modal outer --> </div> </div> </div> |