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 core_course/bulkactivitycompletion
20 Activity completion selector.
22 Example context (json):
31 "modname": "Test activity",
34 {"name": "src", "value": "https://raw.githubusercontent.com/moodle/moodle/master/pix/t/check.png"},
35 {"name": "alt", "value": "module icon"}
42 {"name": "src", "value": "https://raw.githubusercontent.com/moodle/moodle/master/pix/t/check.png"},
43 {"name": "alt", "value": "completion icon"}
51 <div class="container-fluid">
52 <div class="row m-b-2">
53 <div class="col">{{#str}}bulkactivitydetail, moodle{{/str}}</div>
55 <form method="post" action="bulkcompletion.php" class="mform" id="theform">
56 <div class="row m-b-2">
58 <input type="submit" value="{{#str}}edit{{/str}}" class="btn btn-primary" name="submitbutton" aria-label="{{#str}}updateactivities, completion{{/str}}" />
59 <input type="reset" value="{{#str}}cancel{{/str}}" class="btn btn-secondary" aria-label="{{#str}}resetactivities, completion{{/str}}" />
62 <div class="top-section row m-b-1">
63 <div class="col-sm-6 span6">
64 <input type="checkbox" class="mastercheck m-r-1" aria-label="{{#str}}checkall, completion{{/str}}">
65 <label class="font-weight-bold">{{#str}}activitieslabel, moodle{{/str}}</label>
67 <div class="col-sm-6">
68 <label class="font-weight-bold">{{#str}}completiontracking, moodle{{/str}}</label>
69 <span>{{{helpicon}}}</span>
76 <div class="topic-section m-b-1">
77 <div class="row m-b-1">
78 <div class="col-sm-12">
79 <input type="checkbox" data-section-master="{{sectionnumber}}" class="m-r-1" aria-label="{{#str}}checkallsection, completion, {{name}}{{/str}}">
83 {{> core_course/activityinstance}}
89 <input type="hidden" name="id" value="{{courseid}}" />
90 <input type="hidden" name="sesskey" value="{{sesskey}}" />
93 <input type="submit" value="{{#str}}edit{{/str}}" class="btn btn-primary" name="submitbutton" />
94 <input type="reset" value="{{#str}}cancel{{/str}}" class="btn btn-secondary" />
104 $('.mastercheck').click(function() {
105 var checked = $('.mastercheck').is(':checked');
106 $('input[type=checkbox]').each(function() {
107 $(this).prop('checked', checked);
110 var mastersection = $('input[data-section-master]');
111 mastersection.click(function() {
112 var checked = $(this).is(':checked');
113 var dataid = $(this).attr('data-section-master');
114 $('input[type=checkbox][data-section=\'' + dataid + '\']').each(function() {
115 $(this).prop('checked', checked);