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.
This commit is contained in:
Sara Arjona 2024-01-04 16:17:49 +01:00
parent 810554ee83
commit 785d3fd1e7
No known key found for this signature in database
16 changed files with 41 additions and 126 deletions

View File

@ -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.';

View File

@ -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');

View File

@ -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()];

View File

@ -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.';

View File

@ -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();

View File

@ -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.';

View File

@ -31,7 +31,7 @@
<div class="course-content">
{{#showsettings}}
<div class="mb-2">
<a href="{{{settingsurl}}}" title="{{#str}} editsummary {{/str}}" aria-label="{{#str}} editsummary {{/str}}">
<a href="{{{settingsurl}}}" title="{{#str}} edit {{/str}}" aria-label="{{#str}} edit {{/str}}">
{{#pix}} t/edit, moodle {{/pix}}
</a>
</div>

View File

@ -15,40 +15,23 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* 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';

View File

@ -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.
*

View File

@ -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';

View File

@ -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.
*

View File

@ -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']);
}
/**

View File

@ -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';

View File

@ -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';

View File

@ -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';

View File

@ -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')];