MDL-66893 grade: update marking guide template for grader
[moodle.git] / grade / grading / form / rubric / templates / grades / grader / gradingpanel.mustache
CommitLineData
eb9df053
MM
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 gradingform_rubric/grades/grader/gradingpanel
19
20 Classes required for JS:
47919bbe 21 * none
eb9df053
MM
22
23 Data attributes required for JS:
47919bbe 24 * none
eb9df053
MM
25
26 Context variables required for this template:
47919bbe
MM
27 * instanceid: Instance of the module this grading form belongs too
28 * criteria: A gradeable item in the Marking Guide
29 * id: The ID of the criteria
30 * description: Description of the criteria
31 * levels: The level that a criteria can be graded at
32 * criterionid: The ID of the criteria
33 * checked: Flag for if this is the currently selected level
34 * definition: Definition of the level
35 * remark: Text input for the teacher to relay to the student
eb9df053
MM
36
37 Example context (json):
38 {
47919bbe
MM
39 "instanceid": "42",
40 "criteria": [
41 {
42 "id": 13,
43 "description": "Show your motivation to rock climbing",
44 "levels": [
45 {
46 "criterionid": 13,
47 "checked": true,
48 "definition": "Great work!"
49 }
50 ],
51 "remark": "That's great!"
52 }
53 ]
eb9df053
MM
54 }
55}}
56<form id="gradingform_rubric-{{uniqid}}">
57 <input type="hidden" name="instanceid" value="{{instanceid}}">
eb9df053
MM
58 <div id="rubric-advancedgrading-{{uniqid}}" class="criterion">
59 {{#criteria}}
60 <div class="d-block mb-2">
61 <h5 class="d-inline px-0 font-weight-bold mb-0">{{{description}}}</h5>
62 <button class="d-inline btn p-0 font-weight-bold mb-0 pull-right collapse"
63 type="button"
64 data-toggle="collapse"
65 data-target="#criteria-{{id}}"
66 aria-expanded="true"
67 aria-controls="criteria-{{id}}">
68 </button>
69 </div>
70 <div class="collapse show" id="criteria-{{id}}">
71 {{#levels}}
72 <div class="form-check">
73 <input class="form-check-input level"
74 type="radio"
75 name="advancedgrading[criteria][{{criterionid}}][levelid]"
76 id="advancedgrading-criteria-{{criterionid}}-levels-{{id}}-definition"
77 value="{{id}}"
78 {{#checked}}
79 aria-checked="true"
80 tabindex="0"
81 checked
82 {{/checked}}
83 {{^checked}}
84 aria-checked="false"
85 tabindex="-1"
86 {{/checked}}
87 >
88 <label class="w-100" for="advancedgrading-criteria-{{criterionid}}-levels-{{id}}-definition">
89 <label class="font-weight-bold">
90 {{{definition}}}
91 </label>
92 <label class="pull-right font-weight-bold">
93 {{#str}}pointsvalue, gradingform_rubric, {{score}}{{/str}}
94 </label>
95 </label>
96 </div>
97 {{/levels}}
98 <div class="form-group">
99 <label for="advancedgrading-criteria-{{id}}-remark">Additional feedback</label>
100 <textarea class="form-control" name="advancedgrading[criteria][{{id}}][remark]" id="advancedgrading-criteria-{{id}}-remark" cols="10" rows="5">{{{remark}}}</textarea>
101 </div>
102 </div>
103 {{/criteria}}
104 </div>
105</form>