-
Notifications
You must be signed in to change notification settings - Fork 61
/
editable.html
187 lines (173 loc) · 5.59 KB
/
editable.html
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
{% extends "exam/edit.html" %}
{% load verbatim %}
{% block editable_message %}You can edit this question.{% endblock %}
{% block content %}
{{ block.super }}
{% include "editable.html" %}
{% verbatim %}
<script type="text/html" id="examTemplate">
<div class="properties">
<div data-bind="template: {
name: 'property',
data: {label:'Exam name:',property:name}
}"></div>
<div data-bind="template: {
name: 'selectproperty',
data: {label: 'Theme:', property: theme, options: Editor.themes}
}"></div>
<div data-bind="template: {
name: 'property',
data: {label:'Duration (minutes):',property:duration, type:'number',min:0}
}"></div>
<div data-bind="template: {
name: 'percentproperty',
data: {label:'Pass threshold (percent):',property:percentPass}
}"></div>
<div data-bind="template: {
name: 'booleanproperty',
data: {label: 'Shuffle questions?',property:shuffleQuestions}
}"></div>
</div>
<div data-bind="folder: 'Description', show: true">
<div>
<div data-bind="writemaths: description"></div>
</div>
</div>
<div data-bind="folder: 'Author\'s Notes'">
<div>
<div data-bind="writemaths: notes"></div>
</div>
</div>
<div data-bind="folder: 'Navigation'">
<div>
<div class="properties">
<div data-bind="template: {
name: 'booleanproperty',
data: {label:'Allow user to regenerate questions?', property:allowregen}
}"></div>
<div data-bind="template: {
name: 'booleanproperty',
data: {label:'Allow move to previous question?', property:reverse}
}"></div>
<div data-bind="template: {
name: 'booleanproperty',
data: {label:'Allow jump to any question?', property:browse}
}"></div>
<div data-bind="template: {
name: 'booleanproperty',
data: {label: 'Show front page?',property:showfrontpage}
}"></div>
</div>
<div data-bind="template: {
name: 'event',
data: onadvance
}"></div>
<div data-bind="template: {
name: 'event',
data: onreverse
}"></div>
<div data-bind="template: {
name: 'event',
data: onmove
}"></div>
</div>
</div>
<div data-bind="folder: 'Timing'">
<div>
<div data-bind="template: {
name: 'event',
data: timeout
}"></div>
<div data-bind="template: {
name: 'event',
data: timedwarning
}"></div>
</div>
</div>
<div data-bind="folder: 'Feedback'">
<div class="properties">
<div data-bind="template: {
name: 'booleanproperty',
data: { label:'Show current score?', property:showactualmark}
}"></div>
<div data-bind="template: {
name: 'booleanproperty',
data: { label:'Show maximum score?', property:showtotalmark}
}"></div>
<div data-bind="template: {
name: 'booleanproperty',
data: { label:'Show answer state?', property:showanswerstate}
}"></div>
<div data-bind="template: {
name: 'booleanproperty',
data: { label:'Allow reveal answer?', property:allowrevealanswer}
}"></div>
<div data-bind="template: {
name: 'percentproperty',
data: { label:'Advice threshold (percent)', property:advicethreshold}
}"></div>
</div>
</div>
<div data-bind="folder: {label: 'Questions ('+questions().length+')', show: true}">
<div class="questions">
<ul class="questionList editlist big" data-bind="
sortable: {
template: 'question',
data: questions,
afterMove: dropQuestion,
options: {handle: '.handle', placeholder: 'placeholder'}
}
"></ul>
<div class="searchBox">
<label for="questionsearch">Search for questions: </label>
<input type="text" id="questionsearch" class="search" data-bind="
value: search.query,
valueUpdate: 'afterkeydown',
css: {loading: search.searching()}
"/>
<ul class="results editlist big" data-bind="
template: {
name: 'questionResult',
foreach: search.results.all,
}
"></ul>
</div>
</div>
</div>
</script>
<script type="text/html" id="event">
<div data-bind="folder: niceName">
<div>
<div class="properties">
<div>
<label>Action: </label>
<select data-bind="options: actions, value: action, optionsText: 'niceName'"></select>
</div>
</div>
<div data-bind="fadeVisible:action().name!='none'">
Message:
<div data-bind="writemaths: message"/>
</div>
</div>
</div>
</script>
<script type="text/html" id="question">
<li class="question">
<span class="handle"></span>
<span class="number" data-bind="text: ($index()+1)+'.'"/>
<a data-bind="attr:{href: url}, text: name" target="_blank"></a>
<a class="preview" data-bind="attr: {href: url()+'preview/'}" target="_blank" title="Test run this question"></a>
<button class="delete delete-grey" data-bind="click:remove"></button>
<div class="description" data-bind="visible: description.length>0, html: description, mathjax: true"></div>
</li>
</script>
<script type="text/html" id="questionResult">
<li class="question questionResult">
<span class="handle" data-bind="click: add"></span>
<a data-bind="attr: {href: url}, text: name" target="_blank"></a>
<a class="preview" data-bind="attr: {href: url()+'preview/'}" target="_blank" title="Test run this question"></a>
<div class="description" data-bind="visible: description.length>0, html: description, mathjax: true"></div>
</li>
</script>
{% endverbatim %}
{% endblock content %}