summaryrefslogtreecommitdiff
path: root/testapp/templates/exam/grade_user.html
blob: c6f63436ccb136adb142866ce84487dfda3e02a8 (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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
{% extends "manage.html" %}

{% block title %} Grading papers for {{ data.user.get_full_name.title }} {% endblock title %}

{% block subtitle %}Grading papers for {{ data.user.get_full_name.title }}{% endblock %}
 
{% block css %}
	 <link rel="stylesheet" href="{{ URL_ROOT }}/static/exam/css/gradeuser.css" type="text/css" /> 
{% endblock %}

{% block script %}
<script type='text/javascript'>
function data(showContent,showHideDiv)
{
	var con = document.getElementById(showContent);
	var ele=document.getElementById(showHideDiv);
	if (ele.style.display=="block")
	{
		con.style.display = "none"
		ele.style.display = "none";
	}
	else
	{
		con.style.display = "block";
		ele.style.display = "block";
	}
}
</script>
{% endblock %}
{% block manage %}

<p> 
Name: {{ data.user.get_full_name.title }}
{% if data.profile %}
(roll number: {{ data.profile.roll_number }}) <br/>
{{ data.profile.position }},
{{ data.profile.department }},
{{ data.profile.institute }}
{% endif %}
</p>

{% if data.papers %}

{% 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/>
</p>

{% if paper.answers.count %}
<h3> Answers </h3><br>
<form name=frm id="q{{ paper.quiz.id }}_form"
    action="{{URL_ROOT}}/exam/manage/gradeuser/{{data.user.username}}/" method="post">
{% csrf_token %}
{% for question, answers in paper.get_question_answers.items %}
<p><strong> 
	 Question: {{ question.id }}. {{ question.summary }} <font color='red'><img style="cursor: pointer" alt='...'  onClick="data('contentDiv{{question.id}}','myContent{{question.id}}');"></font>
   (Points: {{ question.points }})</strong> </p>
<div id="contentDiv{{question.id}}" style="display:none;">
     <div id="myContent{{question.id}}" style="display: none;">
        <p> Description : {{ question.description }} </p>
	<p> Points : {{ question.points }} </p>
	<p> Test : {{ question.test }} </p>
	<p> Options : {{ question.options }} </p>
	<p> Type : {{ question.type }} </p>

     </div>
</div> 



{% 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 %} {# if question.type #}
{% with answers|last as answer %}
Marks: <input id="q{{ question.id }}" type="text" 
        name="q{{ question.id }}_marks" size="4"
        value="{{ answer.marks }}"><br><br>
{% endwith %}
{% endfor %} {# for question, answers ... #}


<h3>Teacher comments: </h3>
<textarea id="comments_{{paper.quiz.id}}" rows="10" cols="80" 
    name="comments_{{ paper.quiz.id }}">{{ paper.comments }}</textarea>
<br>
<br><button class="btn" type="submit" name="submit_{{paper.quiz.id}}">Save Marks</button>

</form>
{% endif %} {# if paper.answers.count #}

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

{% endif %} {# if data.papers #}

{% if data.papers.count > 1 %}
<a href="{{URL_ROOT}}/exam/manage/monitor/">Monitor quiz</a>
{% else %}
{% with data.papers.0 as paper %}
<a href="{{URL_ROOT}}/exam/manage/monitor/{{paper.quiz.id}}/">
    Monitor quiz</a>
{% endwith %}
{% endif %}
<br />
<a href="{{URL_ROOT}}/admin/">Admin</a>
{% endblock%}