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 gradingform_rubric/grades/grader/gradingpanel
|
|
|
19 |
|
|
|
20 |
Classes required for JS:
|
|
|
21 |
* none
|
|
|
22 |
|
|
|
23 |
Data attributes required for JS:
|
|
|
24 |
* none
|
|
|
25 |
|
|
|
26 |
Context variables required for this template:
|
|
|
27 |
* instanceid: Instance of the module this grading form belongs too
|
|
|
28 |
* criterion: A gradeable item in the Marking Guide
|
|
|
29 |
* name: Name of the gradeable item
|
|
|
30 |
* id: ID of the gradeable item
|
|
|
31 |
* description: Description shown to students for this gradeable item
|
|
|
32 |
* descriptionmarkers: Description shown to teachers for this gradeable item
|
|
|
33 |
* maxscore: Max allowable assinable points for this item
|
|
|
34 |
* score: Current score assigned to the learner for this item
|
|
|
35 |
* remark: Text input for the teacher to relay to the student
|
|
|
36 |
* hascomments: Flag for frequently used comments
|
|
|
37 |
* comments: Array of frequently used comments
|
|
|
38 |
* description: Description of a frequently used comment
|
|
|
39 |
|
|
|
40 |
Example context (json):
|
|
|
41 |
{
|
|
|
42 |
"instanceid": "42",
|
|
|
43 |
"criterion": [
|
|
|
44 |
{
|
|
|
45 |
"name": "Motivation",
|
|
|
46 |
"id": 13,
|
|
|
47 |
"description": "Show your motivation to rock climbing",
|
|
|
48 |
"descriptionmarkers": "Does the student show interest in climbing?",
|
|
|
49 |
"maxscore": 37,
|
|
|
50 |
"score": 20,
|
|
|
51 |
"remark": "That's great!",
|
|
|
52 |
"hascomments": true,
|
|
|
53 |
"comments": [
|
|
|
54 |
{"description": "Great work!"},
|
|
|
55 |
{"description": "You should really try it before jumping to conclusions"}
|
|
|
56 |
]
|
|
|
57 |
}
|
|
|
58 |
]
|
|
|
59 |
}
|
|
|
60 |
}}
|
|
|
61 |
<form id="gradingform_guide-{{uniqid}}">
|
|
|
62 |
<input type="hidden" name="instanceid" value="{{instanceid}}">
|
|
|
63 |
{{#criterion}}
|
|
|
64 |
<div class="mb-1 criterion" data-gradingform-guide-role="criterion">
|
|
|
65 |
<div class="d-flex flex-wrap align-items-center">
|
|
|
66 |
|
|
|
67 |
<button
|
|
|
68 |
class="btn btn-sm btn-info d-inline-flex w-100 mb-2 justify-content-between align-items-center"
|
|
|
69 |
aria-controls="gradingform_guide-{{uniqid}}-criteria-{{id}}-description"
|
|
|
70 |
aria-expanded="false"
|
|
|
71 |
data-target="#gradingform_guide-{{uniqid}}-criteria-{{id}}-description"
|
|
|
72 |
data-toggle="collapse"
|
|
|
73 |
type="button"
|
|
|
74 |
>
|
|
|
75 |
{{#str}}informationforcriterion, gradingform_guide, {{name}}{{/str}}
|
|
|
76 |
<svg width="24" height="24" fill="none" viewBox="0 0 24 24">
|
|
|
77 |
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 13V15"></path>
|
|
|
78 |
<circle cx="12" cy="9" r="1" fill="currentColor"></circle>
|
|
|
79 |
<circle cx="12" cy="12" r="7.25" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></circle>
|
|
|
80 |
</svg>
|
|
|
81 |
</button>
|
|
|
82 |
<div class="collapse w-100" id="gradingform_guide-{{uniqid}}-criteria-{{id}}-description">
|
|
|
83 |
<div class="border p-3 mb-2 rounded">
|
|
|
84 |
{{{description}}}
|
|
|
85 |
{{#descriptionmarkers}}
|
|
|
86 |
<hr>
|
|
|
87 |
{{{descriptionmarkers}}}
|
|
|
88 |
{{/descriptionmarkers}}
|
|
|
89 |
</div>
|
|
|
90 |
</div>
|
|
|
91 |
|
|
|
92 |
<hr />
|
|
|
93 |
<button class="criterion-toggle btn btn-sm btn-secondary d-inline-flex w-100 justify-content-between align-items-center"
|
|
|
94 |
type="button"
|
|
|
95 |
data-toggle="collapse"
|
|
|
96 |
data-target="#criteria-{{id}}"
|
|
|
97 |
aria-expanded="true"
|
|
|
98 |
aria-controls="criteria-{{id}}">
|
|
|
99 |
<span>{{name}}</span>
|
|
|
100 |
<span class="collapsed-icon">
|
|
|
101 |
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
|
102 |
<path d="M12 15.25L16.25 9.75H7.75L12 15.25Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>
|
|
|
103 |
</svg>
|
|
|
104 |
<span class="sr-only">{{#str}} expandcriterion, core_grades {{/str}}</span>
|
|
|
105 |
</span>
|
|
|
106 |
<span class="expanded-icon">
|
|
|
107 |
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
|
108 |
<path d="M12 9.75L16.25 15.25H7.75L12 9.75Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>
|
|
|
109 |
</svg>
|
|
|
110 |
<span class="sr-only">{{#str}} collapsecriterion, core_grades {{/str}}</span>
|
|
|
111 |
</span>
|
|
|
112 |
</button>
|
|
|
113 |
<div class="collapse show border px-3 mt-2 w-100 rounded" id="criteria-{{id}}">
|
|
|
114 |
<div class="form-group">
|
|
|
115 |
<label for="gradingform_guide-{{uniqid}}-criteria-{{id}}-score">{{#str}}outof, gradingform_guide, {{maxscore}}{{/str}}</label>
|
|
|
116 |
<input class="form-control" type="number" name="advancedgrading[criteria][{{id}}][score]" value="{{score}}"
|
|
|
117 |
id="gradingform_guide-{{uniqid}}-criteria-{{id}}-score"
|
|
|
118 |
aria-describedby="gradingform_guide-{{uniqid}}-help-{{id}}-score"
|
|
|
119 |
min="0" max="{{maxscore}}"
|
|
|
120 |
aria-label="{{#str}}scoreforcriterion, gradingform_guide, {{name}}{{/str}}" style="width: 100px;">
|
|
|
121 |
<span id="gradingform_guide-{{uniqid}}-help-{{id}}-score" aria-hidden="true" class="sr-only">{{!
|
|
|
122 |
}}{{#str}}score_help, gradingform_guide, { "criterion": {{# quote }}{{ name }}{{/ quote }}, "maxscore": {{# quote }}{{ maxscore }}{{/ quote }} }{{/str}}
|
|
|
123 |
</span>
|
|
|
124 |
</div>
|
|
|
125 |
<div class="form-group ">
|
|
|
126 |
<label for="gradingform_guide-{{uniqid}}-criteria-{{id}}-remark">{{#str}}additionalcomments, gradingform_guide{{/str}}</label>
|
|
|
127 |
<div class="input-group mb-3 form-inset form-inset-right">
|
|
|
128 |
<textarea class="form-control" type="text" name="advancedgrading[criteria][{{id}}][remark]"
|
|
|
129 |
id="gradingform_guide-{{uniqid}}-criteria-{{id}}-remark"
|
|
|
130 |
aria-describedby="gradingform_guide-{{uniqid}}-help-{{id}}-remark"
|
|
|
131 |
aria-label="{{#str}}additionalcommentsforcriterion, gradingform_guide, {{name}}{{/str}}"
|
|
|
132 |
data-gradingform-guide-role="remark"
|
|
|
133 |
rows="2"
|
|
|
134 |
data-max-rows="5"
|
|
|
135 |
data-auto-rows
|
|
|
136 |
>{{remark}}</textarea>
|
|
|
137 |
{{#hascomments}}
|
|
|
138 |
<button
|
|
|
139 |
class="btn btn-sm btn-info d-inline-flex w-100 mt-2 justify-content-between align-items-center text-left collapsed"
|
|
|
140 |
aria-controls="gradingform_guide-{{uniqid}}-criteria-{{id}}-remark-frequent-comments"
|
|
|
141 |
aria-expanded="false"
|
|
|
142 |
data-toggle="collapse"
|
|
|
143 |
data-target="#gradingform_guide-{{uniqid}}-criteria-{{id}}-remark-frequent-comments"
|
|
|
144 |
type="button"
|
|
|
145 |
>
|
|
|
146 |
<span>{{#str}}commentpickerforcriterion, gradingform_guide, {{name}}{{/str}}</span>
|
|
|
147 |
<svg width="24" height="24" fill="none" viewBox="0 0 24 24">
|
|
|
148 |
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 13V15"></path>
|
|
|
149 |
<circle cx="12" cy="9" r="1" fill="currentColor"></circle>
|
|
|
150 |
<circle cx="12" cy="12" r="7.25" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></circle>
|
|
|
151 |
</svg>
|
|
|
152 |
</button>
|
|
|
153 |
{{/hascomments}}
|
|
|
154 |
</div>
|
|
|
155 |
{{#hascomments}}
|
|
|
156 |
<div class="collapse" id="gradingform_guide-{{uniqid}}-criteria-{{id}}-remark-frequent-comments">
|
|
|
157 |
<div data-gradingform_guide-frequent-comments="gradingform_guide-{{uniqid}}-criteria-{{id}}-remark">
|
|
|
158 |
<h5 class="mb-1">{{#str}}comments, gradingform_guide{{/str}}</h5>
|
|
|
159 |
<div class="list-group">
|
|
|
160 |
{{#comments}}
|
|
|
161 |
<button type="button" class="list-group-item list-group-item-action" data-gradingform_guide-role="frequent-comment">{{description}}</button>
|
|
|
162 |
{{/comments}}
|
|
|
163 |
</div>
|
|
|
164 |
</div>
|
|
|
165 |
</div>
|
|
|
166 |
{{/hascomments}}
|
|
|
167 |
<span id="gradingform_guide-{{uniqid}}-help-{{id}}-remark" aria-hidden="true" class="sr-only">{{#str}}remark_help, gradingform_guide{{/str}}</span>
|
|
|
168 |
</div>
|
|
|
169 |
</div>
|
|
|
170 |
|
|
|
171 |
</div>
|
|
|
172 |
</div>
|
|
|
173 |
{{/criterion}}
|
|
|
174 |
</form>
|
|
|
175 |
{{#js}}
|
|
|
176 |
require(['gradingform_guide/grades/grader/gradingpanel/comments', 'core/auto_rows'], function(Comments, AutoRows) {
|
|
|
177 |
Comments.init('gradingform_guide-{{uniqid}}');
|
|
|
178 |
AutoRows.init(document.getElementById('gradingform_guide-{{uniqid}}'));
|
|
|
179 |
});
|
|
|
180 |
{{/js}}
|