blob: b1395e99cf091e2419bc6b7d72c924d229bfc068 (
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
|
{% extends "manage.html" %}
{% block subtitle %}Edit Question{% endblock %}
{% block css %}
<link rel="stylesheet" href="{{ URL_ROOT }}/static/exam/css/question_quiz.css" type="text/css" />
{% endblock %}
{% block script %}
<script type='text/javascript'>
function my_render(frm)
{
for(var i=1;i<=frm.description.length;i++)
{
document.getElementById(i).innerHTML = frm.description[i-1].value;
}
}
function load_form()
{
}
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 onload %} onload='javascript:load_form();' {% endblock %}
{% block manage %}
<form name='frm' action="{{URL_ROOT}}/exam/manage/editquestion/" method="post" onKeyPress='javascript:my_render(frm);'>
{% csrf_token %}
{% for form in forms %}
{{ form.summary.value }}<a onClick="data('contentDiv{{forloop.counter}}','myContent{{forloop.counter}}');" style='cursor:pointer;'>Show</a> <br>
<b>Look of Question in HTML Format :</b>
<p id='{{forloop.counter}}'></p>
<div id="contentDiv{{forloop.counter}}">
<div id="myContent{{forloop.counter}}" style="display: none;">
<table> {{ form.as_table }} </table>
</div>
</div>
<hr>
{% endfor %}
{% for form in forms %}
<table class=span1>
{{ form.as_table }}
</table>
<hr>
{% endfor %}
<center><button class="btn" type="submit" name="savequestion">Save</button>
<button class="btn" type="button" name="button" onClick='location.replace("{{URL_ROOT}}/exam/manage/questions/");'>Cancel</button> </center>
</form>
{% endblock %}
|