| 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 mod_assign/grading_actionmenu
|
|
|
19 |
|
|
|
20 |
Actions panel for the assignment grading UI.
|
|
|
21 |
|
|
|
22 |
Classes required for JS:
|
|
|
23 |
* none
|
|
|
24 |
|
|
|
25 |
Context variables required for this template:
|
| 1441 |
ariadna |
26 |
* userselector - HTML that outputs the user selector
|
|
|
27 |
* groupselector - (optional) HTML that outputs the group selector
|
|
|
28 |
* statusselector - (optional) The data object containing the required properties to render the status selector
|
|
|
29 |
* extrafiltersdropdown - HTML that outputs the extra filters dropdown
|
|
|
30 |
* pagereset - (optional) URL to reset the page
|
|
|
31 |
* graderurl - (optional) URL to the grader page
|
|
|
32 |
* quickgrading - (optional) Includes the baseurl and enabled properties for the quick grading checkbox
|
|
|
33 |
* downloadasfolders - (optional) Includes the baseurl and enabled properties for the download as folders checkbox
|
|
|
34 |
* actions - (optional) HTML that outputs the bulk action menu
|
| 1 |
efrain |
35 |
|
|
|
36 |
Example context (json):
|
|
|
37 |
{
|
| 1441 |
ariadna |
38 |
"userselector": {"user selector": "context here"},
|
|
|
39 |
"groupselector": {"group selector": "context here"},
|
|
|
40 |
"initialselector": {"initial selector": "context here"},
|
|
|
41 |
"statusselector": {
|
|
|
42 |
"name": "filter",
|
|
|
43 |
"value": "submitted",
|
|
|
44 |
"baseid": "select-menu56789",
|
|
|
45 |
"label": "Status",
|
|
|
46 |
"inlinelabel": true,
|
|
|
47 |
"selectedoption": "Not submitted",
|
|
|
48 |
"options": [
|
|
|
49 |
{"name": "All", "value": "", "selected": false, "id": "select-menu-option56789a"},
|
|
|
50 |
{"name": "Not submitted", "value": "notsubmitted", "selected": true, "id": "select-menu-option56789b"},
|
|
|
51 |
{"isdivider": true},
|
|
|
52 |
{"name": "granted extention", "value": "grantedextension", "selected": false, "id": "select-menu-option56789d"}
|
|
|
53 |
]
|
|
|
54 |
},
|
|
|
55 |
"extrafiltersdropdown": "<div class='dropdown extrafilters'></div>",
|
|
|
56 |
"pagereset": "http://moodle.local/mod/assign/view.php?id=2&action=grading&group=0",
|
|
|
57 |
"graderurl": "http://moodle.local/mod/assign/view.php?id=2&action=grader",
|
|
|
58 |
"quickgrading": {
|
|
|
59 |
"baseurl": "http://moodle.local/mod/assign/view.php?id=2&action=grading",
|
|
|
60 |
"enabled": true
|
|
|
61 |
},
|
|
|
62 |
"downloadasfolders": {
|
|
|
63 |
"baseurl": "http://moodle.local/mod/assign/view.php?id=2&action=grading",
|
|
|
64 |
"enabled": true
|
|
|
65 |
},
|
|
|
66 |
"actions": "<div class='action-menu'></div>"
|
| 1 |
efrain |
67 |
}
|
|
|
68 |
|
|
|
69 |
}}
|
| 1441 |
ariadna |
70 |
<div class="container-fluid tertiary-navigation full-width-bottom-border mb-2">
|
|
|
71 |
<div class="d-flex">
|
|
|
72 |
<div class="navitem">
|
|
|
73 |
<h2>{{#str}}gradeitem:submissions, mod_assign{{/str}}</h2>
|
| 1 |
efrain |
74 |
</div>
|
| 1441 |
ariadna |
75 |
<div class="navitem-divider d-none d-sm-flex"></div>
|
|
|
76 |
{{#userselector}}
|
|
|
77 |
<div class="navitem">
|
|
|
78 |
{{>core/comboboxsearch}}
|
|
|
79 |
</div>
|
|
|
80 |
<div class="navitem-divider d-none d-sm-flex"></div>
|
|
|
81 |
{{/userselector}}
|
|
|
82 |
{{#groupselector}}
|
|
|
83 |
<div class="navitem">
|
|
|
84 |
{{>core/comboboxsearch}}
|
|
|
85 |
</div>
|
|
|
86 |
<div class="navitem-divider d-none d-sm-flex"></div>
|
|
|
87 |
{{/groupselector}}
|
|
|
88 |
{{#initialselector}}
|
|
|
89 |
<div class="navitem d-flex flex-column align-self-center">
|
|
|
90 |
{{>core/comboboxsearch}}
|
|
|
91 |
</div>
|
|
|
92 |
<div class="navitem-divider"></div>
|
|
|
93 |
{{/initialselector}}
|
|
|
94 |
{{#statusselector}}
|
|
|
95 |
<div class="navitem">
|
|
|
96 |
{{>core/select_menu}}
|
|
|
97 |
</div>
|
|
|
98 |
<div class="navitem-divider d-none d-sm-flex"></div>
|
|
|
99 |
{{#js}}
|
|
|
100 |
document.querySelector('#{{baseid}}').addEventListener('change', function(e) {
|
|
|
101 |
window.location.href = e.target.value;
|
|
|
102 |
});
|
|
|
103 |
{{/js}}
|
|
|
104 |
{{/statusselector}}
|
|
|
105 |
{{#extrafiltersdropdown}}
|
|
|
106 |
<div class="navitem">
|
|
|
107 |
{{>core/local/dropdown/dialog}}
|
|
|
108 |
</div>
|
|
|
109 |
<div class="navitem-divider d-none d-sm-flex"></div>
|
|
|
110 |
{{/extrafiltersdropdown}}
|
|
|
111 |
{{#pagereset}}
|
|
|
112 |
<div class="navitem align-self-center">
|
|
|
113 |
<a href="{{{.}}}" class="btn btn-link">{{#str}}clearall, core{{/str}}</a>
|
|
|
114 |
</div>
|
|
|
115 |
<div class="navitem-divider"></div>
|
|
|
116 |
{{/pagereset}}
|
|
|
117 |
{{#graderurl}}
|
|
|
118 |
<div class="navitem ms-sm-auto align-self-center">
|
|
|
119 |
<a class="btn btn-primary" href="{{graderurl}}">{{#str}}gradeverb, core{{/str}}</a>
|
|
|
120 |
</div>
|
|
|
121 |
{{/graderurl}}
|
| 1 |
efrain |
122 |
</div>
|
|
|
123 |
</div>
|
| 1441 |
ariadna |
124 |
<div class="container-fluid tertiary-navigation pt-0">
|
|
|
125 |
<div class="d-flex flex-wrap gap-2 pb-2">
|
|
|
126 |
{{#quickgrading}}
|
|
|
127 |
<div class="navitem m-0 ms-auto">
|
|
|
128 |
<div class="form-check align-self-center">
|
|
|
129 |
<input class="form-check-input" type="checkbox" id="quickgrading-{{uniqid}}" {{#enabled}}checked{{/enabled}}/>
|
|
|
130 |
<label class="form-check-label" for="quickgrading-{{uniqid}}" >{{#str}}quickgrading, mod_assign{{/str}}</label>
|
|
|
131 |
</div>
|
|
|
132 |
</div>
|
|
|
133 |
<div class="navitem-divider m-0"></div>
|
|
|
134 |
{{#js}}
|
|
|
135 |
document.querySelector('#quickgrading-{{uniqid}}').addEventListener('change', function(e) {
|
|
|
136 |
var url = new URL('{{{baseurl}}}');
|
|
|
137 |
url.searchParams.set('quickgrading', e.target.checked ? 1 : 0);
|
|
|
138 |
window.location.href = url;
|
|
|
139 |
});
|
|
|
140 |
{{/js}}
|
|
|
141 |
{{/quickgrading}}
|
|
|
142 |
{{#downloadasfolders}}
|
|
|
143 |
<div class="navitem m-0">
|
|
|
144 |
<div class="form-check align-self-center">
|
|
|
145 |
<input class="form-check-input" type="checkbox" id="downloadasfolders-{{uniqid}}" {{#enabled}}checked{{/enabled}}/>
|
|
|
146 |
<label class="form-check-label" for="downloadasfolders-{{uniqid}}">{{#str}}downloadasfolders, mod_assign{{/str}}</label>
|
|
|
147 |
</div>
|
|
|
148 |
</div>
|
|
|
149 |
<div class="navitem-divider m-0"></div>
|
|
|
150 |
{{#js}}
|
|
|
151 |
document.querySelector('#downloadasfolders-{{uniqid}}').addEventListener('change', function(e) {
|
|
|
152 |
var url = new URL('{{{baseurl}}}');
|
|
|
153 |
url.searchParams.set('downloadasfolders', e.target.checked ? 1 : 0);
|
|
|
154 |
window.location.href = url;
|
|
|
155 |
});
|
|
|
156 |
{{/js}}
|
|
|
157 |
{{/downloadasfolders}}
|
|
|
158 |
{{#actions}}
|
|
|
159 |
<div class="navitem m-0">{{{actions}}}</div>
|
|
|
160 |
{{/actions}}
|
|
|
161 |
</div>
|
|
|
162 |
</div>
|