From 6e8629e3dc0555c442f180c96534af6cfb99cb4f Mon Sep 17 00:00:00 2001 From: Nick Phillips Date: Fri, 31 May 2019 15:05:05 +1200 Subject: [PATCH] Fix #405 New feature to allow better control of "set all" status values. allows the ability to only set unselected items. --- lang/en/attendance.php | 4 ++-- renderer.php | 14 ++++++++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/lang/en/attendance.php b/lang/en/attendance.php index a1ef040..d45e10b 100644 --- a/lang/en/attendance.php +++ b/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'; diff --git a/renderer.php b/renderer.php index 5af41d4..c11bc95 100644 --- a/renderer.php +++ b/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(); }); });");