1 |
efrain |
1 |
{{!
|
|
|
2 |
This file is part of Moodle - http://moodle.org/
|
|
|
3 |
|
|
|
4 |
Moodle is free software: you can redistribute it and/or modify
|
|
|
5 |
it under the terms of the GNU General Public License as published by
|
|
|
6 |
the Free Software Foundation, either version 3 of the License, or
|
|
|
7 |
(at your option) any later version.
|
|
|
8 |
|
|
|
9 |
Moodle is distributed in the hope that it will be useful,
|
|
|
10 |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
11 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
12 |
GNU General Public License for more details.
|
|
|
13 |
|
|
|
14 |
You should have received a copy of the GNU General Public License
|
|
|
15 |
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
|
|
16 |
}}
|
|
|
17 |
{{!
|
|
|
18 |
@template qbank_viewquestiontext/question_text_format
|
|
|
19 |
|
|
|
20 |
Example context (json):
|
|
|
21 |
{
|
|
|
22 |
"label": "Question text format",
|
|
|
23 |
"options": [
|
|
|
24 |
{
|
|
|
25 |
"value": 1,
|
|
|
26 |
"label": "Plain text",
|
|
|
27 |
"selected": true
|
|
|
28 |
},
|
|
|
29 |
{
|
|
|
30 |
"value": 2,
|
|
|
31 |
"label": "Fully rendered",
|
|
|
32 |
"selected": false
|
|
|
33 |
}
|
|
|
34 |
]
|
|
|
35 |
}
|
|
|
36 |
}}
|
|
|
37 |
<form class="question-text-format my-2 ml-2" action="{{formaction}}">
|
|
|
38 |
<input type="hidden" name="sesskey" value="{{sesskey}}">
|
|
|
39 |
<input type="hidden" name="returnurl" value="{{returnurl}}">
|
|
|
40 |
<div class="input-group">
|
|
|
41 |
<label class="input-group-prepend" for="question-text-format">
|
|
|
42 |
<span class="input-group-text">{{label}}</span>
|
|
|
43 |
</label>
|
|
|
44 |
<select class="form-control custom-select" name="format" id="question-text-format">
|
|
|
45 |
{{#options}}
|
|
|
46 |
<option value="{{value}}"{{#selected}} selected{{/selected}}>{{label}}</option>
|
|
|
47 |
{{/options}}
|
|
|
48 |
</select>
|
|
|
49 |
<div class="input-group-append">
|
|
|
50 |
<button class="btn btn-outline-dark mb-2">{{#str}} save {{/str}}</button>
|
|
|
51 |
</div>
|
|
|
52 |
</div>
|
|
|
53 |
</form>
|
|
|
54 |
{{#js}}
|
|
|
55 |
require(['qbank_viewquestiontext/question_text_format'], QuestionTextFormat => {
|
|
|
56 |
QuestionTextFormat.init('questionscontainer');
|
|
|
57 |
});
|
|
|
58 |
{{/js}}
|