From bd8c2c653a06e29dcf7a1a0103f7735f46f0c488 Mon Sep 17 00:00:00 2001 From: adityacp Date: Fri, 31 Mar 2017 16:37:07 +0530 Subject: Change in templates and js and urls - Add urls to download quiz assignments in urls.p - Catch Http404 exception message in 404.html template - Add download assignment links for quiz in grade_user.html - Fix javascript validation in add_question.js --- yaksh/static/yaksh/js/add_question.js | 3 +- yaksh/templates/404.html | 2 +- yaksh/templates/yaksh/grade_user.html | 60 +++++++++++++++++++++-------------- yaksh/urls.py | 4 +++ 4 files changed, 42 insertions(+), 27 deletions(-) (limited to 'yaksh') diff --git a/yaksh/static/yaksh/js/add_question.js b/yaksh/static/yaksh/js/add_question.js index 05752b4..5bec8c6 100644 --- a/yaksh/static/yaksh/js/add_question.js +++ b/yaksh/static/yaksh/js/add_question.js @@ -122,9 +122,8 @@ function textareaformat() }); document.getElementById('my').innerHTML = document.getElementById('id_description').value ; - if (document.getElementById('id_grade_assignment_upload').checked || - document.getElementById('id_type').val() == 'upload'){ + document.getElementById('id_type').value == 'upload'){ $("#id_grade_assignment_upload").prop("disabled", false); } else{ diff --git a/yaksh/templates/404.html b/yaksh/templates/404.html index 7d33dd3..8d43ec5 100644 --- a/yaksh/templates/404.html +++ b/yaksh/templates/404.html @@ -1,5 +1,5 @@ {% extends "base.html" %} {% block content %} -The requested page does not exist. +{{ exception }} {% endblock %} diff --git a/yaksh/templates/yaksh/grade_user.html b/yaksh/templates/yaksh/grade_user.html index 1cb1f99..69c03c9 100644 --- a/yaksh/templates/yaksh/grade_user.html +++ b/yaksh/templates/yaksh/grade_user.html @@ -46,7 +46,11 @@ {% endif %} +{% if quiz_file_status %} + + Download All Assignments +{% endif %}
{% if data %} @@ -69,7 +73,6 @@ {{ paper.total_marks }}

Quiz: {{ paper.question_paper.quiz.description }}

-

Attempt Number: {{paper.attempt_number}} -
Questions correctly answered: {{ paper.get_answered_str }}
Total attempts at questions: {{ paper.answers.count }}
Marks obtained: {{ paper.marks_obtained }}
@@ -95,7 +97,6 @@ Status : Failed
Status : Passed
{% endif %}

- {% if paper.answers.count %}

Report


@@ -122,8 +123,8 @@ Status : Passed
{% endif %} method="post"> {% csrf_token %} -{% for question, answers in paper.get_question_answers.items %} +{% for question, answers in paper.get_question_answers.items %}
Details: {{forloop.counter}}. {{ question.summary }} @@ -153,7 +154,6 @@ Status : Passed
{{ testcase.error_margin|safe }} {% endif %} {% endfor %} - {% else %}
Test cases:
{% for testcase in question.get_test_cases %} @@ -163,29 +163,41 @@ Status : Passed
Student answer:
- {% for ans in answers %} - {% if ans.answer.correct %} -
-
Correct answer: + {% if question.type == "upload" %} + {% if user_file_status %} + +
+ Assignment File for {{ data.user.get_full_name.title }} +
+
+ {% else %} +
No Assignment submitted by {{ data.user.get_full_name.title }}
+ {% endif %} + {% else %} + {% for ans in answers %} + {% if ans.answer.correct %} +
+
Correct answer: + {% else %} +
+
Error: + {% endif %} + {% for err in ans.error_list %} +
{{ err }}
+ {% endfor %} +
+
+ {% if question.type != "code" %} +
+ {{ ans.answer.answer.strip|safe }} +
{% else %} -
-
Error: +
{{ ans.answer.answer.strip|safe }}
{% endif %} - {% for err in ans.error_list %} -
{{ err }}
+
+
{% endfor %} -
-
- {% if question.type != "code" %} -
- {{ ans.answer.answer.strip|safe }} -
- {% else %} -
{{ ans.answer.answer.strip|safe }}
{% endif %} -
-
- {% endfor %} {% with answers|last as answer %} Marks: \d+)/$', views.download_course_csv), + url(r'^manage/download/user_assignment/(?P\d+)/(?P\d+)/(?P\d+)/$', + views.download_assignment_file), + url(r'^manage/download/quiz_assignments/(?P\d+)/$', + views.download_assignment_file) ] -- cgit