{{! This file is part of Moodle - http://moodle.org/ Moodle is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Moodle is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Moodle. If not, see . }} {{! @template core_course/defaultactivitycompletion Activity completion selector. Example context (json): { "courseid": "2", "sesskey": "AAAAAA", "modules": [{ "id": "10", "formattedname": "Assignment", "canmanage": true, "icon": "https://raw.githubusercontent.com/moodle/moodle/master/mod/assign/pix/icon.png", "completionstatus": { "string": "Manual", "icon": "https://raw.githubusercontent.com/moodle/moodle/master/pix/i/completion-manual-enabled.png" } }] } }}
{{#str}}bulkactivitydetail, core_completion{{/str}}
{{{helpicon}}}

{{#modules}} {{#canmanage}}
 {{{formattedname}}}
{{#completionstatus.icon}} {{{completionstatus.icon}}} {{/completionstatus.icon}} {{^completionstatus.icon}} {{/completionstatus.icon}}
{{{completionstatus.string}}}

{{/canmanage}} {{/modules}}
{{#js}} require([ 'jquery', ], function($) { $('.mastercheck').click(function() { var checked = $('.mastercheck').is(':checked'); $('input[type=checkbox]').each(function() { $(this).prop('checked', checked); $(this).trigger('change'); }); }); $('input[type=checkbox][id^=modtype_]').change(function() { if ($(this).is(':checked')) { $('[name=submitbutton]').removeAttr('disabled'); } else { // Is this the last activity checkbox to be un-checked? If so, disable the edit button. var somechecked = false; $('input[type=checkbox][id^=modtype_]').each(function() { if ($(this).is(':checked')) { somechecked = true; return false; } return true; }); if (!somechecked) { $('[name=submitbutton]').attr('disabled', 'disabled'); } } }); }); {{/js}}