diff --git a/mod/feedback/feedback.js b/mod/feedback/feedback.js deleted file mode 100644 index c7c8da86460..00000000000 --- a/mod/feedback/feedback.js +++ /dev/null @@ -1,15 +0,0 @@ -M.mod_feedback = {}; - -M.mod_feedback.init_sendmessage = function(Y) { - Y.on('click', function(e) { - Y.all('input.usercheckbox').each(function() { - this.set('checked', 'checked'); - }); - }, '#checkall'); - - Y.on('click', function(e) { - Y.all('input.usercheckbox').each(function() { - this.set('checked', ''); - }); - }, '#checknone'); -}; diff --git a/mod/feedback/lang/en/feedback.php b/mod/feedback/lang/en/feedback.php index cf070d28349..993defefd4d 100644 --- a/mod/feedback/lang/en/feedback.php +++ b/mod/feedback/lang/en/feedback.php @@ -139,6 +139,7 @@ $string['downloadresponseas'] = 'Download all responses as:'; $string['importfromthisfile'] = 'Import from this file'; $string['import_questions'] = 'Import questions'; $string['import_successfully'] = 'Import successfully'; +$string['includeuserinrecipientslist'] = 'Include {$a} in the list of recipients'; $string['indicator:cognitivedepth'] = 'Feedback cognitive'; $string['indicator:cognitivedepth_help'] = 'This indicator is based on the cognitive depth reached by the student in a Feedback activity.'; $string['indicator:socialbreadth'] = 'Feedback social'; diff --git a/mod/feedback/show_nonrespondents.php b/mod/feedback/show_nonrespondents.php index 8be8e65cc21..fb20199168f 100644 --- a/mod/feedback/show_nonrespondents.php +++ b/mod/feedback/show_nonrespondents.php @@ -76,7 +76,8 @@ if (($formdata = data_submitted()) AND !confirm_sesskey()) { require_capability('mod/feedback:viewreports', $context); -if ($action == 'sendmessage' AND has_capability('moodle/course:bulkmessaging', $coursecontext)) { +$canbulkmessaging = has_capability('moodle/course:bulkmessaging', $coursecontext); +if ($action == 'sendmessage' AND $canbulkmessaging) { $shortname = format_string($course->shortname, true, array('context' => $coursecontext)); @@ -164,9 +165,22 @@ $baseurl->params(array('id'=>$id, 'showall'=>$showall)); $tablecolumns = array('userpic', 'fullname', 'status'); $tableheaders = array(get_string('userpic'), get_string('fullnameuser'), get_string('status')); -if (has_capability('moodle/course:bulkmessaging', $coursecontext)) { +if ($canbulkmessaging) { $tablecolumns[] = 'select'; - $tableheaders[] = get_string('select'); + + // Build the select/deselect all control. + $selectallid = 'selectall-non-respondents'; + $mastercheckbox = new \core\output\checkbox_toggleall('feedback-non-respondents', true, [ + 'id' => $selectallid, + 'name' => $selectallid, + 'value' => 1, + 'label' => get_string('select'), + // Consistent label to prevent the select column from resizing. + 'selectall' => get_string('select'), + 'deselectall' => get_string('select'), + 'labelclasses' => 'm-0', + ]); + $tableheaders[] = $OUTPUT->render($mastercheckbox); } $table = new flexible_table('feedback-shownonrespondents-'.$course->id); @@ -232,7 +246,6 @@ if (empty($students)) { echo $OUTPUT->notification(get_string('noexistingparticipants', 'enrol')); } else { - $canbulkmessaging = has_capability('moodle/course:bulkmessaging', $coursecontext); if ($canbulkmessaging) { echo '