diff options
Diffstat (limited to 'yaksh/templates')
-rw-r--r-- | yaksh/templates/yaksh/grade_user.html | 14 | ||||
-rw-r--r-- | yaksh/templates/yaksh/user_data.html | 17 | ||||
-rw-r--r-- | yaksh/templates/yaksh/view_answerpaper.html | 14 |
3 files changed, 22 insertions, 23 deletions
diff --git a/yaksh/templates/yaksh/grade_user.html b/yaksh/templates/yaksh/grade_user.html index 341fd7c..64b9cb5 100644 --- a/yaksh/templates/yaksh/grade_user.html +++ b/yaksh/templates/yaksh/grade_user.html @@ -319,7 +319,6 @@ function searchNames() { </thead> <tbody> {% for question, answers in paper.get_question_answers.items %} - {% with answers|last as answer %} <tr> <td> <a href="#question_{{question.id}}"> @@ -327,14 +326,13 @@ function searchNames() { </a> </td> <td>{{ question.type }}</td> - <td>{{ answer.marks }}</td> + <td>{{ answers|last }}</td> <td> <a href="{% url 'yaksh:regrade_by_question' course_id quiz.questionpaper_set.get.id paper.id question.id %}" class="btn btn-outline-success"> <i class="fa fa-repeat"></i> Regrade </a> </td> </tr> - {% endwith %} {% endfor %} </tbody> </table> @@ -437,7 +435,10 @@ function searchNames() { </center> {% endif %} <!-- End has_user_assignments --> {% else %} - {% for ans in answers %} + {% if answers|first is None %} + <p> Did not attempt </p> + {% else %} + {% for ans in answers|slice:":-1" %} <strong> Attempt Number: {{forloop.counter}} </strong> @@ -559,6 +560,7 @@ function searchNames() { </div> <br> {% endfor %} <!-- End for ans in answers --> + {% endif %}<!-- check if attempted --> </div> </div> {% endif %} @@ -566,9 +568,7 @@ function searchNames() { <div class="form-group"> <div class="col-md-2"> <label class="col-form-label" for="q{{ question.id }}">Marks:</label> - {% with answers|last as answer %} - <input id="q{{ question.id }}" type="text" name="q{{ question.id }}_marks" size="4" class="form-control" value="{{ answer.marks }}"><br><br> - {% endwith %} + <input id="q{{ question.id }}" type="text" name="q{{ question.id }}_marks" size="4" class="form-control" value="{{ answers|last }}"><br><br> </div> </div> <hr/> diff --git a/yaksh/templates/yaksh/user_data.html b/yaksh/templates/yaksh/user_data.html index a79071d..0506df0 100644 --- a/yaksh/templates/yaksh/user_data.html +++ b/yaksh/templates/yaksh/user_data.html @@ -78,11 +78,7 @@ <tr> <td>{{question.summary}}</td> <td>{{question.type}}</td> - <td> - {% for answer in answers %} - {{answer.marks}} - {% endfor %} - </td> + <td>{{ answers|last }}</td> </tr> {% endfor %} </tbody> @@ -181,7 +177,11 @@ </center> {% endif %} <!-- End has_user_assignments --> {% else %} - {% for ans in answers %} + + {% if answers|first is None %} + <p> Did not attempt </p> + {% else %} + {% for ans in answers|slice:":-1" %} <strong> Attempt Number: {{forloop.counter}} </strong> @@ -303,6 +303,7 @@ </div> <br> {% endfor %} <!-- End for ans in answers --> + {% endif %}<!-- check if attempted --> </div> </div> {% endif %} @@ -310,9 +311,7 @@ <div class="form-group"> <div class="col-md-2"> <label class="col-form-label" for="q{{ question.id }}">Marks:</label> - {% with answers|last as answer %} - <input id="q{{ question.id }}" type="text" name="q{{ question.id }}_marks" size="4" class="form-control" value="{{ answer.marks }}" readonly=""><br><br> - {% endwith %} + <input id="q{{ question.id }}" type="text" name="q{{ question.id }}_marks" size="4" class="form-control" value="{{ answers|last }}" readonly=""><br><br> </div> </div> <hr/> diff --git a/yaksh/templates/yaksh/view_answerpaper.html b/yaksh/templates/yaksh/view_answerpaper.html index 905a111..775525e 100644 --- a/yaksh/templates/yaksh/view_answerpaper.html +++ b/yaksh/templates/yaksh/view_answerpaper.html @@ -80,7 +80,6 @@ </thead> <tbody> {% for question, answers in paper.get_question_answers.items %} - {% with answers|last as answer %} <tr> <td> <a href="#question_{{question.id}}"> @@ -88,9 +87,8 @@ </a> </td> <td>{{ question.type }}</td> - <td>{{ answer.answer.marks }}</td> + <td>{{ answers|last }}{{ answer.answer.marks }}</td> </tr> - {% endwith %} {% endfor %} </tbody> </table> @@ -200,7 +198,10 @@ </center> {% endif %} <!-- End has_user_assignments --> {% else %} - {% for ans in answers %} + {% if answers|first is None %} + <p> Did not attempt </p> + {% else %} + {% for ans in answers|slice:":-1" %} <strong> Attempt Number: {{forloop.counter}} </strong> @@ -324,6 +325,7 @@ </div> <br> {% endfor %} <!-- End for ans in answers --> + {% endif %}<!-- check if attempted --> </div> </div> {% endif %} @@ -331,9 +333,7 @@ <div class="form-group"> <div class="col-md-2"> <label class="col-form-label" for="q{{ question.id }}">Marks:</label> - {% with answers|last as answer %} - <input id="q{{ question.id }}" type="text" name="q{{ question.id }}_marks" size="4" class="form-control" value="{{ answer.answer.marks }}" readonly=""><br><br> - {% endwith %} + <input id="q{{ question.id }}" type="text" name="q{{ question.id }}_marks" size="4" class="form-control" value="{{ answers|last }}" readonly=""><br><br> </div> </div> <hr/> |