1 |
efrain |
1 |
{{!
|
|
|
2 |
This file is part of Moodle - http://moodle.org/
|
|
|
3 |
Moodle is free software: you can redistribute it and/or modify
|
|
|
4 |
it under the terms of the GNU General Public License as published by
|
|
|
5 |
the Free Software Foundation, either version 3 of the License, or
|
|
|
6 |
(at your option) any later version.
|
|
|
7 |
Moodle is distributed in the hope that it will be useful,
|
|
|
8 |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
9 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
10 |
GNU General Public License for more details.
|
|
|
11 |
You should have received a copy of the GNU General Public License
|
|
|
12 |
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
|
|
13 |
}}
|
|
|
14 |
{{!
|
|
|
15 |
@template mod_quiz/question_slot
|
|
|
16 |
|
|
|
17 |
This template renders the question slot content.
|
|
|
18 |
|
|
|
19 |
Example context (json):
|
|
|
20 |
{
|
1441 |
ariadna |
21 |
"slotid": "1",
|
|
|
22 |
"canbeedited": true,
|
|
|
23 |
"checkbox": "<input id='selectquestion-1' name='selectquestion[]' type='checkbox' class='select-multiple-checkbox'>",
|
|
|
24 |
"questionnumber": "<span class='slotnumber'><span class='accesshide'>Question</span> 1</span>",
|
|
|
25 |
"questionname": "This is a test question",
|
|
|
26 |
"questionicons": "<i class='icon fa fa-search-plus fa-fw' title='Preview question'></i>",
|
|
|
27 |
"questiondependencyicon": "<span class='question_dependency_wrapper question_dependency_cannot_depend'></span>",
|
|
|
28 |
"versionselection": true,
|
|
|
29 |
"draftversion": false,
|
|
|
30 |
"bankname": "Question bank 1",
|
|
|
31 |
"issharedbank": true,
|
|
|
32 |
"bankurl": "http://example.com/question/edit.php?cmid=1&cat=1%2C1",
|
|
|
33 |
"versionoptions": [],
|
|
|
34 |
"versionoption": [
|
|
|
35 |
{
|
|
|
36 |
"versionid": 0,
|
|
|
37 |
"version": 0,
|
|
|
38 |
"versionvalue": "Always latest",
|
|
|
39 |
"selected": true
|
|
|
40 |
},
|
|
|
41 |
{
|
|
|
42 |
"versionid": "1",
|
|
|
43 |
"version": "1",
|
|
|
44 |
"questionid": "1",
|
|
|
45 |
"selected": false,
|
|
|
46 |
"versionvalue": "v1 (latest)"
|
|
|
47 |
}
|
|
|
48 |
]
|
1 |
efrain |
49 |
}
|
|
|
50 |
}}
|
|
|
51 |
|
|
|
52 |
<div class="mod-indent-outer" id="mod-indent-outer-slot-{{slotid}}">
|
|
|
53 |
{{{checkbox}}}
|
|
|
54 |
{{{questionnumber}}}
|
|
|
55 |
<div class="mod-indent"></div>
|
|
|
56 |
<div class="activityinstance">
|
1441 |
ariadna |
57 |
<div>{{{questionname}}}</div>
|
|
|
58 |
{{#issharedbank}}
|
|
|
59 |
<div class="sharedbank">
|
|
|
60 |
{{#bankurl}}
|
|
|
61 |
<a href="{{bankurl}}">
|
|
|
62 |
{{/bankurl}}
|
|
|
63 |
<span class="badge bg-primary text-light ms-2 mt-1">{{{bankname}}}</span>
|
|
|
64 |
{{#bankurl}}
|
|
|
65 |
</a>
|
|
|
66 |
{{/bankurl}}
|
|
|
67 |
</div>
|
|
|
68 |
{{/issharedbank}}
|
1 |
efrain |
69 |
</div>
|
1441 |
ariadna |
70 |
<div class="actions">
|
1 |
efrain |
71 |
{{#versionselection}}
|
1441 |
ariadna |
72 |
<label for="version-{{slotid}}" class="visually-hidden">{{#str}}question_version, question{{/str}}</label>
|
|
|
73 |
<select id="version-{{slotid}}" name="version" class="form-select me-2 version-selection"
|
1 |
efrain |
74 |
data-action="mod_quiz-select_slot" data-slot-id="{{slotid}}">
|
|
|
75 |
{{#versionoption}}
|
|
|
76 |
<option value="{{version}}" {{#selected}}selected="selected"{{/selected}}>{{versionvalue}}</option>
|
|
|
77 |
{{/versionoption}}
|
|
|
78 |
</select>
|
|
|
79 |
{{/versionselection}}
|
|
|
80 |
{{{questionicons}}}
|
1441 |
ariadna |
81 |
</div>
|
1 |
efrain |
82 |
{{#canbeedited}}
|
|
|
83 |
{{{questiondependencyicon}}}
|
|
|
84 |
{{/canbeedited}}
|
|
|
85 |
</div>
|
|
|
86 |
{{#draftversion}}
|
|
|
87 |
<div class="alert alert-danger" role="alert">{{#str}}questiondraftwillnotwork, mod_quiz{{/str}}</div>
|
|
|
88 |
{{/draftversion}}
|