diff --git a/mod/assign/lang/en/assign.php b/mod/assign/lang/en/assign.php index f1fff7da33c..6b5c86227e8 100644 --- a/mod/assign/lang/en/assign.php +++ b/mod/assign/lang/en/assign.php @@ -134,7 +134,7 @@ $string['collapsegradepanel'] = 'Collapse grade panel'; $string['collapsereviewpanel'] = 'Collapse review panel'; $string['comment'] = 'Comment'; $string['completiondetail:submit'] = 'Make a submission'; -$string['completionsubmit'] = 'Student must make a submission'; +$string['completionsubmit'] = 'Make a submission'; $string['conversionexception'] = 'Could not convert assignment. Exception was: {$a}.'; $string['configshowrecentsubmissions'] = 'Everyone can see notifications of submissions in recent activity reports.'; $string['confirmsubmission'] = 'Are you sure you want to submit your work for grading? You will not be able to make any more changes.'; diff --git a/mod/bigbluebuttonbn/lang/en/bigbluebuttonbn.php b/mod/bigbluebuttonbn/lang/en/bigbluebuttonbn.php index 18b847bb193..e47c59ce9d8 100644 --- a/mod/bigbluebuttonbn/lang/en/bigbluebuttonbn.php +++ b/mod/bigbluebuttonbn/lang/en/bigbluebuttonbn.php @@ -93,11 +93,10 @@ $string['privacy:metadata:bigbluebutton:fullname'] = 'The full name of the user $string['privacy:metadata:bigbluebuttonbn_recordings'] = 'Stores metadata about recordings.'; $string['privacy:metadata:bigbluebuttonbn_recordings:userid'] = 'The user ID of the user who last changed a recording.'; -$string['completionattendance'] = 'Student must attend the session for:'; +$string['completionattendance'] = 'Require attendance (minutes)'; $string['completionattendance_desc'] = 'Enter and remain in the room for at least {$a} minute(s).'; $string['completionattendance_event_desc'] = 'Student has entered the room and remained in the session for at least {$a} minute(s)'; -$string['completionattendancegroup'] = 'Require attendance'; -$string['completionattendancegroup_help'] = 'Attending the meeting for (n) minutes is required for completion.'; +$string['completionattendancegroup'] = 'Require attendance (minutes)'; $string['completionengagementchats'] = 'Chats'; $string['completionengagementchats_desc'] = 'Participate in {$a} chat(s).'; @@ -117,14 +116,11 @@ $string['completionengagementemojis_event_desc'] = 'Changed their emoji {$a} tim $string['completionengagement_desc'] = 'Engage in activities during the meeting.'; $string['completionengagementgroup'] = 'Require participation'; -$string['completionengagementgroup_help'] = 'Active participation during the session is required for completion.'; $string['completionupdatestate'] = 'Completion update state'; $string['completionvalidatestate'] = 'Validate completion'; $string['completionvalidatestatetriggered'] = 'Validate completion has been triggered.'; -$string['completionview'] = 'Require view'; -$string['completionview_desc'] = 'Student must view the room to complete it.'; $string['completionview_event_desc'] = 'Has viewed the room.'; $string['sendnotification'] = 'Send notification'; @@ -665,3 +661,9 @@ $string['recordingurlnotfound'] = 'The recording URL is invalid.'; $string['subplugintype_bbbext'] = 'BigBlueButton activity extension'; $string['subplugintype_bbbext_plural'] = 'BigBlueButton activity extensions'; + +// Deprecated since Moodle 4.3. +$string['completionview'] = 'Require view'; +$string['completionview_desc'] = 'View the room'; +$string['completionattendancegroup_help'] = 'Attending the meeting for (n) minutes is required for completion.'; +$string['completionengagementgroup_help'] = 'Active participation during the session is required for completion.'; diff --git a/mod/bigbluebuttonbn/lang/en/deprecated.txt b/mod/bigbluebuttonbn/lang/en/deprecated.txt new file mode 100644 index 00000000000..d9ce987c4e9 --- /dev/null +++ b/mod/bigbluebuttonbn/lang/en/deprecated.txt @@ -0,0 +1,4 @@ +completionview,mod_bigbluebuttonbn +completionview_desc,mod_bigbluebuttonbn +completionattendancegroup_help,mod_bigbluebuttonbn +completionengagementgroup_help,mod_bigbluebuttonbn diff --git a/mod/bigbluebuttonbn/mod_form.php b/mod/bigbluebuttonbn/mod_form.php index c37105c6865..07810c7ae83 100644 --- a/mod/bigbluebuttonbn/mod_form.php +++ b/mod/bigbluebuttonbn/mod_form.php @@ -228,26 +228,22 @@ class mod_bigbluebuttonbn_mod_form extends moodleform_mod { $suffix = $this->get_suffix(); // Elements for completion by Attendance. - $attendance['grouplabel'] = get_string('completionattendancegroup', 'bigbluebuttonbn'); $attendance['rulelabel'] = get_string('completionattendance', 'bigbluebuttonbn'); $completionattendanceenabledel = 'completionattendanceenabled' . $suffix; $completionattendanceel = 'completionattendance' . $suffix; $completionattendanceunitel = 'completionattendanceunit' . $suffix; $attendance['group'] = [ $mform->createElement('advcheckbox', $completionattendanceenabledel, '', $attendance['rulelabel'] . ' '), - $mform->createElement('text', $completionattendanceel, '', ['size' => 3]), - $mform->createElement('static', $completionattendanceunitel, ' ', get_string('minutes', 'bigbluebuttonbn')) + $mform->createElement('text', $completionattendanceel, 'minutes', ['size' => 3]), ]; $mform->setType($completionattendanceel, PARAM_INT); $completionattendancegroupel = 'completionattendancegroup' . $suffix; - $mform->addGroup($attendance['group'], $completionattendancegroupel, $attendance['grouplabel'], ' ', false); - $mform->addHelpButton($completionattendancegroupel, 'completionattendancegroup', 'bigbluebuttonbn'); + $mform->addGroup($attendance['group'], $completionattendancegroupel, '', ' ', false); $completionel = 'completion' . $suffix; - $mform->disabledIf($completionattendancegroupel, $completionel, 'neq', COMPLETION_AGGREGATION_ANY); - $mform->disabledIf($completionattendanceel, $completionattendanceenabledel, 'notchecked'); + $mform->hideIf($completionattendancegroupel, $completionel, 'neq', COMPLETION_AGGREGATION_ANY); + $mform->hideIf($completionattendanceel, $completionattendanceenabledel, 'notchecked'); // Elements for completion by Engagement. - $engagement['grouplabel'] = get_string('completionengagementgroup', 'bigbluebuttonbn'); $engagement['chatlabel'] = get_string('completionengagementchats', 'bigbluebuttonbn'); $engagement['talklabel'] = get_string('completionengagementtalks', 'bigbluebuttonbn'); $engagement['raisehand'] = get_string('completionengagementraisehand', 'bigbluebuttonbn'); @@ -267,14 +263,13 @@ class mod_bigbluebuttonbn_mod_form extends moodleform_mod { $mform->createElement('advcheckbox', $completionengagementemojisel, '', $engagement['emojis'] . '  '), ]; $completionengagementgroupel = 'completionengagementgroup' . $suffix; - $mform->addGroup($engagement['group'], $completionengagementgroupel, $engagement['grouplabel'], ' ', false); + $mform->addGroup($engagement['group'], $completionengagementgroupel, '', ' ', false); $mform->addGroupRule($completionattendancegroupel, [ $completionattendanceel => [ [null, 'numeric', null, 'client'] ] ]); - $mform->addHelpButton($completionengagementgroupel, 'completionengagementgroup', 'bigbluebuttonbn'); - $mform->disabledIf($completionengagementgroupel, $completionel, 'neq', COMPLETION_AGGREGATION_ANY); + $mform->hideIf($completionengagementgroupel, $completionel, 'neq', COMPLETION_AGGREGATION_ANY); $completionrules = [$completionattendancegroupel, $completionengagementgroupel]; foreach ($this->formextensions as $formextension) { diff --git a/mod/data/lang/en/data.php b/mod/data/lang/en/data.php index baa16f0e33d..c6494e451eb 100644 --- a/mod/data/lang/en/data.php +++ b/mod/data/lang/en/data.php @@ -71,8 +71,7 @@ $string['commentsaved'] = 'Comment saved'; $string['commentsn'] = '{$a} comment(s)'; $string['commentsoff'] = 'Comments feature is not enabled'; $string['completiondetail:entries'] = 'Make entries: {$a}'; -$string['completionentries'] = 'Require entries'; -$string['completionentriescount'] = 'Count of entries'; +$string['completionentriescount'] = 'Add entries'; $string['completionentriesdesc'] = 'Minimum number of entries required: {$a}'; $string['configenablerssfeeds'] = 'This switch will enable the possibility of RSS feeds for all databases. You will still need to turn feeds on manually in the settings for each database.'; $string['confirmdeletefield'] = 'You are about to delete this field, are you sure?'; @@ -486,3 +485,6 @@ $string['todatabase'] = 'to this database.'; // Deprecated since Moodle 4.2. $string['fieldids'] = 'Field ids'; + +// Deprecated since Moodle 4.3. +$string['completionentries'] = 'Require entries'; diff --git a/mod/data/lang/en/deprecated.txt b/mod/data/lang/en/deprecated.txt index c56751ca789..2e5d4e50bc2 100644 --- a/mod/data/lang/en/deprecated.txt +++ b/mod/data/lang/en/deprecated.txt @@ -8,3 +8,4 @@ addedby,mod_data addentries,mod_data todatabase,mod_data fieldids,mod_data +completionentries,mod_data diff --git a/mod/data/mod_form.php b/mod/data/mod_form.php index 6b535f88a5a..ec36f8e5c5d 100644 --- a/mod/data/mod_form.php +++ b/mod/data/mod_form.php @@ -145,11 +145,11 @@ class mod_data_mod_form extends moodleform_mod { $mform->addGroup( $group, $completionentriesgroupel, - get_string('completionentries', 'data'), + '', [' '], false ); - $mform->disabledIf($completionentriesel, $completionentriesenabledel, 'notchecked'); + $mform->hideIf($completionentriesel, $completionentriesenabledel, 'notchecked'); $mform->setDefault($completionentriesel, 1); $mform->setType($completionentriesel, PARAM_INT); /* This ensures the elements are disabled unless completion rules are enabled */ diff --git a/mod/feedback/lang/en/feedback.php b/mod/feedback/lang/en/feedback.php index 7f753b41ad1..b51950706fe 100644 --- a/mod/feedback/lang/en/feedback.php +++ b/mod/feedback/lang/en/feedback.php @@ -50,7 +50,7 @@ $string['complete_the_form'] = 'Answer the questions'; $string['completed'] = 'Completed'; $string['completedon'] = 'Completed on {$a}'; $string['completiondetail:submit'] = 'Submit feedback'; -$string['completionsubmit'] = 'View as completed if the feedback is submitted'; +$string['completionsubmit'] = 'Submit feedback'; $string['configallowfullanonymous'] = 'If set to \'yes\', users can complete a feedback activity on the site home without being required to log in.'; $string['confirmdeleteentry'] = 'Are you sure you want to delete this entry?'; $string['confirmdeleteitem'] = 'Are you sure you want to delete this element?'; diff --git a/mod/forum/lang/en/forum.php b/mod/forum/lang/en/forum.php index b2c2a25d7f8..ac32a5b1037 100644 --- a/mod/forum/lang/en/forum.php +++ b/mod/forum/lang/en/forum.php @@ -111,18 +111,14 @@ $string['closegrader'] = 'Close grader'; $string['completiondetail:discussions'] = 'Start discussions: {$a}'; $string['completiondetail:replies'] = 'Post replies: {$a}'; $string['completiondetail:posts'] = 'Make forum posts: {$a}'; -$string['completiondiscussions'] = 'Student must create discussions:'; +$string['completiondiscussions'] = 'Start discussions'; $string['completiondiscussionsdesc'] = 'Student must create at least {$a} discussion(s)'; -$string['completiondiscussionsgroup'] = 'Require discussions'; -$string['completiondiscussionshelp'] = 'requiring discussions to complete'; -$string['completionposts'] = 'Student must post discussions or replies:'; +$string['completionpostsinforums'] = 'Post in forums'; +$string['completionposts'] = 'Start discussions or post replies'; $string['completionpostsdesc'] = 'Student must post at least {$a} discussion(s) or reply/replies'; -$string['completionpostsgroup'] = 'Require posts'; $string['completionpostshelp'] = 'requiring discussions or replies to complete'; -$string['completionreplies'] = 'Student must post replies:'; +$string['completionreplies'] = 'Post replies'; $string['completionrepliesdesc'] = 'Student must post at least {$a} reply/replies'; -$string['completionrepliesgroup'] = 'Require replies'; -$string['completionreplieshelp'] = 'requiring replies to complete'; $string['configcleanreadtime'] = 'The hour of the day to clean old posts from the \'read\' table.'; $string['configdigestmailtime'] = 'People who choose to have emails sent to them in digest form will be emailed the digest daily. This setting controls which time of day the daily mail will be sent (the next cron that runs after this hour will send it).'; $string['configdisplaymode'] = 'The default display mode for discussions if one isn\'t set.'; @@ -795,3 +791,10 @@ $string['viewgrades'] = 'View grades'; $string['postmailinfolink'] = 'This is a copy of a message posted in {$a->coursename}. To reply click on this link: {$a->replylink}'; + +// Deprecated since Moodle 4.3. +$string['completionpostsgroup'] = 'Require posts'; +$string['completiondiscussionsgroup'] = 'Require discussions'; +$string['completiondiscussionshelp'] = 'requiring discussions to complete'; +$string['completionrepliesgroup'] = 'Require replies'; +$string['completionreplieshelp'] = 'requiring replies to complete'; diff --git a/mod/forum/mod_form.php b/mod/forum/mod_form.php index 7b9a45d8610..f59059e00a6 100644 --- a/mod/forum/mod_form.php +++ b/mod/forum/mod_form.php @@ -455,8 +455,8 @@ class mod_forum_mod_form extends moodleform_mod { $group[] =& $mform->createElement('text', $completionpostsel, '', ['size' => 3]); $mform->setType($completionpostsel, PARAM_INT); $completionpostsgroupel = 'completionpostsgroup' . $suffix; - $mform->addGroup($group, $completionpostsgroupel, get_string('completionpostsgroup', 'forum'), ' ', false); - $mform->disabledIf($completionpostsel, $completionpostsenabledel, 'notchecked'); + $mform->addGroup($group, $completionpostsgroupel, '', ' ', false); + $mform->hideIf($completionpostsel, $completionpostsenabledel, 'notchecked'); $group = []; $completiondiscussionsenabledel = 'completiondiscussionsenabled' . $suffix; @@ -464,15 +464,14 @@ class mod_forum_mod_form extends moodleform_mod { 'checkbox', $completiondiscussionsenabledel, '', - get_string('completiondiscussions', - 'forum') + get_string('completiondiscussions', 'forum') ); $completiondiscussionsel = 'completiondiscussions' . $suffix; $group[] =& $mform->createElement('text', $completiondiscussionsel, '', ['size' => 3]); $mform->setType($completiondiscussionsel, PARAM_INT); $completiondiscussionsgroupel = 'completiondiscussionsgroup' . $suffix; - $mform->addGroup($group, $completiondiscussionsgroupel, get_string('completiondiscussionsgroup', 'forum'), ' ', false); - $mform->disabledIf($completiondiscussionsel, $completiondiscussionsenabledel, 'notchecked'); + $mform->addGroup($group, $completiondiscussionsgroupel, '', ' ', false); + $mform->hideIf($completiondiscussionsel, $completiondiscussionsenabledel, 'notchecked'); $group = []; $completionrepliesenabledel = 'completionrepliesenabled' . $suffix; @@ -481,8 +480,8 @@ class mod_forum_mod_form extends moodleform_mod { $group[] =& $mform->createElement('text', $completionrepliesel, '', ['size' => 3]); $mform->setType($completionrepliesel, PARAM_INT); $completionrepliesgroupel = 'completionrepliesgroup' . $suffix; - $mform->addGroup($group, $completionrepliesgroupel, get_string('completionrepliesgroup', 'forum'), ' ', false); - $mform->disabledIf($completionrepliesel, $completionrepliesenabledel, 'notchecked'); + $mform->addGroup($group, $completionrepliesgroupel, '', ' ', false); + $mform->hideIf($completionrepliesel, $completionrepliesenabledel, 'notchecked'); return [$completiondiscussionsgroupel, $completionrepliesgroupel, $completionpostsgroupel]; } diff --git a/mod/glossary/lang/en/deprecated.txt b/mod/glossary/lang/en/deprecated.txt index 7b49b56cbca..082184ce9b5 100644 --- a/mod/glossary/lang/en/deprecated.txt +++ b/mod/glossary/lang/en/deprecated.txt @@ -1 +1,2 @@ waitingapproval,mod_glossary +completionentriesgroup,mod_glossary diff --git a/mod/glossary/lang/en/glossary.php b/mod/glossary/lang/en/glossary.php index ca575f06d17..eeec66f2cb9 100644 --- a/mod/glossary/lang/en/glossary.php +++ b/mod/glossary/lang/en/glossary.php @@ -89,9 +89,8 @@ $string['comments'] = 'Comments'; $string['commentson'] = 'Comments on'; $string['commentupdated'] = 'The comment has been updated.'; $string['completiondetail:entries'] = 'Make entries: {$a}'; -$string['completionentries'] = 'Student must create entries:'; +$string['completionentries'] = 'Add entries'; $string['completionentriesdesc'] = 'Student must create at least {$a} entry/entries'; -$string['completionentriesgroup'] = 'Require entries'; $string['concept'] = 'Concept'; $string['concepts'] = 'Concepts'; $string['configenablerssfeeds'] = 'This switch will enable the possibility of RSS feeds for all glossaries. You will still need to turn feeds on manually in the settings for each glossary.'; @@ -342,3 +341,6 @@ $string['youarenottheauthor'] = 'You are not the author of this comment, so you // Deprecated since 4.0. $string['waitingapproval'] = 'Waiting approval'; + +// Deprecated since 4.3. +$string['completionentriesgroup'] = 'Require entries'; diff --git a/mod/glossary/mod_form.php b/mod/glossary/mod_form.php index 5c75fb13fdf..e0db550e5e0 100644 --- a/mod/glossary/mod_form.php +++ b/mod/glossary/mod_form.php @@ -205,8 +205,8 @@ class mod_glossary_mod_form extends moodleform_mod { $group[] =& $mform->createElement('text', $completionentriesel, '', ['size' => 3]); $mform->setType($completionentriesel, PARAM_INT); $completionentriesgroupel = 'completionentriesgroup' . $suffix; - $mform->addGroup($group, $completionentriesgroupel, get_string('completionentriesgroup', 'glossary'), ' ', false); - $mform->disabledIf($completionentriesel, $completionentriesenabledel, 'notchecked'); + $mform->addGroup($group, $completionentriesgroupel, '', ' ', false); + $mform->hideIf($completionentriesel, $completionentriesenabledel, 'notchecked'); return [$completionentriesgroupel]; } diff --git a/mod/lesson/lang/en/deprecated.txt b/mod/lesson/lang/en/deprecated.txt new file mode 100644 index 00000000000..f5b4381172f --- /dev/null +++ b/mod/lesson/lang/en/deprecated.txt @@ -0,0 +1 @@ +completiontimespent,mod_lesson diff --git a/mod/lesson/lang/en/lesson.php b/mod/lesson/lang/en/lesson.php index 17281f8d1dd..55a0df7b536 100644 --- a/mod/lesson/lang/en/lesson.php +++ b/mod/lesson/lang/en/lesson.php @@ -118,7 +118,6 @@ $string['completiondetail:reachend'] = 'Go through the activity to the end'; $string['completiondetail:timespent'] = 'Spend at least {$a} on this activity'; $string['completionendreached'] = 'Require end reached'; $string['completionendreached_desc'] = 'Student must reach the end of lesson page to complete this activity'; -$string['completiontimespent'] = 'Student must do this activity at least for'; $string['completiontimespentdesc'] = 'Student must do this activity for at least {$a}'; $string['completiontimespentgroup'] = 'Require time spent'; $string['conditionsfordependency'] = 'Condition(s) for the dependency'; @@ -612,3 +611,6 @@ $string['youranswer'] = 'Your answer'; $string['yourcurrentgradeis'] = 'Your current grade is {$a}'; $string['yourcurrentgradeisoutof'] = 'Your current grade is {$a->grade} out of {$a->total}'; $string['youshouldview'] = 'You should answer at least: {$a}'; + +// Deprecated since 4.3. +$string['completiontimespent'] = 'Student must do this activity at least for'; diff --git a/mod/lesson/mod_form.php b/mod/lesson/mod_form.php index 88f87925047..dc5b35a65f4 100644 --- a/mod/lesson/mod_form.php +++ b/mod/lesson/mod_form.php @@ -412,8 +412,8 @@ class mod_lesson_mod_form extends moodleform_mod { $completionendreachedel = 'completionendreached' . $suffix; $mform->addElement( 'checkbox', $completionendreachedel, - get_string('completionendreached', 'lesson'), - get_string('completionendreached_desc', 'lesson') + '', + get_string('completionendreached', 'lesson') ); // Enable this completion rule by default. $mform->setDefault($completionendreachedel, 1); @@ -424,14 +424,14 @@ class mod_lesson_mod_form extends moodleform_mod { 'checkbox', $completiontimespentenabledel, '', - get_string('completiontimespent', 'lesson') + get_string('completiontimespentgroup', 'lesson') ); $completiontimespentel = 'completiontimespent' . $suffix; $group[] =& $mform->createElement('duration', $completiontimespentel, '', ['optional' => false]); $completiontimespentgroupel = 'completiontimespentgroup' . $suffix; - $mform->addGroup($group, $completiontimespentgroupel, get_string('completiontimespentgroup', 'lesson'), ' ', false); - $mform->disabledIf($completiontimespentel . '[number]', $completiontimespentenabledel, 'notchecked'); - $mform->disabledIf($completiontimespentel . '[timeunit]', $completiontimespentenabledel, 'notchecked'); + $mform->addGroup($group, $completiontimespentgroupel, '', ' ', false); + $mform->hideIf($completiontimespentel . '[number]', $completiontimespentenabledel, 'notchecked'); + $mform->hideIf($completiontimespentel . '[timeunit]', $completiontimespentenabledel, 'notchecked'); return [$completionendreachedel, $completiontimespentgroupel]; } diff --git a/mod/lesson/tests/lib_test.php b/mod/lesson/tests/lib_test.php index ba965693e00..34d6f33ebf8 100644 --- a/mod/lesson/tests/lib_test.php +++ b/mod/lesson/tests/lib_test.php @@ -774,8 +774,8 @@ class lib_test extends \advanced_testcase { $moddefaults->completion = 2; $activeruledescriptions = [ - get_string('completionendreached_desc', 'lesson'), - get_string('completiontimespentdesc', 'lesson', format_time(3600)), + get_string('completionendreached', 'lesson'), + get_string('completiontimespentgroup', 'lesson', format_time(3600)), ]; $this->assertEquals(mod_lesson_get_completion_active_rule_descriptions($cm1), $activeruledescriptions); $this->assertEquals(mod_lesson_get_completion_active_rule_descriptions($cm2), []); diff --git a/mod/quiz/lang/en/deprecated.txt b/mod/quiz/lang/en/deprecated.txt index 4f40eaa307b..d02b84f2741 100644 --- a/mod/quiz/lang/en/deprecated.txt +++ b/mod/quiz/lang/en/deprecated.txt @@ -4,3 +4,4 @@ completionpass_help,mod_quiz completiondetail:passgrade,mod_quiz gradetopassnotset,mod_quiz basicideasofquiz,mod_quiz +completionminattemptsgroup,mod_quiz diff --git a/mod/quiz/lang/en/quiz.php b/mod/quiz/lang/en/quiz.php index bc44b1d5428..cb5258844e8 100644 --- a/mod/quiz/lang/en/quiz.php +++ b/mod/quiz/lang/en/quiz.php @@ -185,12 +185,11 @@ $string['comments'] = 'Comments'; $string['completedon'] = 'Completed on'; $string['completiondetail:minattempts'] = 'Make attempts: {$a}'; $string['completiondetail:passorexhaust'] = 'Receive a pass grade or complete all available attempts'; -$string['completionminattempts'] = 'Minimum number of attempts:'; +$string['completionminattempts'] = 'Minimum attempts'; $string['completionminattemptsdesc'] = 'Minimum number of attempts required: {$a}'; -$string['completionminattemptsgroup'] = 'Require attempts'; $string['completionminattemptserror'] = 'Minimum number of attempts must be lower or equal to attempts allowed.'; $string['completionpassorattemptsexhausteddesc'] = 'Student must achieve a passing grade, or exhaust all available attempts to complete this activity'; -$string['completionattemptsexhausted'] = 'Or all available attempts completed'; +$string['completionattemptsexhausted'] = 'Passing grade and all available attempts completed'; $string['completionattemptsexhausted_help'] = 'Mark quiz complete when the student has exhausted the maximum number of attempts.'; $string['configadaptive'] = 'If you choose Yes for this option then the student will be allowed multiple responses to a question even within the same attempt at the quiz.'; $string['configattemptsallowed'] = 'Restriction on the number of attempts students are allowed at the quiz.'; @@ -1093,3 +1092,7 @@ $string['completionpass_help'] = 'If enabled, this activity is considered comple $string['completiondetail:passgrade'] = 'Receive a pass grade'; $string['gradetopassnotset'] = 'This quiz does not yet have a grade to pass set. It may be set in the Grade section of the quiz settings.'; $string['basicideasofquiz'] = 'The basic ideas of quiz-making'; + +// Deprecated since Moodle 4.3. +$string['completionminattemptsgroup'] = 'Require attempts'; + diff --git a/mod/quiz/mod_form.php b/mod/quiz/mod_form.php index b3c0cbf9e04..d532fab8c15 100644 --- a/mod/quiz/mod_form.php +++ b/mod/quiz/mod_form.php @@ -616,19 +616,6 @@ class mod_quiz_mod_form extends moodleform_mod { public function add_completion_rules() { $mform = $this->_form; $suffix = $this->get_suffix(); - $items = []; - - $completionattemptsexhaustedel = 'completionattemptsexhausted' . $suffix; - $mform->addElement( - 'advcheckbox', - $completionattemptsexhaustedel, - null, - get_string('completionattemptsexhausted', 'quiz'), - ['group' => 'cattempts'] - ); - $completionpassgradeel = 'completionpassgrade' . $suffix; - $mform->disabledIf($completionattemptsexhaustedel, $completionpassgradeel, 'notchecked'); - $items[] = $completionattemptsexhaustedel; $group = []; $completionminattemptsenabledel = 'completionminattemptsenabled' . $suffix; @@ -642,11 +629,34 @@ class mod_quiz_mod_form extends moodleform_mod { $group[] = $mform->createElement('text', $completionminattemptsel, '', ['size' => 3]); $mform->setType($completionminattemptsel, PARAM_INT); $completionminattemptsgroupel = 'completionminattemptsgroup' . $suffix; - $mform->addGroup($group, $completionminattemptsgroupel, get_string('completionminattemptsgroup', 'quiz'), ' ', false); - $mform->disabledIf($completionminattemptsel, $completionminattemptsenabledel, 'notchecked'); - $items[] = $completionminattemptsgroupel; + $mform->addGroup($group, $completionminattemptsgroupel, '', ' ', false); + $mform->hideIf($completionminattemptsel, $completionminattemptsenabledel, 'notchecked'); - return $items; + return [$completionminattemptsgroupel]; + } + + /** + * Add completion grading elements to the form and return the list of element ids. + * + * @return array Array of string IDs of added items, empty array if none + */ + public function add_completiongrade_rules(): array { + $mform = $this->_form; + $suffix = $this->get_suffix(); + + $completionattemptsexhaustedel = 'completionattemptsexhausted' . $suffix; + $mform->addElement( + 'advcheckbox', + $completionattemptsexhaustedel, + null, + get_string('completionattemptsexhausted', 'quiz'), + ['group' => 'cattempts', 'parentclass' => 'ml-4'] + ); + $completionpassgradeel = 'completionpassgrade' . $suffix; + $mform->hideIf($completionattemptsexhaustedel, $completionpassgradeel, 'notchecked'); + $mform->hideIf($completionattemptsexhaustedel, $completionpassgradeel, 'notchecked'); + + return [$completionattemptsexhaustedel]; } /** diff --git a/mod/scorm/lang/en/scorm.php b/mod/scorm/lang/en/scorm.php index 57cd8556d27..e52b4d56571 100644 --- a/mod/scorm/lang/en/scorm.php +++ b/mod/scorm/lang/en/scorm.php @@ -89,10 +89,9 @@ $string['completiondetail:completionscore'] = 'Receive a score of {$a} or more'; $string['completiondetail:allscos'] = 'Do all parts of this activity'; $string['completionscorerequired'] = 'Require minimum score'; $string['completionscorerequireddesc'] = 'Minimum score of {$a} is required for completion'; -$string['completionscorerequired_help'] = 'Enabling this setting will require a user to have at least the minimum score entered to be marked complete in this SCORM activity, as well as any other Activity Completion requirements.'; $string['completionstatus_passed'] = 'Passed'; $string['completionstatus_completed'] = 'Completed'; -$string['completionstatusallscos'] = 'Require all scos to return completion status'; +$string['completionstatusallscos'] = 'All SCOs must return completion status'; $string['completionstatusallscos_help'] = 'Some SCORM packages contain multiple components or "scos" - when this is enabled all scos within the package must return the relevant lesson_status for this activity to be flagged complete.'; $string['completionstatusrequired'] = 'Require status'; $string['completionstatusrequireddesc'] = 'Student must achieve at least one of the following statuses: {$a}'; @@ -460,3 +459,6 @@ $string['youmustselectastatus'] = 'You must select a status to require'; $string['info'] = 'Info'; $string['displayactivityname'] = 'Display activity name'; $string['displayactivityname_help'] = 'Whether or not to display the activity name above the SCORM player.'; + +// Deprecated since Moodle 4.3. +$string['completionscorerequired_help'] = 'Enabling this setting will require a user to have at least the minimum score entered to be marked complete in this SCORM activity, as well as any other Activity Completion requirements.'; diff --git a/mod/scorm/mod_form.php b/mod/scorm/mod_form.php index cb1748d0aa0..d8228988df1 100644 --- a/mod/scorm/mod_form.php +++ b/mod/scorm/mod_form.php @@ -502,39 +502,35 @@ class mod_scorm_mod_form extends moodleform_mod { public function add_completion_rules() { $suffix = $this->get_suffix(); $mform =& $this->_form; - $items = array(); + $items = []; // Require score. $group = []; $completionscorerequiredel = 'completionscorerequired' . $suffix; + $group[] =& $mform->createElement( + 'checkbox', + 'completionscoredisabled', + null, + get_string('completionscorerequired', 'scorm') + ); $group[] =& $mform->createElement('text', $completionscorerequiredel, '', ['size' => 5]); - $group[] =& $mform->createElement('checkbox', 'completionscoredisabled', null, get_string('disable')); $mform->setType($completionscorerequiredel, PARAM_INT); $completionscoregroupel = 'completionscoregroup' . $suffix; - $mform->addGroup($group, $completionscoregroupel, get_string('completionscorerequired', 'scorm'), '', false); - $mform->addHelpButton($completionscoregroupel, 'completionscorerequired', 'scorm'); - $mform->disabledIf($completionscorerequiredel, 'completionscoredisabled', 'checked'); + $mform->addGroup($group, $completionscoregroupel, '', '', false); + $mform->hideIf($completionscorerequiredel, 'completionscoredisabled', 'notchecked'); $mform->setDefault($completionscorerequiredel, 0); $items[] = $completionscoregroupel; // Require status. - $first = true; - $firstkey = null; $completionstatusrequiredel = 'completionstatusrequired' . $suffix; foreach (scorm_status_options(true) as $key => $value) { - $name = null; $key = $completionstatusrequiredel . '['.$key.']'; - if ($first) { - $name = get_string('completionstatusrequired', 'scorm'); - $first = false; - $firstkey = $key; - } - $mform->addElement('checkbox', $key, $name, $value); + $mform->addElement('checkbox', $key, '', $value); $mform->setType($key, PARAM_BOOL); + $mform->hideIf($key, $completionstatusrequiredel, 'notchecked'); $items[] = $key; } - $mform->addHelpButton($firstkey, 'completionstatusrequired', 'scorm'); $completionstatusallscosel = 'completionstatusallscos' . $suffix; $mform->addElement('checkbox', $completionstatusallscosel, get_string('completionstatusallscos', 'scorm')); diff --git a/mod/survey/lang/en/survey.php b/mod/survey/lang/en/survey.php index e51cae643ae..cef6a930863 100644 --- a/mod/survey/lang/en/survey.php +++ b/mod/survey/lang/en/survey.php @@ -82,7 +82,7 @@ $string['cannotfindanswer'] = 'There are no answers for this survey yet.'; $string['cannotfindquestion'] = 'Question doesn\'t exist'; $string['cannotfindsurveytmpt'] = 'No survey templates found!'; $string['completiondetail:submit'] = 'Submit answers'; -$string['completionsubmit'] = 'Student must make a submission'; +$string['completionsubmit'] = 'Make a submission'; $string['ciqintro'] = 'While thinking about recent events in this class, answer the questions below.'; $string['ciqname'] = 'Critical incidents'; $string['ciq1'] = 'At what moment in class were you most engaged as a learner?';