2 This file is part of Moodle - http://moodle.org/
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.
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.
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/>.
18 @template tool_lp/competency_grader
20 Template for grading a competency.
22 Classes required for JS:
26 * ratings - list of value, name selected for valid ratings
28 Example context (json):
31 {"name": "Bad", "value": 0, "selected": true},
32 {"name": "OK", "value": 1},
33 {"name": "Good", "value": 2}
37 <div class="competency-grader" data-region="competency-grader">
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">
44 <option value="{{value}}" {{#selected}}selected{{/selected}}>{{name}}</option>
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>
53 <div data-region="footer" class="pull-xs-right">
54 <button data-action="rate" class="btn btn-primary">{{#str}}rate, tool_lp{{/str}}</button>
55 <button data-action="cancel" class="btn btn-secondary">{{#str}}cancel{{/str}}</button>
57 <div class="clearfix"></div>