From 785d3fd1e74cdf33e5e1c66380241fe3f68ba04f Mon Sep 17 00:00:00 2001 From: Sara Arjona Date: Thu, 4 Jan 2024 16:17:49 +0100 Subject: [PATCH 1/4] MDL-80461 courseformat: Replace topics and weeks with section After UX research, the conclusion is that all formats should use "section" and not try to use alternative terms such as topic or week. This commit replaces topic and week references with section. A couple of considerations: - Most of the strings in topics and weeks formats have been removed. In that particular case it's not required to follow the deprecation process because they will be using the generic ones defined in moodle or courseformat. - The sectionname will be renamed from "Topic"/"Week" to "New section" in MDL-80460. --- .../lang/en/block_section_links.php | 4 +-- course/editsection_form.php | 3 +- .../output/local/content/addsection.php | 6 +--- .../lang/en/format_singleactivity.php | 2 +- course/format/social/format.php | 6 ++-- .../format/social/lang/en/format_social.php | 2 +- .../local/content/frontpagesection.mustache | 2 +- .../format/topics/lang/en/format_topics.php | 33 +++++-------------- course/format/topics/lib.php | 24 +------------- course/format/weeks/lang/en/format_weeks.php | 32 +++++------------- course/format/weeks/lib.php | 24 +------------- course/tests/behat/behat_course.php | 2 +- lang/en/admin.php | 2 +- lang/en/courseformat.php | 1 + lang/en/moodle.php | 17 +++++----- mod/h5pactivity/index.php | 7 ++-- 16 files changed, 41 insertions(+), 126 deletions(-) diff --git a/blocks/section_links/lang/en/block_section_links.php b/blocks/section_links/lang/en/block_section_links.php index 950a0bbe08d..adb679bac4b 100644 --- a/blocks/section_links/lang/en/block_section_links.php +++ b/blocks/section_links/lang/en/block_section_links.php @@ -26,7 +26,7 @@ $string['incby1'] = 'Increase by'; $string['incby1_help'] = 'This is the value the section is incremented each time a section link is displayed starting at 1.'; $string['incby2'] = 'Alternative increase by'; $string['incby2_help'] = 'This is the value the section is incremented each time a section link is displayed starting at 1.'; -$string['jumptocurrenttopic'] = 'Jump to current topic'; +$string['jumptocurrenttopic'] = 'Jump to highlighted section'; $string['jumptocurrentweek'] = 'Jump to current week'; $string['numsections1'] = 'Number of sections'; $string['numsections1_help'] = 'Once the number of sections in the course reaches this number then the increment by value is used.'; @@ -36,6 +36,4 @@ $string['pluginname'] = 'Section links'; $string['section_links:addinstance'] = 'Add a new section links block'; $string['showsectionname'] = 'Display section name'; $string['showsectionname_help'] = 'Display section name in addition to section number'; -$string['topics'] = 'Topics'; -$string['weeks'] = 'Weeks'; $string['privacy:metadata'] = 'The Section links block only shows data stored in other locations.'; diff --git a/course/editsection_form.php b/course/editsection_form.php index 61bc516a9d6..4575dc1e960 100644 --- a/course/editsection_form.php +++ b/course/editsection_form.php @@ -34,8 +34,7 @@ class editsection_form extends moodleform { /// Prepare course and the editor - $mform->addElement('editor', 'summary_editor', get_string('summary'), null, $this->_customdata['editoroptions']); - $mform->addHelpButton('summary_editor', 'summary'); + $mform->addElement('editor', 'summary_editor', get_string('description'), null, $this->_customdata['editoroptions']); $mform->setType('summary_editor', PARAM_RAW); $mform->addElement('hidden', 'id'); diff --git a/course/format/classes/output/local/content/addsection.php b/course/format/classes/output/local/content/addsection.php index 6309a3b5e43..6acfb554a90 100644 --- a/course/format/classes/output/local/content/addsection.php +++ b/course/format/classes/output/local/content/addsection.php @@ -145,11 +145,7 @@ class addsection implements named_templatable, renderable { $course = $format->get_course(); $data = new stdClass(); - if (get_string_manager()->string_exists('addsections', 'format_' . $course->format)) { - $addstring = get_string('addsections', 'format_' . $course->format); - } else { - $addstring = get_string('addsections'); - } + $addstring = $format->get_format_string('addsection'); $params = ['courseid' => $course->id, 'insertsection' => 0, 'sesskey' => sesskey()]; diff --git a/course/format/singleactivity/lang/en/format_singleactivity.php b/course/format/singleactivity/lang/en/format_singleactivity.php index 8a219503d55..5ccb3e2182f 100644 --- a/course/format/singleactivity/lang/en/format_singleactivity.php +++ b/course/format/singleactivity/lang/en/format_singleactivity.php @@ -29,7 +29,7 @@ $string['defactivitytypedesc'] = 'Specify the activity type that will be selecte $string['erroractivitytype'] = 'Type of activity is not set up in Course settings'; $string['orphaned'] = 'Orphaned'; $string['orphanedwarning'] = 'These activities are unreachable by users!'; -$string['pluginname'] = 'Single activity format'; +$string['pluginname'] = 'Single activity'; $string['sectionname'] = ''; $string['warningchangeformat'] = 'When changing the existing course format to "Single activity" make sure that you removed all extra activities from the course including "Announcements". Note that sections structure may be modified.'; $string['privacy:metadata'] = 'The Single activity format plugin does not store any personal data.'; diff --git a/course/format/social/format.php b/course/format/social/format.php index 44cf6ca12ab..4fd8a4c4bc6 100644 --- a/course/format/social/format.php +++ b/course/format/social/format.php @@ -47,16 +47,16 @@ if (trim($forum->intro) != '') { $introcontent = format_module_intro('forum', $forum, $coursemodule->id); if ($PAGE->user_is_editing() && has_capability('moodle/course:update', $modcontext)) { - $streditsummary = get_string('editsummary'); + $stredit = get_string('edit'); $introcontent .= html_writer::start_div('editinglink'); $introcontent .= html_writer::link( new moodle_url('/course/modedit.php', [ 'update' => $coursemodule->id, 'sesskey' => sesskey(), ]), - $OUTPUT->pix_icon('t/edit', $streditsummary), + $OUTPUT->pix_icon('t/edit', $stredit), [ - 'title' => $streditsummary, + 'title' => $stredit, ] ); $introcontent .= html_writer::end_div(); diff --git a/course/format/social/lang/en/format_social.php b/course/format/social/lang/en/format_social.php index 46e82b94e23..151ea6b7a87 100644 --- a/course/format/social/lang/en/format_social.php +++ b/course/format/social/lang/en/format_social.php @@ -25,6 +25,6 @@ $string['numberdiscussions'] = 'Number of discussions'; $string['numberdiscussions_help'] = 'This setting specifies how many discussions should be displayed.'; -$string['pluginname'] = 'Social format'; +$string['pluginname'] = 'Social'; $string['sectionname'] = 'section'; $string['privacy:metadata'] = 'The Social format plugin does not store any personal data.'; diff --git a/course/format/templates/local/content/frontpagesection.mustache b/course/format/templates/local/content/frontpagesection.mustache index 90624a33c2a..f17865fa51d 100644 --- a/course/format/templates/local/content/frontpagesection.mustache +++ b/course/format/templates/local/content/frontpagesection.mustache @@ -31,7 +31,7 @@
{{#showsettings}} diff --git a/course/format/topics/lang/en/format_topics.php b/course/format/topics/lang/en/format_topics.php index 530ef8120fe..1ee0f5a7ce1 100644 --- a/course/format/topics/lang/en/format_topics.php +++ b/course/format/topics/lang/en/format_topics.php @@ -15,40 +15,23 @@ // along with Moodle. If not, see . /** - * Strings for component Topics course format. + * Strings for component Custom sections course format. * * @package format_topics * @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -$string['addsections'] = 'Add topic'; -$string['currentsection'] = 'This topic'; -$string['deletesection'] = 'Delete topic'; -$string['editsection'] = 'Edit topic'; -$string['editsectionname'] = 'Edit topic name'; -$string['hidefromothers'] = 'Hide topic'; -$string['newsectionname'] = 'New name for topic {$a}'; -$string['page-course-view-topics'] = 'Any course main page in topics format'; -$string['page-course-view-topics-x'] = 'Any course page in topics format'; -$string['pluginname'] = 'Topics format'; -$string['privacy:metadata'] = 'The Topics format plugin does not store any personal data.'; +$string['currentsection'] = 'Current section'; +$string['hidefromothers'] = 'Hide'; +$string['page-course-view-topics'] = 'Any course main page in custom sections format'; +$string['page-course-view-topics-x'] = 'Any course page in custom sections format'; +$string['pluginname'] = 'Custom sections'; +$string['privacy:metadata'] = 'The Custom sections format plugin does not store any personal data.'; $string['indentation'] = 'Allow indentation on course page'; $string['indentation_help'] = 'Allow teachers, and other users with the manage activities capability, to indent items on the course page.'; $string['section_highlight_feedback'] = 'Section {$a->name} is highlighted.'; $string['section_unhighlight_feedback'] = 'Highlight removed from section {$a->name}.'; $string['section0name'] = 'General'; -$string['sectionavailability_title'] = 'Topic availability'; -$string['sectiondelete_title'] = 'Delete topic?'; -$string['sectionmove_title'] = 'Move topic'; $string['sectionname'] = 'Topic'; -$string['sectionsavailability'] = 'Topics availability'; -$string['sectionsavailability_title'] = 'Topics availability'; -$string['sectionsdelete'] = 'Delete topics'; -$string['sectionsdelete_info'] = 'This will delete {$a->count} topics and all the activities they contain.'; -$string['sectionsdelete_title'] = 'Delete selected topics?'; -$string['sectionsmove'] = 'Move topics'; -$string['sectionsmove_info'] = 'Move {$a} topics after'; -$string['sectionsmove_title'] = 'Move selected topics'; -$string['selectsection'] = 'Select topic {$a}'; -$string['showfromothers'] = 'Show topic'; +$string['showfromothers'] = 'Show'; diff --git a/course/format/topics/lib.php b/course/format/topics/lib.php index 096b3a2e2ab..cdc89f01e73 100644 --- a/course/format/topics/lib.php +++ b/course/format/topics/lib.php @@ -99,7 +99,7 @@ class format_topics extends core_courseformat\base { * @return string the page title */ public function page_title(): string { - return get_string('topicoutline'); + return get_string('sectionoutline'); } /** @@ -344,28 +344,6 @@ class format_topics extends core_courseformat\base { return true; } - /** - * Prepares the templateable object to display section name. - * - * @param \section_info|\stdClass $section - * @param bool $linkifneeded - * @param bool $editable - * @param null|lang_string|string $edithint - * @param null|lang_string|string $editlabel - * @return inplace_editable - */ - public function inplace_editable_render_section_name($section, $linkifneeded = true, - $editable = null, $edithint = null, $editlabel = null) { - if (empty($edithint)) { - $edithint = new lang_string('editsectionname', 'format_topics'); - } - if (empty($editlabel)) { - $title = get_section_name($section->course, $section); - $editlabel = new lang_string('newsectionname', 'format_topics', $title); - } - return parent::inplace_editable_render_section_name($section, $linkifneeded, $editable, $edithint, $editlabel); - } - /** * Indicates whether the course format supports the creation of a news forum. * diff --git a/course/format/weeks/lang/en/format_weeks.php b/course/format/weeks/lang/en/format_weeks.php index d8fcb951407..074f8b76860 100644 --- a/course/format/weeks/lang/en/format_weeks.php +++ b/course/format/weeks/lang/en/format_weeks.php @@ -22,33 +22,17 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -$string['addsections'] = 'Add week'; +$string['addsection'] = 'Add week'; $string['automaticenddate'] = 'Calculate the end date from the number of sections'; $string['automaticenddate_help'] = 'If enabled, the end date for the course will be automatically calculated from the number of sections and the course start date.'; -$string['currentsection'] = 'This week'; -$string['deletesection'] = 'Delete week'; -$string['editsection'] = 'Edit week'; -$string['editsectionname'] = 'Edit week name'; -$string['hidefromothers'] = 'Hide week'; -$string['newsectionname'] = 'New name for week {$a}'; -$string['page-course-view-weeks'] = 'Any course main page in weeks format'; -$string['page-course-view-weeks-x'] = 'Any course page in weeks format'; -$string['pluginname'] = 'Weekly format'; -$string['privacy:metadata'] = 'The Weekly format plugin does not store any personal data.'; +$string['currentsection'] = 'Current week'; +$string['hidefromothers'] = 'Hide'; +$string['page-course-view-weeks'] = 'Any course main page in weekly sections format'; +$string['page-course-view-weeks-x'] = 'Any course page in weekly sections format'; +$string['pluginname'] = 'Weekly sections'; +$string['privacy:metadata'] = 'The Weekly sections format plugin does not store any personal data.'; $string['indentation'] = 'Allow indentation on course page'; $string['indentation_help'] = 'Allow teachers, and other users with the manage activities capability, to indent items on the course page.'; $string['section0name'] = 'General'; -$string['sectionavailability_title'] = 'Week availability'; -$string['sectiondelete_title'] = 'Delete week?'; -$string['sectionmove_title'] = 'Move week'; $string['sectionname'] = 'Week'; -$string['sectionsavailability'] = 'Weeks availability'; -$string['sectionsavailability_title'] = 'Weeks availability'; -$string['sectionsdelete'] = 'Delete weeks'; -$string['sectionsdelete_info'] = 'This will delete {$a->count} weeks and all the activities they contain.'; -$string['sectionsdelete_title'] = 'Delete selected weeks?'; -$string['sectionsmove'] = 'Move weeks'; -$string['sectionsmove_info'] = 'Move {$a} weeks after'; -$string['sectionsmove_title'] = 'Move selected weeks'; -$string['selectsection'] = 'Select week {$a}'; -$string['showfromothers'] = 'Show week'; +$string['showfromothers'] = 'Show'; diff --git a/course/format/weeks/lib.php b/course/format/weeks/lib.php index d54e0cf82ee..bffb78951f2 100644 --- a/course/format/weeks/lib.php +++ b/course/format/weeks/lib.php @@ -58,7 +58,7 @@ class format_weeks extends core_courseformat\base { * @return string the page title */ public function page_title(): string { - return get_string('weeklyoutline'); + return get_string('sectionoutline'); } /** @@ -443,28 +443,6 @@ class format_weeks extends core_courseformat\base { return true; } - /** - * Prepares the templateable object to display section name - * - * @param \section_info|\stdClass $section - * @param bool $linkifneeded - * @param bool $editable - * @param null|lang_string|string $edithint - * @param null|lang_string|string $editlabel - * @return \core\output\inplace_editable - */ - public function inplace_editable_render_section_name($section, $linkifneeded = true, - $editable = null, $edithint = null, $editlabel = null) { - if (empty($edithint)) { - $edithint = new lang_string('editsectionname', 'format_weeks'); - } - if (empty($editlabel)) { - $title = get_section_name($section->course, $section); - $editlabel = new lang_string('newsectionname', 'format_weeks', $title); - } - return parent::inplace_editable_render_section_name($section, $linkifneeded, $editable, $edithint, $editlabel); - } - /** * Returns the default end date for weeks course format. * diff --git a/course/tests/behat/behat_course.php b/course/tests/behat/behat_course.php index 7c3f6ab6646..1cf0ad2124c 100644 --- a/course/tests/behat/behat_course.php +++ b/course/tests/behat/behat_course.php @@ -446,7 +446,7 @@ class behat_course extends behat_base { $this->execute('behat_general::should_exist_in_the', ['Highlighted', 'text', $xpath, 'xpath_element']); // The important checking, we can not check the img. - $this->execute('behat_general::should_exist_in_the', ['Remove highlight', 'link', $xpath, 'xpath_element']); + $this->execute('behat_general::should_exist_in_the', ['Unhighlight', 'link', $xpath, 'xpath_element']); } /** diff --git a/lang/en/admin.php b/lang/en/admin.php index 0e18725bb49..acd486a0c77 100644 --- a/lang/en/admin.php +++ b/lang/en/admin.php @@ -1306,7 +1306,7 @@ $string['sitepolicyhandlercore'] = 'Default (core)'; $string['sitepolicyhandlerplugin'] = '{$a->name} ({$a->component})'; $string['sitepolicyguest'] = 'Site policy URL for guests'; $string['sitepolicyguest_help'] = 'The URL of the site policy that all guests must see and agree to before accessing the site. Note that this setting will only have an effect if the site policy handler is set to default (core).'; -$string['sitesectionhelp'] = 'If selected, a topic section will be displayed on the site home.'; +$string['sitesectionhelp'] = 'Display a section at the top of the page where you can add custom content.'; $string['sixtyfourbitsrequired'] = 'It has been detected that your site is not using a 64-bit PHP version. You are required to upgrade your system (operating system, PHP...) before installing this Moodle version.'; $string['sixtyfourbitswarning'] = 'It has been detected that your site is not using a 64-bit PHP version. It is recommended that you upgrade your site to ensure future compatibility.'; $string['slasharguments'] = 'Use slash arguments'; diff --git a/lang/en/courseformat.php b/lang/en/courseformat.php index f350163b8dc..2056bb84cd8 100644 --- a/lang/en/courseformat.php +++ b/lang/en/courseformat.php @@ -22,6 +22,7 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ +$string['addsection'] = 'Add section'; $string['availability_show'] = 'Show on course page'; $string['availability_show_help'] = 'Available to students (subject to any access restrictions which may be set).'; $string['availability_hide'] = 'Hide on course page'; diff --git a/lang/en/moodle.php b/lang/en/moodle.php index 60623e966f3..f2f5a1a842f 100644 --- a/lang/en/moodle.php +++ b/lang/en/moodle.php @@ -547,7 +547,7 @@ $string['deletecheckfiles'] = 'Are you absolutely sure you want to delete these $string['deletecheckfull'] = 'Are you absolutely sure you want to completely delete the user {$a}, including their enrolments, activity and other user data?'; $string['deletecheckwarning'] = 'You are about to delete these files'; $string['deletepicture'] = 'Delete picture'; -$string['deletesection'] = 'Delete section'; +$string['deletesection'] = 'Delete'; $string['deleteselected'] = 'Delete selected'; $string['deleteselectedkey'] = 'Delete selected key'; $string['deletingcourse'] = 'Deleting {$a}'; @@ -630,7 +630,7 @@ $string['editorpreferences'] = 'Editor preferences'; $string['editorresettodefaults'] = 'Reset to default values'; $string['editorsettings'] = 'Editor settings'; $string['editorshortcutkeys'] = 'Editor shortcut keys'; -$string['editsection'] = 'Edit section'; +$string['editsection'] = 'Edit settings'; $string['editsectionname'] = 'Edit section name'; $string['editsummary'] = 'Edit summary'; $string['edittitle'] = 'Edit title'; @@ -938,10 +938,10 @@ $string['forgotteninvalidurl'] = 'Invalid password reset URL'; $string['format'] = 'Format'; $string['format_help'] = 'The course format determines the layout of the course page. -* Single activity format - For displaying a single activity or resource (such as a Quiz or SCORM package) on the course page -* Social format - A forum is displayed on the course page -* Topics format - The course page is organised into topic sections -* Weekly format - The course page is organised into weekly sections, with the first week starting on the course start date'; +* Single activity - The course contains only one activity or resource. +* Social - A forum is displayed on the course page. +* Custom sections - The course is divided into customisable sections. +* Weekly sections - The course is divided into sections corresponding to each week, beginning from the course start date.'; $string['formathtml'] = 'HTML format'; $string['formatmarkdown'] = 'Markdown format'; $string['formatplain'] = 'Plain text format'; @@ -1045,7 +1045,7 @@ $string['hideshowblocks'] = 'Hide or show blocks'; $string['hidepopoverwindow'] = 'Hide popover window'; $string['highlight'] = 'Highlight'; $string['highlighted'] = 'Highlighted'; -$string['highlightoff'] = 'Remove highlight'; +$string['highlightoff'] = 'Unhighlight'; $string['hits'] = 'Hits'; $string['hitsoncourse'] = 'Hits on {$a->coursename} by {$a->username}'; $string['hitsoncoursetoday'] = 'Today\'s hits on {$a->coursename} by {$a->username}'; @@ -1981,6 +1981,7 @@ $string['secs'] = 'secs'; $string['section'] = 'Section'; $string['sectionactionnotsupported'] = 'Section action "{$a}" is not supported here'; $string['sectionname'] = 'Section name'; +$string['sectionoutline'] = 'Section outline'; $string['sections'] = 'Sections'; $string['seealsostats'] = 'See also: stats'; $string['select'] = 'Select'; @@ -2092,7 +2093,7 @@ $string['sitepartlist'] = 'You do not have the required permissions to view the $string['sitepartlist0'] = 'You must be a site teacher to be allowed to see the site participants list'; $string['sitepartlist1'] = 'You must be a teacher to be allowed to see the site participants list'; $string['sites'] = 'Sites'; -$string['sitesection'] = 'Include a topic section'; +$string['sitesection'] = 'Add custom content'; $string['sitesettings'] = 'Site settings'; $string['siteteachers'] = 'Site teachers'; $string['size'] = 'Size'; diff --git a/mod/h5pactivity/index.php b/mod/h5pactivity/index.php index f72fb4b7cdf..b332cd2fd3f 100644 --- a/mod/h5pactivity/index.php +++ b/mod/h5pactivity/index.php @@ -57,11 +57,8 @@ $table = new html_table(); $table->attributes['class'] = 'generaltable mod_index'; $align = ['center', 'left']; -if ($course->format == 'weeks') { - $table->head = [get_string('week'), get_string('name')]; - $table->align = ['center', 'left']; -} else if ($course->format == 'topics') { - $table->head = [get_string('topic'), get_string('name')]; +if ($course->format == 'weeks' || $course->format == 'topics') { + $table->head = [get_string('section'), get_string('name')]; $table->align = ['center', 'left']; } else { $table->head = [get_string('name')]; From 0c716122940bae9579116a14147535b8b14546c9 Mon Sep 17 00:00:00 2001 From: Sara Arjona Date: Thu, 4 Jan 2024 16:34:32 +0100 Subject: [PATCH 2/4] MDL-80461 courseformat: Deprecate unused strings for topics and weeks --- course/lib.php | 2 -- lang/en/deprecated.txt | 13 +++++++++++++ lang/en/error.php | 6 ++++-- lang/en/moodle.php | 22 +++++++++++----------- mod/quiz/classes/output/edit_renderer.php | 2 -- 5 files changed, 28 insertions(+), 17 deletions(-) diff --git a/course/lib.php b/course/lib.php index 4179702d083..67e8a87d3a2 100644 --- a/course/lib.php +++ b/course/lib.php @@ -3128,8 +3128,6 @@ function include_course_ajax($course, $usedmodules = array(), $enabledmodules = 'groupsnone', 'groupsvisible', 'groupsseparate', - 'markthistopic', - 'markedthistopic', 'movesection', 'movecoursemodule', 'movecoursesection', diff --git a/lang/en/deprecated.txt b/lang/en/deprecated.txt index 0e7cc6c77a1..d78d401ef99 100644 --- a/lang/en/deprecated.txt +++ b/lang/en/deprecated.txt @@ -119,3 +119,16 @@ backupcourse,core_backup linkcoursesections,core_admin linkcoursesections_help,core_admin showallusers,core +cannotmarktopic,core_error +unknownhelp,core_error +markedthistopic,core +markthistopic,core +socialheadline,core +weekhide,core +weeklyoutline,core +weekshow,core +topicoutline,core +topicshow,core +topichide,core +summary_help,core +editsummary,core diff --git a/lang/en/error.php b/lang/en/error.php index 6c6d19e71b0..39f25e356fe 100644 --- a/lang/en/error.php +++ b/lang/en/error.php @@ -111,7 +111,6 @@ $string['cannotinsertrecord'] = 'Could not insert new record ID {$a}'; $string['cannotmailconfirm'] = 'Error sending password change confirmation email'; $string['cannotmanualctrack'] = 'Activity does not provide manual completion tracking'; $string['cannotmapfield'] = 'Mapping collision detected - two fields maps to the same grade item {$a}'; -$string['cannotmarktopic'] = 'Could not mark that topic for this course'; $string['cannotmigratedatacomments'] = 'Cannot migrate data module comments'; $string['cannotmodulename'] = 'Cannot get the module name in build navigation'; $string['cannotmoduletype'] = 'Cannot get the module type in build navigation'; @@ -587,7 +586,6 @@ $string['unknowncourserequest'] = 'Unknown course request'; $string['unknownevent'] = 'Unknown event'; $string['unknownfiletype'] = 'Error unknown filtertype'; $string['unknowngroup'] = 'Unknown group "{$a}"'; -$string['unknownhelp'] = 'Unknown help topic {$a}'; $string['unknownjsinrequirejs'] = 'Cannot find JavaScript library {$a}.'; $string['unknownmodulename'] = 'Unknown module name for form'; $string['unknownrole'] = 'Unknown role "{$a}"'; @@ -654,3 +652,7 @@ $string['cannotswitcheditmodeon'] = 'Could not switch edit mode on'; // Deprecated since Moodle 4.3. $string['prefixtoolong'] = '

Error: database table prefix is too long ({$a->dbfamily})

The site administrator must fix this problem. Maximum length for table prefixes in {$a->dbfamily} is {$a->maxlength} characters.

'; + +// Deprecated since Moodle 4.4. +$string['cannotmarktopic'] = 'Could not mark that section for this course'; +$string['unknownhelp'] = 'Unknown help section {$a}'; diff --git a/lang/en/moodle.php b/lang/en/moodle.php index f2f5a1a842f..9e86d6ca94f 100644 --- a/lang/en/moodle.php +++ b/lang/en/moodle.php @@ -632,7 +632,6 @@ $string['editorsettings'] = 'Editor settings'; $string['editorshortcutkeys'] = 'Editor shortcut keys'; $string['editsection'] = 'Edit settings'; $string['editsectionname'] = 'Edit section name'; -$string['editsummary'] = 'Edit summary'; $string['edittitle'] = 'Edit title'; $string['edittitleinstructions'] = 'Escape to cancel, Enter when finished'; $string['editthisactivity'] = 'Edit this activity'; @@ -1275,8 +1274,6 @@ $string['managefilters'] = 'Filters'; $string['managemodules'] = 'Modules'; $string['manageroles'] = 'Roles and permissions'; $string['markallread'] = 'Mark all as read'; -$string['markedthistopic'] = 'This topic is highlighted as the current topic'; -$string['markthistopic'] = 'Highlight this topic as the current topic'; $string['match'] = 'Match'; $string['matchingsearchandrole'] = 'Matching \'{$a->search}\' and {$a->role}'; $string['matchofthefollowing'] = 'of the following:'; @@ -2107,7 +2104,6 @@ $string['skipped'] = 'Skipped'; $string['skiptocategorylisting'] = 'Skip to the category listings'; $string['skiptocourselisting'] = 'Skip to the course listings'; $string['skiptocoursedetails'] = 'Skip to the detailed course information'; -$string['socialheadline'] = 'Social forum - latest topics'; $string['someallowguest'] = 'Some courses may allow guest access'; $string['someerrorswerefound'] = 'Some information was missing or incorrect. Look below for details.'; $string['sort'] = 'Sort'; @@ -2194,7 +2190,6 @@ $string['subject'] = 'Subject'; $string['success'] = 'Success'; $string['successduration'] = 'Success ({$a} seconds)'; $string['summary'] = 'Summary'; -$string['summary_help'] = 'The idea of a summary is a short text to prepare students for the activities within the topic or week. The text is shown on the course page under the section name.'; $string['summaryof'] = 'Summary of {$a}'; $string['suspended'] = 'Suspended'; $string['suspendedusers'] = 'Suspended users'; @@ -2284,9 +2279,6 @@ $string['toonly'] = 'to {$a} only'; $string['top'] = 'Top'; $string['toplevelcategory'] = 'Top level category'; $string['topic'] = 'Topic'; -$string['topicoutline'] = 'Topic outline'; -$string['topicshow'] = 'Show this topic to {$a}'; -$string['topichide'] = 'Hide this topic from {$a}'; $string['total'] = 'Total'; $string['totopofsection'] = 'To the top of section "{$a}"'; $string['trackforums'] = 'Forum tracking'; @@ -2410,9 +2402,6 @@ $string['warningdeleteresource'] = 'Warning: {$a} is referred in a resource. Wou $string['webpage'] = 'Web page'; $string['week'] = 'Week'; $string['weeks'] = 'weeks'; -$string['weekhide'] = 'Hide this week from {$a}'; -$string['weeklyoutline'] = 'Weekly outline'; -$string['weekshow'] = 'Show this week to {$a}'; $string['welcomeback'] = 'Hi, {$a->firstname}! 👋'; $string['welcometosite'] = 'Welcome, {$a->firstname}! 👋'; $string['welcometocourse'] = 'Welcome to {$a}'; @@ -2501,3 +2490,14 @@ $string['passwordrecovery'] = 'Yes, help me log in'; $string['passwordconfirmchange'] = 'Confirm password change'; $string['passwordnohelp'] = 'No help is available to find your lost password. Please contact your Moodle administrator.'; $string['showallusers'] = 'Show all users'; +$string['markedthistopic'] = 'This section is highlighted as the current section'; +$string['markthistopic'] = 'Highlight this section as the current section'; +$string['socialheadline'] = 'Social forum - latest topics'; +$string['weekhide'] = 'Hide this week from {$a}'; +$string['weeklyoutline'] = 'Weekly outline'; +$string['weekshow'] = 'Show this week to {$a}'; +$string['topicoutline'] = 'Topic outline'; +$string['topicshow'] = 'Show this topic to {$a}'; +$string['topichide'] = 'Hide this topic from {$a}'; +$string['summary_help'] = 'The idea of a summary is a short text to prepare students for the activities within the topic or week. The text is shown on the course page under the section name.'; +$string['editsummary'] = 'Edit summary'; diff --git a/mod/quiz/classes/output/edit_renderer.php b/mod/quiz/classes/output/edit_renderer.php index 4cb9a3f7d52..8aea20137ac 100644 --- a/mod/quiz/classes/output/edit_renderer.php +++ b/mod/quiz/classes/output/edit_renderer.php @@ -1234,8 +1234,6 @@ class edit_renderer extends \plugin_renderer_base { 'edittitleinstructions', 'emptydragdropregion', 'hide', - 'markedthistopic', - 'markthistopic', 'move', 'movecontent', 'moveleft', From 69ee5c33959c701726b3cc6504e5255b67ca7ba7 Mon Sep 17 00:00:00 2001 From: Sara Arjona Date: Thu, 4 Jan 2024 16:21:59 +0100 Subject: [PATCH 3/4] MDL-80461 courseformat: Fix tests after replacing topic/week --- admin/tests/behat/resetindentation.feature | 110 +++++++++--------- .../tests/behat/apply_presets.feature | 6 +- .../tests/behat/revert_changes.feature | 4 +- .../usertours/tests/behat/tour_filter.feature | 2 +- .../behat/restore_moodle2_courses.feature | 30 ++--- .../tests/behat/create_course.feature | 2 +- .../tests/behat/edit_format_course.feature | 2 +- course/format/tests/base_test.php | 19 ++- .../tests/behat/bulk_section_actions.feature | 90 +++++++------- course/format/tests/behat/bulk_select.feature | 88 +++++++------- .../bulk_show_one_section_actions.feature | 32 ++--- .../tests/behat/course_courseindex.feature | 2 +- .../behat/course_manageactivities.feature | 8 +- .../tests/behat/duplicate_section.feature | 2 +- .../tests/behat/edit_delete_sections.feature | 36 +++--- .../tests/behat/highlight_sections.feature | 2 +- .../weeks/tests/behat/bulk_actions.feature | 84 ++++++------- .../weeks/tests/behat/current_week.feature | 4 +- .../tests/behat/edit_delete_sections.feature | 8 +- ...course_category_management_listing.feature | 4 +- .../behat/course_collapse_sections.feature | 12 +- course/tests/behat/course_format.feature | 18 +-- .../behat/frontpage_topic_section.feature | 6 +- .../tests/behat/max_number_sections.feature | 4 +- .../tests/behat/section_highlighting.feature | 2 +- course/tests/behat/sectionzero_title.feature | 6 +- .../reportbuilder/datasource/courses_test.php | 2 +- 27 files changed, 296 insertions(+), 289 deletions(-) diff --git a/admin/tests/behat/resetindentation.feature b/admin/tests/behat/resetindentation.feature index d9307558021..33a15a3e698 100644 --- a/admin/tests/behat/resetindentation.feature +++ b/admin/tests/behat/resetindentation.feature @@ -7,35 +7,35 @@ Feature: Reset course indentation Background: Given the following "courses" exist: | fullname | shortname | format | - | Topics Course 1 | T1 | topics | - | Topics Course 2 | T2 | topics | + | Sections Course 1 | T1 | topics | + | Sections Course 2 | T2 | topics | | Weekly Course 1 | W1 | weeks | | Weekly Course 2 | W2 | weeks | And the following "activities" exist: - | activity | name | intro | course | idnumber | - | forum | Topics forum name | Topics forum description | T1 | forum1 | - | data | Topics database name | Topics database description | T1 | data1 | - | wiki | Topics wiki name | Topics wiki description | T2 | wiki1 | - | forum | Weekly forum name | Weekly forum description | W1 | forum2 | - | data | Weekly database name | Weekly database description | W1 | data2 | - | wiki | Weekly wiki name | Weekly wiki description | W2 | wiki2 | + | activity | name | intro | course | idnumber | + | forum | Sections forum name | Sections forum description | T1 | forum1 | + | data | Sections database name | Sections database description | T1 | data1 | + | wiki | Sections wiki name | Sections wiki description | T2 | wiki1 | + | forum | Weekly forum name | Weekly forum description | W1 | forum2 | + | data | Weekly database name | Weekly database description | W1 | data2 | + | wiki | Weekly wiki name | Weekly wiki description | W2 | wiki2 | And I log in as "admin" - And I am on "Topics Course 1" course homepage with editing mode on - And I open "Topics forum name" actions menu - And I click on "Move right" "link" in the "Topics forum name" activity - And I open "Topics forum name" actions menu - And "Move right" "link" in the "Topics forum name" "activity" should not be visible - And "Move left" "link" in the "Topics forum name" "activity" should be visible + And I am on "Sections Course 1" course homepage with editing mode on + And I open "Sections forum name" actions menu + And I click on "Move right" "link" in the "Sections forum name" activity + And I open "Sections forum name" actions menu + And "Move right" "link" in the "Sections forum name" "activity" should not be visible + And "Move left" "link" in the "Sections forum name" "activity" should be visible And I press the escape key - And I open "Topics database name" actions menu - And "Move right" "link" in the "Topics database name" "activity" should be visible - And "Move left" "link" in the "Topics database name" "activity" should not be visible - And I am on "Topics Course 2" course homepage with editing mode on - And I open "Topics wiki name" actions menu - And I click on "Move right" "link" in the "Topics wiki name" activity - And I open "Topics wiki name" actions menu - And "Move right" "link" in the "Topics wiki name" "activity" should not be visible - And "Move left" "link" in the "Topics wiki name" "activity" should be visible + And I open "Sections database name" actions menu + And "Move right" "link" in the "Sections database name" "activity" should be visible + And "Move left" "link" in the "Sections database name" "activity" should not be visible + And I am on "Sections Course 2" course homepage with editing mode on + And I open "Sections wiki name" actions menu + And I click on "Move right" "link" in the "Sections wiki name" activity + And I open "Sections wiki name" actions menu + And "Move right" "link" in the "Sections wiki name" "activity" should not be visible + And "Move left" "link" in the "Sections wiki name" "activity" should be visible And I am on "Weekly Course 1" course homepage with editing mode on And I open "Weekly forum name" actions menu And I click on "Move right" "link" in the "Weekly forum name" activity @@ -54,7 +54,7 @@ Feature: Reset course indentation And "Move left" "link" in the "Weekly wiki name" "activity" should be visible Scenario Outline: Apply course indentation reset - Given I navigate to "Plugins > Course formats > format" in site administration + Given I navigate to "Plugins > Course formats > " in site administration And I wait "5" seconds And "Reset indentation sitewide" "link" should exist When I click on "Reset indentation sitewide" "link" @@ -62,31 +62,31 @@ Feature: Reset course indentation And "Reset indentation sitewide" "button" should exist And I click on "Reset indentation sitewide" "button" Then I should see "Indentation reset." - And I am on " Course 1" course homepage with editing mode on - And I open " forum name" actions menu - And "Move right" "link" in the " forum name" "activity" should be visible - And "Move left" "link" in the " forum name" "activity" should not be visible + And I am on " Course 1" course homepage with editing mode on + And I open " forum name" actions menu + And "Move right" "link" in the " forum name" "activity" should be visible + And "Move left" "link" in the " forum name" "activity" should not be visible And I press the escape key - And I open " database name" actions menu - And "Move right" "link" in the " database name" "activity" should be visible - And "Move left" "link" in the " database name" "activity" should not be visible - And I am on " Course 2" course homepage with editing mode on - And I open " wiki name" actions menu - And "Move right" "link" in the " wiki name" "activity" should be visible - And "Move left" "link" in the " wiki name" "activity" should not be visible -# Check other course formats had not been reset + And I open " database name" actions menu + And "Move right" "link" in the " database name" "activity" should be visible + And "Move left" "link" in the " database name" "activity" should not be visible + And I am on " Course 2" course homepage with editing mode on + And I open " wiki name" actions menu + And "Move right" "link" in the " wiki name" "activity" should be visible + And "Move left" "link" in the " wiki name" "activity" should not be visible + # Check other course formats had not been reset And I am on " Course 1" course homepage with editing mode on And I open " forum name" actions menu And "Move right" "link" in the " forum name" "activity" should not be visible And "Move left" "link" in the " forum name" "activity" should be visible Examples: - | format | other | - | Topics | Weekly | - | Weekly | Topics | + | format | prefix | other | + | Custom sections | Sections | Weekly | + | Weekly sections | Weekly | Sections | Scenario Outline: Cancel course indentation reset - Given I navigate to "Plugins > Course formats > format" in site administration + Given I navigate to "Plugins > Course formats > " in site administration And "Reset indentation sitewide" "link" should exist When I click on "Reset indentation sitewide" "link" And I should see "Reset indentation sitewide" @@ -94,20 +94,20 @@ Feature: Reset course indentation And "Cancel" "button" should exist And I click on "Cancel" "button" Then I should not see "Indentation reset." - And I am on " Course 1" course homepage with editing mode on - And I open " forum name" actions menu - And "Move right" "link" in the " forum name" "activity" should not be visible - And "Move left" "link" in the " forum name" "activity" should be visible + And I am on " Course 1" course homepage with editing mode on + And I open " forum name" actions menu + And "Move right" "link" in the " forum name" "activity" should not be visible + And "Move left" "link" in the " forum name" "activity" should be visible And I press the escape key - And I open " database name" actions menu - And "Move right" "link" in the " database name" "activity" should be visible - And "Move left" "link" in the " database name" "activity" should not be visible - And I am on " Course 2" course homepage with editing mode on - And I open " wiki name" actions menu - And "Move right" "link" in the " wiki name" "activity" should not be visible - And "Move left" "link" in the " wiki name" "activity" should be visible + And I open " database name" actions menu + And "Move right" "link" in the " database name" "activity" should be visible + And "Move left" "link" in the " database name" "activity" should not be visible + And I am on " Course 2" course homepage with editing mode on + And I open " wiki name" actions menu + And "Move right" "link" in the " wiki name" "activity" should not be visible + And "Move left" "link" in the " wiki name" "activity" should be visible Examples: - | format | - | Topics | - | Weekly | + | format | prefix | + | Custom sections | Sections | + | Weekly sections | Weekly | diff --git a/admin/tool/admin_presets/tests/behat/apply_presets.feature b/admin/tool/admin_presets/tests/behat/apply_presets.feature index a3a2629d601..de9f87987c8 100644 --- a/admin/tool/admin_presets/tests/behat/apply_presets.feature +++ b/admin/tool/admin_presets/tests/behat/apply_presets.feature @@ -20,7 +20,7 @@ Feature: I can apply presets And I navigate to "Plugins > Blocks > Manage blocks" in site administration And "Disable Logged in user" "icon" should exist in the "Logged in user" "table_row" And I navigate to "Plugins > Course formats > Manage course formats" in site administration - And "Disable" "icon" should exist in the "Social format" "table_row" + And "Disable" "icon" should exist in the "Social" "table_row" And I navigate to "Plugins > Question behaviours > Manage question behaviours" in site administration And "Enabled" "icon" should exist in the "Immediate feedback with CBM" "table_row" And I navigate to "Plugins > Question types > Manage question types" in site administration @@ -92,7 +92,7 @@ Feature: I can apply presets And I should see "Server files" in the "Setting changes" "table" And I should see "Show data retention summary" in the "Setting changes" "table" And I should see "Social activities" in the "Setting changes" "table" - And I should see "Social format" in the "Setting changes" "table" + And I should see "Social" in the "Setting changes" "table" And I should see "Starred courses" in the "Setting changes" "table" And I should see "Survey" in the "Setting changes" "table" And I should see "Tags" in the "Setting changes" "table" @@ -115,7 +115,7 @@ Feature: I can apply presets And I navigate to "Plugins > Blocks > Manage blocks" in site administration And "Disable Logged in user" "icon" should not exist in the "Logged in user" "table_row" And I navigate to "Plugins > Course formats > Manage course formats" in site administration - And "Disable" "icon" should not exist in the "Social format" "table_row" + And "Disable" "icon" should not exist in the "Social" "table_row" And I navigate to "Plugins > Question behaviours > Manage question behaviours" in site administration And "Enabled" "icon" should not exist in the "Immediate feedback with CBM" "table_row" And I navigate to "Plugins > Question types > Manage question types" in site administration diff --git a/admin/tool/admin_presets/tests/behat/revert_changes.feature b/admin/tool/admin_presets/tests/behat/revert_changes.feature index 26f9fa0768c..1e51e01a6c3 100644 --- a/admin/tool/admin_presets/tests/behat/revert_changes.feature +++ b/admin/tool/admin_presets/tests/behat/revert_changes.feature @@ -26,7 +26,7 @@ Feature: I can revert changes after a load And I navigate to "Plugins > Blocks > Manage blocks" in site administration And "Disable Logged in user" "icon" should not exist in the "Logged in user" "table_row" And I navigate to "Plugins > Course formats > Manage course formats" in site administration - And "Disable" "icon" should not exist in the "Social format" "table_row" + And "Disable" "icon" should not exist in the "Social" "table_row" And I navigate to "Plugins > Question behaviours > Manage question behaviours" in site administration And "Enabled" "icon" should not exist in the "Immediate feedback with CBM" "table_row" And I navigate to "Plugins > Question types > Manage question types" in site administration @@ -45,7 +45,7 @@ Feature: I can revert changes after a load And I navigate to "Plugins > Blocks > Manage blocks" in site administration And "Disable Logged in user" "icon" should exist in the "Logged in user" "table_row" And I navigate to "Plugins > Course formats > Manage course formats" in site administration - And "Disable" "icon" should exist in the "Social format" "table_row" + And "Disable" "icon" should exist in the "Social" "table_row" And I navigate to "Plugins > Question behaviours > Manage question behaviours" in site administration And "Enabled" "icon" should exist in the "Immediate feedback with CBM" "table_row" And I navigate to "Plugins > Question types > Manage question types" in site administration diff --git a/admin/tool/usertours/tests/behat/tour_filter.feature b/admin/tool/usertours/tests/behat/tour_filter.feature index b4b8514a2a4..0ec7d15944b 100644 --- a/admin/tool/usertours/tests/behat/tour_filter.feature +++ b/admin/tool/usertours/tests/behat/tour_filter.feature @@ -98,7 +98,7 @@ Feature: Apply tour filters to a tour | Description | My first tour | | Apply to URL match | /course/view.php% | | Tour is enabled | 1 | - | Course format | Weekly format | + | Course format | Weekly sections | And I add steps to the "First tour" tour: | targettype | Title | id_content | Content type | | Display in middle of page | Welcome | Welcome to your course tour. | Manual | diff --git a/backup/util/ui/tests/behat/restore_moodle2_courses.feature b/backup/util/ui/tests/behat/restore_moodle2_courses.feature index 15628289139..17dadcc4176 100644 --- a/backup/util/ui/tests/behat/restore_moodle2_courses.feature +++ b/backup/util/ui/tests/behat/restore_moodle2_courses.feature @@ -45,7 +45,7 @@ Feature: Restore Moodle 2 course backups And I should not see "Topic 16" And I navigate to "Settings" in current page administration And I expand all fieldsets - And the field "id_format" matches value "Topics format" + And the field "id_format" matches value "Custom sections" And I press "Cancel" @javascript @@ -86,26 +86,26 @@ Feature: Restore Moodle 2 course backups And I should see "Test forum name" And I navigate to "Settings" in current page administration And I expand all fieldsets - And the field "id_format" matches value "Topics format" + And the field "id_format" matches value "Custom sections" And I set the following fields to these values: - | id_startdate_day | 1 | - | id_startdate_month | January | - | id_startdate_year | 2020 | - | id_format | Weekly format | - | id_enddate_enabled | 0 | + | id_startdate_day | 1 | + | id_startdate_month | January | + | id_startdate_year | 2020 | + | id_format | Weekly sections | + | id_enddate_enabled | 0 | And I press "Save and display" And I should see "1 January - 7 January" And I should see "Test forum name" And I navigate to "Settings" in current page administration And I expand all fieldsets - And the field "id_format" matches value "Weekly format" + And the field "id_format" matches value "Weekly sections" And I set the following fields to these values: - | id_format | Social format | + | id_format | Social | And I press "Save and display" And I should see "An open forum for chatting about anything you want to" And I navigate to "Settings" in current page administration And I expand all fieldsets - And the field "id_format" matches value "Social format" + And the field "id_format" matches value "Social" And I press "Cancel" @javascript @@ -118,7 +118,7 @@ Feature: Restore Moodle 2 course backups | Schema | Overwrite course configuration | Yes | And I navigate to "Settings" in current page administration And I expand all fieldsets - Then the field "id_format" matches value "Topics format" + Then the field "id_format" matches value "Custom sections" And the field "Course layout" matches value "Show one section per page" And the field "Course short name" matches value "C1_1" And I press "Cancel" @@ -140,7 +140,7 @@ Feature: Restore Moodle 2 course backups | Schema | Overwrite course configuration | No | And I navigate to "Settings" in current page administration And I expand all fieldsets - Then the field "id_format" matches value "Topics format" + Then the field "id_format" matches value "Custom sections" And the field "Course short name" matches value "C2" And the field "Course layout" matches value "Show all sections on one page" And I press "Cancel" @@ -164,7 +164,7 @@ Feature: Restore Moodle 2 course backups | Schema | Overwrite course configuration | Yes | And I navigate to "Settings" in current page administration And I expand all fieldsets - Then the field "id_format" matches value "Topics format" + Then the field "id_format" matches value "Custom sections" And the field "Course layout" matches value "Show one section per page" And the field "Course short name" matches value "C1_1" And I press "Cancel" @@ -188,7 +188,7 @@ Feature: Restore Moodle 2 course backups | Schema | Overwrite course configuration | No | And I navigate to "Settings" in current page administration And I expand all fieldsets - Then the field "id_format" matches value "Topics format" + Then the field "id_format" matches value "Custom sections" And the field "Course short name" matches value "C2" And the field "Course layout" matches value "Show all sections on one page" And I press "Cancel" @@ -212,7 +212,7 @@ Feature: Restore Moodle 2 course backups | Schema | Overwrite course configuration | No | And I navigate to "Settings" in current page administration And I expand all fieldsets - Then the field "id_format" matches value "Topics format" + Then the field "id_format" matches value "Custom sections" And the field "Course short name" matches value "C4" And the field "Course layout" matches value "Show all sections on one page" And I press "Cancel" diff --git a/course/format/singleactivity/tests/behat/create_course.feature b/course/format/singleactivity/tests/behat/create_course.feature index abce67e9eca..eb81f7cad8f 100644 --- a/course/format/singleactivity/tests/behat/create_course.feature +++ b/course/format/singleactivity/tests/behat/create_course.feature @@ -28,7 +28,7 @@ Feature: Courses can be created in Single Activity mode And I set the following fields to these values: | Course full name | My first course | | Course short name | myfirstcourse | - | Format | Single activity format | + | Format | Single activity | And I press "Update format" Then I should see "Quiz" in the "Type of activity" "field" And I should not see "Forum" in the "Type of activity" "field" diff --git a/course/format/singleactivity/tests/behat/edit_format_course.feature b/course/format/singleactivity/tests/behat/edit_format_course.feature index 15935c9db2f..1372c9f36ba 100644 --- a/course/format/singleactivity/tests/behat/edit_format_course.feature +++ b/course/format/singleactivity/tests/behat/edit_format_course.feature @@ -20,7 +20,7 @@ Feature: Edit format course to Single Activity format And I set the following fields to these values: | Course full name | My first course | | Course short name | myfirstcourse | - | Format | Single activity format | + | Format | Single activity | And I press "Update format" Then I should see "Forum" in the "Type of activity" "field" And I press "Save and display" diff --git a/course/format/tests/base_test.php b/course/format/tests/base_test.php index 6852286d097..f0928dadfd8 100644 --- a/course/format/tests/base_test.php +++ b/course/format/tests/base_test.php @@ -508,14 +508,20 @@ class base_test extends advanced_testcase { * @param string $key the string key * @param string|null $data any string data * @param array|null $expectedstring the expected string (null for exception) + * @param string $courseformat the course format */ - public function test_get_format_string(string $key, ?string $data, ?array $expectedstring) { + public function test_get_format_string( + string $key, + ?string $data, + ?array $expectedstring, + string $courseformat = 'topics' + ): void { global $DB; $this->resetAfterTest(); $generator = $this->getDataGenerator(); - $course = $generator->create_course(['format' => 'topics']); + $course = $generator->create_course(['format' => $courseformat]); if ($expectedstring) { $expected = get_string($expectedstring[0], $expectedstring[1], $expectedstring[2]); @@ -535,9 +541,10 @@ class base_test extends advanced_testcase { public function get_format_string_provider(): array { return [ 'Existing in format lang' => [ - 'key' => 'sectionsdelete', + 'key' => 'addsection', 'data' => null, - 'expectedstring' => ['sectionsdelete', 'format_topics', null], + 'expectedstring' => ['addsection', 'format_weeks', null], + 'courseformat' => 'weeks', ], 'Not existing in format lang' => [ 'key' => 'bulkedit', @@ -545,9 +552,9 @@ class base_test extends advanced_testcase { 'expectedstring' => ['bulkedit', 'core_courseformat', null], ], 'Existing in format lang with data' => [ - 'key' => 'selectsection', + 'key' => 'section_highlight_feedback', 'data' => 'Example', - 'expectedstring' => ['selectsection', 'format_topics', 'Example'], + 'expectedstring' => ['section_highlight_feedback', 'format_topics', 'Example'], ], 'Not existing in format lang with data' => [ 'key' => 'bulkselection', diff --git a/course/format/tests/behat/bulk_section_actions.feature b/course/format/tests/behat/bulk_section_actions.feature index adda2bf9822..1ff9c1cc60f 100644 --- a/course/format/tests/behat/bulk_section_actions.feature +++ b/course/format/tests/behat/bulk_section_actions.feature @@ -38,12 +38,12 @@ Feature: Bulk course section actions. And I should not see "Hidden from students" in the "Topic 2" "section" And I should not see "Hidden from students" in the "Topic 3" "section" And I should not see "Hidden from students" in the "Topic 4" "section" - When I click on "Select topic Topic 1" "checkbox" - And I click on "Select topic Topic 2" "checkbox" + When I click on "Select section Topic 1" "checkbox" + And I click on "Select section Topic 2" "checkbox" And I should see "2 selected" in the "sticky-footer" "region" - And I click on "Topics availability" "button" in the "sticky-footer" "region" - And I click on "Hide on course page" "radio" in the "Topics availability" "dialogue" - And I click on "Apply" "button" in the "Topics availability" "dialogue" + And I click on "Sections availability" "button" in the "sticky-footer" "region" + And I click on "Hide on course page" "radio" in the "Sections availability" "dialogue" + And I click on "Apply" "button" in the "Sections availability" "dialogue" Then I should see "Hidden from students" in the "Activity sample 1" "activity" And I should see "Hidden from students" in the "Activity sample 2" "activity" And I should see "Hidden from students" in the "Activity sample 3" "activity" @@ -55,11 +55,11 @@ Feature: Bulk course section actions. And I should see "0 selected" in the "sticky-footer" "region" Scenario: Bulk show sections - Given I click on "Select topic Topic 1" "checkbox" - And I click on "Select topic Topic 3" "checkbox" - And I click on "Topics availability" "button" in the "sticky-footer" "region" - And I click on "Hide on course page" "radio" in the "Topics availability" "dialogue" - And I click on "Apply" "button" in the "Topics availability" "dialogue" + Given I click on "Select section Topic 1" "checkbox" + And I click on "Select section Topic 3" "checkbox" + And I click on "Sections availability" "button" in the "sticky-footer" "region" + And I click on "Hide on course page" "radio" in the "Sections availability" "dialogue" + And I click on "Apply" "button" in the "Sections availability" "dialogue" And I should see "Hidden from students" in the "Activity sample 1" "activity" And I should see "Hidden from students" in the "Activity sample 2" "activity" And I should not see "Hidden from students" in the "Activity sample 3" "activity" @@ -68,12 +68,12 @@ Feature: Bulk course section actions. And I should not see "Hidden from students" in the "Topic 2" "section" And I should see "Hidden from students" in the "Topic 3" "section" And I should not see "Hidden from students" in the "Topic 4" "section" - When I click on "Select topic Topic 1" "checkbox" - And I click on "Select topic Topic 2" "checkbox" + When I click on "Select section Topic 1" "checkbox" + And I click on "Select section Topic 2" "checkbox" And I should see "2 selected" in the "sticky-footer" "region" - And I click on "Topics availability" "button" in the "sticky-footer" "region" - And I click on "Show on course page" "radio" in the "Topics availability" "dialogue" - And I click on "Apply" "button" in the "Topics availability" "dialogue" + And I click on "Sections availability" "button" in the "sticky-footer" "region" + And I click on "Show on course page" "radio" in the "Sections availability" "dialogue" + And I click on "Apply" "button" in the "Sections availability" "dialogue" Then I should not see "Hidden from students" in the "Activity sample 1" "activity" And I should not see "Hidden from students" in the "Activity sample 2" "activity" And I should not see "Hidden from students" in the "Activity sample 3" "activity" @@ -92,11 +92,11 @@ Feature: Bulk course section actions. And I should see "Activity sample 2" in the "Topic 1" "section" And I should see "Activity sample 3" in the "Topic 2" "section" And I should see "Activity sample 4" in the "Topic 2" "section" - And I click on "Select topic Topic 1" "checkbox" - And I click on "Select topic Topic 2" "checkbox" + And I click on "Select section Topic 1" "checkbox" + And I click on "Select section Topic 2" "checkbox" And I should see "2 selected" in the "sticky-footer" "region" - When I click on "Delete topics" "button" in the "sticky-footer" "region" - And I click on "Delete" "button" in the "Delete selected topics?" "dialogue" + When I click on "Delete sections" "button" in the "sticky-footer" "region" + And I click on "Delete" "button" in the "Delete selected sections?" "dialogue" Then I should see "Topic 1" in the "region-main" "region" And I should see "Topic 2" in the "region-main" "region" And I should not see "Topic 3" in the "region-main" "region" @@ -116,10 +116,10 @@ Feature: Bulk course section actions. And I should see "Activity sample 2" in the "Topic 1" "section" And I should see "Activity sample 3" in the "Topic 2" "section" And I should see "Activity sample 4" in the "Topic 2" "section" - And I click on "Select topic Topic 3" "checkbox" - And I click on "Select topic Topic 4" "checkbox" + And I click on "Select section Topic 3" "checkbox" + And I click on "Select section Topic 4" "checkbox" And I should see "2 selected" in the "sticky-footer" "region" - When I click on "Delete topics" "button" in the "sticky-footer" "region" + When I click on "Delete sections" "button" in the "sticky-footer" "region" Then I should see "Topic 1" in the "region-main" "region" And I should see "Topic 2" in the "region-main" "region" And I should not see "Topic 3" in the "region-main" "region" @@ -139,11 +139,11 @@ Feature: Bulk course section actions. And I should see "Activity sample 2" in the "Topic 1" "section" And I should see "Activity sample 3" in the "Topic 2" "section" And I should see "Activity sample 4" in the "Topic 2" "section" - And I click on "Select topic Topic 2" "checkbox" - And I click on "Select topic Topic 3" "checkbox" + And I click on "Select section Topic 2" "checkbox" + And I click on "Select section Topic 3" "checkbox" And I should see "2 selected" in the "sticky-footer" "region" - When I click on "Delete topics" "button" in the "sticky-footer" "region" - And I click on "Delete" "button" in the "Delete selected topics?" "dialogue" + When I click on "Delete sections" "button" in the "sticky-footer" "region" + And I click on "Delete" "button" in the "Delete selected sections?" "dialogue" Then I should see "Topic 1" in the "region-main" "region" And I should see "Topic 2" in the "region-main" "region" And I should not see "Topic 3" in the "region-main" "region" @@ -155,14 +155,14 @@ Feature: Bulk course section actions. And I should not see "Activity sample 4" in the "Topic 2" "section" And I should see "0 selected" in the "sticky-footer" "region" - Scenario: Bulk move topics after general section - Given I set the field "Edit topic name" in the "Topic 2" "section" to "Move one" - And I set the field "Edit topic name" in the "Topic 3" "section" to "Move two" - And I click on "Select topic Move one" "checkbox" - And I click on "Select topic Move two" "checkbox" + Scenario: Bulk move sections after general section + Given I set the field "Edit section name" in the "Topic 2" "section" to "Move one" + And I set the field "Edit section name" in the "Topic 3" "section" to "Move two" + And I click on "Select section Move one" "checkbox" + And I click on "Select section Move two" "checkbox" And I should see "2 selected" in the "sticky-footer" "region" - When I click on "Move topics" "button" in the "sticky-footer" "region" - And I click on "General" "link" in the "Move selected topics" "dialogue" + When I click on "Move sections" "button" in the "sticky-footer" "region" + And I click on "General" "link" in the "Move selected sections" "dialogue" # Check activities are moved with the topics. Then I should see "Activity sample 1" in the "Topic 3" "section" And I should see "Activity sample 2" in the "Topic 3" "section" @@ -174,13 +174,13 @@ Feature: Bulk course section actions. And "Topic 3" "section" should appear after "Move two" "section" And "Topic 4" "section" should appear after "Topic 3" "section" - Scenario: Bulk move topics at the end of the course - Given I set the field "Edit topic name" in the "Topic 3" "section" to "Move me" - And I click on "Select topic Topic 2" "checkbox" - And I click on "Select topic Move me" "checkbox" + Scenario: Bulk move sections at the end of the course + Given I set the field "Edit section name" in the "Topic 3" "section" to "Move me" + And I click on "Select section Topic 2" "checkbox" + And I click on "Select section Move me" "checkbox" And I should see "2 selected" in the "sticky-footer" "region" - When I click on "Move topics" "button" in the "sticky-footer" "region" - And I click on "Topic 4" "link" in the "Move selected topics" "dialogue" + When I click on "Move sections" "button" in the "sticky-footer" "region" + And I click on "Topic 4" "link" in the "Move selected sections" "dialogue" # Check activities are moved with the topics. Then I should see "Activity sample 1" in the "Topic 1" "section" And I should see "Activity sample 2" in the "Topic 1" "section" @@ -192,13 +192,13 @@ Feature: Bulk course section actions. And "Topic 3" "section" should appear after "Topic 2" "section" And "Move me" "section" should appear after "Topic 3" "section" - Scenario: Bulk move topics in the middle of the course - Given I set the field "Edit topic name" in the "Topic 4" "section" to "Move me" - And I click on "Select topic Topic 1" "checkbox" - And I click on "Select topic Move me" "checkbox" + Scenario: Bulk move sections in the middle of the course + Given I set the field "Edit section name" in the "Topic 4" "section" to "Move me" + And I click on "Select section Topic 1" "checkbox" + And I click on "Select section Move me" "checkbox" And I should see "2 selected" in the "sticky-footer" "region" - When I click on "Move topics" "button" in the "sticky-footer" "region" - And I click on "Topic 2" "link" in the "Move selected topics" "dialogue" + When I click on "Move sections" "button" in the "sticky-footer" "region" + And I click on "Topic 2" "link" in the "Move selected sections" "dialogue" # Check activities are moved with the topics. Then I should see "Activity sample 1" in the "Topic 2" "section" And I should see "Activity sample 2" in the "Topic 2" "section" diff --git a/course/format/tests/behat/bulk_select.feature b/course/format/tests/behat/bulk_select.feature index d2f69f483cd..bdc631d4ae1 100644 --- a/course/format/tests/behat/bulk_select.feature +++ b/course/format/tests/behat/bulk_select.feature @@ -28,7 +28,7 @@ Feature: Bulk activity and section selection. Scenario: Enable and disable bulk editing When I click on "Bulk actions" "button" Then I should see "0 selected" in the "sticky-footer" "region" - And the focused element is "Select topic Topic 1" "checkbox" + And the focused element is "Select section Topic 1" "checkbox" And I click on "Close bulk actions" "button" in the "sticky-footer" "region" And "sticky-footer" "region" should not be visible And the focused element is "Bulk actions" "button" @@ -38,12 +38,12 @@ Feature: Bulk activity and section selection. And I should see "0 selected" in the "sticky-footer" "region" When I click on "Select activity Activity sample 1" "checkbox" And I should see "1 selected" in the "sticky-footer" "region" - Then the "Select topic Topic 1" "checkbox" should be disabled + Then the "Select section Topic 1" "checkbox" should be disabled Scenario: Selecting sections disable activity selection Given I click on "Bulk actions" "button" And I should see "0 selected" in the "sticky-footer" "region" - When I click on "Select topic Topic 1" "checkbox" + When I click on "Select section Topic 1" "checkbox" And I should see "1 selected" in the "sticky-footer" "region" Then the "Select activity Activity sample 1" "checkbox" should be disabled @@ -74,7 +74,7 @@ Feature: Bulk activity and section selection. Scenario: Select all is disabled until a section is selected Given I click on "Bulk actions" "button" And the "Select all" "checkbox" should be disabled - When I click on "Select topic Topic 1" "checkbox" + When I click on "Select section Topic 1" "checkbox" And I should see "1 selected" in the "sticky-footer" "region" Then the "Select all" "checkbox" should be enabled @@ -96,35 +96,35 @@ Feature: Bulk activity and section selection. Scenario: Select all when a section is selected will select all sections Given I click on "Bulk actions" "button" - And I click on "Select topic Topic 1" "checkbox" + And I click on "Select section Topic 1" "checkbox" And I should see "1 selected" in the "sticky-footer" "region" - And the field "Select topic Topic 1" matches value "1" - And the field "Select topic Topic 2" matches value "" - And the field "Select topic Topic 3" matches value "" - And the field "Select topic Topic 4" matches value "" + And the field "Select section Topic 1" matches value "1" + And the field "Select section Topic 2" matches value "" + And the field "Select section Topic 3" matches value "" + And the field "Select section Topic 4" matches value "" And the "Select all" "checkbox" should be enabled When I click on "Select all" "checkbox" in the "sticky-footer" "region" Then I should see "4 selected" in the "sticky-footer" "region" - And the field "Select topic Topic 1" matches value "1" - And the field "Select topic Topic 2" matches value "1" - And the field "Select topic Topic 3" matches value "1" - And the field "Select topic Topic 4" matches value "1" + And the field "Select section Topic 1" matches value "1" + And the field "Select section Topic 2" matches value "1" + And the field "Select section Topic 3" matches value "1" + And the field "Select section Topic 4" matches value "1" Scenario: Click on a select all with all sections selected unselects all sections Given I click on "Bulk actions" "button" - And I click on "Select topic Topic 1" "checkbox" - And I click on "Select topic Topic 2" "checkbox" - And I click on "Select topic Topic 3" "checkbox" - And I click on "Select topic Topic 4" "checkbox" + And I click on "Select section Topic 1" "checkbox" + And I click on "Select section Topic 2" "checkbox" + And I click on "Select section Topic 3" "checkbox" + And I click on "Select section Topic 4" "checkbox" And I should see "4 selected" in the "sticky-footer" "region" And the "Select all" "checkbox" should be enabled When I click on "Select all" "checkbox" in the "sticky-footer" "region" Then I should see "0 selected" in the "sticky-footer" "region" - And the focused element is "Select topic Topic 1" "checkbox" - And the field "Select topic Topic 1" matches value "" - And the field "Select topic Topic 2" matches value "" - And the field "Select topic Topic 3" matches value "" - And the field "Select topic Topic 4" matches value "" + And the focused element is "Select section Topic 1" "checkbox" + And the field "Select section Topic 1" matches value "" + And the field "Select section Topic 2" matches value "" + And the field "Select section Topic 3" matches value "" + And the field "Select section Topic 4" matches value "" Scenario: Click on a select all with all activity selected unselects all activities Given I click on "Bulk actions" "button" @@ -136,7 +136,7 @@ Feature: Bulk activity and section selection. And the "Select all" "checkbox" should be enabled When I click on "Select all" "checkbox" in the "sticky-footer" "region" Then I should see "0 selected" in the "sticky-footer" "region" - And the focused element is "Select topic Topic 1" "checkbox" + And the focused element is "Select section Topic 1" "checkbox" And the field "Activity sample 1" matches value "" And the field "Activity sample 2" matches value "" And the field "Activity sample 3" matches value "" @@ -191,31 +191,31 @@ Feature: Bulk activity and section selection. Scenario: Select a range of sections using shift Given I click on "Bulk actions" "button" And I should see "0 selected" in the "sticky-footer" "region" - When I click on "Select topic Topic 1" "checkbox" - And the field "Select topic Topic 1" matches value "1" - And the field "Select topic Topic 2" matches value "" - And the field "Select topic Topic 3" matches value "" - And the field "Select topic Topic 4" matches value "" - And I shift click on "Select topic Topic 3" "checkbox" in the "page" "region" + When I click on "Select section Topic 1" "checkbox" + And the field "Select section Topic 1" matches value "1" + And the field "Select section Topic 2" matches value "" + And the field "Select section Topic 3" matches value "" + And the field "Select section Topic 4" matches value "" + And I shift click on "Select section Topic 3" "checkbox" in the "page" "region" Then I should see "3 selected" in the "sticky-footer" "region" - And the field "Select topic Topic 1" matches value "1" - And the field "Select topic Topic 2" matches value "1" - And the field "Select topic Topic 3" matches value "1" - And the field "Select topic Topic 4" matches value "" + And the field "Select section Topic 1" matches value "1" + And the field "Select section Topic 2" matches value "1" + And the field "Select section Topic 3" matches value "1" + And the field "Select section Topic 4" matches value "" Scenario: Select all section with alt click Given I click on "Bulk actions" "button" And I should see "0 selected" in the "sticky-footer" "region" - And the field "Select topic Topic 1" matches value "" - And the field "Select topic Topic 2" matches value "" - And the field "Select topic Topic 3" matches value "" - And the field "Select topic Topic 4" matches value "" - When I alt click on "Select topic Topic 3" "checkbox" in the "page" "region" + And the field "Select section Topic 1" matches value "" + And the field "Select section Topic 2" matches value "" + And the field "Select section Topic 3" matches value "" + And the field "Select section Topic 4" matches value "" + When I alt click on "Select section Topic 3" "checkbox" in the "page" "region" And I should see "4 selected" in the "sticky-footer" "region" - And the field "Select topic Topic 1" matches value "1" - And the field "Select topic Topic 2" matches value "1" - And the field "Select topic Topic 3" matches value "1" - And the field "Select topic Topic 4" matches value "1" + And the field "Select section Topic 1" matches value "1" + And the field "Select section Topic 2" matches value "1" + And the field "Select section Topic 3" matches value "1" + And the field "Select section Topic 4" matches value "1" Scenario: Bulk section selection is available also in one section per page Given I navigate to "Settings" in current page administration @@ -224,6 +224,6 @@ Feature: Bulk activity and section selection. And I click on "Save and display" "button" And I click on "Bulk actions" "button" And I should see "0 selected" in the "sticky-footer" "region" - When I click on "Select topic Topic 1" "checkbox" - And I click on "Select topic Topic 2" "checkbox" + When I click on "Select section Topic 1" "checkbox" + And I click on "Select section Topic 2" "checkbox" Then I should see "2 selected" in the "sticky-footer" "region" diff --git a/course/format/tests/behat/bulk_show_one_section_actions.feature b/course/format/tests/behat/bulk_show_one_section_actions.feature index ad9facee5c7..04309a5e5f9 100644 --- a/course/format/tests/behat/bulk_show_one_section_actions.feature +++ b/course/format/tests/behat/bulk_show_one_section_actions.feature @@ -31,25 +31,25 @@ Feature: Bulk course section actions one section per page And I should see "0 selected" in the "sticky-footer" "region" Scenario: Bulk section edit is only available when multiple sections are displayed - Given I click on "Select topic Topic 1" "checkbox" + Given I click on "Select section Topic 1" "checkbox" And I should see "1 selected" in the "sticky-footer" "region" And I click on "Close bulk actions" "button" in the "sticky-footer" "region" # Move to single topic page. And I open section "1" edit menu When I click on "View" "link" in the "Topic 1" "section" And I click on "Bulk actions" "button" - Then "Select topic Topic 1" "checkbox" should not exist + Then "Select section Topic 1" "checkbox" should not exist Scenario: Bulk availability sections in one section per page Given I should not see "Hidden from students" in the "Activity sample 1" "activity" And I should not see "Hidden from students" in the "Activity sample 2" "activity" And I should not see "Hidden from students" in the "Topic 1" "section" And I should not see "Hidden from students" in the "Topic 2" "section" - And I click on "Select topic Topic 1" "checkbox" + And I click on "Select section Topic 1" "checkbox" And I should see "1 selected" in the "sticky-footer" "region" - And I click on "Topics availability" "button" in the "sticky-footer" "region" - And I click on "Hide on course page" "radio" in the "Topic availability" "dialogue" - When I click on "Apply" "button" in the "Topic availability" "dialogue" + And I click on "Sections availability" "button" in the "sticky-footer" "region" + And I click on "Hide on course page" "radio" in the "Section availability" "dialogue" + When I click on "Apply" "button" in the "Section availability" "dialogue" And I should see "Hidden from students" in the "Activity sample 1" "activity" And I should see "Hidden from students" in the "Activity sample 2" "activity" And I should see "Hidden from students" in the "Topic 1" "section" @@ -65,10 +65,10 @@ Feature: Bulk course section actions one section per page And I should see "Activity sample 2" in the "Topic 1" "section" And I should see "Activity sample 3" in the "Topic 2" "section" And I should see "Activity sample 4" in the "Topic 2" "section" - And I click on "Select topic Topic 1" "checkbox" + And I click on "Select section Topic 1" "checkbox" And I should see "1 selected" in the "sticky-footer" "region" - When I click on "Delete topics" "button" in the "sticky-footer" "region" - And I click on "Delete" "button" in the "Delete topic?" "dialogue" + When I click on "Delete sections" "button" in the "sticky-footer" "region" + And I click on "Delete" "button" in the "Delete section?" "dialogue" Then I should see "Topic 1" in the "region-main" "region" And I should see "Topic 2" in the "region-main" "region" And I should see "Topic 3" in the "region-main" "region" @@ -79,14 +79,14 @@ Feature: Bulk course section actions one section per page And I should see "Activity sample 4" in the "Topic 1" "section" And I should see "0 selected" in the "sticky-footer" "region" - Scenario: Bulk move topics in one section per page - Given I set the field "Edit topic name" in the "Topic 2" "section" to "Move one" - And I set the field "Edit topic name" in the "Topic 3" "section" to "Move two" - And I click on "Select topic Move one" "checkbox" - And I click on "Select topic Move two" "checkbox" + Scenario: Bulk move sections in one section per page + Given I set the field "Edit section name" in the "Topic 2" "section" to "Move one" + And I set the field "Edit section name" in the "Topic 3" "section" to "Move two" + And I click on "Select section Move one" "checkbox" + And I click on "Select section Move two" "checkbox" And I should see "2 selected" in the "sticky-footer" "region" - When I click on "Move topics" "button" in the "sticky-footer" "region" - And I click on "General" "link" in the "Move selected topics" "dialogue" + When I click on "Move sections" "button" in the "sticky-footer" "region" + And I click on "General" "link" in the "Move selected sections" "dialogue" # Check activities are moved with the topics. Then I should see "Activity sample 1" in the "Topic 3" "section" And I should see "Activity sample 2" in the "Topic 3" "section" diff --git a/course/format/tests/behat/course_courseindex.feature b/course/format/tests/behat/course_courseindex.feature index d45931f5f9e..9aee7ea6444 100644 --- a/course/format/tests/behat/course_courseindex.feature +++ b/course/format/tests/behat/course_courseindex.feature @@ -257,7 +257,7 @@ Feature: Course index depending on role Scenario: Adding section should alter the course index Given I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on - When I click on "Add topic" "link" in the "Topic 4" "section" + When I click on "Add section" "link" in the "Topic 4" "section" Then I should see "Topic 5" in the "courseindex-content" "region" @javascript diff --git a/course/format/tests/behat/course_manageactivities.feature b/course/format/tests/behat/course_manageactivities.feature index 1833a123e1f..9645769a1eb 100644 --- a/course/format/tests/behat/course_manageactivities.feature +++ b/course/format/tests/behat/course_manageactivities.feature @@ -40,7 +40,7 @@ Feature: Verify edit utils availability And I should see "Edit settings" And ".section_action_menu" "css_element" should exist in the "Topic 1" "section" And I click on ".section_action_menu" "css_element" in the "Topic 1" "section" - And I should see "Edit topic" + And I should see "Edit settings" @javascript Scenario: Edit mode should not be available to students. @@ -54,7 +54,7 @@ Feature: Verify edit utils availability When I am on "Course 1" course homepage And I turn editing mode on Then I should see "Add an activity or resource" - But I should not see "Add topic" + But I should not see "Add section" And I open "Activity sample 1" actions menu And I should see "Edit settings" And I open section "1" edit menu @@ -70,9 +70,9 @@ Feature: Verify edit utils availability When I am on "Course 1" course homepage And I turn editing mode on Then I should see "Add an activity or resource" - And I should see "Add topic" + And I should see "Add section" And I open "Activity sample 1" actions menu And I should see "Edit settings" And ".section_action_menu" "css_element" should exist in the "Topic 1" "section" And I click on ".section_action_menu" "css_element" in the "Topic 1" "section" - And I should see "Edit topic" + And I should see "Edit settings" diff --git a/course/format/tests/behat/duplicate_section.feature b/course/format/tests/behat/duplicate_section.feature index bbf2926e678..aff40ccea60 100644 --- a/course/format/tests/behat/duplicate_section.feature +++ b/course/format/tests/behat/duplicate_section.feature @@ -27,7 +27,7 @@ Feature: Duplicate a section @javascript Scenario: Duplicate a named section - Given I set the field "Edit topic name" in the "Topic 1" "section" to "New name" + Given I set the field "Edit section name" in the "Topic 1" "section" to "New name" And I should see "New name" in the "New name" "section" When I open section "1" edit menu And I click on "Duplicate" "link" in the "New name" "section" diff --git a/course/format/topics/tests/behat/edit_delete_sections.feature b/course/format/topics/tests/behat/edit_delete_sections.feature index e556c85f52f..c3ff0a5db3c 100644 --- a/course/format/topics/tests/behat/edit_delete_sections.feature +++ b/course/format/topics/tests/behat/edit_delete_sections.feature @@ -1,8 +1,8 @@ @format @format_topics -Feature: Sections can be edited and deleted in topics format +Feature: Sections can be edited and deleted in custom sections format In order to rearrange my course contents As a teacher - I need to edit and Delete topics + I need to edit and delete sections Background: Given the following "users" exist: @@ -23,29 +23,29 @@ Feature: Sections can be edited and deleted in topics format And I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on - Scenario: View the default name of the general section in topics format + Scenario: View the default name of the general section in custom sections format When I edit the section "0" Then the field "Custom" matches value "0" And the field "New value for Section name" matches value "General" - Scenario: Edit the default name of the general section in topics format + Scenario: Edit the default name of the general section in custom sections format Given I should see "General" in the "General" "section" When I edit the section "0" and I fill the form with: | Custom | 1 | | New value for Section name | This is the general section | Then I should see "This is the general section" in the "This is the general section" "section" - Scenario: View the default name of the second section in topics format + Scenario: View the default name of the second section in custom sections format When I edit the section "2" Then the field "Custom" matches value "0" And the field "New value for Section name" matches value "Topic 2" - Scenario: Edit section summary in topics format + Scenario: Edit section summary in custom sections format When I edit the section "2" and I fill the form with: - | Summary | Welcome to section 2 | + | Description | Welcome to section 2 | Then I should see "Welcome to section 2" in the "Topic 2" "section" - Scenario: Edit section default name in topics format + Scenario: Edit section default name in custom sections format When I edit the section "2" and I fill the form with: | Custom | 1 | | New value for Section name | This is the second topic | @@ -53,23 +53,23 @@ Feature: Sections can be edited and deleted in topics format And I should not see "Topic 2" in the "region-main" "region" @javascript - Scenario: Inline edit section name in topics format - When I set the field "Edit topic name" in the "Topic 1" "section" to "Midterm evaluation" + Scenario: Inline edit section name in custom sections format + When I set the field "Edit section name" in the "Topic 1" "section" to "Midterm evaluation" Then I should not see "Topic 1" in the "region-main" "region" - And "New name for topic" "field" should not exist + And "New name for section" "field" should not exist And I should see "Midterm evaluation" in the "Midterm evaluation" "section" And I am on "Course 1" course homepage And I should not see "Topic 1" in the "region-main" "region" And I should see "Midterm evaluation" in the "Midterm evaluation" "section" - Scenario: Deleting the last section in topics format + Scenario: Deleting the last section in custom sections format When I delete section "5" Then I should see "Are you absolutely sure you want to completely delete \"Topic 5\" and all the activities it contains?" And I press "Delete" And I should not see "Topic 5" And I should see "Topic 4" - Scenario: Deleting the middle section in topics format + Scenario: Deleting the middle section in custom sections format When I delete section "4" And I press "Delete" Then I should not see "Topic 5" @@ -78,21 +78,21 @@ Feature: Sections can be edited and deleted in topics format And I should see "Topic 4" @javascript - Scenario: Adding sections at the end of a topics format - When I click on "Add topic" "link" in the "Topic 5" "section" + Scenario: Adding sections at the end of a custom sections format + When I click on "Add section" "link" in the "Topic 5" "section" Then I should see "Topic 6" in the "Topic 6" "section" And I should see "Test choice name" in the "Topic 5" "section" @javascript - Scenario: Adding sections between topics in topics format - When I click on "Add topic" "link" in the "Topic 4" "section" + Scenario: Adding sections between topics in custom sections format + When I click on "Add section" "link" in the "Topic 4" "section" Then I should see "Topic 6" in the "Topic 6" "section" And I should not see "Test choice name" in the "Topic 5" "section" And I should see "Test choice name" in the "Topic 6" "section" @javascript Scenario: Add a topic and then add an activity in it - When I click on "Add topic" "link" in the "Topic 5" "section" + When I click on "Add section" "link" in the "Topic 5" "section" And I add a "Assignment" to section "6" and I fill the form with: | Assignment name | Very new activity | | Description | Test | diff --git a/course/format/topics/tests/behat/highlight_sections.feature b/course/format/topics/tests/behat/highlight_sections.feature index a520be353ef..ba51c0f52e3 100644 --- a/course/format/topics/tests/behat/highlight_sections.feature +++ b/course/format/topics/tests/behat/highlight_sections.feature @@ -45,5 +45,5 @@ Feature: Sections can be highlighted And I click on "Highlight" "link" in the "Topic 3" "section" And I should see "Highlighted" in the "Topic 3" "section" When I open section "3" edit menu - And I click on "Remove highlight" "link" in the "Topic 3" "section" + And I click on "Unhighlight" "link" in the "Topic 3" "section" Then I should not see "Highlighted" in the "Topic 3" "section" diff --git a/course/format/weeks/tests/behat/bulk_actions.feature b/course/format/weeks/tests/behat/bulk_actions.feature index 5136e4249ca..111b76d8368 100644 --- a/course/format/weeks/tests/behat/bulk_actions.feature +++ b/course/format/weeks/tests/behat/bulk_actions.feature @@ -38,12 +38,12 @@ Feature: Weeks format bulk activity actions. And I should not see "Hidden from students" in the "8 May - 14 May" "section" And I should not see "Hidden from students" in the "15 May - 21 May" "section" And I should not see "Hidden from students" in the "22 May - 28 May" "section" - When I click on "Select week 1 May - 7 May" "checkbox" - And I click on "Select week 8 May - 14 May" "checkbox" + When I click on "Select section 1 May - 7 May" "checkbox" + And I click on "Select section 8 May - 14 May" "checkbox" And I should see "2 selected" in the "sticky-footer" "region" - And I click on "Weeks availability" "button" in the "sticky-footer" "region" - And I click on "Hide on course page" "radio" in the "Weeks availability" "dialogue" - And I click on "Apply" "button" in the "Weeks availability" "dialogue" + And I click on "Sections availability" "button" in the "sticky-footer" "region" + And I click on "Hide on course page" "radio" in the "Sections availability" "dialogue" + And I click on "Apply" "button" in the "Sections availability" "dialogue" Then I should see "Hidden from students" in the "Activity sample 1" "activity" And I should see "Hidden from students" in the "Activity sample 2" "activity" And I should see "Hidden from students" in the "Activity sample 3" "activity" @@ -55,11 +55,11 @@ Feature: Weeks format bulk activity actions. And I should see "0 selected" in the "sticky-footer" "region" Scenario: Bulk show weeks - Given I click on "Select week 1 May - 7 May" "checkbox" - And I click on "Select week 15 May - 21 May" "checkbox" - And I click on "Weeks availability" "button" in the "sticky-footer" "region" - And I click on "Hide on course page" "radio" in the "Weeks availability" "dialogue" - And I click on "Apply" "button" in the "Weeks availability" "dialogue" + Given I click on "Select section 1 May - 7 May" "checkbox" + And I click on "Select section 15 May - 21 May" "checkbox" + And I click on "Sections availability" "button" in the "sticky-footer" "region" + And I click on "Hide on course page" "radio" in the "Sections availability" "dialogue" + And I click on "Apply" "button" in the "Sections availability" "dialogue" And I should see "Hidden from students" in the "Activity sample 1" "activity" And I should see "Hidden from students" in the "Activity sample 2" "activity" And I should not see "Hidden from students" in the "Activity sample 3" "activity" @@ -68,12 +68,12 @@ Feature: Weeks format bulk activity actions. And I should not see "Hidden from students" in the "8 May - 14 May" "section" And I should see "Hidden from students" in the "15 May - 21 May" "section" And I should not see "Hidden from students" in the "22 May - 28 May" "section" - When I click on "Select week 1 May - 7 May" "checkbox" - And I click on "Select week 8 May - 14 May" "checkbox" + When I click on "Select section 1 May - 7 May" "checkbox" + And I click on "Select section 8 May - 14 May" "checkbox" And I should see "2 selected" in the "sticky-footer" "region" - And I click on "Weeks availability" "button" in the "sticky-footer" "region" - And I click on "Show on course page" "radio" in the "Weeks availability" "dialogue" - And I click on "Apply" "button" in the "Weeks availability" "dialogue" + And I click on "Sections availability" "button" in the "sticky-footer" "region" + And I click on "Show on course page" "radio" in the "Sections availability" "dialogue" + And I click on "Apply" "button" in the "Sections availability" "dialogue" Then I should not see "Hidden from students" in the "Activity sample 1" "activity" And I should not see "Hidden from students" in the "Activity sample 2" "activity" And I should not see "Hidden from students" in the "Activity sample 3" "activity" @@ -92,11 +92,11 @@ Feature: Weeks format bulk activity actions. And I should see "Activity sample 2" in the "1 May - 7 May" "section" And I should see "Activity sample 3" in the "8 May - 14 May" "section" And I should see "Activity sample 4" in the "8 May - 14 May" "section" - And I click on "Select week 1 May - 7 May" "checkbox" - And I click on "Select week 8 May - 14 May" "checkbox" + And I click on "Select section 1 May - 7 May" "checkbox" + And I click on "Select section 8 May - 14 May" "checkbox" And I should see "2 selected" in the "sticky-footer" "region" - When I click on "Delete weeks" "button" in the "sticky-footer" "region" - And I click on "Delete" "button" in the "Delete selected weeks?" "dialogue" + When I click on "Delete sections" "button" in the "sticky-footer" "region" + And I click on "Delete" "button" in the "Delete selected sections?" "dialogue" Then I should see "1 May - 7 May" in the "region-main" "region" And I should see "8 May - 14 May" in the "region-main" "region" And I should not see "15 May - 21 May" in the "region-main" "region" @@ -116,11 +116,11 @@ Feature: Weeks format bulk activity actions. And I should see "Activity sample 2" in the "1 May - 7 May" "section" And I should see "Activity sample 3" in the "8 May - 14 May" "section" And I should see "Activity sample 4" in the "8 May - 14 May" "section" - And I click on "Select week 8 May - 14 May" "checkbox" - And I click on "Select week 15 May - 21 May" "checkbox" + And I click on "Select section 8 May - 14 May" "checkbox" + And I click on "Select section 15 May - 21 May" "checkbox" And I should see "2 selected" in the "sticky-footer" "region" - When I click on "Delete weeks" "button" in the "sticky-footer" "region" - And I click on "Delete" "button" in the "Delete selected weeks?" "dialogue" + When I click on "Delete sections" "button" in the "sticky-footer" "region" + And I click on "Delete" "button" in the "Delete selected sections?" "dialogue" Then I should see "1 May - 7 May" in the "region-main" "region" And I should see "8 May - 14 May" in the "region-main" "region" And I should not see "15 May - 21 May" in the "region-main" "region" @@ -132,14 +132,14 @@ Feature: Weeks format bulk activity actions. And I should not see "Activity sample 4" in the "8 May - 14 May" "section" And I should see "0 selected" in the "sticky-footer" "region" - Scenario: Bulk move weeks after general section - Given I set the field "Edit week name" in the "8 May - 14 May" "section" to "Move one" - And I set the field "Edit week name" in the "15 May - 21 May" "section" to "Move two" - And I click on "Select week Move one" "checkbox" - And I click on "Select week Move two" "checkbox" + Scenario: Bulk move sections after general section + Given I set the field "Edit section name" in the "8 May - 14 May" "section" to "Move one" + And I set the field "Edit section name" in the "15 May - 21 May" "section" to "Move two" + And I click on "Select section Move one" "checkbox" + And I click on "Select section Move two" "checkbox" And I should see "2 selected" in the "sticky-footer" "region" - When I click on "Move weeks" "button" in the "sticky-footer" "region" - And I click on "General" "link" in the "Move selected weeks" "dialogue" + When I click on "Move sections" "button" in the "sticky-footer" "region" + And I click on "General" "link" in the "Move selected sections" "dialogue" # Check activities are moved with the weeks. Then I should see "Activity sample 1" in the "15 May - 21 May" "section" And I should see "Activity sample 2" in the "15 May - 21 May" "section" @@ -151,13 +151,13 @@ Feature: Weeks format bulk activity actions. And "15 May - 21 May" "section" should appear after "Move two" "section" And "22 May - 28 May" "section" should appear after "15 May - 21 May" "section" - Scenario: Bulk move weeks at the end of the course - Given I set the field "Edit week name" in the "15 May - 21 May" "section" to "Move me" - And I click on "Select week 8 May - 14 May" "checkbox" - And I click on "Select week Move me" "checkbox" + Scenario: Bulk move sections at the end of the course + Given I set the field "Edit section name" in the "15 May - 21 May" "section" to "Move me" + And I click on "Select section 8 May - 14 May" "checkbox" + And I click on "Select section Move me" "checkbox" And I should see "2 selected" in the "sticky-footer" "region" - When I click on "Move weeks" "button" in the "sticky-footer" "region" - And I click on "22 May - 28 May" "link" in the "Move selected weeks" "dialogue" + When I click on "Move sections" "button" in the "sticky-footer" "region" + And I click on "22 May - 28 May" "link" in the "Move selected sections" "dialogue" # Check activities are moved with the weeks. Then I should see "Activity sample 1" in the "1 May - 7 May" "section" And I should see "Activity sample 2" in the "1 May - 7 May" "section" @@ -169,13 +169,13 @@ Feature: Weeks format bulk activity actions. And "15 May - 21 May" "section" should appear after "8 May - 14 May" "section" And "Move me" "section" should appear after "15 May - 21 May" "section" - Scenario: Bulk move weeks in the middle of the course - Given I set the field "Edit week name" in the "22 May - 28 May" "section" to "Move me" - And I click on "Select week 1 May - 7 May" "checkbox" - And I click on "Select week Move me" "checkbox" + Scenario: Bulk move sections in the middle of the course + Given I set the field "Edit section name" in the "22 May - 28 May" "section" to "Move me" + And I click on "Select section 1 May - 7 May" "checkbox" + And I click on "Select section Move me" "checkbox" And I should see "2 selected" in the "sticky-footer" "region" - When I click on "Move weeks" "button" in the "sticky-footer" "region" - And I click on "8 May - 14 May" "link" in the "Move selected weeks" "dialogue" + When I click on "Move sections" "button" in the "sticky-footer" "region" + And I click on "8 May - 14 May" "link" in the "Move selected sections" "dialogue" # Check activities are moved with the weeks. Then I should see "Activity sample 1" in the "8 May - 14 May" "section" And I should see "Activity sample 2" in the "8 May - 14 May" "section" diff --git a/course/format/weeks/tests/behat/current_week.feature b/course/format/weeks/tests/behat/current_week.feature index ee00821c715..5658c150f3a 100644 --- a/course/format/weeks/tests/behat/current_week.feature +++ b/course/format/weeks/tests/behat/current_week.feature @@ -9,11 +9,11 @@ Feature: The current week should be highlighted in the course. | fullname | shortname | format | coursedisplay | numsections | startdate | | Course 1 | C1 | weeks | 0 | 5 | ##yesterday## | When I am on the "C1" "Course" page logged in as "admin" - Then I should see "This week" in the "#section-1" "css_element" + Then I should see "Current week" in the "#section-1" "css_element" Scenario: Highlight next week Given the following "courses" exist: | fullname | shortname | format | coursedisplay | numsections | startdate | | Course 1 | C1 | weeks | 0 | 5 | ##monday last week## | When I am on the "C1" "Course" page logged in as "admin" - Then I should see "This week" in the "#section-2" "css_element" + Then I should see "Current week" in the "#section-2" "css_element" diff --git a/course/format/weeks/tests/behat/edit_delete_sections.feature b/course/format/weeks/tests/behat/edit_delete_sections.feature index f91d48aec19..fe42db9d08f 100644 --- a/course/format/weeks/tests/behat/edit_delete_sections.feature +++ b/course/format/weeks/tests/behat/edit_delete_sections.feature @@ -1,8 +1,8 @@ @format @format_weeks -Feature: Sections can be edited and deleted in weeks format +Feature: Sections can be edited and deleted in weekly sections format In order to rearrange my course contents As a teacher - I need to edit and Delete weeks + I need to edit and delete sections Background: Given the following "users" exist: @@ -41,7 +41,7 @@ Feature: Sections can be edited and deleted in weeks format Scenario: Edit section summary in weeks format When I edit the section "2" and I fill the form with: - | Summary | Welcome to section 2 | + | Description | Welcome to section 2 | Then I should see "Welcome to section 2" in the "8 May - 14 May" "section" Scenario: Edit section default name in weeks format @@ -54,7 +54,7 @@ Feature: Sections can be edited and deleted in weeks format @javascript Scenario: Inline edit section name in weeks format - When I set the field "Edit week name" in the "1 May - 7 May" "section" to "Midterm evaluation" + When I set the field "Edit section name" in the "1 May - 7 May" "section" to "Midterm evaluation" Then I should not see "1 May - 7 May" in the "region-main" "region" And "New name for week" "field" should not exist And I should see "Midterm evaluation" in the "Midterm evaluation" "section" diff --git a/course/tests/behat/course_category_management_listing.feature b/course/tests/behat/course_category_management_listing.feature index e6ba2dc5a3e..39d24ade4b2 100644 --- a/course/tests/behat/course_category_management_listing.feature +++ b/course/tests/behat/course_category_management_listing.feature @@ -30,7 +30,7 @@ Feature: Course category management interface performs as expected | Cat 1 | 0 | CAT1 | And the following "courses" exist: | fullname | shortname | category | format | - | Course 1 | C1 | CAT1 | topics | + | Course 1 | C1 | CAT1 | topics | And I log in as "admin" And I go to the courses management page @@ -69,7 +69,7 @@ Feature: Course category management interface performs as expected And I should see "Course 1" in the "#course-detail h3" "css_element" And I should see "C1" in the "#course-detail .shortname" "css_element" And I should see "Course 1" in the "#course-detail .fullname" "css_element" - And I should see "Topics" in the "#course-detail .format" "css_element" + And I should see "Custom sections" in the "#course-detail .format" "css_element" And I should see "Cat 1" in the "#course-detail .category" "css_element" Scenario: Test displaying of sub categories diff --git a/course/tests/behat/course_collapse_sections.feature b/course/tests/behat/course_collapse_sections.feature index d8516568237..62b68be063d 100644 --- a/course/tests/behat/course_collapse_sections.feature +++ b/course/tests/behat/course_collapse_sections.feature @@ -43,7 +43,7 @@ Feature: Collapse course sections @javascript Scenario: No chevron on site home - Given the following activity" exists: + Given the following "activity" exists: | activity | forum | | course | Acceptance test site | | section | 1 | @@ -51,14 +51,14 @@ Feature: Collapse course sections And I log in as "admin" And I am on site homepage And I turn editing mode on - And I click on "Edit summary" "link" in the "region-main" "region" + And I click on "Edit" "link" in the "region-main" "region" And I click on "Custom" "checkbox" And I set the field "New value for Section name" to "New section name" When I press "Save changes" Then "[data-toggle=collapse]" "css_element" should not exist in the "region-main" "region" @javascript - Scenario: Expand/collapse sections for Topics format. + Scenario: Expand/collapse sections for Custom sections format. Given I am on the "Course 1" course page logged in as student1 And "[data-toggle=collapse]" "css_element" should exist in the "region-main" "region" And I should see "Assignment 1" in the "region-main" "region" @@ -101,7 +101,7 @@ Feature: Collapse course sections When I navigate to "Settings" in current page administration And I expand all fieldsets And I set the following fields to these values: - | Format | Weekly format | + | Format | Weekly sections | And I press "Save and display" And I should see "Assignment 1" in the "region-main" "region" And I should see "Assignment 2" in the "region-main" "region" @@ -143,7 +143,7 @@ Feature: Collapse course sections And I should see "Forum 5" @javascript - Scenario: Users don't see chevron on one section per page for Topics format + Scenario: Users don't see chevron on one section per page for Custom sections format Given I am on the "Course 1" course page logged in as teacher1 When I navigate to "Settings" in current page administration And I expand all fieldsets @@ -170,7 +170,7 @@ Feature: Collapse course sections And I expand all fieldsets And I set the following fields to these values: | Course layout | Show one section per page | - | Format | Weekly format | + | Format | Weekly sections | And I press "Save and display" And "[data-toggle=collapse]" "css_element" should not exist in the "region-main" "region" And I click on "8 May - 14 May" "link" in the "region-main" "region" diff --git a/course/tests/behat/course_format.feature b/course/tests/behat/course_format.feature index bb3d2c28da6..7045dc5385d 100644 --- a/course/tests/behat/course_format.feature +++ b/course/tests/behat/course_format.feature @@ -9,7 +9,7 @@ Feature: Teacher can change the course format Given the following "users" exist: | username | firstname | lastname | email | | teacher1 | Teacher | 1 | teacher1@example.com | - # Course format is initially set to Topics format + # Course format is initially set to Custom sections format And the following "courses" exist: | fullname | shortname | format | startdate | | Course 1 | C1 | topics | ## 1 day ago ## | @@ -21,7 +21,7 @@ Feature: Teacher can change the course format Then I should see "Topic 1" And I am on the "Course 1" "course editing" page And I expand all fieldsets - # Fields that appear for Topics format exist + # Fields that appear for Custom sections format exist # Also confirm contents of Hidden sections and Course layout select box And I should see "Hidden sections" And the "Hidden sections" select box should contain "Hidden sections are shown as not available" @@ -34,7 +34,7 @@ Feature: Teacher can change the course format # Course layout default value is 0 (Show all sections on one page) And the field "Course layout" matches value "0" # Set course format to Single activity format - And I set the field "Format" to "Single activity format" + And I set the field "Format" to "Single activity" And I expand all fieldsets # Confirm that fields that appear for Single activity format appears And I should see "Type of activity" @@ -47,10 +47,10 @@ Feature: Teacher can change the course format And I should not see "Topic 1" And I am on the "Course 1" "course editing" page And I expand all fieldsets - # Set course format to Weekly format - And I set the field "Format" to "Weekly format" + # Set course format. + And I set the field "Format" to "Weekly sections" And I expand all fieldsets - # Confirm that fields that appear for Weekly format appears + # Confirm that fields that appear for Weekly sections format appears # Also confirm contents of Hidden sections and Course layout select box And I should see "Hidden sections" And the "Hidden sections" select box should contain "Hidden sections are shown as not available" @@ -64,12 +64,12 @@ Feature: Teacher can change the course format And the field "Course layout" matches value "0" And I press "Save and display" # Confirm that course page displays weekly sections - And I should see "This week" + And I should see "Current week" And I should not see "Browse the glossary using this index" And I am on the "Course 1" "course editing" page And I expand all fieldsets # Set course format to Social format - And I set the field "Format" to "Social format" + And I set the field "Format" to "Social" # Confirm that fields that appear for Social format appears And I expand all fieldsets And I should see "Number of discussions" @@ -77,4 +77,4 @@ Feature: Teacher can change the course format And I press "Save and display" # Confirm that course page displays a forum And I should see "There are no discussion topics yet in this forum" - And I should not see "This week" + And I should not see "Current week" diff --git a/course/tests/behat/frontpage_topic_section.feature b/course/tests/behat/frontpage_topic_section.feature index 7ea81a57a3d..e5619279748 100644 --- a/course/tests/behat/frontpage_topic_section.feature +++ b/course/tests/behat/frontpage_topic_section.feature @@ -24,7 +24,7 @@ Feature: Site home topic section And I log in as "admin" And I am on site homepage And I turn editing mode on - And I click on "Edit summary" "link" in the "region-main" "region" + And I click on "Edit" "link" in the "region-main" "region" And I click on "Custom" "checkbox" And I set the field "New value for Section name" to "New section name" When I press "Save changes" @@ -37,8 +37,8 @@ Feature: Site home topic section Given I log in as "admin" And I am on site homepage And I turn editing mode on - And I click on "Edit summary" "link" in the "region-main" "region" - And I set the field "Summary" to "New section description" + And I click on "Edit" "link" in the "region-main" "region" + And I set the field "Description" to "New section description" When I press "Save changes" And I should see "New section description" in the "region-main" "region" Then I turn editing mode off diff --git a/course/tests/behat/max_number_sections.feature b/course/tests/behat/max_number_sections.feature index 5fa0c04c6ce..e556f0efe7e 100644 --- a/course/tests/behat/max_number_sections.feature +++ b/course/tests/behat/max_number_sections.feature @@ -26,7 +26,7 @@ Feature: The maximum number of weeks/topics in a course can be configured | Course full name | New course fullname | | Course short name | New course shortname | | Number of sections | 90 | - | Format | Topics format | + | Format | Custom sections | And I should see "Topic 90" @javascript @@ -42,5 +42,5 @@ Feature: The maximum number of weeks/topics in a course can be configured | Course full name | New course fullname | | Course short name | New course shortname | | Number of sections | 0 | - | Format | Topics format | + | Format | Custom sections | And I should not see "Topic 1" diff --git a/course/tests/behat/section_highlighting.feature b/course/tests/behat/section_highlighting.feature index 07b54235bf5..fd2a39924dd 100644 --- a/course/tests/behat/section_highlighting.feature +++ b/course/tests/behat/section_highlighting.feature @@ -5,7 +5,7 @@ Feature: Topic's course sections highlighting I need to highlight one specific section @javascript - Scenario Outline: Highlight a topic's course section with course paged mode and without it + Scenario Outline: Highlight a course section with course paged mode and without it Given the following "users" exist: | username | firstname | lastname | email | | teacher1 | Teacher | 1 | teacher1@example.com | diff --git a/course/tests/behat/sectionzero_title.feature b/course/tests/behat/sectionzero_title.feature index d3599dba3a4..41e322b77a0 100644 --- a/course/tests/behat/sectionzero_title.feature +++ b/course/tests/behat/sectionzero_title.feature @@ -32,11 +32,11 @@ Feature: Section 0 default/custom title | Custom | 1 | | New value for Section name | Edited section 0 | And I should see "Edited section 0" in the "li#section-0" "css_element" - When I set the field "Edit topic name" in the "li#section-0" "css_element" to "" + When I set the field "Edit section name" in the "li#section-0" "css_element" to "" Then I should not see "Edited section 0" in the "li#section-0" "css_element" And I should see "General" in the "li#section-0" "css_element" - And "New name for topic" "field" should not exist - And I set the field "Edit topic name" in the "li#section-0" "css_element" to "Edited section 0" + And "New name for section" "field" should not exist + And I set the field "Edit section name" in the "li#section-0" "css_element" to "Edited section 0" And I should see "Edited section 0" in the "li#section-0" "css_element" And I edit the section "0" and I fill the form with: | Custom | 0 | diff --git a/course/tests/reportbuilder/datasource/courses_test.php b/course/tests/reportbuilder/datasource/courses_test.php index 824436f6e0b..39455f303c5 100644 --- a/course/tests/reportbuilder/datasource/courses_test.php +++ b/course/tests/reportbuilder/datasource/courses_test.php @@ -155,7 +155,7 @@ class courses_test extends core_reportbuilder_testcase { $this->assertStringContainsString($course->shortname, $courserow[5]); $this->assertStringContainsString($course->idnumber, $courserow[6]); $this->assertEquals(format_text($course->summary, $course->summaryformat), $courserow[7]); - $this->assertEquals('Topics format', $courserow[8]); + $this->assertEquals('Custom sections', $courserow[8]); $this->assertEquals(userdate($course->startdate), $courserow[9]); $this->assertEmpty($courserow[10]); $this->assertEquals('Yes', $courserow[11]); From 2a708f985aa2b12c71a919fe5c36a3ceb3442ebf Mon Sep 17 00:00:00 2001 From: Sara Arjona Date: Thu, 4 Jan 2024 18:02:51 +0100 Subject: [PATCH 4/4] MDL-80461 courseformat: Use choicedropdown for the format setting In MDL-79985 a new form element was created to display a new generic dropdown with extra information like a description or an icon on each option. This commits replaces the select for the course format form element in the Course settings page with this new component. --- .../tool/uploadcourse/classes/step2_form.php | 24 ++++++++++-- course/edit_form.php | 37 ++++++++++++++----- .../lang/en/format_singleactivity.php | 1 + .../format/social/lang/en/format_social.php | 1 + .../format/topics/lang/en/format_topics.php | 1 + course/format/upgrade.txt | 2 + course/format/weeks/lang/en/format_weeks.php | 1 + lang/en/deprecated.txt | 1 + lang/en/moodle.php | 12 +++--- 9 files changed, 60 insertions(+), 20 deletions(-) diff --git a/admin/tool/uploadcourse/classes/step2_form.php b/admin/tool/uploadcourse/classes/step2_form.php index ffd6ba06f79..033c2aba273 100644 --- a/admin/tool/uploadcourse/classes/step2_form.php +++ b/admin/tool/uploadcourse/classes/step2_form.php @@ -120,12 +120,28 @@ class tool_uploadcourse_step2_form extends tool_uploadcourse_base_form { $mform->addHelpButton('defaults[enddate]', 'enddate'); $courseformats = get_sorted_course_formats(true); - $formcourseformats = array(); + $formcourseformats = new core\output\choicelist(); + $formcourseformats->set_allow_empty(false); foreach ($courseformats as $courseformat) { - $formcourseformats[$courseformat] = get_string('pluginname', "format_$courseformat"); + $definition = []; + $component = "format_$courseformat"; + if (get_string_manager()->string_exists('plugin_description', $component)) { + $definition['description'] = get_string('plugin_description', $component); + } + $formcourseformats->add_option( + $courseformat, + get_string('pluginname', "format_$courseformat"), + [ + 'description' => $definition, + ], + ); } - $mform->addElement('select', 'defaults[format]', get_string('format'), $formcourseformats); - $mform->addHelpButton('defaults[format]', 'format'); + $mform->addElement( + 'choicedropdown', + 'defaults[format]', + get_string('format'), + $formcourseformats, + ); $mform->setDefault('defaults[format]', $courseconfig->format); if (!empty($CFG->allowcoursethemes)) { diff --git a/course/edit_form.php b/course/edit_form.php index c5f2b44611e..3b67acb6f50 100644 --- a/course/edit_form.php +++ b/course/edit_form.php @@ -221,23 +221,40 @@ class course_edit_form extends moodleform { $mform->addElement('header', 'courseformathdr', get_string('type_format', 'plugin')); $courseformats = get_sorted_course_formats(true); - $formcourseformats = array(); + $formcourseformats = new core\output\choicelist(); + $formcourseformats->set_allow_empty(false); foreach ($courseformats as $courseformat) { - $formcourseformats[$courseformat] = get_string('pluginname', "format_$courseformat"); + $definition = []; + $component = "format_$courseformat"; + if (get_string_manager()->string_exists('plugin_description', $component)) { + $definition['description'] = get_string('plugin_description', $component); + } + $formcourseformats->add_option( + $courseformat, + get_string('pluginname', "format_$courseformat"), + [ + 'description' => $definition, + ], + ); } if (isset($course->format)) { - $course->format = course_get_format($course)->get_format(); // replace with default if not found + $course->format = course_get_format($course)->get_format(); // Replace with default if not found. if (!in_array($course->format, $courseformats)) { - // this format is disabled. Still display it in the dropdown - $formcourseformats[$course->format] = get_string('withdisablednote', 'moodle', - get_string('pluginname', 'format_'.$course->format)); + // This format is disabled. Still display it in the dropdown. + $formcourseformats->add_option( + $course->format, + get_string('withdisablednote', 'moodle', get_string('pluginname', 'format_'.$course->format)), + ); } } - $mform->addElement('select', 'format', get_string('format'), $formcourseformats, [ - 'data-formatchooser-field' => 'selector', - ]); - $mform->addHelpButton('format', 'format'); + $mform->addElement( + 'choicedropdown', + 'format', + get_string('format'), + $formcourseformats, + ['data-formatchooser-field' => 'selector'], + ); $mform->setDefault('format', $courseconfig->format); // Button to update format-specific options on format change (will be hidden by JavaScript). diff --git a/course/format/singleactivity/lang/en/format_singleactivity.php b/course/format/singleactivity/lang/en/format_singleactivity.php index 5ccb3e2182f..ad2ae685b7b 100644 --- a/course/format/singleactivity/lang/en/format_singleactivity.php +++ b/course/format/singleactivity/lang/en/format_singleactivity.php @@ -30,6 +30,7 @@ $string['erroractivitytype'] = 'Type of activity is not set up in Course setting $string['orphaned'] = 'Orphaned'; $string['orphanedwarning'] = 'These activities are unreachable by users!'; $string['pluginname'] = 'Single activity'; +$string['plugin_description'] = 'The course contains only one activity or resource.'; $string['sectionname'] = ''; $string['warningchangeformat'] = 'When changing the existing course format to "Single activity" make sure that you removed all extra activities from the course including "Announcements". Note that sections structure may be modified.'; $string['privacy:metadata'] = 'The Single activity format plugin does not store any personal data.'; diff --git a/course/format/social/lang/en/format_social.php b/course/format/social/lang/en/format_social.php index 151ea6b7a87..fab01047d0a 100644 --- a/course/format/social/lang/en/format_social.php +++ b/course/format/social/lang/en/format_social.php @@ -26,5 +26,6 @@ $string['numberdiscussions'] = 'Number of discussions'; $string['numberdiscussions_help'] = 'This setting specifies how many discussions should be displayed.'; $string['pluginname'] = 'Social'; +$string['plugin_description'] = 'The course is centred around a main forum on the course page. Additional activities and resources can be added using the Social activities block.'; $string['sectionname'] = 'section'; $string['privacy:metadata'] = 'The Social format plugin does not store any personal data.'; diff --git a/course/format/topics/lang/en/format_topics.php b/course/format/topics/lang/en/format_topics.php index 1ee0f5a7ce1..3cc3a62d4da 100644 --- a/course/format/topics/lang/en/format_topics.php +++ b/course/format/topics/lang/en/format_topics.php @@ -27,6 +27,7 @@ $string['hidefromothers'] = 'Hide'; $string['page-course-view-topics'] = 'Any course main page in custom sections format'; $string['page-course-view-topics-x'] = 'Any course page in custom sections format'; $string['pluginname'] = 'Custom sections'; +$string['plugin_description'] = 'The course is divided into customisable sections.'; $string['privacy:metadata'] = 'The Custom sections format plugin does not store any personal data.'; $string['indentation'] = 'Allow indentation on course page'; $string['indentation_help'] = 'Allow teachers, and other users with the manage activities capability, to indent items on the course page.'; diff --git a/course/format/upgrade.txt b/course/format/upgrade.txt index 121afc8c2d3..e9042ea86d2 100644 --- a/course/format/upgrade.txt +++ b/course/format/upgrade.txt @@ -47,6 +47,8 @@ always linked because a new page, section.php, has been created to display any s - course/format/topics/renderer.php - course/format/weeks/renderer.php * New core_courseformat\sectiondelegate class. The class can be extended by plugins to take control of a course section. +* The course format setting has been updated to use a choice dropdown form element instead of a select element. Third-party +plugins can now include the string 'plugin_description' to provide a description of the course format. === 4.3 === * New core_courseformat\output\activitybadge class that can be extended by any module to display content near the activity name. diff --git a/course/format/weeks/lang/en/format_weeks.php b/course/format/weeks/lang/en/format_weeks.php index 074f8b76860..58f009fafe3 100644 --- a/course/format/weeks/lang/en/format_weeks.php +++ b/course/format/weeks/lang/en/format_weeks.php @@ -30,6 +30,7 @@ $string['hidefromothers'] = 'Hide'; $string['page-course-view-weeks'] = 'Any course main page in weekly sections format'; $string['page-course-view-weeks-x'] = 'Any course page in weekly sections format'; $string['pluginname'] = 'Weekly sections'; +$string['plugin_description'] = 'The course is divided into sections corresponding to each week, beginning from the course start date.'; $string['privacy:metadata'] = 'The Weekly sections format plugin does not store any personal data.'; $string['indentation'] = 'Allow indentation on course page'; $string['indentation_help'] = 'Allow teachers, and other users with the manage activities capability, to indent items on the course page.'; diff --git a/lang/en/deprecated.txt b/lang/en/deprecated.txt index d78d401ef99..96147edbc26 100644 --- a/lang/en/deprecated.txt +++ b/lang/en/deprecated.txt @@ -132,3 +132,4 @@ topicshow,core topichide,core summary_help,core editsummary,core +format_help,core diff --git a/lang/en/moodle.php b/lang/en/moodle.php index 9e86d6ca94f..a0f2c13b3f8 100644 --- a/lang/en/moodle.php +++ b/lang/en/moodle.php @@ -935,12 +935,6 @@ $string['forgotten'] = 'Forgotten your username or password?'; $string['forgottenduplicate'] = 'The email address is shared by several accounts, please enter username instead'; $string['forgotteninvalidurl'] = 'Invalid password reset URL'; $string['format'] = 'Format'; -$string['format_help'] = 'The course format determines the layout of the course page. - -* Single activity - The course contains only one activity or resource. -* Social - A forum is displayed on the course page. -* Custom sections - The course is divided into customisable sections. -* Weekly sections - The course is divided into sections corresponding to each week, beginning from the course start date.'; $string['formathtml'] = 'HTML format'; $string['formatmarkdown'] = 'Markdown format'; $string['formatplain'] = 'Plain text format'; @@ -2501,3 +2495,9 @@ $string['topicshow'] = 'Show this topic to {$a}'; $string['topichide'] = 'Hide this topic from {$a}'; $string['summary_help'] = 'The idea of a summary is a short text to prepare students for the activities within the topic or week. The text is shown on the course page under the section name.'; $string['editsummary'] = 'Edit summary'; +$string['format_help'] = 'The course format determines the layout of the course page. + +* Single activity - The course contains only one activity or resource. +* Social - The course is centred around a main forum on the course page. Additional activities and resources can be added using the Social activities block. +* Custom sections - The course is divided into customisable sections. +* Weekly sections - The course is divided into sections corresponding to each week, beginning from the course start date.';