Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
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
    * 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
36
 
37
    Example context (json):
38
    {
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
        ]
54
    }
55
}}
56
<form id="gradingform_rubric-{{uniqid}}">
57
    <input type="hidden" name="instanceid" value="{{instanceid}}">
58
    <div id="rubric-advancedgrading-{{uniqid}}" class="criterion">
59
        {{#criteria}}
60
            <div class="mb-1">
61
                <div class="d-flex align-items-center mb-2">
62
                    <button class="criterion-toggle btn btn-sm btn-secondary d-inline-flex w-100 justify-content-between align-items-center"
63
                            type="button"
64
                            data-toggle="collapse"
65
                            data-target="#criteria-{{id}}"
66
                            aria-expanded="true"
67
                            aria-controls="criteria-{{id}}">
68
                            <span id="criterion-description-{{id}}">{{{description}}}</span>
69
 
70
                            <span class="expanded-icon">
71
                                {{#pix}} t/expanded, core {{/pix}}
72
                                <span class="sr-only">{{#str}} collapsecriterion, core_grades {{/str}}</span>
73
                            </span>
74
                    </button>
75
                </div>
76
                <div class="collapse show px-3" id="criteria-{{id}}" role="radiogroup" aria-labelledby="criterion-description-{{id}}">
77
                    {{#levels}}
78
                        <div class="form-check d-inline-flex align-items-center justify-content-start w-100">
79
                            <input class="form-check-input level"
80
                                   type="radio"
81
                                   name="advancedgrading[criteria][{{criterionid}}][levelid]"
82
                                   id="advancedgrading-criteria-{{criterionid}}-levels-{{id}}-definition"
83
                                   value="{{id}}"
84
                                    {{#checked}}
85
                                        aria-checked="true"
86
                                        tabindex="0"
87
                                        checked
88
                                    {{/checked}}
89
                                    {{^checked}}
90
                                        aria-checked="false"
91
                                        tabindex="-1"
92
                                    {{/checked}}
93
                            >
94
                            <label class="col" for="advancedgrading-criteria-{{criterionid}}-levels-{{id}}-definition">
95
                                <span>
96
                                    {{{definition}}}
97
                                </span>
98
                                <span class="pull-right">
99
                                    {{#str}}pointsvalue, gradingform_rubric, {{score}}{{/str}}
100
                                </span>
101
                            </label>
102
                        </div>
103
                    {{/levels}}
104
                    <div class="form-group">
105
                        <label class="text-muted" for="advancedgrading-criteria-{{id}}-remark">{{#str}} additionalfeedback, core_grades {{/str}}</label>
106
                        <textarea class="form-control"
107
                                  name="advancedgrading[criteria][{{id}}][remark]"
108
                                  id="advancedgrading-criteria-{{id}}-remark"
109
                                  cols="10"
110
                                  rows="1"
111
                                  data-max-rows="5"
112
                                  data-auto-rows="true"
113
                        >{{{remark}}}</textarea>
114
                    </div>
115
                </div>
116
            </div>
117
        {{/criteria}}
118
    </div>
119
</form>
120
{{#js}}
121
require(['core/auto_rows'], function(AutoRows) {
122
    AutoRows.init(document.getElementById('gradingform_rubric-{{uniqid}}'));
123
});
124
{{/js}}