diff options
author | adityacp | 2020-09-15 15:19:58 +0530 |
---|---|---|
committer | adityacp | 2020-09-15 15:39:47 +0530 |
commit | fee2f97d867e11216ee928f37c228e94a951bb9c (patch) | |
tree | 80ccacb0b89cabb22f6b4340944b2b668550afb6 | |
parent | 34539e10f25e6bd12862f4a4f045ca1fb667844e (diff) | |
download | online_test-fee2f97d867e11216ee928f37c228e94a951bb9c.tar.gz online_test-fee2f97d867e11216ee928f37c228e94a951bb9c.tar.bz2 online_test-fee2f97d867e11216ee928f37c228e94a951bb9c.zip |
Show missing marks in grade user
-rw-r--r-- | yaksh/templates/yaksh/grade_user.html | 4 | ||||
-rw-r--r-- | yaksh/views.py | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/yaksh/templates/yaksh/grade_user.html b/yaksh/templates/yaksh/grade_user.html index a9ab53e..341fd7c 100644 --- a/yaksh/templates/yaksh/grade_user.html +++ b/yaksh/templates/yaksh/grade_user.html @@ -327,7 +327,7 @@ function searchNames() { </a> </td> <td>{{ question.type }}</td> - <td>{{ answer.answer.marks }}</td> + <td>{{ answer.marks }}</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 @@ -567,7 +567,7 @@ function searchNames() { <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 }}"><br><br> + <input id="q{{ question.id }}" type="text" name="q{{ question.id }}_marks" size="4" class="form-control" value="{{ answer.marks }}"><br><br> {% endwith %} </div> </div> diff --git a/yaksh/views.py b/yaksh/views.py index 0ed8f9f..a8f0d23 100644 --- a/yaksh/views.py +++ b/yaksh/views.py @@ -1964,7 +1964,7 @@ def grade_user(request, quiz_id=None, user_id=None, attempt_number=None, for paper in papers: for question, answers in paper.get_question_answers().items(): marks = float(request.POST.get('q%d_marks' % question.id, 0)) - answer = answers[-1]['answer'] + answer = answers[0]['answer'] answer.set_marks(marks) answer.save() paper.update_marks() |