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 mod_forum/local/grades/local/grader
20 Classes required for JS:
23 Data attributes required for JS:
24 * data-first-userid="350"
27 Context variables required for this template:
28 * userid: ID of the first user to jump to
29 * cmid: ID of the course module we want to grade
31 Example context (json):
38 id="grader-container-{{uniqid}}"
39 class="d-flex flex-column h-100 unified-grader"
40 data-region="unified-grader"
41 {{#userid}}data-first-userid="{{.}}"{{/userid}}
44 {{> mod_forum/local/grades/local/grader/navigation }}
46 <div class="d-flex flex-grow-1 h-100 position-relative">
47 {{#drawer}}{{> mod_forum/local/grades/local/grader/grading }}{{/drawer}}
48 {{> mod_forum/local/grades/local/grader/content }}
52 require(['jquery', 'core/drawer'], function($, Drawer) {
53 var root = $('#grader-container-{{uniqid}}');
54 var drawer = root.find('[data-region="right-hand-drawer"]');
55 var expandButtons = root.find('[data-action="expand-grading-drawer"]');
56 var collapseButtons = root.find('[data-action="collapse-grading-drawer"]');
58 expandButtons.click(function() {
59 collapseButtons.removeClass('active');
60 expandButtons.addClass('active');
61 collapseButtons.attr('aria-expanded', true);
62 expandButtons.attr('aria-expanded', true);
66 collapseButtons.click(function() {
67 expandButtons.removeClass('active');
68 collapseButtons.addClass('active');
69 collapseButtons.attr('aria-expanded', false);
70 expandButtons.attr('aria-expanded', false);