Closed liesugahara closed 2 years ago
This is the sugggested solution:
define(['jquery','core_user/participants'],
function($,Participants) {
return /** @alias module:block_completion_progress/overview */ {
/**
* Initialise the overview page.
*
* @param {object} options initialisation options.
*/
init: function(options) {
Participants.init(options);
disable_select();
$('.overviewTable tbody').on('change', ':input', function() {
disable_select();
});
function disable_select() {
let countchecks = 0;
$('.overviewTable tbody :checkbox').each(function() {
if (this.checked) {
countchecks = 1;
$('#formactionid').removeAttr('disabled');
return;
}
});
if (!countchecks) {
$('#formactionid').attr('disabled', 'disabled');
}
}
}
};
});
Hello,
After playing around with the plugin i noticed that when you navigate to "Overview of students", scroll down to "With selected users..." and select either "send a message" or "add a note" without selecting a user, it throws the following error:
This was tested on moodle 4.0, using the plugin version 2022042000.
A possible solution would be disabling this dropdown via javascript when no student is selected.
Best regards!!