Merge branch 'MDL-80461-main' of https://github.com/sarjona/moodle

This commit is contained in:
Jun Pataleta
2024-01-22 16:17:21 +08:00
50 changed files with 420 additions and 447 deletions
+55 -55
View File
@@ -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> format" in site administration
Given I navigate to "Plugins > Course formats > <format>" 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 "<format> Course 1" course homepage with editing mode on
And I open "<format> forum name" actions menu
And "Move right" "link" in the "<format> forum name" "activity" should be visible
And "Move left" "link" in the "<format> forum name" "activity" should not be visible
And I am on "<prefix> Course 1" course homepage with editing mode on
And I open "<prefix> forum name" actions menu
And "Move right" "link" in the "<prefix> forum name" "activity" should be visible
And "Move left" "link" in the "<prefix> forum name" "activity" should not be visible
And I press the escape key
And I open "<format> database name" actions menu
And "Move right" "link" in the "<format> database name" "activity" should be visible
And "Move left" "link" in the "<format> database name" "activity" should not be visible
And I am on "<format> Course 2" course homepage with editing mode on
And I open "<format> wiki name" actions menu
And "Move right" "link" in the "<format> wiki name" "activity" should be visible
And "Move left" "link" in the "<format> wiki name" "activity" should not be visible
# Check other course formats had not been reset
And I open "<prefix> database name" actions menu
And "Move right" "link" in the "<prefix> database name" "activity" should be visible
And "Move left" "link" in the "<prefix> database name" "activity" should not be visible
And I am on "<prefix> Course 2" course homepage with editing mode on
And I open "<prefix> wiki name" actions menu
And "Move right" "link" in the "<prefix> wiki name" "activity" should be visible
And "Move left" "link" in the "<prefix> wiki name" "activity" should not be visible
# Check other course formats had not been reset
And I am on "<other> Course 1" course homepage with editing mode on
And I open "<other> forum name" actions menu
And "Move right" "link" in the "<other> forum name" "activity" should not be visible
And "Move left" "link" in the "<other> 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> format" in site administration
Given I navigate to "Plugins > Course formats > <format>" 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 "<format> Course 1" course homepage with editing mode on
And I open "<format> forum name" actions menu
And "Move right" "link" in the "<format> forum name" "activity" should not be visible
And "Move left" "link" in the "<format> forum name" "activity" should be visible
And I am on "<prefix> Course 1" course homepage with editing mode on
And I open "<prefix> forum name" actions menu
And "Move right" "link" in the "<prefix> forum name" "activity" should not be visible
And "Move left" "link" in the "<prefix> forum name" "activity" should be visible
And I press the escape key
And I open "<format> database name" actions menu
And "Move right" "link" in the "<format> database name" "activity" should be visible
And "Move left" "link" in the "<format> database name" "activity" should not be visible
And I am on "<format> Course 2" course homepage with editing mode on
And I open "<format> wiki name" actions menu
And "Move right" "link" in the "<format> wiki name" "activity" should not be visible
And "Move left" "link" in the "<format> wiki name" "activity" should be visible
And I open "<prefix> database name" actions menu
And "Move right" "link" in the "<prefix> database name" "activity" should be visible
And "Move left" "link" in the "<prefix> database name" "activity" should not be visible
And I am on "<prefix> Course 2" course homepage with editing mode on
And I open "<prefix> wiki name" actions menu
And "Move right" "link" in the "<prefix> wiki name" "activity" should not be visible
And "Move left" "link" in the "<prefix> wiki name" "activity" should be visible
Examples:
| format |
| Topics |
| Weekly |
| format | prefix |
| Custom sections | Sections |
| Weekly sections | Weekly |
@@ -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
@@ -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
+20 -4
View File
@@ -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)) {
@@ -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 |
@@ -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"
@@ -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.';
+27 -10
View File
@@ -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).
+1 -2
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');
@@ -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()];
@@ -29,7 +29,8 @@ $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['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.';
@@ -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"
@@ -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"
+3 -3
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();
@@ -25,6 +25,7 @@
$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['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.';
@@ -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>
+13 -6
View File
@@ -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',
@@ -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"
+44 -44
View File
@@ -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"
@@ -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"
@@ -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
@@ -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"
@@ -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"
+9 -25
View File
@@ -15,40 +15,24 @@
// 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['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.';
$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';
+1 -23
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.
*
@@ -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 |
@@ -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"
+2
View File
@@ -50,6 +50,8 @@ always linked because a new page, section.php, has been created to display any s
* The methods core_courseformat\base::set_section_number() and core_courseformat\base:: get_section_number() have been deprecated
and replaced by core_courseformat\base::set_sectionnum() and core_courseformat\base::get_sectionnum(). The new methods use the null
value when all the sections must be displayed (instead of 0). That way, section 0 (General), can be displayed on a single page too.
* 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.
+9 -24
View File
@@ -22,33 +22,18 @@
* @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['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.';
$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';
+1 -23
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.
*
@@ -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"
@@ -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"
@@ -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"
-2
View File
@@ -3128,8 +3128,6 @@ function include_course_ajax($course, $usedmodules = array(), $enabledmodules =
'groupsnone',
'groupsvisible',
'groupsseparate',
'markthistopic',
'markedthistopic',
'movesection',
'movecoursemodule',
'movecoursesection',
+1 -1
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']);
}
/**
@@ -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
@@ -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"
+9 -9
View File
@@ -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"
@@ -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
@@ -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"
@@ -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 |
+3 -3
View File
@@ -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 |
@@ -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]);
+1 -1
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';
+1
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';
+14
View File
@@ -119,3 +119,17 @@ 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
format_help,core
+4 -2
View File
@@ -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'] = '<p>Error: database table prefix is too long ({$a->dbfamily})</p>
<p>The site administrator must fix this problem. Maximum length for table prefixes in {$a->dbfamily} is {$a->maxlength} characters.</p>';
// Deprecated since Moodle 4.4.
$string['cannotmarktopic'] = 'Could not mark that section for this course';
$string['unknownhelp'] = 'Unknown help section {$a}';
+22 -21
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,9 +630,8 @@ $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';
$string['edittitleinstructions'] = 'Escape to cancel, Enter when finished';
$string['editthisactivity'] = 'Edit this activity';
@@ -936,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 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';
$string['formathtml'] = 'HTML format';
$string['formatmarkdown'] = 'Markdown format';
$string['formatplain'] = 'Plain text format';
@@ -1045,7 +1038,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}';
@@ -1275,8 +1268,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:';
@@ -1981,6 +1972,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 +2084,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';
@@ -2106,7 +2098,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';
@@ -2193,7 +2184,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';
@@ -2283,9 +2273,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';
@@ -2409,9 +2396,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}';
@@ -2500,3 +2484,20 @@ $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';
$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.';
+2 -5
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')];
@@ -1234,8 +1234,6 @@ class edit_renderer extends \plugin_renderer_base {
'edittitleinstructions',
'emptydragdropregion',
'hide',
'markedthistopic',
'markthistopic',
'move',
'movecontent',
'moveleft',