summaryrefslogtreecommitdiff
path: root/testapp/templates/exam/user_data.html
blob: 8026a732724ab94d33d20d204c9cddb47ca8f0c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
{% extends "base.html" %}

{% block title %} Data for user {{ data.user.get_full_name.title }} {% endblock title %}

{% block content %}
<html lang="en">
  <body>
    <div class="container">
     <div class="content">
<div class="page-header">
<h1><Strong><center>Online Test</center></strong></h1>
</div>
          <div class=row>
         <div class=span14>
<h3><center>Data for user {{ data.user.get_full_name.title }}</center></h3><br>
<form action="" method="post">


<p> 
Name: {{ data.user.get_full_name.title }} <br/>
Username: {{ data.user.username }} <br/>
{% if data.profile %}
Roll number: {{ data.profile.roll_number }} <br/>
Position: {{ data.profile.position }} <br/>
Department: {{ data.profile.department }} <br/>
Institute: {{ data.profile.institute }} <br/>
{% endif %}
Email: {{ data.user.email }} <br/>
Date joined: {{ data.user.date_joined }} <br/>
Last login: {{ data.user.last_login }} 
</p>

{% if data.papers %}
<p><a href="{{URL_ROOT}}/exam/grade_user/{{ data.user.username }}/">
    Grade/correct paper</a>
</p>

{% for paper in data.papers %}

<h2> Quiz: {{ paper.quiz.description }} </h2>

<p>
Questions correctly answered: {{ paper.get_answered_str }} <br/>
Total attempts at questions: {{ paper.answers.count }} <br/>
Marks obtained: {{ paper.get_total_marks }} <br/>
Start time: {{ paper.start_time }} <br/>
User IP address: {{ paper.user_ip }} 
</p>

{% if paper.answers.count %}
<h3> Answers </h3>
{% for question, answers in paper.get_question_answers.items %}
<p><strong> Question: {{ question.id }}. {{ question.summary }} (Points: {{ question.points }})</strong> </p>
{% if question.type == "mcq" %}
<p> Choices: 
{% for option in question.options.strip.splitlines %} {{option}}, {% endfor %}
</p>
<p>Student answer: {{ answers.0 }}</p>
{% else %}{# non-mcq questions #}
<pre> 
{% for answer in answers %}################################################################################
{{ answer.answer.strip }}
# Autocheck: {{ answer.error }}
{% endfor %}</pre>
{% endif %}
{% with answers|last as answer %}
<p><em>Marks: {{answer.marks}} </em> </p>
{% endwith %}
{% endfor %} {# for question, answers ... #}
<h3>Teacher comments: </h3>
{{ paper.comments|default:"None" }}
{% endif %} {# if paper.answers.count #}

{% endfor %} {# for paper in data.papers #}

{% endif %} {# if data.papers #}
<br />
<hr />
<a href="{{URL_ROOT}}/exam/grade_user/{{ data.user.username }}/">
    Grade/correct paper</a>
<br/>
{% if data.papers.count > 1 %}
<a href="{{URL_ROOT}}/exam/monitor/">
    Monitor quiz</a>
{% else %}
{% with data.papers.0 as paper %}
<a href="{{URL_ROOT}}/exam/monitor/{{paper.quiz.id}}/">
    Monitor quiz</a>
{% endwith %}
{% endif %}
<br />
<a href="{{URL_ROOT}}/admin/">Admin</a>

</div>
          </div>
     </div>
<footer>
        <p>&copy; FOSSEE group, IIT Bombay</p>
      </footer>

    </div> <!-- /container -->

  </body>
</html>

{% endblock content %}