From ca74e03a7593a5d8d12df7d372704270bf7db9a2 Mon Sep 17 00:00:00 2001 From: ankitjavalkar Date: Wed, 9 Jan 2019 11:09:51 +0530 Subject: Fix Monitor in Moderator interface: - Fix indentation - Add proper corresponding closing
tags - Add closing tags - Minor changes in inconsistent HTML tags and commented HTML code --- yaksh/templates/base.html | 2 +- yaksh/templates/manage.html | 1 + yaksh/templates/yaksh/user_data.html | 506 ++++++++++++++++++----------------- 3 files changed, 269 insertions(+), 240 deletions(-) diff --git a/yaksh/templates/base.html b/yaksh/templates/base.html index 2842c8b..e5d1a56 100644 --- a/yaksh/templates/base.html +++ b/yaksh/templates/base.html @@ -60,7 +60,7 @@
-

{% block pagetitle %}{% endblock pagetitle %}

+

{% block pagetitle %}{% endblock pagetitle %}

{% block content %} {% endblock %} diff --git a/yaksh/templates/manage.html b/yaksh/templates/manage.html index fbd4c64..5b11a84 100644 --- a/yaksh/templates/manage.html +++ b/yaksh/templates/manage.html @@ -33,6 +33,7 @@ Logout
+
diff --git a/yaksh/templates/yaksh/user_data.html b/yaksh/templates/yaksh/user_data.html index 62e9c56..317cb15 100644 --- a/yaksh/templates/yaksh/user_data.html +++ b/yaksh/templates/yaksh/user_data.html @@ -1,264 +1,294 @@ {% extends "manage.html" %} {% load custom_filters %} - {% block pagetitle %} Data for user {{ data.user.get_full_name.title }} {% endblock pagetitle %} - {% block content %} - {% block script %} - {% endblock %}
-
-
-

-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 }} - -
- -
- {% if question.type != "code" %} - {% if "Correct answer" in answers.0.error_list %} -
-
Correct
- {% else %} -
-
Incorrect
- {% endif %} -
-
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 }} + +
    +
    -
    - {% 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 %} - - - - - - - - - - - - {% for expected,user in error.expected_output|zip:error.user_output %} - - - - {% if forloop.counter0 in error.error_line_numbers or not expected or not user %} - - {% else %} - - {% endif %} - - {% endfor %} -
    Line No.
    Expected Output
    User output
    Status
    {{forloop.counter}} {{expected|default:""}} {{user|default:""}}
    - - - - - - -
    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 %} +
    +
    Correct answer
    +
    + {% else %} +
    +
    Incorrect Answer
    +
    {% endif %} -

    The following error took place:

    -
    - - - - - - - - - - - {% if error.traceback %} - - + {% endwith %} + {% else %} +
    +
    +
    No Assignment submitted by {{ data.user.get_full_name.title }}
    +
    +
    {% endif %} - -
    Exception Name: {{error.exception}}
    Exception Message: {{error.message}}
    Full Traceback:
    {{error.traceback}}
    -
    - {% 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 %} + + + + + + + + + + + + {% for expected,user in error.expected_output|zip:error.user_output %} + + + + + {% if forloop.counter0 in error.error_line_numbers or not expected or not user %} + + {% else %} + + {% endif %} + + {% endfor %} +
    +
    Line No.
    +
    +
    Expected Output
    +
    +
    User output
    +
    +
    Status
    +
    {{forloop.counter}} {{expected|default:""}} {{user|default:""}}
    + + + + + + +
    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:

    +
    +
    + + + + + + + + + + + + {% if error.traceback %} + + + {% endif %} + +
    Exception Name: {{error.exception}}
    Exception Message: {{error.message}}
    Full Traceback: +
    {{error.traceback}}
    +
    +
    +
    + + {% 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