-
Student answer:
-
- {% if question.type == "mcc"%}
-
- {% for testcases in question.get_test_cases %}
- {%if testcases.id|stringformat:"i" in answers.0.answer %}
-
{{ testcases.options.strip }}
- {% endif %}
- {% endfor %}
-
-
- {% elif question.type == "mcq"%}
-
- {% for testcases in question.get_test_cases %}
- {%if testcases.id|stringformat:"i" == answers.0.answer %}
-
{{ testcases.options.strip }}
- {% endif %}
- {% endfor %}
-
-
- {% elif question.type == "arrange"%}
-
- {% get_answer_for_arrange_options answers.0.answer question as tc_list %}
- {% for testcases in tc_list %}
-
{{ testcases.options.strip }}
- {% endfor %}
-
-
- {%else%}
-
- {{ answers.0.answer }}
-
- {% endif %}
+
+
+ Name: {{ data.user.get_full_name.title }}
+ Username: {{ data.user.username }}
+ {% if data.profile %}
+ Roll number: {{ data.profile.roll_number }}
+ Position: {{ data.profile.position }}
+ Department: {{ data.profile.department }}
+ Institute: {{ data.profile.institute }}
+ {% endif %}
+ Email: {{ data.user.email }}
+ Date joined: {{ data.user.date_joined }}
+ Last login: {{ data.user.last_login }}
+
+
+ {% if data.papers %}
+
+ Grade/correct paper
+
+ {% for paper in data.papers %}
+ {% if forloop.counter == 2 and data.questionpaperid %}
+
+
+ Previous attempts
+
+ {% endif %}
+
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 }}
+ Start time: {{ paper.start_time }}
+ User IP address: {{ paper.user_ip }}
+
+ {% if paper.answers.count %}
+
+
Answers
+
+ {% for question, answers in paper.get_question_answers.items %}
+
+
+
+
Details: {{forloop.counter}}. {{ question.summary }}
+ Show Question
+ Mark(s): {{ question.points }}
+
+
+
+
Question:
+
{{ question.description|safe }}
+ {% if question.type == "mcq" or question.type == "mcc" %}
+
Choices:
+ {% for testcase in question.get_test_cases %}
+ {% if testcase.correct %}
+
+
{{ forloop.counter }}. {{ testcase.options|safe }}
+
Correct
+ {% else %}
+
+ {{ forloop.counter }}. {{ testcase.options|safe }}
+ {% endif %}
+ {% endfor %}
+ {% elif question.type == "integer" or question.type == "string" or question.type == "float" %}
+
Correct Answer:
+ {% for testcase in question.get_test_cases %}
+
{{ testcase.correct|safe }}
+ {% if testcase.error_margin %}
+
{{ testcase.error_margin|safe }}
+ {% endif %}
+ {% endfor %}
+ {% elif question.type == "arrange" %}
+
Correct Order:
+
+ {% for testcase in question.get_test_cases %}
+
{{ testcase.options|safe }}
+ {% endfor %}
+
+ {% else %}
+
Test cases:
+ {% for testcase in question.get_test_cases %}
+
{{ forloop.counter }}. {{ testcase }}
+ {% endfor %}
+ {%endif%}
+
-
- {% else %}
-
Student answer:
- {% for answer in answers %}
-
- {% if answer.answer.correct %}
-
-
Correct answer
- {% else %}
-
-
Error
- {% with answer.error_list as err %}
- {% for error in err %}
- {% if error.type == 'stdio' %}
-
- {% if error.given_input %}
-
-
-
- For given Input value(s): |
- {{error.given_input}} |
-
-
- {% endif %}
-
-
-
-
-
-
- Line No. |
- Expected Output |
- User output |
- Status |
-
- {% for expected,user in error.expected_output|zip:error.user_output %}
- {{forloop.counter}} |
- {{expected|default:""}} |
- {{user|default:""}} |
- {% if forloop.counter0 in error.error_line_numbers or not expected or not user %}
- |
- {% else %}
- |
- {% endif %}
-
- {% endfor %}
-
-
-
-
- Error: |
- {{error.error_msg}} |
-
-
-
- {% elif error.type == 'assertion' %}
- {% if error.test_case %}
-
We tried you code with the following test case:
-
{{error.test_case}}
+
Student answer:
+ {% if question.type == "upload" %}
+ {% if has_user_assignments %}
+
+
+ Assignment File for {{ data.user.get_full_name.title }}
+
+
+ {% with answers|last as answer%}
+ {% if answer.answer.correct %}
+
+ {% else %}
+
{% endif %}
-
The following error took place:
-
-
-
-
- Exception Name: |
- {{error.exception}} |
-
-
- Exception Message: | {{error.message}} |
-
-
- {% if error.traceback %}
- Full Traceback: |
- {{error.traceback}} |
+ {% endwith %}
+ {% else %}
+
+
+
No Assignment submitted by {{ data.user.get_full_name.title }}
+
+
{% endif %}
-
-
-
- {% else %}
-
{{error}}
- {% endif %}
- {% endfor %}
- {% endwith %}
- {% endif %}
-
-
-
- {% if question.type != "code" %}
-
- {{question.type}}
- {{ answer.answer.answer.strip }}
-
- {% else %}
-
{{ answer.answer.answer.strip }}
- {% endif %}
-
-
+ {% else %}
+ {% for ans in answers %}
+ {% if ans.answer.correct %}
+
+
+ Correct answer:
+ {% else %}
+
+
+ Error:
+ {% endif %}
+ {% with ans.error_list as err %}
+ {% for error in err %}
+ {% if error.type == 'stdio' %}
+
+
+ {% if error.given_input %}
+
+
+
+ For given Input value(s): |
+ {{error.given_input}} |
+
+
+ {% endif %}
+
+
+
+
+
+
+
+ Line No.
+ |
+
+ Expected Output
+ |
+
+ User output
+ |
+
+ Status
+ |
+
+ {% for expected,user in error.expected_output|zip:error.user_output %}
+
+ {{forloop.counter}} |
+ {{expected|default:""}} |
+ {{user|default:""}} |
+ {% if forloop.counter0 in error.error_line_numbers or not expected or not user %}
+ |
+ {% else %}
+ |
+ {% endif %}
+
+ {% endfor %}
+
+
+
+
+ Error: |
+ {{error.error_msg}} |
+
+
+
+
+ {% elif error.type == 'assertion' %}
+ {% if error.test_case %}
+
We tried you code with the following test case:
+
{{error.test_case}}
+ {% endif %}
+
The following error took place:
+
+
+
+
+
+ Exception Name: |
+ {{error.exception}} |
+
+
+ Exception Message: |
+ {{error.message}} |
+
+
+ {% if error.traceback %}
+ Full Traceback: |
+
+ {{error.traceback}}
+ |
+ {% endif %}
+
+
+
+
+
+ {% else %}
+
{{error|safe}}
+ {% endif %}
+ {% endfor %}
+ {% endwith %}
+
+
+ {% if question.type == "code" %}
+
{{ ans.answer.answer.strip|safe }}
+ {% elif question.type == "mcc"%}
+
+
+ {% for testcases in question.get_test_cases %}
+ {%if testcases.id|stringformat:"i" in ans.answer.answer.strip|safe %}
+
{{ testcases.options.strip|safe }}
+ {% endif %}
+ {% endfor %}
+
+
+ {% elif question.type == "mcq"%}
+
+
+ {% for testcases in question.get_test_cases %}
+ {%if testcases.id|stringformat:"i" == ans.answer.answer.strip|safe %}
+
{{ testcases.options.strip|safe }}
+ {% endif %}
+ {% endfor %}
+
+
+ {% elif question.type == "arrange"%}
+
+
+ {% get_answer_for_arrange_options ans.answer.answer question as tc_list %}
+ {% for testcases in tc_list %}
+
{{ testcases.options.strip|safe }}
+ {% endfor %}
+
+
+ {% else %}
+
+
+ {{ ans.answer.answer.strip|safe }}
+
+
+ {% endif %}
+
+
+ {% endfor %}
+ {% endif %}
+ {% with answers|last as answer %}
+ Marks:
+ {% endwith %}
+
+
+
+ {% endfor %} {# for question, answers ... #}
+
- {% endfor %}
- {% endif %}
-
- {% endfor %} {# for question, answers ... #}
Teacher comments:
{{ paper.comments|default:"None" }}
{% endif %} {# if paper.answers.count #}
-
{% endfor %} {# for paper in data.papers #}
-
{% endif %} {# if data.papers #}
+
+
-
{% with data.papers.0 as paper %}
Grade/correct paper
{% endwith %}
-
{% if data.papers.count > 1 %}
Monitor quiz
{% else %}
@@ -266,6 +296,4 @@ User IP address: {{ paper.user_ip }}
Monitor quiz
{% endwith %}
{% endif %}
-
-
-{% endblock %}
+{% endblock %}
\ No newline at end of file
--
cgit