Merge branch 'MDL-71610-master' of git://github.com/bmbrands/moodle

This commit is contained in:
Ilya Tregubov 2021-09-29 15:40:39 +02:00
commit 34a0ba3232
110 changed files with 769 additions and 265 deletions

View file

@ -346,7 +346,9 @@ function book_extend_settings_navigation(settings_navigation $settingsnav, navig
$url = new moodle_url('/mod/book/view.php', array('id'=>$params['id'], 'chapterid'=>$params['chapterid'], 'edit'=>$edit, 'sesskey'=>sesskey()));
$editnode = navigation_node::create($string, $url, navigation_node::TYPE_SETTING);
$booknode->add_node($editnode, $firstkey);
$PAGE->set_button($OUTPUT->single_button($url, $string));
if (!$PAGE->theme->haseditswitch) {
$PAGE->set_button($OUTPUT->single_button($url, $string));
}
}
$plugins = core_component::get_plugin_list('booktool');

View file

@ -73,7 +73,7 @@ Feature: In a book, create chapters and sub chapters
And "Delete chapter \"1. Dummy first chapter\"" "link" should exist in the "Table of contents" "block"
And "Hide chapter \"1. Dummy first chapter\"" "link" should exist in the "Table of contents" "block"
And "Add new chapter" "link" should exist in the "Table of contents" "block"
When I press "Turn editing off"
When I turn editing mode off
Then "Edit chapter \"1. Dummy first chapter\"" "link" should not exist in the "Table of contents" "block"
And "Delete chapter \"1. Dummy first chapter\"" "link" should not exist in the "Table of contents" "block"
And "Hide chapter \"1. Dummy first chapter\"" "link" should not exist in the "Table of contents" "block"

View file

@ -33,7 +33,7 @@ Feature: Edited book chapters handle tags correctly
Then I should see "Example" in the ".book-tags" "css_element"
And I should see "Chapter" in the ".book-tags" "css_element"
And I should see "Cool" in the ".book-tags" "css_element"
And I press "Turn editing on"
And I turn editing mode on
And I follow "Edit chapter \"1. Dummy first chapter\""
Then I should see "Example" in the ".form-autocomplete-selection" "css_element"
Then I should see "Chapter" in the ".form-autocomplete-selection" "css_element"
@ -42,6 +42,7 @@ Feature: Edited book chapters handle tags correctly
@javascript
Scenario: Book chapter edition of standard tags works as expected
Given I log in as "admin"
And I change window size to "large"
And I navigate to "Appearance > Manage tags" in site administration
And I follow "Default collection"
And I follow "Add standard tags"
@ -61,7 +62,7 @@ Feature: Edited book chapters handle tags correctly
Then I should see "OT1" in the ".book-tags" "css_element"
And I should see "OT3" in the ".book-tags" "css_element"
And I should not see "OT2" in the ".book-tags" "css_element"
And I press "Turn editing on"
And I turn editing mode on
And I follow "Edit chapter \"1. Dummy first chapter\""
And I should see "OT1" in the ".form-autocomplete-selection" "css_element"
And I should see "OT3" in the ".form-autocomplete-selection" "css_element"

View file

@ -17,7 +17,7 @@ Feature: Teachers can enable comments only if comments are enabled at site level
| teacher1 | C1 | editingteacher |
When I log in as "teacher1"
And I am on "Course 1" course homepage
And I press "Turn editing on"
And I turn editing mode on
And I press "Add an activity or resource"
And I click on "Add a new Database" "link" in the "Add an activity or resource" "dialogue"
And I expand all fieldsets

View file

@ -231,7 +231,7 @@
// The code will be much nicer than this eventually.
$title = $courseshortname.': ' . format_string($data->name);
if ($PAGE->user_allowed_editing()) {
if ($PAGE->user_allowed_editing() && !$PAGE->theme->haseditswitch) {
// Change URL parameter and block display string value depending on whether editing is enabled or not
if ($PAGE->user_is_editing()) {
$urlediting = 'off';

View file

@ -232,7 +232,7 @@ Feature: Mapping courses in a feedback
And I add the "Main menu" block
And I click on "Delete" "link" in the "Course feedback" activity
And I press "Yes"
And I follow "Turn editing off"
And I turn editing mode off
And I am on site homepage
Then "Feedback" "block" should not exist
And I am on "Course 1" course homepage

View file

@ -40,6 +40,7 @@ Feature: Edited forum posts handle tags correctly
@javascript
Scenario: Forum post edition of standard tags works as expected
Given I log in as "admin"
And I change window size to "large"
And I navigate to "Appearance > Manage tags" in site administration
And I follow "Default collection"
And I follow "Add standard tags"

View file

@ -117,7 +117,6 @@ Feature: I can grade a students interaction across a forum
And I set the field "Ratings > Grade to pass" to "4"
When I press "Save and return to course"
And I navigate to "View > Grader report" in the course gradebook
And I turn editing mode on
# There shouldn't be any Whole forum grade gradeitem.
Then I should see "Test Forum 1 rating"

View file

@ -41,6 +41,7 @@ Feature: Edited glossary entries handle tags correctly
Scenario: Glossary entry edition of standard tags works as expected
Given I log in as "admin"
And I change window size to "large"
And I navigate to "Appearance > Manage tags" in site administration
And I follow "Default collection"
And I follow "Add standard tags"

View file

@ -68,7 +68,7 @@ Feature: A teacher can choose whether glossary entries require approval
| Tags | Test |
And I log out
And I log in as "teacher1"
And I press "Customise this page"
And I turn editing mode on
And I add the "Navigation" block if not present
And I expand "Site pages" node
And I click on "Tags" "link" in the "Navigation" "block"

View file

@ -42,6 +42,7 @@ Feature: Edited wiki pages handle tags correctly
@javascript
Scenario: Wiki page edition of standard tags works as expected
Given I log in as "admin"
And I change window size to "large"
And I navigate to "Appearance > Manage tags" in site administration
And I follow "Default collection"
And I follow "Add standard tags"