Browse Source

Fix #405 New feature to allow better control of "set all" status values.

allows the ability to only set unselected items.
MOODLE_37_STABLE
Nick Phillips 6 years ago
committed by Dan Marsden
parent
commit
6e8629e3dc
  1. 4
      lang/en/attendance.php
  2. 14
      renderer.php

4
lang/en/attendance.php

@ -440,8 +440,8 @@ $string['sessiontype'] = 'Type';
$string['sessiontypeshort'] = 'Type';
$string['sessionupdated'] = 'Session successfully updated';
$string['set_by_student'] = 'Self-recorded';
$string['setallstatuses'] = 'Set status for all users';
$string['setallstatusesto'] = 'Set status for all users to «{$a}»';
$string['setallstatuses'] = 'Set status for';
$string['setallstatusesto'] = 'Set status to «{$a}»';
$string['setperiod'] = 'Specified time in minutes to release IP';
$string['settings'] = 'Settings';
$string['setunmarked'] = 'Automatically set when not marked';

14
renderer.php

@ -663,7 +663,12 @@ class mod_attendance_renderer extends plugin_renderer_base {
$PAGE->requires->js_amd_inline("
require(['jquery'], function($) {
$('#radiocheckstatus".$st->id."').click(function(e) {
$('#attendancetakeform').find('.st".$st->id."').prop('checked', true);
if (e.shiftKey) {
$('#attendancetakeform').find('.st".$st->id."').prop('checked', true);
}
else {
$('#attendancetakeform').find('input:indeterminate.st".$st->id."').prop('checked', true);
}
});
});");
}
@ -729,7 +734,12 @@ class mod_attendance_renderer extends plugin_renderer_base {
$PAGE->requires->js_amd_inline("
require(['jquery'], function($) {
$('#checkstatus".$st->id."').click(function(e) {
$('#attendancetakeform').find('.st".$st->id."').prop('checked', true);
if (e.shiftKey) {
$('#attendancetakeform').find('input:indeterminate.st".$st->id."').prop('checked', true);
}
else {
$('#attendancetakeform').find('.st".$st->id."').prop('checked', true);
}
e.preventDefault();
});
});");

Loading…
Cancel
Save