diff --git a/mod/quiz/accessrule/offlineattempts/lang/en/quizaccess_offlineattempts.php b/mod/quiz/accessrule/offlineattempts/lang/en/quizaccess_offlineattempts.php index 69e71008cf4..2fbea601988 100644 --- a/mod/quiz/accessrule/offlineattempts/lang/en/quizaccess_offlineattempts.php +++ b/mod/quiz/accessrule/offlineattempts/lang/en/quizaccess_offlineattempts.php @@ -27,10 +27,10 @@ defined('MOODLE_INTERNAL') || die(); $string['allowofflineattempts'] = 'Allow quiz to be attempted offline using the mobile app'; $string['allowofflineattempts_help'] = 'If enabled, a mobile app user can download the quiz and attempt it offline. -Note: It is not possible for a quiz to be attempted offline if it has a time limit, or requires a network address, or uses any question behaviour other than deferred feedback (with or without CBM).'; +Note: It is not possible for a quiz to be attempted offline if it has a time limit, or requires a network address, or uses any question behaviour other than deferred feedback (with or without CBM), or uses sequential navigation.'; $string['confirmdatasaved'] = 'I confirm that I do not have any unsaved work on a mobile device.'; $string['mobileapp'] = 'Mobile app'; -$string['offlineattemptserror'] = 'It is not possible for a quiz to be attempted offline if it has a time limit, or requires a network address, or uses any question behaviour other than deferred feedback (with or without CBM).'; +$string['offlineattemptserror'] = 'It is not possible for a quiz to be attempted offline if it has a time limit, or requires a network address, or uses any question behaviour other than deferred feedback (with or without CBM), or uses sequential navigation.'; $string['offlinedatamessage'] = 'You have worked on this attempt using a mobile device. Data was last saved to this site {$a} ago.'; $string['pleaseconfirm'] = 'Please check and confirm that you do not have any unsaved work.'; $string['pluginname'] = 'Offline attempts access rule'; diff --git a/mod/quiz/accessrule/offlineattempts/rule.php b/mod/quiz/accessrule/offlineattempts/rule.php index 511be30f145..20db32753c3 100644 --- a/mod/quiz/accessrule/offlineattempts/rule.php +++ b/mod/quiz/accessrule/offlineattempts/rule.php @@ -114,6 +114,7 @@ class quizaccess_offlineattempts extends quiz_access_rule_base { $mform->setAdvanced('allowofflineattempts'); $mform->disabledIf('allowofflineattempts', 'timelimit[number]', 'neq', 0); $mform->disabledIf('allowofflineattempts', 'subnet', 'neq', ''); + $mform->disabledIf('allowofflineattempts', 'navmethod', 'eq', 'sequential'); } } @@ -126,9 +127,11 @@ class quizaccess_offlineattempts extends quiz_access_rule_base { // - The quiz uses a timer. // - The quiz is restricted by subnet. // - The question behaviour is not deferred feedback or deferred feedback with CBM. - if (!empty($data['allowofflineattempts']) and - (!empty($data['timelimit']) or !empty($data['subnet']) or - ($data['preferredbehaviour'] != 'deferredfeedback' and $data['preferredbehaviour'] != 'deferredcbm'))) { + // - The quiz uses the sequential navigation. + if (!empty($data['allowofflineattempts']) && + (!empty($data['timelimit']) || !empty($data['subnet']) || + $data['navmethod'] === 'sequential' || + ($data['preferredbehaviour'] != 'deferredfeedback' && $data['preferredbehaviour'] != 'deferredcbm'))) { $errors['allowofflineattempts'] = get_string('offlineattemptserror', 'quizaccess_offlineattempts'); }