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 tool_lp/competency_grader
|
|
|
19 |
|
|
|
20 |
Template for grading a competency.
|
|
|
21 |
|
|
|
22 |
Classes required for JS:
|
|
|
23 |
None
|
|
|
24 |
|
|
|
25 |
Data required for JS:
|
|
|
26 |
* ratings - list of value, name selected for valid ratings
|
|
|
27 |
|
|
|
28 |
Example context (json):
|
|
|
29 |
{
|
|
|
30 |
"ratings": [
|
|
|
31 |
{"name": "Bad", "value": 0, "selected": true},
|
|
|
32 |
{"name": "OK", "value": 1},
|
|
|
33 |
{"name": "Good", "value": 2}
|
|
|
34 |
]
|
|
|
35 |
}
|
|
|
36 |
}}
|
|
|
37 |
<div class="competency-grader" data-region="competency-grader">
|
|
|
38 |
<form>
|
|
|
39 |
<div class="content">
|
|
|
40 |
<div data-region="rating">
|
|
|
41 |
<label for="rating_{{uniqid}}">{{#str}}rating, tool_lp{{/str}}</label>
|
|
|
42 |
<select name="rating" id="rating_{{uniqid}}" class="custom-select">
|
|
|
43 |
{{#ratings}}
|
|
|
44 |
<option value="{{value}}" {{#selected}}selected{{/selected}}>{{name}}</option>
|
|
|
45 |
{{/ratings}}
|
|
|
46 |
</select>
|
|
|
47 |
</div>
|
|
|
48 |
<div data-region="comment" class="mt-1">
|
|
|
49 |
<label for="comment_{{uniqid}}">{{#str}}ratecomment, tool_lp{{/str}}</label>
|
|
|
50 |
<textarea name="comment" id="comment_{{uniqid}}" class="form-control mb-1"></textarea>
|
|
|
51 |
</div>
|
|
|
52 |
</div>
|
|
|
53 |
<div data-region="footer" class="mt-3 row no-gutters w-100">
|
|
|
54 |
<div class="col">
|
|
|
55 |
<button data-action="rate" class="btn btn-primary w-100 mr-1">{{#str}}rate, tool_lp{{/str}}</button>
|
|
|
56 |
</div>
|
|
|
57 |
<div class="col">
|
|
|
58 |
<button data-action="cancel" class="btn btn-secondary w-100 ml-1">{{#str}}cancel{{/str}}</button>
|
|
|
59 |
</div>
|
|
|
60 |
</div>
|
|
|
61 |
<div class="clearfix"></div>
|
|
|
62 |
</form>
|
|
|
63 |
</div>
|