diff --git a/admin/admin_settings_search_form.php b/admin/admin_settings_search_form.php new file mode 100644 index 00000000000..ad42300b853 --- /dev/null +++ b/admin/admin_settings_search_form.php @@ -0,0 +1,48 @@ +. + +/** + * Admin settings search form + * + * @package admin + * @copyright 2016 Damyon Wiese + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); + +require_once $CFG->libdir.'/formslib.php'; + +/** + * Admin settings search form + * + * @package admin + * @copyright 2016 Damyon Wiese + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ +class admin_settings_search_form extends moodleform { + function definition () { + $mform = $this->_form; + + //$mform->addElement('header', 'settingsheader', get_string('search', 'admin')); + $elements = []; + $elements[] = $mform->createElement('text', 'query', get_string('query', 'admin')); + $elements[] = $mform->createElement('submit', 'search', get_string('search')); + $mform->addGroup($elements); + $mform->setType('query', PARAM_RAW); + $mform->setDefault('query', optional_param('query', '', PARAM_RAW)); + } +} diff --git a/admin/search.php b/admin/search.php index 6c255c6d336..0e9a531944e 100644 --- a/admin/search.php +++ b/admin/search.php @@ -36,6 +36,8 @@ if ($data = data_submitted() and confirm_sesskey()) { // to modify them echo $OUTPUT->header($focus); +echo $OUTPUT->heading(get_string('administrationsite')); + if ($errormsg !== '') { echo $OUTPUT->notification($errormsg); @@ -43,6 +45,18 @@ if ($errormsg !== '') { echo $OUTPUT->notification($statusmsg, 'notifysuccess'); } -echo admin_search_settings_html($query); +require_once("admin_settings_search_form.php"); +$form = new admin_settings_search_form(); +$form->display(); +echo '
'; + +if ($query) { + echo admin_search_settings_html($query); +} else { + $node = $PAGE->settingsnav->find('root', navigation_node::TYPE_SITE_ADMIN); + if ($node) { + echo $OUTPUT->render_from_template('core/settings_link_page', ['node' => $node]); + } +} echo $OUTPUT->footer(); diff --git a/admin/settings/appearance.php b/admin/settings/appearance.php index f2047d8aa3d..7ee3f7004c3 100644 --- a/admin/settings/appearance.php +++ b/admin/settings/appearance.php @@ -172,7 +172,6 @@ preferences,moodle|/user/preferences.php|preferences', $temp->add(new admin_setting_configcheckbox('navshowcategories', new lang_string('navshowcategories', 'admin'), new lang_string('confignavshowcategories', 'admin'), 1)); $temp->add(new admin_setting_configcheckbox('navshowmycoursecategories', new lang_string('navshowmycoursecategories', 'admin'), new lang_string('navshowmycoursecategories_help', 'admin'), 0)); $temp->add(new admin_setting_configcheckbox('navshowallcourses', new lang_string('navshowallcourses', 'admin'), new lang_string('confignavshowallcourses', 'admin'), 0)); - $temp->add(new admin_setting_configcheckbox('navexpandmycourses', new lang_string('navexpandmycourses', 'admin'), new lang_string('navexpandmycourses_desc', 'admin'), 1)); $sortoptions = array( 'sortorder' => new lang_string('sort_sortorder', 'admin'), 'fullname' => new lang_string('sort_fullname', 'admin'), diff --git a/admin/settings/top.php b/admin/settings/top.php index 223af0cfc59..59a6102e9ae 100644 --- a/admin/settings/top.php +++ b/admin/settings/top.php @@ -47,4 +47,4 @@ $ADMIN->add('root', new admin_category('development', new lang_string('developme $ADMIN->add('root', new admin_category('unsupported', new lang_string('unsupported', 'admin'), true)); // hidden search script -$ADMIN->add('root', new admin_externalpage('search', new lang_string('searchresults'), "$CFG->wwwroot/$CFG->admin/search.php", 'moodle/site:config', true)); +$ADMIN->add('root', new admin_externalpage('search', new lang_string('search', 'admin'), "$CFG->wwwroot/$CFG->admin/search.php", 'moodle/site:config', true)); diff --git a/admin/tool/behat/tests/behat/data_generators.feature b/admin/tool/behat/tests/behat/data_generators.feature index cac5f633456..6b6d5ed2140 100644 --- a/admin/tool/behat/tests/behat/data_generators.feature +++ b/admin/tool/behat/tests/behat/data_generators.feature @@ -325,7 +325,7 @@ Feature: Set up contextual data for tests And I am on site homepage And I follow "Courses" And I follow "Course 1" - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" Then I should see "Grade category 1" And I should see "Grade sub category 2" @@ -349,7 +349,7 @@ Feature: Set up contextual data for tests When I log in as "admin" And I am on site homepage And I follow "Course 1" - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" And I expand "Setup" node And I follow "Gradebook setup" Then I should see "Test Grade Item 1" @@ -380,7 +380,7 @@ Feature: Set up contextual data for tests When I log in as "admin" And I am on site homepage And I follow "Course 1" - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" And I follow "Scales" Then I should see "Test Scale 1" And I should see "Disappointing, Good, Very good, Excellent" @@ -432,7 +432,7 @@ Feature: Set up contextual data for tests When I log in as "admin" And I am on site homepage And I follow "Course 1" - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" And I expand "Setup" node And I follow "Gradebook setup" Then I should see "Test Outcome Grade Item 1" diff --git a/admin/tool/behat/tests/behat/edit_permissions.feature b/admin/tool/behat/tests/behat/edit_permissions.feature index 29f798193a7..b07c1218bcb 100644 --- a/admin/tool/behat/tests/behat/edit_permissions.feature +++ b/admin/tool/behat/tests/behat/edit_permissions.feature @@ -52,13 +52,13 @@ Feature: Edit capabilities | Forum name | I'm the name | | Description | I'm the introduction | And I follow "I'm the name" - And I follow "Permissions" + And I navigate to "Permissions" node in "Forum administration" And I override the system permissions of "Student" role with: | mod/forum:deleteanypost | Prohibit | | mod/forum:editanypost | Prevent | | mod/forum:addquestion | Allow | When I set the field "Advanced role override" to "Student (3)" - And I press "Go" + And I click on "Go" "button" in the "region-main" "region" Then "mod/forum:deleteanypost" capability has "Prohibit" permission And "mod/forum:editanypost" capability has "Prevent" permission And "mod/forum:addquestion" capability has "Allow" permission diff --git a/admin/tool/behat/tests/behat/get_and_set_fields.feature b/admin/tool/behat/tests/behat/get_and_set_fields.feature index ca4f2a1a15d..9edf445d769 100644 --- a/admin/tool/behat/tests/behat/get_and_set_fields.feature +++ b/admin/tool/behat/tests/behat/get_and_set_fields.feature @@ -37,7 +37,7 @@ Feature: Verify that all form fields values can be get and set And I expand "Appearance" node And I am on site homepage And I follow "Course 1" - And I follow "Reset" + And I navigate to "Reset" node in "Course administration" # Select (multi-select) - Checking "the select box should contain". And I expand all fieldsets And the "Unenrol users" select box should contain "No roles" diff --git a/admin/tool/behat/tests/behat/manipulate_forms.feature b/admin/tool/behat/tests/behat/manipulate_forms.feature index 126a800f6bb..b2524fb6297 100644 --- a/admin/tool/behat/tests/behat/manipulate_forms.feature +++ b/admin/tool/behat/tests/behat/manipulate_forms.feature @@ -8,7 +8,7 @@ Feature: Forms manipulation Scenario: Basic forms manipulation Given I log in as "admin" And I follow "Preferences" in the user menu - And I follow "Edit profile" + And I click on "Edit profile" "link" in the "region-main" "region" When I set the field "First name" to "Field value" And I set the field "Select a country" to "Japan" And I set the field "Unmask" to "1" diff --git a/admin/tool/behat/tests/behat/nasty_strings.feature b/admin/tool/behat/tests/behat/nasty_strings.feature index f8d847d5245..1c547653d33 100644 --- a/admin/tool/behat/tests/behat/nasty_strings.feature +++ b/admin/tool/behat/tests/behat/nasty_strings.feature @@ -11,14 +11,14 @@ Feature: Transform steps arguments | Course 1 | C1 | 0 | And I log in as "admin" And I follow "Preferences" in the user menu - And I follow "Edit profile" + And I click on "Edit profile" "link" in the "region-main" "region" Scenario: Use nasty strings on steps arguments When I set the field "Surname" to "$NASTYSTRING1" And I set the field "Description" to "$NASTYSTRING2" And I set the field "City/town" to "$NASTYSTRING3" And I press "Update profile" - And I follow "Edit profile" + And I click on "Edit profile" "link" in the "region-main" "region" Then I should not see "NASTYSTRING" And the field "Surname" matches value "$NASTYSTRING1" And the field "City/town" matches value "$NASTYSTRING3" @@ -29,7 +29,7 @@ Feature: Transform steps arguments | Description | $NASTYSTRING2 | | City/town | $NASTYSTRING3 | And I press "Update profile" - And I follow "Edit profile" + And I click on "Edit profile" "link" in the "region-main" "region" Then I should not see "NASTYSTRING" # BEHAT Transformation regression - See MDL-56397 #And the field "Surname" matches value "$NASTYSTRING1" @@ -41,7 +41,7 @@ Feature: Transform steps arguments | Description | va\"lue2 | And I set the field "City/town" to "va\"lue3" And I press "Update profile" - And I follow "Edit profile" + And I click on "Edit profile" "link" in the "region-main" "region" Then I should not see "NASTYSTRING" And the field "First name" matches value "va\"lue1" And the field "Description" matches value "va\\"lue2" @@ -52,7 +52,7 @@ Feature: Transform steps arguments And I set the following fields to these values: | Surname | My Surname $NASTYSTRING2 | And I press "Update profile" - And I follow "Edit profile" + And I click on "Edit profile" "link" in the "region-main" "region" Then I should not see "NASTYSTRING" And I should see "My Firstname" And I should see "My Surname" diff --git a/admin/tool/lp/lib.php b/admin/tool/lp/lib.php index 62b6892b6fc..7f1ba9cfc0e 100644 --- a/admin/tool/lp/lib.php +++ b/admin/tool/lp/lib.php @@ -24,40 +24,6 @@ defined('MOODLE_INTERNAL') || die(); -/** - * This function extends the course navigation - * - * @param navigation_node $navigation The navigation node to extend - * @param stdClass $course The course to object for the tool - * @param context $coursecontext The context of the course - */ -function tool_lp_extend_navigation_course($navigation, $course, $coursecontext) { - if (!get_config('core_competency', 'enabled')) { - return; - } - - // Check access to the course and competencies page. - $capabilities = array('moodle/competency:coursecompetencyview', 'moodle/competency:coursecompetencymanage'); - $context = context_course::instance($course->id); - if (!has_any_capability($capabilities, $context) || !can_access_course($course)) { - return; - } - - // Just a link to course competency. - $title = get_string('competencies', 'core_competency'); - $path = new moodle_url("/admin/tool/lp/coursecompetencies.php", array('courseid' => $course->id)); - $settingsnode = navigation_node::create($title, - $path, - navigation_node::TYPE_SETTING, - null, - null, - new pix_icon('i/competencies', '')); - if (isset($settingsnode)) { - $navigation->add_node($settingsnode); - } -} - - /** * This function extends the user navigation. * diff --git a/admin/tool/lp/tests/behat/user_evidence_comp_link.feature b/admin/tool/lp/tests/behat/user_evidence_comp_link.feature index 4ebd5c920ab..779ece3bfce 100644 --- a/admin/tool/lp/tests/behat/user_evidence_comp_link.feature +++ b/admin/tool/lp/tests/behat/user_evidence_comp_link.feature @@ -41,6 +41,7 @@ Feature: Manage competencies linked to evidence of prior learning Scenario: Link competency to evidence of prior learning from list Given I follow "Evidence of prior learning" + And I change window size to "large" And I should see "List of evidence" And I should see "Test-Evidence" And I click on "Link" of edit menu in the "Test-Evidence" row diff --git a/admin/tool/monitor/tests/behat/subscription.feature b/admin/tool/monitor/tests/behat/subscription.feature index bcf2ff664bb..4b29277d428 100644 --- a/admin/tool/monitor/tests/behat/subscription.feature +++ b/admin/tool/monitor/tests/behat/subscription.feature @@ -147,7 +147,7 @@ Feature: tool_monitor_subscriptions When I follow "Event monitoring" And I set the field "Select a course" to "Course 1" Then I should see "You can manage rules from the Event monitoring rules page." - And I follow "Event monitoring rules" + And I click on "Event monitoring rules" "link" in the "region-main" "region" And I should see "You can subscribe to rules from the Event monitoring page." And I log out And I log in as "teacher1" @@ -155,7 +155,7 @@ Feature: tool_monitor_subscriptions And I follow "Event monitoring" And I set the field "Select a course" to "Course 1" And I should see "You can manage rules from the Event monitoring rules page." - And I follow "Event monitoring rules" + And I click on "Event monitoring rules" "link" in the "region-main" "region" And I should see "You can subscribe to rules from the Event monitoring page." And I click on "//a[text()='Event monitoring']" "xpath_element" And the field "courseid" matches value "Course 1" diff --git a/admin/tool/recyclebin/tests/behat/backup_user_data.feature b/admin/tool/recyclebin/tests/behat/backup_user_data.feature index 7c20c3eebd5..500a2730b2f 100644 --- a/admin/tool/recyclebin/tests/behat/backup_user_data.feature +++ b/admin/tool/recyclebin/tests/behat/backup_user_data.feature @@ -58,12 +58,12 @@ Feature: Backup user data And I follow "Course 1" And I turn editing mode on And I delete "Quiz 1" activity - And I follow "Recycle bin" + And I navigate to "Recycle bin" node in "Course administration" And I should see "Quiz 1" - And I follow "Restore" + And I click on "Restore" "link" in the "region-main" "region" And I log out And I log in as "student1" And I follow "Course 1" - When I navigate to "Grades" node in "Course administration" + When I click on "Grades" "link" in the "Navigation" "block" Then "Quiz 1" row "Grade" column of "user-grade" table should contain "5" And "Quiz 1" row "Percentage" column of "user-grade" table should contain "50" diff --git a/admin/tool/recyclebin/tests/behat/basic_functionality.feature b/admin/tool/recyclebin/tests/behat/basic_functionality.feature index 85e5d57882d..ded5e99f349 100644 --- a/admin/tool/recyclebin/tests/behat/basic_functionality.feature +++ b/admin/tool/recyclebin/tests/behat/basic_functionality.feature @@ -31,10 +31,10 @@ Feature: Basic recycle bin functionality | Assignment name | Test assign | | Description | Test | And I delete "Test assign" activity - When I follow "Recycle bin" + When I navigate to "Recycle bin" node in "Course administration" Then I should see "Test assign" And I should see "Contents will be permanently deleted after 7 days" - And I follow "Restore" + And I click on "Restore" "link" in the "region-main" "region" And I should see "'Test assign' has been restored" And I wait to be redirected And I am on homepage @@ -51,10 +51,10 @@ Feature: Basic recycle bin functionality And I press "Continue" And I go to the courses management page And I should not see "Course 2" in the "#course-listing" "css_element" - When I follow "Recycle bin" + When I navigate to "Recycle bin" node in "Category: Miscellaneous" Then I should see "Course 2" And I should see "Contents will be permanently deleted after 14 days" - And I follow "Restore" + And I click on "Restore" "link" in the "region-main" "region" And I should see "'Course 2' has been restored" And I wait to be redirected And I go to the courses management page @@ -69,7 +69,7 @@ Feature: Basic recycle bin functionality | Assignment name | Test assign | | Description | Test | And I delete "Test assign" activity - And I follow "Recycle bin" + And I navigate to "Recycle bin" node in "Course administration" When I click on "Delete" "link" Then I should see "Are you sure you want to delete the selected item from the recycle bin?" And I press "Cancel" @@ -92,7 +92,7 @@ Feature: Basic recycle bin functionality | Description | Test 2 | And I delete "Test assign 1" activity And I delete "Test assign 2" activity - And I follow "Recycle bin" + And I navigate to "Recycle bin" node in "Course administration" And I should see "Test assign 1" And I should see "Test assign 2" When I click on "Delete all" "link" diff --git a/backup/util/ui/tests/behat/restore_moodle2_courses.feature b/backup/util/ui/tests/behat/restore_moodle2_courses.feature index 5aad4a3758a..1fa38f17d1f 100644 --- a/backup/util/ui/tests/behat/restore_moodle2_courses.feature +++ b/backup/util/ui/tests/behat/restore_moodle2_courses.feature @@ -67,7 +67,7 @@ Feature: Restore Moodle 2 course backups And I add a "Forum" to section "1" and I fill the form with: | Forum name | Test forum post backup name | | Description | Test forum post backup description | - And I follow "Restore" + And I navigate to "Restore" node in "Course administration" And I merge "test_backup.mbz" backup into the current course after deleting it's contents using this options: | Schema | Section 3 | 0 | Then I should see "Course 1" @@ -91,6 +91,7 @@ Feature: Restore Moodle 2 course backups | id_startdate_month | January | | id_startdate_year | 2020 | | id_format | Weekly format | + | 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" diff --git a/badges/tests/behat/award_badge.feature b/badges/tests/behat/award_badge.feature index bd0a070a1e1..92cc5ad6b8e 100644 --- a/badges/tests/behat/award_badge.feature +++ b/badges/tests/behat/award_badge.feature @@ -32,7 +32,7 @@ Feature: Award badges And I press "Continue" And I click on "Admin User" "link" And I choose "Profile" in the open action menu - And I follow "Edit profile" + And I click on "Edit profile" "link" in the "region-main" "region" And I expand all fieldsets And I set the field "Phone" to "123456789" And I press "Update profile" @@ -113,7 +113,7 @@ Feature: Award badges And I log out And I log in as "student1" And I follow "Profile" in the user menu - And I follow "Course 1" + And I click on "Course 1" "link" in the "region-main" "region" And I should see "Course Badge" @javascript @@ -131,7 +131,7 @@ Feature: Award badges | student1 | C1 | student | And I log in as "teacher1" And I follow "Course 1" - And I follow "Edit settings" + And I navigate to "Edit settings" node in "Course administration" And I set the following fields to these values: | Enable completion tracking | Yes | And I press "Save and display" @@ -156,13 +156,13 @@ Feature: Award badges And I log out And I log in as "student1" And I follow "Profile" in the user menu - And I follow "Course 1" + And I click on "Course 1" "link" in the "region-main" "region" Then I should not see "badges" And I am on homepage And I follow "Course 1" And I press "Mark as complete: Test assignment name" And I follow "Profile" in the user menu - And I follow "Course 1" + And I click on "Course 1" "link" in the "region-main" "region" Then I should see "Course Badge" @javascript @@ -180,7 +180,7 @@ Feature: Award badges | student1 | C1 | student | And I log in as "teacher1" And I follow "Course 1" - And I follow "Edit settings" + And I navigate to "Edit settings" node in "Course administration" And I set the following fields to these values: | Enable completion tracking | Yes | And I press "Save and display" @@ -189,7 +189,7 @@ Feature: Award badges | Assignment name | Test assignment name | | Description | Submit your online text | | assignsubmission_onlinetext_enabled | 1 | - And I follow "Course completion" + And I navigate to "Course completion" node in "Course administration" And I set the field "id_overall_aggregation" to "2" And I click on "Condition: Activity completion" "link" And I set the field "Assignment - Test assignment name" to "1" @@ -211,7 +211,7 @@ Feature: Award badges And I log out And I log in as "student1" And I follow "Profile" in the user menu - And I follow "Course 1" + And I click on "Course 1" "link" in the "region-main" "region" Then I should not see "badges" And I am on homepage And I follow "Course 1" @@ -300,14 +300,14 @@ Feature: Award badges # Student 1 should have just course badge 1. And I log in as "student1" And I follow "Profile" in the user menu - When I follow "Course 1" + When I click on "Course 1" "link" in the "region-main" "region" Then I should see "Course Badge 1" And I should not see "Course Badge 2" And I log out # Student 2 should have just course badge 2. And I log in as "student2" And I follow "Profile" in the user menu - When I follow "Course 1" + When I click on "Course 1" "link" in the "region-main" "region" Then I should see "Course Badge 2" Then I should not see "Course Badge 1" diff --git a/blocks/activity_results/tests/behat/addblockinactivity.feature b/blocks/activity_results/tests/behat/addblockinactivity.feature index 1f444c88533..2c62fb7e157 100644 --- a/blocks/activity_results/tests/behat/addblockinactivity.feature +++ b/blocks/activity_results/tests/behat/addblockinactivity.feature @@ -50,7 +50,7 @@ Feature: The activity results block displays student scores And I press "Save and return to course" And I follow "Course 1" And I should see "Test page name" - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" And I turn editing mode on And I give the grade "90.00" to the user "Student 1" for the grade item "Test assignment 1" And I give the grade "80.00" to the user "Student 2" for the grade item "Test assignment 1" diff --git a/blocks/activity_results/tests/behat/highscoreswithoutgroups.feature b/blocks/activity_results/tests/behat/highscoreswithoutgroups.feature index b74485122f4..6797129ef92 100644 --- a/blocks/activity_results/tests/behat/highscoreswithoutgroups.feature +++ b/blocks/activity_results/tests/behat/highscoreswithoutgroups.feature @@ -32,7 +32,7 @@ Feature: The activity results block displays student scores | Description | Offline text | | assignsubmission_file_enabled | 0 | And I follow "Course 1" - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" And I turn editing mode on And I give the grade "90.00" to the user "Student 1" for the grade item "Test assignment" And I give the grade "80.00" to the user "Student 2" for the grade item "Test assignment" @@ -167,4 +167,4 @@ Feature: The activity results block displays student scores Then I should see "User" in the "Activity results" "block" And I should see "90.00%" in the "Activity results" "block" And I should see "80.00%" in the "Activity results" "block" - And I should see "70.00%" in the "Activity results" "block" \ No newline at end of file + And I should see "70.00%" in the "Activity results" "block" diff --git a/blocks/activity_results/tests/behat/highscoreswithscales.feature b/blocks/activity_results/tests/behat/highscoreswithscales.feature index b5e52f875a1..44ea70b66f0 100644 --- a/blocks/activity_results/tests/behat/highscoreswithscales.feature +++ b/blocks/activity_results/tests/behat/highscoreswithscales.feature @@ -26,7 +26,7 @@ Feature: The activity results block displays student scores as scales | student5 | C1 | student | And I log in as "teacher1" And I follow "Course 1" - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" And I navigate to "Scales" node in "Grade administration" And I press "Add a new scale" And I set the following fields to these values: @@ -42,7 +42,7 @@ Feature: The activity results block displays student scores as scales | id_grade_modgrade_type | Scale | | id_grade_modgrade_scale | My Scale | And I follow "Course 1" - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" And I turn editing mode on And I give the grade "Excellent!" to the user "Student 1" for the grade item "Test assignment" And I give the grade "Very good" to the user "Student 2" for the grade item "Test assignment" diff --git a/blocks/activity_results/tests/behat/highscoreswithscalesandgroups.feature b/blocks/activity_results/tests/behat/highscoreswithscalesandgroups.feature index d546fda0c5c..1f23958615b 100644 --- a/blocks/activity_results/tests/behat/highscoreswithscalesandgroups.feature +++ b/blocks/activity_results/tests/behat/highscoreswithscalesandgroups.feature @@ -43,7 +43,7 @@ Feature: The activity results block displays student scores as scales | student6 | G3 | And I log in as "teacher1" And I follow "Course 1" - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" And I navigate to "Scales" node in "Grade administration" And I press "Add a new scale" And I set the following fields to these values: @@ -60,7 +60,7 @@ Feature: The activity results block displays student scores as scales | id_grade_modgrade_scale | My Scale | | Group mode | Separate groups | And I follow "Course 1" - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" And I turn editing mode on And I give the grade "Excellent!" to the user "Student 1" for the grade item "Test assignment" And I give the grade "Very good" to the user "Student 2" for the grade item "Test assignment" diff --git a/blocks/activity_results/tests/behat/highscoreswithseperategroups.feature b/blocks/activity_results/tests/behat/highscoreswithseperategroups.feature index 27807f80d4b..5e7632624ac 100644 --- a/blocks/activity_results/tests/behat/highscoreswithseperategroups.feature +++ b/blocks/activity_results/tests/behat/highscoreswithseperategroups.feature @@ -50,7 +50,7 @@ Feature: The activity results block displays student scores | assignsubmission_file_enabled | 0 | | Group mode | Separate groups | And I follow "Course 1" - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" And I turn editing mode on And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment" And I give the grade "90.00" to the user "Student 2" for the grade item "Test assignment" @@ -225,4 +225,4 @@ Feature: The activity results block displays student scores And I follow "Course 1" And I should see "User" in the "Activity results" "block" And I should see "100.00%" in the "Activity results" "block" - And I should see "90.00%" in the "Activity results" "block" \ No newline at end of file + And I should see "90.00%" in the "Activity results" "block" diff --git a/blocks/activity_results/tests/behat/highscoreswithvisiblegroups.feature b/blocks/activity_results/tests/behat/highscoreswithvisiblegroups.feature index f5fd1bd6f00..1d4d8d4e55d 100644 --- a/blocks/activity_results/tests/behat/highscoreswithvisiblegroups.feature +++ b/blocks/activity_results/tests/behat/highscoreswithvisiblegroups.feature @@ -50,7 +50,7 @@ Feature: The activity results block displays student scores | assignsubmission_file_enabled | 0 | | Group mode | Visible groups | And I follow "Course 1" - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" And I turn editing mode on And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment" And I give the grade "90.00" to the user "Student 2" for the grade item "Test assignment" @@ -202,4 +202,4 @@ Feature: The activity results block displays student scores And I should see "Group" in the "Activity results" "block" And I should see "95.00%" in the "Activity results" "block" And I should see "85.00%" in the "Activity results" "block" - And I should see "75.00%" in the "Activity results" "block" \ No newline at end of file + And I should see "75.00%" in the "Activity results" "block" diff --git a/blocks/activity_results/tests/behat/lowscoreswithoutgroups.feature b/blocks/activity_results/tests/behat/lowscoreswithoutgroups.feature index c20061ffd37..92900957567 100644 --- a/blocks/activity_results/tests/behat/lowscoreswithoutgroups.feature +++ b/blocks/activity_results/tests/behat/lowscoreswithoutgroups.feature @@ -32,7 +32,7 @@ Feature: The activity results block displays student scores | Description | Offline text | | assignsubmission_file_enabled | 0 | And I follow "Course 1" - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" And I turn editing mode on And I give the grade "90.00" to the user "Student 1" for the grade item "Test assignment" And I give the grade "80.00" to the user "Student 2" for the grade item "Test assignment" @@ -156,4 +156,4 @@ Feature: The activity results block displays student scores Then I should see "User" in the "Activity results" "block" And I should see "50.00%" in the "Activity results" "block" And I should see "60.00%" in the "Activity results" "block" - And I should see "70.00%" in the "Activity results" "block" \ No newline at end of file + And I should see "70.00%" in the "Activity results" "block" diff --git a/blocks/activity_results/tests/behat/lowscoreswithscales.feature b/blocks/activity_results/tests/behat/lowscoreswithscales.feature index 00f31f6b48b..52c97bda22b 100644 --- a/blocks/activity_results/tests/behat/lowscoreswithscales.feature +++ b/blocks/activity_results/tests/behat/lowscoreswithscales.feature @@ -26,7 +26,7 @@ Feature: The activity results block displays student scores as scales | student5 | C1 | student | And I log in as "teacher1" And I follow "Course 1" - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" And I navigate to "Scales" node in "Grade administration" And I press "Add a new scale" And I set the following fields to these values: @@ -42,7 +42,7 @@ Feature: The activity results block displays student scores as scales | id_grade_modgrade_type | Scale | | id_grade_modgrade_scale | My Scale | And I follow "Course 1" - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" And I turn editing mode on And I give the grade "Excellent!" to the user "Student 1" for the grade item "Test assignment" And I give the grade "Very good" to the user "Student 2" for the grade item "Test assignment" diff --git a/blocks/activity_results/tests/behat/lowscoreswithscalesandgroups.feature b/blocks/activity_results/tests/behat/lowscoreswithscalesandgroups.feature index be5ae335e79..b16a3394566 100644 --- a/blocks/activity_results/tests/behat/lowscoreswithscalesandgroups.feature +++ b/blocks/activity_results/tests/behat/lowscoreswithscalesandgroups.feature @@ -43,7 +43,7 @@ Feature: The activity results block displays student scores as scales | student6 | G3 | And I log in as "teacher1" And I follow "Course 1" - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" And I navigate to "Scales" node in "Grade administration" And I press "Add a new scale" And I set the following fields to these values: @@ -60,7 +60,7 @@ Feature: The activity results block displays student scores as scales | id_grade_modgrade_scale | My Scale | | Group mode | Separate groups | And I follow "Course 1" - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" And I turn editing mode on And I give the grade "Excellent!" to the user "Student 1" for the grade item "Test assignment" And I give the grade "Very good" to the user "Student 2" for the grade item "Test assignment" diff --git a/blocks/activity_results/tests/behat/lowscoreswithseperategroups.feature b/blocks/activity_results/tests/behat/lowscoreswithseperategroups.feature index b5e0546b2c7..47c5f564f94 100644 --- a/blocks/activity_results/tests/behat/lowscoreswithseperategroups.feature +++ b/blocks/activity_results/tests/behat/lowscoreswithseperategroups.feature @@ -50,7 +50,7 @@ Feature: The activity results block displays student scores | assignsubmission_file_enabled | 0 | | Group mode | Separate groups | And I follow "Course 1" - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" And I turn editing mode on And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment" And I give the grade "90.00" to the user "Student 2" for the grade item "Test assignment" @@ -217,4 +217,4 @@ Feature: The activity results block displays student scores And I follow "Course 1" And I should see "User" in the "Activity results" "block" And I should see "100.00%" in the "Activity results" "block" - And I should see "90.00%" in the "Activity results" "block" \ No newline at end of file + And I should see "90.00%" in the "Activity results" "block" diff --git a/blocks/activity_results/tests/behat/lowscoreswithvisiblegroups.feature b/blocks/activity_results/tests/behat/lowscoreswithvisiblegroups.feature index 7049958399c..0d0f2246d4d 100644 --- a/blocks/activity_results/tests/behat/lowscoreswithvisiblegroups.feature +++ b/blocks/activity_results/tests/behat/lowscoreswithvisiblegroups.feature @@ -50,7 +50,7 @@ Feature: The activity results block displays student scores | assignsubmission_file_enabled | 0 | | Group mode | Visible groups | And I follow "Course 1" - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" And I turn editing mode on And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment" And I give the grade "90.00" to the user "Student 2" for the grade item "Test assignment" @@ -198,4 +198,4 @@ Feature: The activity results block displays student scores And I follow "Course 1" And I should see "Group" in the "Activity results" "block" And I should see "85.00%" in the "Activity results" "block" - And I should see "75.00%" in the "Activity results" "block" \ No newline at end of file + And I should see "75.00%" in the "Activity results" "block" diff --git a/blocks/blog_menu/tests/behat/block_blog_menu_activity.feature b/blocks/blog_menu/tests/behat/block_blog_menu_activity.feature index 7bfb0635840..6b8001f6c09 100644 --- a/blocks/blog_menu/tests/behat/block_blog_menu_activity.feature +++ b/blocks/blog_menu/tests/behat/block_blog_menu_activity.feature @@ -219,4 +219,4 @@ Feature: Enable Block blog menu in an activity And I press "Search" Then I should see "S1 First Blog" And I should see "S2 First Blog" - And I should not see "S2 Second Blog" \ No newline at end of file + And I should not see "S2 Second Blog" diff --git a/blocks/blog_tags/tests/behat/blogtag.feature b/blocks/blog_tags/tests/behat/blogtag.feature index d840c38eccc..597cbe781d6 100644 --- a/blocks/blog_tags/tests/behat/blogtag.feature +++ b/blocks/blog_tags/tests/behat/blogtag.feature @@ -25,7 +25,7 @@ Feature: Adding blog tag block And I turn editing mode on And I add the "Blog tags" block - And I navigate to "Course blogs" node in "Current course > c1 > Participants" + And I navigate to "Course blogs" node in "My courses > c1 > Participants" And I follow "Blog about this Course" And I set the following fields to these values: | Entry title | Blog post from teacher | @@ -35,7 +35,7 @@ Feature: Adding blog tag block And I log out And I log in as "student1" And I follow "Course 1" - And I navigate to "Course blogs" node in "Current course > c1 > Participants" + And I navigate to "Course blogs" node in "My courses > c1 > Participants" And I follow "Blog about this Course" And I set the following fields to these values: | Entry title | Blog post from student | diff --git a/blocks/calendar_month/tests/behat/block_calendar_month_frontpage.feature b/blocks/calendar_month/tests/behat/block_calendar_month_frontpage.feature index ae09aa8e27a..b7ef68e40e6 100644 --- a/blocks/calendar_month/tests/behat/block_calendar_month_frontpage.feature +++ b/blocks/calendar_month/tests/behat/block_calendar_month_frontpage.feature @@ -11,6 +11,8 @@ Feature: Enable the calendar block on the site front page | student1 | Student | 1 | student1@example.com | S1 | And I log in as "admin" And I am on site homepage + And I turn editing mode on + And I add the "Calendar" block And I create a calendar event with form data: | id_eventtype | Site | | id_name | Site Event | diff --git a/blocks/course_list/tests/behat/block_course_list_category.feature b/blocks/course_list/tests/behat/block_course_list_category.feature index 4f3fa502ed4..c4273008f28 100644 --- a/blocks/course_list/tests/behat/block_course_list_category.feature +++ b/blocks/course_list/tests/behat/block_course_list_category.feature @@ -28,13 +28,13 @@ Feature: Enable the course_list block on a category page and view it's contents Scenario: Add the course list block on category page and navigate to the course listing Given I log in as "admin" And I am on site homepage - And I navigate to "Turn editing on" node in "Front page settings" - And I follow "Course 1" + And I turn editing mode on + And I am on course index And I follow "Miscellaneous" And I add the "Courses" block And I log out When I log in as "teacher1" - And I follow "Course 1" + And I am on course index And I follow "Miscellaneous" Then I should see "Course 1" in the "My courses" "block" And I should see "Course 2" in the "My courses" "block" @@ -46,13 +46,13 @@ Feature: Enable the course_list block on a category page and view it's contents Scenario: Add the course list block on category page and navigate to another course Given I log in as "admin" And I am on site homepage - And I navigate to "Turn editing on" node in "Front page settings" - And I follow "Course 1" + And I turn editing mode on + And I am on course index And I follow "Miscellaneous" And I add the "Courses" block And I log out When I log in as "teacher1" - And I follow "Course 1" + And I am on course index And I follow "Miscellaneous" Then I should see "Course 1" in the "My courses" "block" And I should see "Course 2" in the "My courses" "block" @@ -64,8 +64,8 @@ Feature: Enable the course_list block on a category page and view it's contents Scenario: Add the course list block on category page and view as an admin Given I log in as "admin" And I am on site homepage - And I navigate to "Turn editing on" node in "Front page settings" - And I follow "Course 1" + And I turn editing mode on + And I am on course index And I follow "Miscellaneous" When I add the "Courses" block Then I should see "Miscellaneous" in the "Course categories" "block" diff --git a/blocks/course_summary/tests/behat/block_course_summary_frontpage.feature b/blocks/course_summary/tests/behat/block_course_summary_frontpage.feature index e8980b0ad5c..6299f59b4ef 100644 --- a/blocks/course_summary/tests/behat/block_course_summary_frontpage.feature +++ b/blocks/course_summary/tests/behat/block_course_summary_frontpage.feature @@ -7,6 +7,8 @@ Feature: Course summary block used on the frontpage Background: Given I log in as "admin" And I am on site homepage + And I turn editing mode on + And I add the "Course/site summary" block And I navigate to "Edit settings" node in "Front page settings" And I set the following fields to these values: | summary | Proved the summary block works! | diff --git a/blocks/navigation/tests/behat/expand_my_courses_setting.feature b/blocks/navigation/tests/behat/expand_my_courses_setting.feature deleted file mode 100644 index bfba988db66..00000000000 --- a/blocks/navigation/tests/behat/expand_my_courses_setting.feature +++ /dev/null @@ -1,56 +0,0 @@ -@block @block_navigation -Feature: Test expand my courses navigation setting - As a student - I visit my My Moodle page and observe the the My Courses branch - - Background: - Given the following "users" exist: - | username | firstname | lastname | email | - | student1 | Student | 1 | student1@example.com | - And the following "categories" exist: - | name | category | idnumber | - | cat1 | 0 | cat1 | - And the following "courses" exist: - | fullname | shortname | category | - | Course1 | c1 | cat1 | - | Course2 | c2 | cat1 | - | Course3 | c3 | cat1 | - And the following "course enrolments" exist: - | user | course | role | - | student1 | c1 | student | - | student1 | c2 | student | - - Scenario: The My Courses branch is expanded on the My Moodle page by default - When I log in as "student1" - And I click on "Dashboard" "link" in the "Navigation" "block" - Then I should see "c1" in the "Navigation" "block" - And I should see "c2" in the "Navigation" "block" - And I should not see "c3" in the "Navigation" "block" - - @javascript - Scenario: The My Courses branch is collapsed when expand my courses is off - Given I log in as "admin" - And I set the following administration settings values: - | Show My courses expanded on Dashboard | 0 | - And I log out - When I log in as "student1" - And I click on "Dashboard" "link" in the "Navigation" "block" - Then I should not see "c1" in the "Navigation" "block" - And I should not see "c2" in the "Navigation" "block" - And I should not see "c3" in the "Navigation" "block" - - @javascript - Scenario: My Courses can be expanded on the My Moodle page when expand my courses is off - Given I log in as "admin" - And I set the following administration settings values: - | Show My courses expanded on Dashboard | 0 | - And I log out - When I log in as "student1" - And I click on "Dashboard" "link" in the "Navigation" "block" - And I should not see "c1" in the "Navigation" "block" - And I should not see "c2" in the "Navigation" "block" - And I should not see "c3" in the "Navigation" "block" - And I expand "My courses" node - Then I should see "c1" in the "Navigation" "block" - And I should see "c2" in the "Navigation" "block" - And I should not see "c3" in the "Navigation" "block" diff --git a/blocks/news_items/tests/behat/display_news.feature b/blocks/news_items/tests/behat/display_news.feature index ecac0bde2e8..a899073dc5b 100644 --- a/blocks/news_items/tests/behat/display_news.feature +++ b/blocks/news_items/tests/behat/display_news.feature @@ -18,6 +18,9 @@ Feature: Latest announcements block displays the course latest news And I log out And I log in as "teacher1" And I follow "Course 1" + And I turn editing mode on + And I add the "Latest announcements" block + And I turn editing mode off When I add a new topic to "Announcements" forum with: | Subject | Discussion One | | Message | Not important | @@ -31,14 +34,14 @@ Feature: Latest announcements block displays the course latest news Then I should see "Discussion One" in the "Latest announcements" "block" And I should see "Discussion Two" in the "Latest announcements" "block" And I should see "Discussion Three" in the "Latest announcements" "block" - And I follow "Edit settings" + And I click on "Edit settings" "link" in the "Administration" "block" And I set the following fields to these values: | News items to show | 2 | And I press "Save and display" And I should not see "Discussion One" in the "Latest announcements" "block" And I should see "Discussion Two" in the "Latest announcements" "block" And I should see "Discussion Three" in the "Latest announcements" "block" - And I follow "Edit settings" + And I click on "Edit settings" "link" in the "Administration" "block" And I set the following fields to these values: | News items to show | 0 | And I press "Save and display" diff --git a/blocks/recent_activity/tests/behat/structural_changes.feature b/blocks/recent_activity/tests/behat/structural_changes.feature index 380ea1e9c78..d66978a4be6 100644 --- a/blocks/recent_activity/tests/behat/structural_changes.feature +++ b/blocks/recent_activity/tests/behat/structural_changes.feature @@ -49,6 +49,7 @@ Feature: View structural changes in recent activity block Given I log in as "teacher1" And I follow "Course 1" And I turn editing mode on + And I add the "Recent activity" block When I add a "Forum" to section "1" and I fill the form with: | name | ForumVisibleGroups | | Description | No description | @@ -145,6 +146,7 @@ Feature: View structural changes in recent activity block When I log in as "teacher1" And I follow "Course 1" And I turn editing mode on + And I add the "Recent activity" block And I add a "Forum" to section "1" and I fill the form with: | name | ForumNew | | Description | No description | diff --git a/blocks/search_forums/tests/behat/block_search_forums_course.feature b/blocks/search_forums/tests/behat/block_search_forums_course.feature index 48d164d057f..0f54b4b4dab 100644 --- a/blocks/search_forums/tests/behat/block_search_forums_course.feature +++ b/blocks/search_forums/tests/behat/block_search_forums_course.feature @@ -21,6 +21,9 @@ Feature: The search forums block allows users to search for forum posts And I navigate to "Edit settings" node in "Course administration" And I set the field "id_newsitems" to "1" And I press "Save and display" + And I turn editing mode on + And I add the "Latest announcements" block + And I add the "Search forums" block And I log out Scenario: Use the search forum block in a course without any forum posts diff --git a/blocks/site_main_menu/tests/behat/add_url.feature b/blocks/site_main_menu/tests/behat/add_url.feature index f391d7bc6f1..62054a04951 100644 --- a/blocks/site_main_menu/tests/behat/add_url.feature +++ b/blocks/site_main_menu/tests/behat/add_url.feature @@ -9,6 +9,7 @@ Feature: Add URL to main menu block Given I log in as "admin" And I am on site homepage And I navigate to "Turn editing on" node in "Front page settings" + And I add the "Main menu" block When I add a "URL" to section "0" and I fill the form with: | Name | google | | Description | gooooooooogle | diff --git a/blocks/site_main_menu/tests/behat/edit_activities.feature b/blocks/site_main_menu/tests/behat/edit_activities.feature index dc73b9d1f7b..47994952f45 100644 --- a/blocks/site_main_menu/tests/behat/edit_activities.feature +++ b/blocks/site_main_menu/tests/behat/edit_activities.feature @@ -9,6 +9,7 @@ Feature: Edit activities in main menu block Given I log in as "admin" And I am on site homepage And I navigate to "Turn editing on" node in "Front page settings" + And I add the "Main menu" block When I add a "Forum" to section "0" and I fill the form with: | Forum name | My forum name | And I click on "Edit title" "link" in the "//*[contains(@class,'block_site_main_menu')]//li[contains(.,'My forum name')]" "xpath_element" diff --git a/blocks/social_activities/tests/behat/edit_activities.feature b/blocks/social_activities/tests/behat/edit_activities.feature index 07b58e391e0..ca391d3115f 100644 --- a/blocks/social_activities/tests/behat/edit_activities.feature +++ b/blocks/social_activities/tests/behat/edit_activities.feature @@ -18,6 +18,7 @@ Feature: Edit activities in social activities block Given I log in as "user1" And I follow "Course 1" And I turn editing mode on + And I add the "Social activities" block And I set the field "Add an activity to section 'section 0'" to "Forum" And I set the field "Forum name" to "My forum name" And I press "Save and return to course" diff --git a/blocks/tags/tests/behat/tagcloud.feature b/blocks/tags/tests/behat/tagcloud.feature index 36e1bc06a69..9c7ee6b5633 100644 --- a/blocks/tags/tests/behat/tagcloud.feature +++ b/blocks/tags/tests/behat/tagcloud.feature @@ -31,7 +31,7 @@ Feature: Block tags displaying tag cloud And I should see "Cats" in the "Tags" "block" And I should not see "Neverusedtag" in the "Tags" "block" And I click on "Dogs" "link" in the "Tags" "block" - And I should see "Log in to the site" in the ".breadcrumb" "css_element" + And I should see "You are not logged in" Scenario: Add Tags block in a course When I log in as "teacher1" diff --git a/blocks/tests/behat/configure_block_throughout_site.feature b/blocks/tests/behat/configure_block_throughout_site.feature index 9498021ef91..db03ce2107b 100644 --- a/blocks/tests/behat/configure_block_throughout_site.feature +++ b/blocks/tests/behat/configure_block_throughout_site.feature @@ -58,6 +58,7 @@ Feature: Add and configure blocks throughout the site Given I log in as "teacher1" And I follow "Course 1" And I follow "Turn editing on" + And I add the "Search forums" block Then I should see "Assign roles in Search forums block" @javascript diff --git a/blocks/tests/behat/hidden_block_region.feature b/blocks/tests/behat/hidden_block_region.feature index bd3a6c44a20..6abadca1865 100644 --- a/blocks/tests/behat/hidden_block_region.feature +++ b/blocks/tests/behat/hidden_block_region.feature @@ -14,6 +14,10 @@ Feature: Show hidden blocks in a docked block region when editing And I log in as "admin" And I follow "Course 1" And I turn editing mode on + And I add the "Search forums" block + And I add the "Latest announcements" block + And I add the "Upcoming events" block + And I add the "Recent activity" block # Hide all the blocks in the non-default region And I configure the "Search forums" block And I set the following fields to these values: diff --git a/calendar/tests/behat/calendar_lookahead.feature b/calendar/tests/behat/calendar_lookahead.feature index 449574ff8c8..9c6c046fd0d 100644 --- a/calendar/tests/behat/calendar_lookahead.feature +++ b/calendar/tests/behat/calendar_lookahead.feature @@ -20,6 +20,7 @@ Feature: Limit displayed upcoming events Given I follow "C1" And I turn editing mode on And I add the "Calendar" block + And I add the "Upcoming events" block And I follow "This month" And I click on "a.next" "css_element" And I click on "a.next" "css_element" diff --git a/cohort/tests/behat/add_cohort.feature b/cohort/tests/behat/add_cohort.feature index 7d8ccdb78b3..3d89faf90b4 100644 --- a/cohort/tests/behat/add_cohort.feature +++ b/cohort/tests/behat/add_cohort.feature @@ -32,7 +32,7 @@ Feature: Add cohorts of users When I add "First User (first@example.com)" user to "333" cohort members And I add "Second User (second@example.com)" user to "333" cohort members Then I should see "2" in the "#cohorts" "css_element" - And I follow "Assign" + And I click on "Assign" "link" in the "Test cohort name" "table_row" And the "Current users" select box should contain "First User (first@example.com)" And the "Current users" select box should contain "Second User (second@example.com)" And the "Current users" select box should not contain "Forth User (forth@example.com)" @@ -49,7 +49,7 @@ Feature: Add cohorts of users And I press "Add to cohort" And I follow "Cohorts" Then I should see "2" in the "#cohorts" "css_element" - And I follow "Assign" + And I click on "Assign" "link" in the "Test cohort name" "table_row" And the "Current users" select box should contain "Third User (third@example.com)" And the "Current users" select box should contain "Forth User (forth@example.com)" And the "Current users" select box should not contain "First User (first@example.com)" diff --git a/course/admin.php b/course/admin.php new file mode 100644 index 00000000000..959101b17be --- /dev/null +++ b/course/admin.php @@ -0,0 +1,55 @@ +. + +/** + * Listing of the course administration pages for this course. + * + * @copyright 2016 Damyon Wiese + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +require_once("../config.php"); + +$courseid = required_param('courseid', PARAM_INT); + +$PAGE->set_url('/course/admin.php', array('courseid'=>$courseid)); + +$course = $DB->get_record('course', array('id' => $courseid), '*', MUST_EXIST); + +require_login($course); +$context = context_course::instance($course->id); + +$PAGE->set_pagelayout('incourse'); + +if ($courseid == $SITE->id) { + $title = get_string('frontpagesettings'); + $node = $PAGE->settingsnav->find('frontpage', navigation_node::TYPE_SETTING); +} else { + $title = get_string('courseadministration'); + $node = $PAGE->settingsnav->find('courseadmin', navigation_node::TYPE_COURSE); +} +$PAGE->set_title($title); +$PAGE->set_heading($course->fullname); +$PAGE->navbar->add($title); +echo $OUTPUT->header(); +echo $OUTPUT->heading($title); + +if ($node) { + echo $OUTPUT->render_from_template('core/settings_link_page', ['node' => $node]); +} + +echo $OUTPUT->footer(); diff --git a/course/format/lib.php b/course/format/lib.php index f6674275c63..edc7dbf9e47 100644 --- a/course/format/lib.php +++ b/course/format/lib.php @@ -482,7 +482,7 @@ abstract class format_base { } $blocknames = array( BLOCK_POS_LEFT => array(), - BLOCK_POS_RIGHT => array('search_forums', 'news_items', 'calendar_upcoming', 'recent_activity') + BLOCK_POS_RIGHT => array() ); return $blocknames; } diff --git a/course/format/social/lib.php b/course/format/social/lib.php index e4665859633..6d43ce43286 100644 --- a/course/format/social/lib.php +++ b/course/format/social/lib.php @@ -71,8 +71,7 @@ class format_social extends format_base { public function get_default_blocks() { return array( BLOCK_POS_LEFT => array(), - BLOCK_POS_RIGHT => array('search_forums', 'calendar_upcoming', 'social_activities', - 'recent_activity', 'course_list') + BLOCK_POS_RIGHT => array() ); } diff --git a/course/format/topics/lib.php b/course/format/topics/lib.php index da48e81017c..5acb246d95a 100644 --- a/course/format/topics/lib.php +++ b/course/format/topics/lib.php @@ -121,9 +121,6 @@ class format_topics extends format_base { if ($sectionno != 0 && $usercoursedisplay == COURSE_DISPLAY_MULTIPAGE) { $url->param('section', $sectionno); } else { - if (empty($CFG->linkcoursesections) && !empty($options['navigation'])) { - return null; - } $url->set_anchor('section-'.$sectionno); } } @@ -208,7 +205,7 @@ class format_topics extends format_base { public function get_default_blocks() { return array( BLOCK_POS_LEFT => array(), - BLOCK_POS_RIGHT => array('search_forums', 'news_items', 'calendar_upcoming', 'recent_activity') + BLOCK_POS_RIGHT => array() ); } diff --git a/course/format/topics/tests/behat/edit_delete_sections.feature b/course/format/topics/tests/behat/edit_delete_sections.feature index 03db896f751..49023a54996 100644 --- a/course/format/topics/tests/behat/edit_delete_sections.feature +++ b/course/format/topics/tests/behat/edit_delete_sections.feature @@ -57,11 +57,11 @@ Feature: Sections can be edited and deleted in topics format When I click on "Edit topic name" "link" in the "li#section-1" "css_element" And I set the field "New name for topic Topic 1" to "Midterm evaluation" And I press key "13" in the field "New name for topic Topic 1" - Then I should not see "Topic 1" in the "#region-main" "css_element" + Then I should not see "Topic 1" in the "region-main" "region" And "New name for topic" "field" should not exist And I should see "Midterm evaluation" in the "li#section-1" "css_element" And I follow "Course 1" - And I should not see "Topic 1" in the "#region-main" "css_element" + And I should not see "Topic 1" in the "region-main" "region" And I should see "Midterm evaluation" in the "li#section-1" "css_element" Scenario: Deleting the last section in topics format diff --git a/course/format/weeks/lib.php b/course/format/weeks/lib.php index d32664cc8a7..e9237c60f40 100644 --- a/course/format/weeks/lib.php +++ b/course/format/weeks/lib.php @@ -124,9 +124,6 @@ class format_weeks extends format_base { if ($sectionno != 0 && $usercoursedisplay == COURSE_DISPLAY_MULTIPAGE) { $url->param('section', $sectionno); } else { - if (empty($CFG->linkcoursesections) && !empty($options['navigation'])) { - return null; - } $url->set_anchor('section-'.$sectionno); } } @@ -213,7 +210,7 @@ class format_weeks extends format_base { public function get_default_blocks() { return array( BLOCK_POS_LEFT => array(), - BLOCK_POS_RIGHT => array('search_forums', 'news_items', 'calendar_upcoming', 'recent_activity') + BLOCK_POS_RIGHT => array() ); } diff --git a/course/format/weeks/tests/behat/edit_delete_sections.feature b/course/format/weeks/tests/behat/edit_delete_sections.feature index 355059a5d72..5d2150cf4be 100644 --- a/course/format/weeks/tests/behat/edit_delete_sections.feature +++ b/course/format/weeks/tests/behat/edit_delete_sections.feature @@ -62,11 +62,11 @@ Feature: Sections can be edited and deleted in weeks format When I click on "Edit week name" "link" in the "li#section-1" "css_element" And I set the field "New name for week 1 May - 7 May" to "Midterm evaluation" And I press key "13" in the field "New name for week 1 May - 7 May" - Then I should not see "1 May - 7 May" in the "#region-main" "css_element" + 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 "li#section-1" "css_element" And I follow "Course 1" - And I should not see "1 May - 7 May" in the "#region-main" "css_element" + And I should not see "1 May - 7 May" in the "region-main" "region" And I should see "Midterm evaluation" in the "li#section-1" "css_element" Scenario: Deleting the last section in weeks format diff --git a/course/lib.php b/course/lib.php index e731709b266..d8a922b522c 100644 --- a/course/lib.php +++ b/course/lib.php @@ -3469,7 +3469,7 @@ function course_get_tagged_course_modules($tag, $exclusivemode = false, $fromcon * This function also handles the frontpage course. * * @param stdClass $context context object (it can be a course context or the system context for frontpage settings) - * @param stdClass $course the course where the settings are being rendered (only used when $context is set to frontpage) + * @param stdClass $course the course where the settings are being rendered * @return stdClass the navigation options in a course and their availability status * @since Moodle 3.2 */ @@ -3510,6 +3510,30 @@ function course_get_user_navigation_options($context, $course = null) { $options->participants = has_capability('moodle/course:viewparticipants', $context); $options->badges = !empty($CFG->enablebadges) && !empty($CFG->badges_allowcoursebadges) && has_capability('moodle/badges:viewbadges', $context); + // Add view grade report is permitted. + $grades = false; + + if (has_capability('moodle/grade:viewall', $context)) { + $grades = true; + } else if (!empty($course->showgrades)) { + $reports = core_component::get_plugin_list('gradereport'); + if (is_array($reports) && count($reports) > 0) { // Get all installed reports. + arsort($reports); // User is last, we want to test it first. + foreach ($reports as $plugin => $plugindir) { + if (has_capability('gradereport/'.$plugin.':view', $context)) { + // Stop when the first visible plugin is found. + $grades = true; + break; + } + } + } + } + $options->grades = $grades; + } + + if (\core_competency\api::is_enabled()) { + $capabilities = array('moodle/competency:coursecompetencyview', 'moodle/competency:coursecompetencymanage'); + $options->competencies = has_any_capability($capabilities, $context); } return $options; } @@ -3545,25 +3569,6 @@ function course_get_user_administration_options($course, $context) { $options->publish = has_capability('moodle/course:publish', $context); $options->reset = has_capability('moodle/course:reset', $context); $options->roles = has_capability('moodle/role:switchroles', $context); - - // Add view grade report is permitted. - $grades = false; - if (has_capability('moodle/grade:viewall', $context)) { - $grades = true; - } else if (!empty($course->showgrades)) { - $reports = core_component::get_plugin_list('gradereport'); - if (is_array($reports) && count($reports) > 0) { // Get all installed reports. - arsort($reports); // User is last, we want to test it first. - foreach ($reports as $plugin => $plugindir) { - if (has_capability('gradereport/'.$plugin.':view', $context)) { - // Stop when the first visible plugin is found. - $grades = true; - break; - } - } - } - } - $options->grades = $grades; } else { // Set default options to false. $listofoptions = array('tags', 'gradebook', 'outcomes', 'badges', 'import', 'publish', 'reset', 'roles', 'grades'); diff --git a/course/switchrole.php b/course/switchrole.php index a682c37a842..4e7c2379a28 100644 --- a/course/switchrole.php +++ b/course/switchrole.php @@ -46,9 +46,11 @@ if (strpos($returnurl, '?') === false) { $returnurl = clean_param($returnurl, PARAM_URL); } -$PAGE->set_url('/course/switchrole.php', array('id'=>$id)); +$PAGE->set_url('/course/switchrole.php', array('id'=>$id, 'switchrole'=>$switchrole)); -require_sesskey(); +if ($switchrole >= 0) { + require_sesskey(); +} if (!$course = $DB->get_record('course', array('id'=>$id))) { redirect(new moodle_url('/')); @@ -70,6 +72,21 @@ if ($switchrole > 0 && has_capability('moodle/role:switchroles', $context)) { if (is_array($aroles) && isset($aroles[$switchrole])) { role_switch($switchrole, $context); } +} else if ($switchrole < 0) { + + $PAGE->set_title(get_string('switchroleto')); + $PAGE->set_heading($course->fullname); + $PAGE->set_pagelayout('incourse'); + + echo $OUTPUT->header(); + echo $OUTPUT->heading(get_string('switchroleto')); + + require_once($CFG->dirroot.'/course/switchrole_form.php'); + $form = new switchrole_form(null, ['course' => $course]); + $form->display(); + + echo $OUTPUT->footer(); + exit; } redirect($returnurl); diff --git a/course/switchrole_form.php b/course/switchrole_form.php new file mode 100644 index 00000000000..57886564c04 --- /dev/null +++ b/course/switchrole_form.php @@ -0,0 +1,96 @@ +. + +/** + * Switch roles form. + * + * @package core_course + * @copyright 2016 Damyon Wiese + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); + +require_once($CFG->libdir.'/formslib.php'); + +/** + * Defines the course completion settings form. + */ +class switchrole_form extends moodleform { + + /** + * Determine whether the user is assuming another role + * + * This function checks to see if the user is assuming another role by means of + * role switching. In doing this we compare each RSW key (context path) against + * the current context path. This ensures that we can provide the switching + * options against both the course and any page shown under the course. + * + * @param context $context + * @return bool|int The role(int) if the user is in another role, false otherwise + */ + protected function in_alternative_role($context) { + global $USER, $PAGE; + if (!empty($USER->access['rsw']) && is_array($USER->access['rsw'])) { + if (!empty($PAGE->context) && !empty($USER->access['rsw'][$PAGE->context->path])) { + return $USER->access['rsw'][$PAGE->context->path]; + } + foreach ($USER->access['rsw'] as $key=>$role) { + if (strpos($context->path, $key)===0) { + return $role; + } + } + } + return false; + } + + /** + * Defines the form fields. + */ + public function definition() { + global $USER, $CFG, $DB; + + $mform = $this->_form; + $course = $this->_customdata['course']; + + // Overall criteria aggregation. + $context = context_course::instance($course->id); + $roles = array(); + $assumedrole = -1; + if (is_role_switched($course->id)) { + $roles[0] = get_string('switchrolereturn'); + $assumedrole = $USER->access['rsw'][$context->path]; + } + $availableroles = get_switchable_roles($context); + if (is_array($availableroles)) { + foreach ($availableroles as $key=>$role) { + if ($assumedrole == (int)$key) { + continue; + } + $roles[$key] = $role; + } + } + $mform->addElement('select', 'switchrole', get_string('role'), $roles); + + // Add common action buttons. + $this->add_action_buttons(); + + // Add hidden fields. + $mform->addElement('hidden', 'id', $course->id); + $mform->setType('id', PARAM_INT); + } +} diff --git a/course/tests/behat/behat_course.php b/course/tests/behat/behat_course.php index cf006b9c3cc..166210a8f51 100644 --- a/course/tests/behat/behat_course.php +++ b/course/tests/behat/behat_course.php @@ -650,7 +650,7 @@ class behat_course extends behat_base { // It should not exist at all. try { $this->find_link($activityname); - throw new ExpectationException('The "' . $activityname . '" should not appear'); + throw new ExpectationException('The "' . $activityname . '" should not appear', $this->getSession()); } catch (ElementNotFoundException $e) { // This is good, the activity should not be there. } diff --git a/course/tests/behat/category_change_visibility.feature b/course/tests/behat/category_change_visibility.feature index 4b41415df35..1bb7129b396 100644 --- a/course/tests/behat/category_change_visibility.feature +++ b/course/tests/behat/category_change_visibility.feature @@ -315,4 +315,4 @@ Feature: We can change the visibility of categories in the management interface. And category in management listing should be visible "CAT1" And category in management listing should be visible "CAT2" And category in management listing should be visible "CAT3" - And course in management listing should be dimmed "C1" \ No newline at end of file + And course in management listing should be dimmed "C1" diff --git a/course/tests/behat/category_resort.feature b/course/tests/behat/category_resort.feature index 42dacac5fa6..615928e04d1 100644 --- a/course/tests/behat/category_resort.feature +++ b/course/tests/behat/category_resort.feature @@ -209,4 +209,4 @@ Feature: Test we can resort categories in the management interface. And I should see category listing "Cat 1" before "Cat 1b" And I should see category listing "Cat 1b" before "Cat 1c" And I should see category listing "Cat 1c" before "Cat 1a" - And I should see category listing "Cat 1a" before "Cat 2" \ No newline at end of file + And I should see category listing "Cat 1a" before "Cat 2" diff --git a/course/tests/behat/course_change_visibility.feature b/course/tests/behat/course_change_visibility.feature index 6311d8bd524..ea67b3439a1 100644 --- a/course/tests/behat/course_change_visibility.feature +++ b/course/tests/behat/course_change_visibility.feature @@ -95,7 +95,7 @@ Feature: We can change the visibility of courses in the management interface. And I toggle visibility of category "CAT1" in management listing And I toggle visibility of course "C1" in management listing And I click on "Course categories and courses" "link" in the ".view-mode-selector" "css_element" - And I click on "Courses" "link" + And I click on "Courses" "link" in the ".view-mode-selector" "css_element" And a new page should have loaded since I started watching And I start watching to see if a new page loads And I should see "Course 1" in the "#course-listing ul.ml" "css_element" diff --git a/course/tests/behat/course_controls.feature b/course/tests/behat/course_controls.feature index 7dfb1c78b63..fda72f91b5a 100644 --- a/course/tests/behat/course_controls.feature +++ b/course/tests/behat/course_controls.feature @@ -29,16 +29,8 @@ Feature: Course activity controls works as expected And I log in as "teacher1" And I follow "Course 1" When I follow - And I press "Turn editing on" - Then I should see "Turn editing off" - And I press "Turn editing off" - And "Turn editing on" "button" should exist - And I follow "Turn editing on" - And "Turn editing off" "button" should exist - And I follow "Turn editing off" - And I should see "Turn editing on" - And "Turn editing on" "button" should exist And I turn editing mode on + And I add the "Recent activity" block And I open the action menu in "Recent activity" "block" And I click on "Delete Recent activity block" "link" And I press "Yes" @@ -68,7 +60,7 @@ Feature: Course activity controls works as expected And I click on "Hide" "link" in the "Test forum name 1" activity And "section" exist And I delete "Test forum name 1" activity - And I should not see "Test forum name 1" in the "#region-main" "css_element" + And I should not see "Test forum name 1" in the "region-main" "region" And I duplicate "Test forum name 2" activity editing the new copy with: | Forum name | Edited test forum name 2 | And "section" exist @@ -109,16 +101,8 @@ Feature: Course activity controls works as expected And I log in as "teacher1" And I follow "Course 1" When I follow - And I press "Turn editing on" - Then I should see "Turn editing off" - And I press "Turn editing off" - And "Turn editing on" "button" should exist - And I follow "Turn editing on" - And "Turn editing off" "button" should exist - And I follow "Turn editing off" - And I should see "Turn editing on" - And "Turn editing on" "button" should exist And I turn editing mode on + And I add the "Recent activity" block And I open the action menu in "Recent activity" "block" And I click on "Delete Recent activity block" "link" And I press "Yes" @@ -143,7 +127,7 @@ Feature: Course activity controls works as expected And "section" exist And I delete "Test forum name 1" activity And "section" exist - And I should not see "Test forum name 1" in the "#region-main" "css_element" + And I should not see "Test forum name 1" in the "region-main" "region" And I duplicate "Test forum name 2" activity editing the new copy with: | Forum name | Edited test forum name 2 | And "section" exist diff --git a/course/tests/behat/course_creation.feature b/course/tests/behat/course_creation.feature index 3b2b0ff0171..f8c945c9065 100644 --- a/course/tests/behat/course_creation.feature +++ b/course/tests/behat/course_creation.feature @@ -19,6 +19,8 @@ Feature: Managers can create courses And I log out When I log in as "teacher1" And I follow "Course 1" + And I turn editing mode on + And I add the "Latest announcements" block Then "Latest announcements" "block" should exist And I follow "Announcements" And "Add a new topic" "button" should exist @@ -52,8 +54,10 @@ Feature: Managers can create courses | id_enddate_year | 2016 | And I press "Save and return" Then I should see the "Course categories and courses" management page + And I click on "Sort courses" "link" + And I click on "Sort by Course time created ascending" "link" in the ".course-listing-actions" "css_element" And I should see course listing "Course 1" before "Course 2" - And I follow "Course 2" + And I click on "Course 2" "link" in the "region-main" "region" And I click on "Edit" "link" in the ".course-detail" "css_element" And the following fields match these values: | Course full name | Course 2 | diff --git a/course/tests/behat/move_activities.feature b/course/tests/behat/move_activities.feature index 7366eccced0..1c81efd6ee0 100644 --- a/course/tests/behat/move_activities.feature +++ b/course/tests/behat/move_activities.feature @@ -17,6 +17,7 @@ Feature: Activities can be moved between sections And I log in as "teacher1" And I follow "Course 1" And I turn editing mode on + And I add the "Recent activity" block And I follow "Delete Recent activity block" And I press "Yes" And I follow "Configure Navigation block" diff --git a/course/tests/behat/navigate_course_list.feature b/course/tests/behat/navigate_course_list.feature index cabeacecbe1..d2bb13075da 100644 --- a/course/tests/behat/navigate_course_list.feature +++ b/course/tests/behat/navigate_course_list.feature @@ -34,7 +34,7 @@ Feature: Browse course list and return back from enrolment page Scenario: A user can return to the previous page from enrolment page by clicking navigation links When I log in as "user2" And I follow "Preferences" in the user menu - And I follow "Edit profile" + And I click on "Edit profile" "link" in the "region-main" "region" And I expand "Courses" node And I expand "Sample category" node And I follow "Course 1" diff --git a/course/tests/courselib_test.php b/course/tests/courselib_test.php index e470289c27a..262bbed460e 100644 --- a/course/tests/courselib_test.php +++ b/course/tests/courselib_test.php @@ -575,10 +575,6 @@ class core_course_courselib_testcase extends advanced_testcase { $sectioncreated = $DB->record_exists('course_sections', array('course' => $created->id, 'section' => 0)); $this->assertTrue($sectioncreated); - // Ensure blocks have been associated to the course. - $blockcount = $DB->count_records('block_instances', array('parentcontextid' => $context->id)); - $this->assertGreaterThan(0, $blockcount); - // Ensure that the shortname isn't duplicated. try { $created = create_course($course); @@ -3085,7 +3081,6 @@ class core_course_courselib_testcase extends advanced_testcase { $this->assertTrue($adminoptions->publish); $this->assertTrue($adminoptions->reset); $this->assertTrue($adminoptions->roles); - $this->assertTrue($adminoptions->grades); } /** @@ -3118,7 +3113,6 @@ class core_course_courselib_testcase extends advanced_testcase { $this->assertFalse($adminoptions->publish); $this->assertFalse($adminoptions->reset); $this->assertFalse($adminoptions->roles); - $this->assertTrue($adminoptions->grades); $CFG->enablebadges = false; $adminoptions = course_get_user_administration_options($course, $context); diff --git a/course/tests/externallib_test.php b/course/tests/externallib_test.php index d6a9183e00e..d991ac7c22d 100644 --- a/course/tests/externallib_test.php +++ b/course/tests/externallib_test.php @@ -558,6 +558,7 @@ class core_course_externallib_testcase extends externallib_advanced_testcase { $coursedata['summary'] = 'Course 1 description'; $coursedata['summaryformat'] = FORMAT_MOODLE; $course1 = self::getDataGenerator()->create_course($coursedata); + $generatedcourses[$course1->id] = $course1; $course2 = self::getDataGenerator()->create_course(); $generatedcourses[$course2->id] = $course2; @@ -642,8 +643,17 @@ class core_course_externallib_testcase extends externallib_advanced_testcase { $generatedcourses = array(); $coursedata1['fullname'] = 'FIRST COURSE'; $course1 = self::getDataGenerator()->create_course($coursedata1); + + $page = new moodle_page(); + $page->set_course($course1); + $page->blocks->add_blocks([BLOCK_POS_LEFT => ['news_items'], BLOCK_POS_RIGHT => []], 'course-view-*'); + $coursedata2['fullname'] = 'SECOND COURSE'; $course2 = self::getDataGenerator()->create_course($coursedata2); + + $page = new moodle_page(); + $page->set_course($course2); + $page->blocks->add_blocks([BLOCK_POS_LEFT => ['news_items'], BLOCK_POS_RIGHT => []], 'course-view-*'); // Search by name. $results = core_course_external::search_courses('search', 'FIRST'); $results = external_api::clean_returnvalue(core_course_external::search_courses_returns(), $results); @@ -1842,7 +1852,7 @@ class core_course_externallib_testcase extends externallib_advanced_testcase { $navoptions->{$option['name']} = $option['available']; } if ($course['id'] == SITEID) { - $this->assertCount(7, $course['options']); + $this->assertCount(8, $course['options']); $this->assertTrue($navoptions->blogs); $this->assertFalse($navoptions->notes); $this->assertFalse($navoptions->participants); @@ -1850,12 +1860,15 @@ class core_course_externallib_testcase extends externallib_advanced_testcase { $this->assertTrue($navoptions->tags); $this->assertFalse($navoptions->search); $this->assertTrue($navoptions->calendar); + $this->assertTrue($navoptions->competencies); } else { - $this->assertCount(4, $course['options']); + $this->assertCount(6, $course['options']); $this->assertTrue($navoptions->blogs); $this->assertFalse($navoptions->notes); $this->assertTrue($navoptions->participants); $this->assertTrue($navoptions->badges); + $this->assertTrue($navoptions->grades); + $this->assertTrue($navoptions->competencies); } } } @@ -1905,9 +1918,8 @@ class core_course_externallib_testcase extends externallib_advanced_testcase { $this->assertFalse($adminoptions->publish); $this->assertFalse($adminoptions->reset); $this->assertFalse($adminoptions->roles); - $this->assertFalse($adminoptions->grades); } else { - $this->assertCount(15, $course['options']); + $this->assertCount(14, $course['options']); $this->assertFalse($adminoptions->update); $this->assertFalse($adminoptions->filters); $this->assertFalse($adminoptions->reports); @@ -1922,7 +1934,6 @@ class core_course_externallib_testcase extends externallib_advanced_testcase { $this->assertFalse($adminoptions->publish); $this->assertFalse($adminoptions->reset); $this->assertFalse($adminoptions->roles); - $this->assertTrue($adminoptions->grades); } } } diff --git a/course/user.php b/course/user.php index aadbd89bca4..ccf39f7d1b9 100644 --- a/course/user.php +++ b/course/user.php @@ -149,9 +149,10 @@ switch ($mode) { if ($course->id == SITEID) { $activenode = $PAGE->navigation->find('user' . $user->id, null); } else { - $currentcoursenode = $PAGE->navigation->find('currentcourse', null); + $currentcoursenode = $PAGE->navigation->find($course->id, navigation_node::TYPE_COURSE); $activenode = $currentcoursenode->find_active_node(); } + // Check to see if the active node is a user name. if (!preg_match('/^user\d{0,}$/', $activenode->key)) { // No user name found. $userurl = new moodle_url('/user/view.php', array('id' => $user->id, 'course' => $course->id)); diff --git a/enrol/tests/behat/manage_enrolments_from_participants.feature b/enrol/tests/behat/manage_enrolments_from_participants.feature index 82e7f11b822..7a4bbd9868c 100644 --- a/enrol/tests/behat/manage_enrolments_from_participants.feature +++ b/enrol/tests/behat/manage_enrolments_from_participants.feature @@ -20,16 +20,16 @@ Feature: Manage enrollments from participants page | teacher1 | C1 | editingteacher | And I log in as "teacher1" And I follow "Course 1" - And I navigate to "Participants" node in "Current course > C1" + And I navigate to "Participants" node in "My courses > C1" Scenario: Check the participants link when "All partipants" selected Given I select "All participants" from the "roleid" singleselect - When I follow "Edit" + When I click on "Edit" "link" in the "region-main" "region" Then I should see "Enrolled users" in the "h2" "css_element" And the field "Role" matches value "All" Scenario: Check the participants link when "Student" selected Given I select "Student" from the "roleid" singleselect - When I follow "Edit" + When I click on "Edit" "link" in the "region-main" "region" Then I should see "Enrolled users" in the "h2" "css_element" And the field "Role" matches value "Student" diff --git a/files/tests/behat/course_files.feature b/files/tests/behat/course_files.feature index 9143b75a392..c610bfabde2 100644 --- a/files/tests/behat/course_files.feature +++ b/files/tests/behat/course_files.feature @@ -16,7 +16,7 @@ Feature: Course files And I am on site homepage And I follow "Course 1" Then I should see "Legacy course files" - And I follow "Legacy course files" + And I navigate to "Legacy course files" node in "Course administration" And I press "Edit legacy course files" And "Add..." "link" should be visible And "Create folder" "link" should be visible @@ -33,7 +33,7 @@ Feature: Course files And I am on site homepage And I follow "Course 1" Then I should see "Legacy course files" - And I follow "Legacy course files" + And I navigate to "Legacy course files" node in "Course administration" And I press "Edit legacy course files" And "Add..." "link" should not be visible And "Create folder" "link" should not be visible diff --git a/grade/export/txt/tests/behat/export.feature b/grade/export/txt/tests/behat/export.feature index 5670d2cddeb..db6d0e9aca7 100644 --- a/grade/export/txt/tests/behat/export.feature +++ b/grade/export/txt/tests/behat/export.feature @@ -22,7 +22,7 @@ Feature: I need to export grades as text | assign | C1 | a2 | Test assignment name 2 | Submit your online text | 1 | And I log in as "teacher1" And I follow "Course 1" - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" And I turn editing mode on And I give the grade "80.00" to the user "Student 1" for the grade item "Test assignment name" And I press "Save changes" @@ -76,4 +76,4 @@ Feature: I need to export grades as text And I should see "80.00 %" And I should see "B-" And I should not see "40.00 %" - And I should not see ",F," \ No newline at end of file + And I should not see ",F," diff --git a/grade/export/xml/tests/behat/export.feature b/grade/export/xml/tests/behat/export.feature index 9048755bdcf..65300651bd7 100644 --- a/grade/export/xml/tests/behat/export.feature +++ b/grade/export/xml/tests/behat/export.feature @@ -21,7 +21,7 @@ Feature: I need to export grades as xml | assign | C1 | a1 | Test assignment name | Submit something! | And I log in as "teacher1" And I follow "Course 1" - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" And I turn editing mode on And I give the grade "80.00" to the user "Student 1" for the grade item "Test assignment name" And I press "Save changes" diff --git a/grade/report/grader/tests/behat/ajax_grader.feature b/grade/report/grader/tests/behat/ajax_grader.feature index 71dad25bc17..1ee18cf9966 100644 --- a/grade/report/grader/tests/behat/ajax_grader.feature +++ b/grade/report/grader/tests/behat/ajax_grader.feature @@ -55,7 +55,7 @@ Feature: Using the AJAX grading feature of Grader report to update grades and fe | grade_report_showquickfeedback | 0 | And I log in as "teacher1" And I follow "Course 1" - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" And I click on student "Student 2" for grade item "Item VU" Then I should see a grade field for "Student 2" and grade item "Item VU" And I should not see a feedback field for "Student 2" and grade item "Item VU" @@ -107,7 +107,7 @@ Feature: Using the AJAX grading feature of Grader report to update grades and fe | grade_report_showquickfeedback | 1 | And I log in as "teacher1" And I follow "Course 1" - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" And I click on student "Student 2" for grade item "Item VU" Then I should see a grade field for "Student 2" and grade item "Item VU" And I should see a feedback field for "Student 2" and grade item "Item VU" @@ -142,7 +142,7 @@ Feature: Using the AJAX grading feature of Grader report to update grades and fe | grade_report_showquickfeedback | 1 | And I log in as "teacher1" And I follow "Course 1" - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" And I click on student "Student 2" for grade item "Item VU" Then I should see a grade field for "Student 2" and grade item "Item VU" And I should see a feedback field for "Student 2" and grade item "Item VU" @@ -162,7 +162,7 @@ Feature: Using the AJAX grading feature of Grader report to update grades and fe | grade_report_showquickfeedback | 1 | And I log in as "teacher1" And I follow "Course 1" - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" And I turn editing mode on Then I should not see a grade field for "Student 2" and grade item "Item VL" And I should not see a feedback field for "Student 2" and grade item "Item VL" @@ -193,7 +193,7 @@ Feature: Using the AJAX grading feature of Grader report to update grades and fe | grade_report_showquickfeedback | 1 | And I log in as "teacher1" And I follow "Course 1" - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" And I turn editing mode on And I change window size to "large" And I set "=[[i1]] + [[i3]] + [[gsc]]" calculation for grade item "Calc Item" with idnumbers: diff --git a/grade/report/grader/tests/behat/switch_views.feature b/grade/report/grader/tests/behat/switch_views.feature index db1d5b7724b..09ecf628e1c 100644 --- a/grade/report/grader/tests/behat/switch_views.feature +++ b/grade/report/grader/tests/behat/switch_views.feature @@ -46,7 +46,7 @@ Feature: We can change what we are viewing on the grader report And I log out And I log in as "teacher1" And I follow "Course 1" - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" And I turn editing mode on And I give the grade "80.00" to the user "Student 1" for the grade item "Test assignment name 1" And I give the grade "90.00" to the user "Student 1" for the grade item "Test assignment name 2" @@ -60,7 +60,7 @@ Feature: We can change what we are viewing on the grader report And I open "Test assignment name 2" actions menu And I click on "Hide" "link" in the "Test assignment name 2" activity And I follow "Course 1" - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" And I select "Grader report" from the "Grade report" singleselect And I should see "Test assignment name 1" And I should see "Test assignment name 2" @@ -97,7 +97,7 @@ Feature: We can change what we are viewing on the grader report And I log out And I log in as "teacher1" And I follow "Course 1" - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" And I select "Grader report" from the "Grade report" singleselect And I should see "Test assignment name 1" And I should see "Test assignment name 2" diff --git a/grade/report/history/tests/behat/basic_functionality.feature b/grade/report/history/tests/behat/basic_functionality.feature index 0cfc9057e96..a488922c9f3 100644 --- a/grade/report/history/tests/behat/basic_functionality.feature +++ b/grade/report/history/tests/behat/basic_functionality.feature @@ -30,7 +30,7 @@ Feature: A teacher checks the grade history report in a course And I add a "Assignment" to section "1" and I fill the form with: | Assignment name | Rewarding assignment | | Description | After writing your behat test go grab a beer! | - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" And I turn editing mode on And I give the grade "50.00" to the user "Student 1" for the grade item "The greatest assignment ever" And I give the grade "60.00" to the user "Student 1" for the grade item "Rewarding assignment" @@ -40,7 +40,7 @@ Feature: A teacher checks the grade history report in a course And I log out And I log in as "teacher2" And I follow "Course 1" - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" And I turn editing mode on And I give the grade "70.00" to the user "Student 1" for the grade item "The greatest assignment ever" And I give the grade "80.00" to the user "Student 1" for the grade item "Rewarding assignment" diff --git a/grade/report/singleview/tests/behat/singleview.feature b/grade/report/singleview/tests/behat/singleview.feature index 22aba02e7fa..f2158da1b0e 100644 --- a/grade/report/singleview/tests/behat/singleview.feature +++ b/grade/report/singleview/tests/behat/singleview.feature @@ -52,7 +52,7 @@ Feature: We can use Single view | gradereport/singleview:view | Allow | teacher | Course | C1 | And I log in as "teacher1" And I follow "Course 1" - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" @javascript Scenario: I can update grades, add feedback and exclude grades. @@ -97,7 +97,7 @@ Feature: We can use Single view And I log out And I log in as "teacher2" And I follow "Course 1" - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" And I click on "Single view" "option" And I click on "Student 4" "option" And the "Exclude for Test assignment one" "checkbox" should be disabled diff --git a/grade/report/user/tests/behat/user_view.feature b/grade/report/user/tests/behat/user_view.feature index 01794bf53aa..d7b270c3a97 100644 --- a/grade/report/user/tests/behat/user_view.feature +++ b/grade/report/user/tests/behat/user_view.feature @@ -35,7 +35,7 @@ Feature: View the user report as the student will see it And I navigate to "Gradebook setup" node in "Course administration" And I hide the grade item "Test assignment six" And I hide the grade item "Sub category 2" - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" And I turn editing mode on And I change window size to "large" And I give the grade "80.00" to the user "Student 1" for the grade item "Test assignment one" @@ -83,7 +83,7 @@ Feature: View the user report as the student will see it And I log out And I log in as "student1" And I follow "Course 1" - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" Then the following should exist in the "user-grade" table: | Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total | | Test assignment one | - | 80.00 | 0–100 | 80.00 % | - | @@ -121,7 +121,7 @@ Feature: View the user report as the student will see it And I log out And I log in as "student1" And I follow "Course 1" - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" Then the following should exist in the "user-grade" table: | Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total | | Test assignment one | 50.00 % | 80.00 | 0–100 | 80.00 % | 26.67 % | @@ -159,7 +159,7 @@ Feature: View the user report as the student will see it And I log out And I log in as "student1" And I follow "Course 1" - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" Then the following should exist in the "user-grade" table: | Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total | | Test assignment one | 50.00 % | 80.00 | 0–100 | 80.00 % | 13.33 % | @@ -204,7 +204,7 @@ Feature: View the user report as the student will see it And I log out And I log in as "student1" And I follow "Course 1" - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" Then the following should exist in the "user-grade" table: | Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total | | Test assignment one | 50.00 % | 80.00 | 0–100 | 80.00 % | 13.33 % | diff --git a/grade/report/user/tests/behat/view_usereport.feature b/grade/report/user/tests/behat/view_usereport.feature index 9bc1f8f2fa8..7f7b25e4f59 100644 --- a/grade/report/user/tests/behat/view_usereport.feature +++ b/grade/report/user/tests/behat/view_usereport.feature @@ -12,7 +12,7 @@ Feature: We can use the user report Given I log in as "admin" And I am on site homepage And I follow "Course 1" - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" And I select "User report" from the "Grade report" singleselect And I select "All users (0)" from the "Select all or one user" singleselect Then I should see "No students enrolled in this course yet" diff --git a/grade/tests/behat/grade_UI_settings.feature b/grade/tests/behat/grade_UI_settings.feature index e01b9282c7c..1618704c537 100644 --- a/grade/tests/behat/grade_UI_settings.feature +++ b/grade/tests/behat/grade_UI_settings.feature @@ -20,7 +20,7 @@ Feature: Site settings can be used to hide parts of the gradebook UI And I log in as "admin" And I am on site homepage And I follow "Course 1" - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" And I turn editing mode on @javascript @@ -32,7 +32,7 @@ Feature: Site settings can be used to hide parts of the gradebook UI And I press "Save changes" And I am on site homepage And I follow "Course 1" - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" And I click on "Edit assign Assignment1" "link" And I should not see "Minimum grade" @@ -44,7 +44,7 @@ Feature: Site settings can be used to hide parts of the gradebook UI And I press "Save changes" And I am on site homepage And I follow "Course 1" - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" Then "Edit calculation for Course total" "link" should not exist @javascript @@ -55,5 +55,5 @@ Feature: Site settings can be used to hide parts of the gradebook UI And I press "Save changes" And I am on site homepage And I follow "Course 1" - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" And "tr .course input[type='text']" "css_element" should not exist diff --git a/grade/tests/behat/grade_aggregation.feature b/grade/tests/behat/grade_aggregation.feature index 54c2cb7d1fc..dcbbd5c3b7d 100644 --- a/grade/tests/behat/grade_aggregation.feature +++ b/grade/tests/behat/grade_aggregation.feature @@ -42,7 +42,7 @@ Feature: We can use calculated grade totals And I log out And I log in as "teacher1" And I follow "Course 1" - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" And I turn editing mode on And I change window size to "large" And I give the grade "60.00" to the user "Student 1" for the grade item "Test assignment one" @@ -253,12 +253,12 @@ Feature: We can use calculated grade totals And I log in as "student1" And I follow "Grades" in the user menu Then I should see "114.82 (18.27 %)" in the "overview-grade" "table" - And I follow "Course 1" + And I click on "Course 1" "link" in the "region-main" "region" And "Test outcome item one" row "Grade" column of "user-grade" table should contain "Excellent (100.00 %)" And I log out And I log in as "teacher1" And I follow "Course 1" - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" And I expand "Setup" node And I follow "Gradebook setup" And I set the following settings for grade item "Test outcome item one": @@ -267,12 +267,12 @@ Feature: We can use calculated grade totals And I log in as "student1" And I follow "Grades" in the user menu Then I should see "114.00 (18.39 %)" in the "overview-grade" "table" - And I follow "Course 1" + And I click on "Course 1" "link" in the "region-main" "region" And "Test outcome item one" row "Grade" column of "user-grade" table should contain "Excellent (100.00 %)" And I log out And I log in as "teacher1" And I follow "Course 1" - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" And I expand "Setup" node And I follow "Gradebook setup" And I set the following settings for grade item "Course 1": @@ -282,7 +282,7 @@ Feature: We can use calculated grade totals And I log in as "student1" And I follow "Grades" in the user menu Then I should see "110.00 (17.74 %)" in the "overview-grade" "table" - And I follow "Course 1" + And I click on "Course 1" "link" in the "region-main" "region" And "Test outcome item one" row "Grade" column of "user-grade" table should contain "Excellent (100.00 %)" Scenario: Natural aggregation on outcome items with modified weights @@ -297,7 +297,7 @@ Feature: We can use calculated grade totals And the following "grade items" exist: | itemname | course | outcome | gradetype | scale | | Test outcome item one | C1 | OT1 | Scale | Test Scale | - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" And I expand "Setup" node And I follow "Gradebook setup" And I set the following settings for grade item "Course 1": @@ -318,7 +318,7 @@ Feature: We can use calculated grade totals And I log in as "student1" And I follow "Grades" in the user menu Then I should see "4.00 (100.00 %)" in the "overview-grade" "table" - And I follow "Course 1" + And I click on "Course 1" "link" in the "region-main" "region" And "Test outcome item one" row "Grade" column of "user-grade" table should contain "Excellent (100.00 %)" Scenario: Natural aggregation @@ -363,7 +363,7 @@ Feature: We can use calculated grade totals And I log in as "student1" And I follow "Grades" in the user menu And I should see "113.75 (23.45 %)" in the "overview-grade" "table" - And I follow "Course 1" + And I click on "Course 1" "link" in the "region-main" "region" And the following should exist in the "user-grade" table: | Grade item | Calculated weight | Grade | Range | Contribution to course total | | Test assignment six | 70.00 % | 5.00 (50.00 %) | 0–10 | 1.80 % | @@ -379,7 +379,7 @@ Feature: We can use calculated grade totals And I log in as "admin" And I am on site homepage And I follow "Course 1" - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" And I turn editing mode on And I set the following settings for grade item "Sub category 1": | Aggregation | Natural | @@ -553,7 +553,7 @@ Feature: We can use calculated grade totals And I log in as "student1" And I follow "Grades" in the user menu And I should see "45.00 (13.85 %)" in the "overview-grade" "table" - And I follow "Course 1" + And I click on "Course 1" "link" in the "region-main" "region" And the following should exist in the "user-grade" table: | Grade item | Calculated weight | Grade | Contribution to course total | | Test assignment six | 0.00 % | 5.00 (50.00 %) | 0.00 % | diff --git a/grade/tests/behat/grade_aggregation_changes.feature b/grade/tests/behat/grade_aggregation_changes.feature index fd792e0fac9..5f2e6e13839 100644 --- a/grade/tests/behat/grade_aggregation_changes.feature +++ b/grade/tests/behat/grade_aggregation_changes.feature @@ -35,7 +35,7 @@ Feature: Changing the aggregation of an item affects its weight and extra credit | grade_aggregations_visible | Mean of grades,Weighted mean of grades,Simple weighted mean of grades,Mean of grades (with extra credits),Median of grades,Lowest grade,Highest grade,Mode of grades,Natural | And I am on site homepage And I follow "Course 1" - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" And I navigate to "Grader report" node in "Grade administration" And I turn editing mode on And I follow "Edit Cat mean" diff --git a/grade/tests/behat/grade_average.feature b/grade/tests/behat/grade_average.feature index e52ab6a1480..eefea37bbb6 100644 --- a/grade/tests/behat/grade_average.feature +++ b/grade/tests/behat/grade_average.feature @@ -24,7 +24,7 @@ Feature: Average grades are displayed in the gradebook And I am on site homepage And I follow "Course 1" # Enable averages - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" And I navigate to "Course grade settings" node in "Grade administration > Setup" And I set the following fields to these values: | Show average | Show | @@ -52,7 +52,7 @@ Feature: Average grades are displayed in the gradebook Scenario: Grade a grade item and ensure the results display correctly in the gradebook # Check the admin grade table - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" Then I should see "50.00" in the ".avg.r0.lastrow .c1" "css_element" Then I should see "50.00" in the ".avg.r0.lastrow .c2" "css_element" And I log out @@ -61,7 +61,7 @@ Feature: Average grades are displayed in the gradebook And I log in as "student1" And I am on site homepage And I follow "Course 1" - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" Then I should see "50.00" in the ".level2.column-grade" "css_element" Then I should see "50.00" in the ".level2.column-average" "css_element" And I log out diff --git a/grade/tests/behat/grade_calculated_grade_items.feature b/grade/tests/behat/grade_calculated_grade_items.feature index 3eb9dfe6133..d39b632ee60 100644 --- a/grade/tests/behat/grade_calculated_grade_items.feature +++ b/grade/tests/behat/grade_calculated_grade_items.feature @@ -21,7 +21,7 @@ Feature: Calculated grade items can be used in the gradebook And I log in as "admin" And I am on site homepage And I follow "Course 1" - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" And I navigate to "Gradebook setup" node in "Grade administration > Setup" @javascript diff --git a/grade/tests/behat/grade_calculated_grade_items_20150627.feature b/grade/tests/behat/grade_calculated_grade_items_20150627.feature index 1199365a985..6271c9f69b9 100644 --- a/grade/tests/behat/grade_calculated_grade_items_20150627.feature +++ b/grade/tests/behat/grade_calculated_grade_items_20150627.feature @@ -22,7 +22,7 @@ Feature: Gradebook calculations for calculated grade items before the fix 201506 And I log in as "admin" And I am on site homepage And I follow "Course 1" - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" And I navigate to "Gradebook setup" node in "Grade administration > Setup" @javascript diff --git a/grade/tests/behat/grade_calculated_weights.feature b/grade/tests/behat/grade_calculated_weights.feature index e899835dd17..97c4fffe4c0 100644 --- a/grade/tests/behat/grade_calculated_weights.feature +++ b/grade/tests/behat/grade_calculated_weights.feature @@ -30,7 +30,7 @@ Feature: We can understand the gradebook user report And I log out And I log in as "teacher1" And I follow "Course 1" - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" And I turn editing mode on And I give the grade "60.00" to the user "Student 1" for the grade item "Test assignment one" And I give the grade "20.00" to the user "Student 1" for the grade item "Test assignment two" diff --git a/grade/tests/behat/grade_contribution_with_extra_credit.feature b/grade/tests/behat/grade_contribution_with_extra_credit.feature index 7f60a151a62..e59d032ebbb 100644 --- a/grade/tests/behat/grade_contribution_with_extra_credit.feature +++ b/grade/tests/behat/grade_contribution_with_extra_credit.feature @@ -21,7 +21,7 @@ Feature: Extra credit contributions are normalised when going out of bounds | grade_aggregations_visible | Simple weighted mean of grades,Mean of grades (with extra credits),Natural | And I am on site homepage And I follow "Course 1" - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" And I navigate to "Gradebook setup" node in "Grade administration > Setup" And I press "Add grade item" And I set the following fields to these values: @@ -47,7 +47,7 @@ Feature: Extra credit contributions are normalised when going out of bounds And I log out And I log in as "teacher1" And I follow "Course 1" - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" And I turn editing mode on And I give the grade "80.00" to the user "Student 1" for the grade item "Manual item 1" And I give the grade "10.00" to the user "Student 1" for the grade item "Manual item 2" diff --git a/grade/tests/behat/grade_grade_minmax_change.feature b/grade/tests/behat/grade_grade_minmax_change.feature index edcc64a6c97..51f127d110f 100644 --- a/grade/tests/behat/grade_grade_minmax_change.feature +++ b/grade/tests/behat/grade_grade_minmax_change.feature @@ -22,7 +22,7 @@ Feature: We can change the maximum and minimum number of points for manual items And I log in as "teacher1" And I am on site homepage And I follow "Course 1" - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" And I navigate to "Gradebook setup" node in "Grade administration > Setup" And I press "Add grade item" And I set the following fields to these values: @@ -37,7 +37,7 @@ Feature: We can change the maximum and minimum number of points for manual items Scenario: Change maximum number of points on a graded item. And I follow "Course 1" - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" And I turn editing mode on And I give the grade "10.00" to the user "Student 1" for the grade item "Manual item 1" And I give the grade "8.00" to the user "Student 2" for the grade item "Manual item 1" diff --git a/grade/tests/behat/grade_hidden_items.feature b/grade/tests/behat/grade_hidden_items.feature index a85f78028cc..519e7503140 100644 --- a/grade/tests/behat/grade_hidden_items.feature +++ b/grade/tests/behat/grade_hidden_items.feature @@ -35,7 +35,7 @@ Feature: Student and teacher's view of aggregated grade items is consistent when When I log out And I log in as "teacher1" And I follow "Course 1" - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" And I turn editing mode on And I give the grade "50.00" to the user "Student 1" for the grade item "Test assignment one" And I give the grade "50.00" to the user "Student 1" for the grade item "Test assignment three" @@ -44,7 +44,7 @@ Feature: Student and teacher's view of aggregated grade items is consistent when | Hidden | 1 | And I press "Save changes" And I follow "Course 1" - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" And I select "User report" from the "Grade report" singleselect And I select "Myself" from the "View report as" singleselect And I select "Student 1" from the "Select all or one user" singleselect @@ -57,7 +57,7 @@ Feature: Student and teacher's view of aggregated grade items is consistent when When I log out And I log in as "student1" And I follow "Course 1" - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" And I navigate to "User report" node in "Grade administration" Then the following should exist in the "user-grade" table: | Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total | diff --git a/grade/tests/behat/grade_letter_boundary.feature b/grade/tests/behat/grade_letter_boundary.feature index 73c04f1e225..868a2cea133 100644 --- a/grade/tests/behat/grade_letter_boundary.feature +++ b/grade/tests/behat/grade_letter_boundary.feature @@ -22,7 +22,7 @@ Feature: We can customise the letter boundary of a course. | assign | C1 | a1 | Test assignment one | Submit something! | 100 | And I log in as "teacher1" And I follow "Course 1" - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" And I select "Course grade settings" from the "Grade report" singleselect And I set the following fields to these values: | Grade display type | Letter | diff --git a/grade/tests/behat/grade_letter_boundary_20160518.feature b/grade/tests/behat/grade_letter_boundary_20160518.feature index e451824f76e..bd81919ead1 100644 --- a/grade/tests/behat/grade_letter_boundary_20160518.feature +++ b/grade/tests/behat/grade_letter_boundary_20160518.feature @@ -23,7 +23,7 @@ Feature: We can customise the letter boundary of a course. | assign | C1 | a1 | Test assignment one | Submit something! | 100 | And I log in as "teacher1" And I follow "Course 1" - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" And I select "Course grade settings" from the "Grade report" singleselect And I set the following fields to these values: | Grade display type | Letter | diff --git a/grade/tests/behat/grade_mingrade.feature b/grade/tests/behat/grade_mingrade.feature index a886c39cb7a..7d720a490b5 100644 --- a/grade/tests/behat/grade_mingrade.feature +++ b/grade/tests/behat/grade_mingrade.feature @@ -27,7 +27,7 @@ Feature: We can use a minimum grade different than zero | grade_aggregations_visible | Mean of grades,Weighted mean of grades,Simple weighted mean of grades,Mean of grades (with extra credits),Median of grades,Lowest grade,Highest grade,Mode of grades,Natural | And I am on site homepage And I follow "Course 1" - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" And I navigate to "Gradebook setup" node in "Grade administration > Setup" And I press "Add grade item" And I set the following fields to these values: @@ -86,7 +86,7 @@ Feature: We can use a minimum grade different than zero And I log out And I log in as "teacher1" And I follow "Course 1" - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" And I turn editing mode on When I give the grade "-25.00" to the user "Student 1" for the grade item "Manual item 1" And I give the grade "50.00" to the user "Student 1" for the grade item "Manual item 2" diff --git a/grade/tests/behat/grade_minmax.feature b/grade/tests/behat/grade_minmax.feature index 971461ad819..f38dbfea36b 100644 --- a/grade/tests/behat/grade_minmax.feature +++ b/grade/tests/behat/grade_minmax.feature @@ -26,7 +26,7 @@ Feature: We can choose what min or max grade to use when aggregating grades. | grade_minmaxtouse | Min and max grades as specified in grade item settings | And I am on site homepage And I follow "C1" - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" And I navigate to "Gradebook setup" node in "Grade administration > Setup" And I press "Add grade item" And I set the following fields to these values: @@ -68,7 +68,7 @@ Feature: We can choose what min or max grade to use when aggregating grades. And I log out And I log in as "teacher1" And I follow "C1" - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" And I turn editing mode on And I give the grade "75.00" to the user "Student 1" for the grade item "MI 1" And I give the grade "25.00" to the user "Student 1" for the grade item "MI 2" diff --git a/grade/tests/behat/grade_natural_exclude_empty.feature b/grade/tests/behat/grade_natural_exclude_empty.feature index 22c35aaad35..471029907f7 100644 --- a/grade/tests/behat/grade_natural_exclude_empty.feature +++ b/grade/tests/behat/grade_natural_exclude_empty.feature @@ -25,7 +25,7 @@ Feature: Weights in natural aggregation are adjusted if the items are excluded f | assign | C1 | a5 | Test assignment five (extra) | x | 10 | And I log in as "teacher1" And I follow "Course 1" - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" And I set the field "Grade report" to "Gradebook setup" And I set the following settings for grade item "Test assignment four (extra)": | Extra credit | 1 | @@ -34,7 +34,7 @@ Feature: Weights in natural aggregation are adjusted if the items are excluded f @javascript Scenario: No weights are overridden and student has all grades present - When I navigate to "Grades" node in "Course administration" + When I click on "Grades" "link" in the "Navigation" "block" And I turn editing mode on And I give the grade "80.00" to the user "Student 1" for the grade item "Test assignment one" And I give the grade "30.00" to the user "Student 1" for the grade item "Test assignment two" @@ -56,7 +56,7 @@ Feature: Weights in natural aggregation are adjusted if the items are excluded f @javascript Scenario: No weights are overridden, student has some grades present - When I navigate to "Grades" node in "Course administration" + When I click on "Grades" "link" in the "Navigation" "block" And I turn editing mode on And I give the grade "80.00" to the user "Student 1" for the grade item "Test assignment one" And I give the grade "30.00" to the user "Student 1" for the grade item "Test assignment two" @@ -77,7 +77,7 @@ Feature: Weights in natural aggregation are adjusted if the items are excluded f @javascript Scenario: No weights are overridden, student has none grades present except for extra credit - When I navigate to "Grades" node in "Course administration" + When I click on "Grades" "link" in the "Navigation" "block" And I turn editing mode on And I give the grade "10.00" to the user "Student 1" for the grade item "Test assignment four (extra)" And I give the grade "8.00" to the user "Student 1" for the grade item "Test assignment five (extra)" @@ -102,7 +102,7 @@ Feature: Weights in natural aggregation are adjusted if the items are excluded f | Extra credit | 1 | And I set the following settings for grade item "Test assignment three": | Extra credit | 1 | - When I navigate to "Grades" node in "Course administration" + When I click on "Grades" "link" in the "Navigation" "block" And I turn editing mode on And I give the grade "80.00" to the user "Student 1" for the grade item "Test assignment one" And I give the grade "30.00" to the user "Student 1" for the grade item "Test assignment two" @@ -126,7 +126,7 @@ Feature: Weights in natural aggregation are adjusted if the items are excluded f When I set the field "Override weight of Test assignment one" to "1" And I set the field "Weight of Test assignment one" to "50" And I press "Save changes" - When I navigate to "Grades" node in "Course administration" + When I click on "Grades" "link" in the "Navigation" "block" And I turn editing mode on And I give the grade "80.00" to the user "Student 1" for the grade item "Test assignment one" And I give the grade "30.00" to the user "Student 1" for the grade item "Test assignment two" @@ -151,7 +151,7 @@ Feature: Weights in natural aggregation are adjusted if the items are excluded f When I set the field "Override weight of Test assignment one" to "1" And I set the field "Weight of Test assignment one" to "50" And I press "Save changes" - When I navigate to "Grades" node in "Course administration" + When I click on "Grades" "link" in the "Navigation" "block" And I turn editing mode on And I give the grade "80.00" to the user "Student 1" for the grade item "Test assignment one" And I give the grade "30.00" to the user "Student 1" for the grade item "Test assignment two" @@ -175,7 +175,7 @@ Feature: Weights in natural aggregation are adjusted if the items are excluded f When I set the field "Override weight of Test assignment one" to "1" And I set the field "Weight of Test assignment one" to "50" And I press "Save changes" - When I navigate to "Grades" node in "Course administration" + When I click on "Grades" "link" in the "Navigation" "block" And I turn editing mode on And I give the grade "10.00" to the user "Student 1" for the grade item "Test assignment four (extra)" And I give the grade "8.00" to the user "Student 1" for the grade item "Test assignment five (extra)" @@ -199,7 +199,7 @@ Feature: Weights in natural aggregation are adjusted if the items are excluded f And I set the field "Override weight of Test assignment four (extra)" to "1" And I set the field "Weight of Test assignment four (extra)" to "10" And I press "Save changes" - When I navigate to "Grades" node in "Course administration" + When I click on "Grades" "link" in the "Navigation" "block" And I turn editing mode on And I give the grade "80.00" to the user "Student 1" for the grade item "Test assignment one" And I give the grade "30.00" to the user "Student 1" for the grade item "Test assignment two" @@ -226,7 +226,7 @@ Feature: Weights in natural aggregation are adjusted if the items are excluded f And I set the field "Override weight of Test assignment four (extra)" to "1" And I set the field "Weight of Test assignment four (extra)" to "10" And I press "Save changes" - When I navigate to "Grades" node in "Course administration" + When I click on "Grades" "link" in the "Navigation" "block" And I turn editing mode on And I give the grade "80.00" to the user "Student 1" for the grade item "Test assignment one" And I give the grade "30.00" to the user "Student 1" for the grade item "Test assignment two" @@ -252,7 +252,7 @@ Feature: Weights in natural aggregation are adjusted if the items are excluded f And I set the field "Override weight of Test assignment four (extra)" to "1" And I set the field "Weight of Test assignment four (extra)" to "10" And I press "Save changes" - When I navigate to "Grades" node in "Course administration" + When I click on "Grades" "link" in the "Navigation" "block" And I turn editing mode on And I give the grade "10.00" to the user "Student 1" for the grade item "Test assignment four (extra)" And I give the grade "8.00" to the user "Student 1" for the grade item "Test assignment five (extra)" diff --git a/grade/tests/behat/grade_natural_exclude_empty_20150619.feature b/grade/tests/behat/grade_natural_exclude_empty_20150619.feature index e3722f39fb4..81bab50f6dd 100644 --- a/grade/tests/behat/grade_natural_exclude_empty_20150619.feature +++ b/grade/tests/behat/grade_natural_exclude_empty_20150619.feature @@ -26,7 +26,7 @@ Feature: Gradebook calculations for extra credit items before the fix 20150619 | assign | C1 | a5 | Test assignment five (extra) | x | 10 | And I log in as "teacher1" And I follow "Course 1" - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" And I set the field "Grade report" to "Gradebook setup" And I set the following settings for grade item "Test assignment four (extra)": | Extra credit | 1 | @@ -35,7 +35,7 @@ Feature: Gradebook calculations for extra credit items before the fix 20150619 @javascript Scenario: No weights are overridden and student has all grades present (before the fix 20150619) - When I navigate to "Grades" node in "Course administration" + When I click on "Grades" "link" in the "Navigation" "block" And I turn editing mode on And I give the grade "80.00" to the user "Student 1" for the grade item "Test assignment one" And I give the grade "30.00" to the user "Student 1" for the grade item "Test assignment two" @@ -57,7 +57,7 @@ Feature: Gradebook calculations for extra credit items before the fix 20150619 @javascript Scenario: No weights are overridden, student has some grades present (before the fix 20150619) - When I navigate to "Grades" node in "Course administration" + When I click on "Grades" "link" in the "Navigation" "block" And I turn editing mode on And I give the grade "80.00" to the user "Student 1" for the grade item "Test assignment one" And I give the grade "30.00" to the user "Student 1" for the grade item "Test assignment two" @@ -78,7 +78,7 @@ Feature: Gradebook calculations for extra credit items before the fix 20150619 @javascript Scenario: No weights are overridden, student has none grades present except for extra credit (before the fix 20150619) - When I navigate to "Grades" node in "Course administration" + When I click on "Grades" "link" in the "Navigation" "block" And I turn editing mode on And I give the grade "10.00" to the user "Student 1" for the grade item "Test assignment four (extra)" And I give the grade "8.00" to the user "Student 1" for the grade item "Test assignment five (extra)" @@ -103,7 +103,7 @@ Feature: Gradebook calculations for extra credit items before the fix 20150619 | Extra credit | 1 | And I set the following settings for grade item "Test assignment three": | Extra credit | 1 | - When I navigate to "Grades" node in "Course administration" + When I click on "Grades" "link" in the "Navigation" "block" And I turn editing mode on And I give the grade "80.00" to the user "Student 1" for the grade item "Test assignment one" And I give the grade "30.00" to the user "Student 1" for the grade item "Test assignment two" @@ -127,7 +127,7 @@ Feature: Gradebook calculations for extra credit items before the fix 20150619 When I set the field "Override weight of Test assignment one" to "1" And I set the field "Weight of Test assignment one" to "50" And I press "Save changes" - When I navigate to "Grades" node in "Course administration" + When I click on "Grades" "link" in the "Navigation" "block" And I turn editing mode on And I give the grade "80.00" to the user "Student 1" for the grade item "Test assignment one" And I give the grade "30.00" to the user "Student 1" for the grade item "Test assignment two" @@ -153,7 +153,7 @@ Feature: Gradebook calculations for extra credit items before the fix 20150619 When I set the field "Override weight of Test assignment one" to "1" And I set the field "Weight of Test assignment one" to "50" And I press "Save changes" - When I navigate to "Grades" node in "Course administration" + When I click on "Grades" "link" in the "Navigation" "block" And I turn editing mode on And I give the grade "80.00" to the user "Student 1" for the grade item "Test assignment one" And I give the grade "30.00" to the user "Student 1" for the grade item "Test assignment two" @@ -178,7 +178,7 @@ Feature: Gradebook calculations for extra credit items before the fix 20150619 When I set the field "Override weight of Test assignment one" to "1" And I set the field "Weight of Test assignment one" to "50" And I press "Save changes" - When I navigate to "Grades" node in "Course administration" + When I click on "Grades" "link" in the "Navigation" "block" And I turn editing mode on And I give the grade "10.00" to the user "Student 1" for the grade item "Test assignment four (extra)" And I give the grade "8.00" to the user "Student 1" for the grade item "Test assignment five (extra)" @@ -202,7 +202,7 @@ Feature: Gradebook calculations for extra credit items before the fix 20150619 And I set the field "Override weight of Test assignment four (extra)" to "1" And I set the field "Weight of Test assignment four (extra)" to "10" And I press "Save changes" - When I navigate to "Grades" node in "Course administration" + When I click on "Grades" "link" in the "Navigation" "block" And I turn editing mode on And I give the grade "80.00" to the user "Student 1" for the grade item "Test assignment one" And I give the grade "30.00" to the user "Student 1" for the grade item "Test assignment two" @@ -230,7 +230,7 @@ Feature: Gradebook calculations for extra credit items before the fix 20150619 And I set the field "Override weight of Test assignment four (extra)" to "1" And I set the field "Weight of Test assignment four (extra)" to "10" And I press "Save changes" - When I navigate to "Grades" node in "Course administration" + When I click on "Grades" "link" in the "Navigation" "block" And I turn editing mode on And I give the grade "80.00" to the user "Student 1" for the grade item "Test assignment one" And I give the grade "30.00" to the user "Student 1" for the grade item "Test assignment two" @@ -257,7 +257,7 @@ Feature: Gradebook calculations for extra credit items before the fix 20150619 And I set the field "Override weight of Test assignment four (extra)" to "1" And I set the field "Weight of Test assignment four (extra)" to "10" And I press "Save changes" - When I navigate to "Grades" node in "Course administration" + When I click on "Grades" "link" in the "Navigation" "block" And I turn editing mode on And I give the grade "10.00" to the user "Student 1" for the grade item "Test assignment four (extra)" And I give the grade "8.00" to the user "Student 1" for the grade item "Test assignment five (extra)" diff --git a/grade/tests/behat/grade_natural_normalisation.feature b/grade/tests/behat/grade_natural_normalisation.feature index 6f8a16bff37..3bcc6b67cf1 100644 --- a/grade/tests/behat/grade_natural_normalisation.feature +++ b/grade/tests/behat/grade_natural_normalisation.feature @@ -32,7 +32,7 @@ Feature: We can use natural aggregation and weights will be normalised to a tota | assign | C1 | a7 | Test assignment seven | Submit nothing! | Sub category 1 | 15 | And I log in as "teacher1" And I follow "Course 1" - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" And I set the field "Grade report" to "Gradebook setup" @javascript diff --git a/grade/tests/behat/grade_natural_normalisation_20150619.feature b/grade/tests/behat/grade_natural_normalisation_20150619.feature index 6b488e17207..55ef48ff723 100644 --- a/grade/tests/behat/grade_natural_normalisation_20150619.feature +++ b/grade/tests/behat/grade_natural_normalisation_20150619.feature @@ -33,7 +33,7 @@ Feature: Gradebook calculations for natural weights normalisation before the fix | assign | C1 | a7 | Test assignment seven | Submit nothing! | Sub category 1 | 15 | And I log in as "teacher1" And I follow "Course 1" - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" And I set the field "Grade report" to "Gradebook setup" @javascript diff --git a/grade/tests/behat/grade_override_letter.feature b/grade/tests/behat/grade_override_letter.feature index 6abdcb9e0d4..42b44ace907 100644 --- a/grade/tests/behat/grade_override_letter.feature +++ b/grade/tests/behat/grade_override_letter.feature @@ -16,7 +16,7 @@ Feature: Grade letters can be overridden | teacher1 | C1 | editingteacher | And I log in as "teacher1" And I follow "Course 1" - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" And I follow "Letters" And I follow "Edit grade letters" diff --git a/grade/tests/behat/grade_scales.feature b/grade/tests/behat/grade_scales.feature index f6485ed2d04..c63a8047974 100644 --- a/grade/tests/behat/grade_scales.feature +++ b/grade/tests/behat/grade_scales.feature @@ -71,7 +71,7 @@ Feature: View gradebook when scales are used And I press "Save changes" And I press "Ok" And I follow "Course 1" - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" And I navigate to "Course grade settings" node in "Grade administration > Setup" And I set the field "Show weightings" to "Show" And I set the field "Show contribution to course total" to "Show" @@ -108,7 +108,7 @@ Feature: View gradebook when scales are used And I log out And I log in as "student2" And I follow "Grades" in the user menu - And I follow "Course 1" + And I click on "Course 1" "link" in the "region-main" "region" And the following should exist in the "user-grade" table: | Grade item | Grade | Range | Percentage | Contribution to course total | | Test assignment one | B | F–A | 75.00 % | 80.00 % | @@ -154,7 +154,7 @@ Feature: View gradebook when scales are used And I log out And I log in as "student2" And I follow "Grades" in the user menu - And I follow "Course 1" + And I click on "Course 1" "link" in the "region-main" "region" And the following should exist in the "user-grade" table: | Grade item | Grade | Range | Percentage | Contribution to course total | | Test assignment one | B | F–A | 75.00 % | | diff --git a/grade/tests/behat/grade_scales_aggregation.feature b/grade/tests/behat/grade_scales_aggregation.feature index 216bc05adda..6051ed7b633 100644 --- a/grade/tests/behat/grade_scales_aggregation.feature +++ b/grade/tests/behat/grade_scales_aggregation.feature @@ -39,7 +39,7 @@ Feature: Control the aggregation of the scales Scenario Outline: Scales can be excluded from aggregation Given I log in as "teacher1" And I follow "Course 1" - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" And I turn editing mode on When I give the grade "10" to the user "Student 1" for the grade item "Grade me" And I give the grade "B" to the user "Student 1" for the grade item "Scale me" @@ -60,7 +60,7 @@ Feature: Control the aggregation of the scales And I log out And I log in as "teacher1" And I follow "Course 1" - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" And I follow "User report" And I select "Student 1" from the "Select all or one user" singleselect And the following should exist in the "user-grade" table: @@ -85,7 +85,7 @@ Feature: Control the aggregation of the scales Scenario: Weights of scales cannot be edited when they are not aggregated Given I log in as "teacher1" And I follow "Course 1" - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" And I turn editing mode on When I set the following settings for grade item "Course 1": | Aggregation | Natural | @@ -100,7 +100,7 @@ Feature: Control the aggregation of the scales And the following config values are set as admin: | grade_includescalesinaggregation | 1 | And I follow "Course 1" - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" And I navigate to "Gradebook setup" node in "Grade administration > Setup" And I set the field "Override weight of Grade me" to "1" And the field "Override weight of Grade me" matches value "95.238" diff --git a/grade/tests/behat/grade_single_item_scales.feature b/grade/tests/behat/grade_single_item_scales.feature index f62db0af703..9a5f78a5fce 100644 --- a/grade/tests/behat/grade_single_item_scales.feature +++ b/grade/tests/behat/grade_single_item_scales.feature @@ -49,7 +49,7 @@ Feature: View gradebook when single item scales are used And I press "Save changes" And I press "Ok" And I follow "Course 1" - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" And I navigate to "Course grade settings" node in "Grade administration > Setup" And I set the field "Show weightings" to "Show" And I set the field "Show contribution to course total" to "Show" diff --git a/grade/tests/behat/grade_to_pass.feature b/grade/tests/behat/grade_to_pass.feature index 55ec7b4d799..ad1ed26936a 100644 --- a/grade/tests/behat/grade_to_pass.feature +++ b/grade/tests/behat/grade_to_pass.feature @@ -54,7 +54,7 @@ Feature: We can set the grade to pass value | grade[modgrade_type] | Point | | grade[modgrade_point] | 50 | | Grade to pass | 25 | - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" And I turn editing mode on And I click on "Edit assign Test Assignment 1" "link" Then the field "Grade to pass" matches value "25" @@ -64,7 +64,7 @@ Feature: We can set the grade to pass value And I expand all fieldsets And I set the field "Grade to pass" to "30" And I press "Save and return to course" - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" And I click on "Edit assign Test Assignment 1" "link" And the field "Grade to pass" matches value "30" @@ -76,7 +76,7 @@ Feature: We can set the grade to pass value | grade[modgrade_type] | Scale | | grade[modgrade_scale] | Test Scale 1 | | Grade to pass | 3 | - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" And I turn editing mode on And I click on "Edit assign Test Assignment 1" "link" And I expand all fieldsets @@ -107,7 +107,7 @@ Feature: We can set the grade to pass value | Submission grade to pass | 40 | | gradinggrade | 20 | | Assessment grade to pass | 10 | - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" And I turn editing mode on And I click on "Edit workshop Test Workshop 1 (submission)" "link" And I expand all fieldsets @@ -142,7 +142,7 @@ Feature: We can set the grade to pass value And I add a "Quiz" to section "1" and I fill the form with: | Name | Test Quiz 1 | | Grade to pass | 9.5 | - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" And I turn editing mode on And I click on "Edit quiz Test Quiz 1" "link" And I expand all fieldsets @@ -160,7 +160,7 @@ Feature: We can set the grade to pass value | Name | Test Lesson 1 | | Description | Test | | Grade to pass | 90 | - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" And I turn editing mode on And I click on "Edit lesson Test Lesson 1" "link" And I expand all fieldsets @@ -179,7 +179,7 @@ Feature: We can set the grade to pass value | Description | Test | | Aggregate type | Average of ratings | | Grade to pass | 90 | - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" And I turn editing mode on And I click on "Edit data Test Database 1" "link" And I expand all fieldsets @@ -208,7 +208,7 @@ Feature: We can set the grade to pass value | Description | Test | | Aggregate type | Average of ratings | | Grade to pass | 90 | - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" And I turn editing mode on And I click on "Edit forum Test Forum 1" "link" And I expand all fieldsets @@ -227,7 +227,7 @@ Feature: We can set the grade to pass value | Description | Test | | Aggregate type | Average of ratings | | Grade to pass | 90 | - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" And I turn editing mode on And I click on "Edit glossary Test Glossary 1" "link" And I expand all fieldsets diff --git a/grade/tests/behat/grade_view.feature b/grade/tests/behat/grade_view.feature index 2632fed99d2..73c1995c3f0 100644 --- a/grade/tests/behat/grade_view.feature +++ b/grade/tests/behat/grade_view.feature @@ -51,7 +51,7 @@ Feature: We can enter in grades and view reports from the gradebook And I log out And I log in as "teacher1" And I follow "Course 1" - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" And I turn editing mode on And I give the grade "80.00" to the user "Student 1" for the grade item "Test assignment name 1" And I give the grade "90.00" to the user "Student 1" for the grade item "Test assignment name 2" @@ -66,7 +66,7 @@ Feature: We can enter in grades and view reports from the gradebook And I log out And I log in as "student1" And I follow "Grades" in the user menu - And I follow "Course 1" + And I click on "Course 1" "link" in the "region-main" "region" Then the following should exist in the "user-grade" table: | Grade item | Grade | Range | Percentage | | Test assignment name 1 | 80.00 | 0–100 | 80.00 % | @@ -93,7 +93,7 @@ Feature: We can enter in grades and view reports from the gradebook And I log out And I log in as "student1" And I follow "Grades" in the user menu - And I follow "Course 1" + And I click on "Course 1" "link" in the "region-main" "region" Then the following should exist in the "user-grade" table: | Grade item | Calculated weight | Grade | Range | Percentage | | Test assignment name 1 | 41.86 % | 80.00 | 0–100 | 80.00 % | diff --git a/group/tests/behat/update_groups.feature b/group/tests/behat/update_groups.feature index 3779fc748e6..e7b428bb225 100644 --- a/group/tests/behat/update_groups.feature +++ b/group/tests/behat/update_groups.feature @@ -150,4 +150,4 @@ Feature: Automatic updating of groups and groupings And I set the following fields to these values: | Enrolment key | Abcdef-1 | And I press "Save changes" - And I should not see "This enrolment key is already used for another group." \ No newline at end of file + And I should not see "This enrolment key is already used for another group." diff --git a/lang/en/admin.php b/lang/en/admin.php index 0f833aca334..23a2ec83e4b 100644 --- a/lang/en/admin.php +++ b/lang/en/admin.php @@ -737,8 +737,6 @@ $string['navadduserpostslinks'] = 'Add links to view user posts'; $string['navadduserpostslinks_help'] = 'If enabled two links will be added to each user in the navigation to view discussions the user has started and posts the user has made in forums throughout the site or in specific courses.'; $string['navigationupgrade'] = 'This upgrade introduces two new navigation blocks that will replace these blocks: Administration, Courses, Activities and Participants. If you had set any special permissions on those blocks you should check to make sure everything is behaving as you want it.'; $string['navcourselimit'] = 'Course limit'; -$string['navexpandmycourses'] = 'Show My courses expanded on Dashboard'; -$string['navexpandmycourses_desc'] = 'If enabled, My courses is initially shown expanded in the navigation block on Dashboard.'; $string['navshowfullcoursenames'] = 'Show course full names'; $string['navshowfullcoursenames_help'] = 'If enabled, course full names will be used in the navigation rather than short names.'; $string['navshowfrontpagemods'] = 'Show front page activities in the navigation'; @@ -889,6 +887,7 @@ $string['proxypassword'] = 'Proxy password'; $string['proxyport'] = 'Proxy port'; $string['proxytype'] = 'Proxy type'; $string['proxyuser'] = 'Proxy username'; +$string['query'] = 'Query'; $string['question'] = 'Question'; $string['questionbehaviours'] = 'Question behaviours'; $string['questioncwqpfscheck'] = 'One or more \'random\' questions in a quiz are set up to select questions from a mixture of shared and unshared question categories. There is a more detailed report here and see Moodle Docs page here.'; diff --git a/lang/en/block.php b/lang/en/block.php index 7b318595184..ad04aef94cc 100644 --- a/lang/en/block.php +++ b/lang/en/block.php @@ -26,6 +26,7 @@ $string['addtodock'] = 'Move this to the dock'; $string['anypagematchingtheabove'] = 'Any page matching the above'; $string['appearsinsubcontexts'] = 'Appears in sub-contexts'; $string['assignrolesinblock'] = 'Assign roles in {$a} block'; +$string['blocksdrawertoggle'] = 'Hide/show blocks drawer'; $string['blocksettings'] = 'Block settings'; $string['bracketfirst'] = '{$a} (first)'; $string['bracketlast'] = '{$a} (last)'; @@ -51,6 +52,7 @@ $string['moveblockafter'] = 'Move block to after {$a} block'; $string['moveblockbefore'] = 'Move block to before {$a} block'; $string['moveblockinregion'] = 'Move block to {$a} region'; $string['movingthisblockcancel'] = 'Moving this block ({$a})'; +$string['myblocks'] = 'My blocks'; $string['onthispage'] = 'On this page'; $string['pagetypes'] = 'Page types'; $string['pagetypewarning'] = 'The previously specified page type is no longer selectable. Please choose the most appropriate page type below.'; diff --git a/lib/behat/classes/util.php b/lib/behat/classes/util.php index 9bb56b8ec19..5cfb8fd177e 100644 --- a/lib/behat/classes/util.php +++ b/lib/behat/classes/util.php @@ -108,6 +108,9 @@ class behat_util extends testing_util { set_config('debug', DEBUG_DEVELOPER); set_config('debugdisplay', 1); + // Force the navigation and settings blocks, even if the theme has made them optional. + set_config('undeletableblocktypes', 'navigation,settings'); + // Disable some settings that are not wanted on test sites. set_config('noemailever', 1); diff --git a/lib/blocklib.php b/lib/blocklib.php index 2f745512651..37b560465f4 100644 --- a/lib/blocklib.php +++ b/lib/blocklib.php @@ -363,14 +363,20 @@ class block_manager { * @return array names of block types that cannot be added or deleted. E.g. array('navigation','settings'). */ public static function get_undeletable_block_types() { - global $CFG; + global $CFG, $PAGE; + $undeletableblocks = false; + if (isset($CFG->undeletableblocktypes)) { + $undeletableblocks = $CFG->undeletableblocktypes; + } else if (isset($PAGE->theme->undeletableblocktypes)) { + $undeletableblocks = $PAGE->theme->undeletableblocktypes; + } - if (!isset($CFG->undeletableblocktypes) || (!is_array($CFG->undeletableblocktypes) && !is_string($CFG->undeletableblocktypes))) { + if ($undeletableblocks === false) { return array('navigation','settings'); - } else if (is_string($CFG->undeletableblocktypes)) { - return explode(',', $CFG->undeletableblocktypes); + } else if (is_string($undeletableblocks)) { + return explode(',', $undeletableblocks); } else { - return $CFG->undeletableblocktypes; + return $undeletableblocks; } } @@ -711,6 +717,10 @@ class block_manager { } public function add_block_at_end_of_default_region($blockname) { + if (empty($this->birecordsbyregion)) { + // No blocks or block regions exist yet. + return; + } $defaulregion = $this->get_default_region(); $lastcurrentblock = end($this->birecordsbyregion[$defaulregion]); @@ -947,9 +957,30 @@ class block_manager { * method, before any output is done. */ public function create_all_block_instances() { + global $PAGE; + + // If there are any un-removable blocks that were not created - force them. + $undeletable = $this->get_undeletable_block_types(); + foreach ($undeletable as $forced) { + if (empty($forced)) { + continue; + } + $found = false; + foreach ($this->get_regions() as $region) { + foreach($this->birecordsbyregion[$region] as $instance) { + if ($instance->blockname == $forced) { + $found = true; + } + } + } + if (!$found) { + $this->add_block_at_end_of_default_region($forced); + } + } foreach ($this->get_regions() as $region) { $this->ensure_instances_exist($region); } + } /** @@ -2225,8 +2256,8 @@ function blocks_get_default_site_course_blocks() { return blocks_parse_default_blocks_list($CFG->defaultblocks_site); } else { return array( - BLOCK_POS_LEFT => array('site_main_menu'), - BLOCK_POS_RIGHT => array('course_summary', 'calendar_month') + BLOCK_POS_LEFT => array(), + BLOCK_POS_RIGHT => array() ); } } @@ -2272,7 +2303,7 @@ function blocks_add_default_system_blocks() { $page = new moodle_page(); $page->set_context(context_system::instance()); - $page->blocks->add_blocks(array(BLOCK_POS_LEFT => array('navigation', 'settings')), '*', null, true); + $page->blocks->add_blocks(array(BLOCK_POS_LEFT => block_manager::get_undeletable_block_types()), '*', null, true); $page->blocks->add_blocks(array(BLOCK_POS_LEFT => array('admin_bookmarks')), 'admin-*', null, null, 2); if ($defaultmypage = $DB->get_record('my_pages', array('userid' => null, 'name' => '__default', 'private' => 1))) { diff --git a/lib/editor/atto/plugins/accessibilitychecker/tests/behat/accessibilitychecker.feature b/lib/editor/atto/plugins/accessibilitychecker/tests/behat/accessibilitychecker.feature index 478f50e69ad..90c53d7dba9 100644 --- a/lib/editor/atto/plugins/accessibilitychecker/tests/behat/accessibilitychecker.feature +++ b/lib/editor/atto/plugins/accessibilitychecker/tests/behat/accessibilitychecker.feature @@ -6,7 +6,7 @@ Feature: Atto accessibility checker Scenario: Images with no alt Given I log in as "admin" And I follow "Profile" in the user menu - And I follow "Edit profile" + And I click on "Edit profile" "link" in the "region-main" "region" And I set the field "Description" to "

Some plain text

Some more text

" When I click on "Show more buttons" "button" And I click on "Accessibility checker" "button" @@ -32,7 +32,7 @@ Feature: Atto accessibility checker Scenario: Low contrast Given I log in as "admin" And I follow "Profile" in the user menu - And I follow "Edit profile" + And I click on "Edit profile" "link" in the "region-main" "region" And I set the field "Description" to "

Hard to read

" When I click on "Show more buttons" "button" And I click on "Accessibility checker" "button" @@ -42,7 +42,7 @@ Feature: Atto accessibility checker Scenario: No headings Given I log in as "admin" And I follow "Profile" in the user menu - And I follow "Edit profile" + And I click on "Edit profile" "link" in the "region-main" "region" And I set the field "Description" to "

Sweet roll oat cake jelly-o macaroon donut oat cake. Caramels macaroon cookie sweet roll croissant cheesecake candy jelly-o. Gummies sugar plum sugar plum gingerbread dessert. Tiramisu bonbon jujubes danish marshmallow cookie chocolate cake cupcake tiramisu. Bear claw oat cake chocolate bar croissant. Lollipop cookie topping liquorice croissant. Brownie cookie cupcake lollipop cupcake cupcake. Fruitcake dessert sweet biscuit dragée caramels marzipan brownie. Chupa chups gingerbread apple pie cookie liquorice caramels carrot cake cookie gingerbread. Croissant candy jelly beans. Tiramisu apple pie dessert apple pie macaroon soufflé. Brownie powder carrot cake chocolate. Tart applicake croissant dragée macaroon chocolate donut.

Jelly beans gingerbread tootsie roll. Sugar plum tiramisu cotton candy toffee pie cotton candy tiramisu. Carrot cake chocolate bar sesame snaps cupcake cake dessert sweet fruitcake wafer. Marshmallow cupcake gingerbread pie sweet candy canes powder gummi bears. Jujubes cake muffin marshmallow candy jelly beans tootsie roll pie. Gummi bears applicake chocolate cake sweet jelly sesame snaps lollipop lollipop carrot cake. Marshmallow cake jelly beans. Jelly beans sesame snaps muffin halvah cookie ice cream candy canes carrot cake. Halvah donut marshmallow tiramisu. Cookie dessert gummi bears. Sugar plum apple pie jelly beans gummi bears tart chupa chups. Liquorice macaroon gummi bears gummies macaroon marshmallow sweet roll cake topping. Lemon drops caramels pie icing danish. Chocolate cake oat cake dessert halvah danish carrot cake apple pie.

" When I click on "Show more buttons" "button" And I click on "Accessibility checker" "button" @@ -52,7 +52,7 @@ Feature: Atto accessibility checker Scenario: Merged cells Given I log in as "admin" And I follow "Profile" in the user menu - And I follow "Edit profile" + And I click on "Edit profile" "link" in the "region-main" "region" And I set the field "Description" to "
Dogs that look good in pants
BreedCoolness
PoodleNOT COOL
Doberman
" When I click on "Show more buttons" "button" And I click on "Accessibility checker" "button" @@ -62,7 +62,7 @@ Feature: Atto accessibility checker Scenario: Table missing row/column headers Given I log in as "admin" And I follow "Profile" in the user menu - And I follow "Edit profile" + And I click on "Edit profile" "link" in the "region-main" "region" And I set the field "Description" to "
Dogs that look good in pants
BreedCoolness
PoodleNOT COOL
DobermanCOOL
" When I click on "Show more buttons" "button" And I click on "Accessibility checker" "button" @@ -72,7 +72,7 @@ Feature: Atto accessibility checker Scenario: Table missing caption Given I log in as "admin" And I follow "Profile" in the user menu - And I follow "Edit profile" + And I click on "Edit profile" "link" in the "region-main" "region" And I set the field "Description" to "
BreedCoolness
PoodleNOT COOL
DobermanCOOL
" When I click on "Show more buttons" "button" And I click on "Accessibility checker" "button" diff --git a/lib/editor/atto/plugins/accessibilityhelper/tests/behat/accessibilityhelper.feature b/lib/editor/atto/plugins/accessibilityhelper/tests/behat/accessibilityhelper.feature index 2bb6bb46210..810f999b75f 100644 --- a/lib/editor/atto/plugins/accessibilityhelper/tests/behat/accessibilityhelper.feature +++ b/lib/editor/atto/plugins/accessibilityhelper/tests/behat/accessibilityhelper.feature @@ -6,7 +6,7 @@ Feature: Atto accessibility helper Scenario: Images and links Given I log in as "admin" And I follow "Profile" in the user menu - And I follow "Edit profile" + And I click on "Edit profile" "link" in the "region-main" "region" And I set the field "Description" to "

Some plain text

Image 1

Some link text

" And I select the text in the "Description" Atto editor When I click on "Show more buttons" "button" @@ -22,7 +22,7 @@ Feature: Atto accessibility helper Scenario: Styles Given I log in as "admin" And I follow "Profile" in the user menu - And I follow "Edit profile" + And I click on "Edit profile" "link" in the "region-main" "region" And I set the field "Description" to "

Some plain text

" When I click on "Show more buttons" "button" And I select the text in the "Description" Atto editor diff --git a/lib/editor/atto/plugins/align/tests/behat/align.feature b/lib/editor/atto/plugins/align/tests/behat/align.feature index f3f724add7b..130389088a8 100644 --- a/lib/editor/atto/plugins/align/tests/behat/align.feature +++ b/lib/editor/atto/plugins/align/tests/behat/align.feature @@ -6,7 +6,7 @@ Feature: Atto align text Scenario: Right align some text Given I log in as "admin" And I follow "Profile" in the user menu - And I follow "Edit profile" + And I click on "Edit profile" "link" in the "region-main" "region" And I set the field "Description" to "

Fascism

" And I click on "Show more buttons" "button" And I select the text in the "Description" Atto editor @@ -16,14 +16,14 @@ Feature: Atto align text And I follow "Editor preferences" And I set the field "Text editor" to "Plain text area" And I press "Save changes" - And I follow "Edit profile" + And I click on "Edit profile" "link" in the "region-main" "region" Then I should see "style=\"text-align:right;\"" @javascript Scenario: Left align some text Given I log in as "admin" And I follow "Profile" in the user menu - And I follow "Edit profile" + And I click on "Edit profile" "link" in the "region-main" "region" And I set the field "Description" to "

Communism

" And I click on "Show more buttons" "button" And I select the text in the "Description" Atto editor @@ -34,14 +34,14 @@ Feature: Atto align text And I follow "Editor preferences" And I set the field "Text editor" to "Plain text area" And I press "Save changes" - And I follow "Edit profile" + And I click on "Edit profile" "link" in the "region-main" "region" Then I should see "style=\"text-align:left;\"" @javascript Scenario: Center align some text Given I log in as "admin" And I follow "Profile" in the user menu - And I follow "Edit profile" + And I click on "Edit profile" "link" in the "region-main" "region" And I set the field "Description" to "

United Future

" And I click on "Show more buttons" "button" And I select the text in the "Description" Atto editor @@ -51,6 +51,6 @@ Feature: Atto align text And I follow "Editor preferences" And I set the field "Text editor" to "Plain text area" And I press "Save changes" - And I follow "Edit profile" + And I click on "Edit profile" "link" in the "region-main" "region" Then I should see "style=\"text-align:center;\"" diff --git a/lib/editor/atto/plugins/bold/tests/behat/bold.feature b/lib/editor/atto/plugins/bold/tests/behat/bold.feature index a1d6316a515..7baf1addcc7 100644 --- a/lib/editor/atto/plugins/bold/tests/behat/bold.feature +++ b/lib/editor/atto/plugins/bold/tests/behat/bold.feature @@ -6,7 +6,7 @@ Feature: Atto bold button Scenario: Bold some text Given I log in as "admin" And I follow "Profile" in the user menu - And I follow "Edit profile" + And I click on "Edit profile" "link" in the "region-main" "region" And I set the field "Description" to "Badger" And I select the text in the "Description" Atto editor When I click on "Bold" "button" @@ -15,14 +15,14 @@ Feature: Atto bold button And I follow "Editor preferences" And I set the field "Text editor" to "Plain text area" And I press "Save changes" - And I follow "Edit profile" + And I click on "Edit profile" "link" in the "region-main" "region" Then I should see "Badger" @javascript Scenario: Unbold some text Given I log in as "admin" And I follow "Profile" in the user menu - And I follow "Edit profile" + And I click on "Edit profile" "link" in the "region-main" "region" And I set the field "Description" to "Mouse" And I select the text in the "Description" Atto editor When I click on "Bold" "button" @@ -32,6 +32,6 @@ Feature: Atto bold button And I follow "Editor preferences" And I set the field "Text editor" to "Plain text area" And I press "Save changes" - And I follow "Edit profile" + And I click on "Edit profile" "link" in the "region-main" "region" Then I should not see "Mouse" And I should see "Mouse" diff --git a/lib/editor/atto/plugins/charmap/tests/behat/charmap.feature b/lib/editor/atto/plugins/charmap/tests/behat/charmap.feature index f7d648169ab..9da6cc936d9 100644 --- a/lib/editor/atto/plugins/charmap/tests/behat/charmap.feature +++ b/lib/editor/atto/plugins/charmap/tests/behat/charmap.feature @@ -6,7 +6,7 @@ Feature: Atto charmap button Scenario: Insert symbols Given I log in as "admin" And I follow "Profile" in the user menu - And I follow "Edit profile" + And I click on "Edit profile" "link" in the "region-main" "region" And I set the field "Description" to "

1980 Mullet

" And I select the text in the "Description" Atto editor When I click on "Show more buttons" "button" @@ -17,5 +17,5 @@ Feature: Atto charmap button And I follow "Editor preferences" And I set the field "Text editor" to "Plain text area" And I press "Save changes" - And I follow "Edit profile" + And I click on "Edit profile" "link" in the "region-main" "region" Then I should see "ā" diff --git a/lib/editor/atto/plugins/clear/tests/behat/clear.feature b/lib/editor/atto/plugins/clear/tests/behat/clear.feature index 1915c7bffba..c458ee6f2d3 100644 --- a/lib/editor/atto/plugins/clear/tests/behat/clear.feature +++ b/lib/editor/atto/plugins/clear/tests/behat/clear.feature @@ -6,7 +6,7 @@ Feature: Atto clear button Scenario: Clear formatting Given I log in as "admin" And I follow "Profile" in the user menu - And I follow "Edit profile" + And I click on "Edit profile" "link" in the "region-main" "region" And I set the field "Description" to "Pisa" And I select the text in the "Description" Atto editor And I click on "Italic" "button" @@ -18,6 +18,6 @@ Feature: Atto clear button And I follow "Editor preferences" And I set the field "Text editor" to "Plain text area" And I press "Save changes" - And I follow "Edit profile" + And I click on "Edit profile" "link" in the "region-main" "region" Then I should not see "Pisa" diff --git a/lib/editor/atto/plugins/collapse/tests/behat/collapse.feature b/lib/editor/atto/plugins/collapse/tests/behat/collapse.feature index 5174ded51b9..88f1aab15b6 100644 --- a/lib/editor/atto/plugins/collapse/tests/behat/collapse.feature +++ b/lib/editor/atto/plugins/collapse/tests/behat/collapse.feature @@ -6,7 +6,7 @@ Feature: Atto collapse button Scenario: Toggle toolbar Given I log in as "admin" And I follow "Profile" in the user menu - And I follow "Edit profile" + And I click on "Edit profile" "link" in the "region-main" "region" When I click on "Show more buttons" "button" Then "Equation editor" "button" should be visible And I click on "Show fewer buttons" "button" diff --git a/lib/editor/atto/plugins/equation/tests/behat/equation.feature b/lib/editor/atto/plugins/equation/tests/behat/equation.feature index a74efe0bfc6..9e219a28126 100644 --- a/lib/editor/atto/plugins/equation/tests/behat/equation.feature +++ b/lib/editor/atto/plugins/equation/tests/behat/equation.feature @@ -6,7 +6,7 @@ Feature: Atto equation editor Scenario: Create an equation Given I log in as "admin" When I follow "Profile" in the user menu - And I follow "Edit profile" + And I click on "Edit profile" "link" in the "region-main" "region" And I set the field "Description" to "

Equation test

" # Set field on the bottom of page, so equation editor dialogue is visible. And I expand all fieldsets @@ -25,7 +25,7 @@ Feature: Atto equation editor Scenario: Edit an equation Given I log in as "admin" When I follow "Profile" in the user menu - And I follow "Edit profile" + And I click on "Edit profile" "link" in the "region-main" "region" And I set the field "Description" to "

\( \pi \)

" # Set field on the bottom of page, so equation editor dialogue is visible. And I expand all fieldsets diff --git a/lib/editor/atto/plugins/html/tests/behat/html.feature b/lib/editor/atto/plugins/html/tests/behat/html.feature index cf4613415a5..1357cfcb0df 100644 --- a/lib/editor/atto/plugins/html/tests/behat/html.feature +++ b/lib/editor/atto/plugins/html/tests/behat/html.feature @@ -6,7 +6,7 @@ Feature: Atto edit HTML Scenario: Edit the html source Given I log in as "admin" When I follow "Profile" in the user menu - And I follow "Edit profile" + And I click on "Edit profile" "link" in the "region-main" "region" And I set the field "Description" to "

Smurf

" And I click on "Show more buttons" "button" And I click on "HTML" "button" diff --git a/lib/editor/atto/plugins/image/tests/behat/image.feature b/lib/editor/atto/plugins/image/tests/behat/image.feature index 744831de47a..c493d0043b8 100644 --- a/lib/editor/atto/plugins/image/tests/behat/image.feature +++ b/lib/editor/atto/plugins/image/tests/behat/image.feature @@ -9,12 +9,12 @@ Feature: Add images to Atto And I upload "lib/editor/atto/tests/fixtures/moodle-logo.png" file to "Files" filemanager And I click on "Save changes" "button" And I follow "Profile" in the user menu - And I follow "Edit profile" + And I click on "Edit profile" "link" in the "region-main" "region" When I set the field "Description" to "

Image test

" And I select the text in the "Description" Atto editor And I click on "Image" "button" And I click on "Browse repositories..." "button" - And I click on "Private files" "link" + And I click on "Private files" "link" in the ".fp-repo-area" "css_element" And I click on "moodle-logo.png" "link" And I click on "Select this file" "button" And I set the field "Describe this image for someone who cannot see it" to "It's the Moodle" @@ -42,7 +42,7 @@ Feature: Add images to Atto And the field "Height" matches value "456" And I click on "Save image" "button" And I click on "Update profile" "button" - And I follow "Edit profile" + And I click on "Edit profile" "link" in the "region-main" "region" And I select the text in the "Description" Atto editor And I click on "Image" "button" Then the field "Describe this image for someone who cannot see it" matches value "It's the Moodle" @@ -53,7 +53,7 @@ Feature: Add images to Atto Scenario: Manually inserting an image Given I log in as "admin" And I follow "Profile" in the user menu - And I follow "Edit profile" + And I click on "Edit profile" "link" in the "region-main" "region" And I set the field "Description" to "

Image: .

" And I select the text in the "Description" Atto editor When I click on "Image" "button" @@ -63,7 +63,7 @@ Feature: Add images to Atto And I press "Save image" And I set the field "Description" to "

Image: Awesome!.

" And I press "Update profile" - And I follow "Edit profile" + And I click on "Edit profile" "link" in the "region-main" "region" And I select the text in the "Description" Atto editor And I click on "Image" "button" And the field "Enter URL" matches value "/nothing/again" diff --git a/lib/editor/atto/plugins/indent/tests/behat/indent.feature b/lib/editor/atto/plugins/indent/tests/behat/indent.feature index 39827b2c0f0..fc4a773e151 100644 --- a/lib/editor/atto/plugins/indent/tests/behat/indent.feature +++ b/lib/editor/atto/plugins/indent/tests/behat/indent.feature @@ -6,7 +6,7 @@ Feature: Indent text in Atto Scenario: Indent Given I log in as "admin" And I follow "Profile" in the user menu - When I follow "Edit profile" + When I click on "Edit profile" "link" in the "region-main" "region" And I set the field "Description" to "

I need some space.

" And I select the text in the "Description" Atto editor And I click on "Show more buttons" "button" @@ -16,14 +16,14 @@ Feature: Indent text in Atto And I follow "Editor preferences" And I set the field "Text editor" to "Plain text area" And I press "Save changes" - And I follow "Edit profile" + And I click on "Edit profile" "link" in the "region-main" "region" Then I should see "class=\"editor-indent\"" @javascript Scenario: Indent and outdent Given I log in as "admin" And I follow "Profile" in the user menu - When I follow "Edit profile" + When I click on "Edit profile" "link" in the "region-main" "region" And I set the field "Description" to "

I need some space.

" And I select the text in the "Description" Atto editor And I click on "Show more buttons" "button" @@ -34,5 +34,5 @@ Feature: Indent text in Atto And I follow "Editor preferences" And I set the field "Text editor" to "Plain text area" And I press "Save changes" - And I follow "Edit profile" + And I click on "Edit profile" "link" in the "region-main" "region" Then I should not see "class=\"editor-indent\"" diff --git a/lib/editor/atto/plugins/italic/tests/behat/italic.feature b/lib/editor/atto/plugins/italic/tests/behat/italic.feature index cd063f069e7..01770e6174a 100644 --- a/lib/editor/atto/plugins/italic/tests/behat/italic.feature +++ b/lib/editor/atto/plugins/italic/tests/behat/italic.feature @@ -6,7 +6,7 @@ Feature: Atto italic button Scenario: Italicise some text Given I log in as "admin" And I follow "Profile" in the user menu - And I follow "Edit profile" + And I click on "Edit profile" "link" in the "region-main" "region" And I set the field "Description" to "Tower of Pisa" And I select the text in the "Description" Atto editor When I click on "Italic" "button" @@ -15,14 +15,14 @@ Feature: Atto italic button And I follow "Editor preferences" And I set the field "Text editor" to "Plain text area" And I press "Save changes" - And I follow "Edit profile" + And I click on "Edit profile" "link" in the "region-main" "region" Then I should see "Tower of Pisa" @javascript Scenario: Toggle italics in some text Given I log in as "admin" And I follow "Profile" in the user menu - And I follow "Edit profile" + And I click on "Edit profile" "link" in the "region-main" "region" And I set the field "Description" to "GHD - for hair" And I select the text in the "Description" Atto editor When I click on "Italic" "button" @@ -32,6 +32,6 @@ Feature: Atto italic button And I follow "Editor preferences" And I set the field "Text editor" to "Plain text area" And I press "Save changes" - And I follow "Edit profile" + And I click on "Edit profile" "link" in the "region-main" "region" Then I should not see "GHD - for hair" And I should see "GHD - for hair" diff --git a/lib/editor/atto/plugins/link/tests/behat/link.feature b/lib/editor/atto/plugins/link/tests/behat/link.feature index 0a0234adaea..4d02eb6d73a 100644 --- a/lib/editor/atto/plugins/link/tests/behat/link.feature +++ b/lib/editor/atto/plugins/link/tests/behat/link.feature @@ -9,12 +9,12 @@ Feature: Add links to Atto And I upload "lib/editor/atto/tests/fixtures/moodle-logo.png" file to "Files" filemanager And I click on "Save changes" "button" When I follow "Profile" in the user menu - And I follow "Edit profile" + And I click on "Edit profile" "link" in the "region-main" "region" And I set the field "Description" to "Super cool" And I select the text in the "Description" Atto editor And I click on "Link" "button" And I click on "Browse repositories..." "button" - And I click on "Private files" "link" + And I click on "Private files" "link" in the ".fp-repo-area" "css_element" And I click on "moodle-logo.png" "link" And I click on "Select this file" "button" And I click on "Update profile" "button" @@ -22,6 +22,6 @@ Feature: Add links to Atto And I follow "Editor preferences" And I set the field "Text editor" to "Plain text area" And I press "Save changes" - And I follow "Edit profile" + And I click on "Edit profile" "link" in the "region-main" "region" Then I should see "Super cool" diff --git a/lib/editor/atto/plugins/media/tests/behat/media.feature b/lib/editor/atto/plugins/media/tests/behat/media.feature index f558f9e4615..5c1326a0bed 100644 --- a/lib/editor/atto/plugins/media/tests/behat/media.feature +++ b/lib/editor/atto/plugins/media/tests/behat/media.feature @@ -16,7 +16,7 @@ Feature: Add media to Atto And I set the field "Entry title" to "The best video in the entire world (not really)" And I click on "Media" "button" And I click on "Browse repositories..." "button" - And I click on "Private files" "link" + And I click on "Private files" "link" in the ".fp-repo-area" "css_element" And I click on "moodle-logo.webm" "link" And I click on "Select this file" "button" And I set the field "Enter name" to "It's the logo" diff --git a/lib/editor/atto/plugins/orderedlist/tests/behat/orderedlist.feature b/lib/editor/atto/plugins/orderedlist/tests/behat/orderedlist.feature index 65393cb829c..548d9c21c3a 100644 --- a/lib/editor/atto/plugins/orderedlist/tests/behat/orderedlist.feature +++ b/lib/editor/atto/plugins/orderedlist/tests/behat/orderedlist.feature @@ -6,7 +6,7 @@ Feature: Atto ordered list button Scenario: Make a list from some text Given I log in as "admin" And I follow "Profile" in the user menu - And I follow "Edit profile" + And I click on "Edit profile" "link" in the "region-main" "region" And I set the field "Description" to "Have you heard the news everyone's talking
Life is good 'cause everything's awesome
" And I select the text in the "Description" Atto editor When I click on "Ordered list" "button" @@ -15,6 +15,6 @@ Feature: Atto ordered list button And I follow "Editor preferences" And I set the field "Text editor" to "Plain text area" And I press "Save changes" - And I follow "Edit profile" + And I click on "Edit profile" "link" in the "region-main" "region" Then I should see "
  1. Have you heard the news everyone's talking" diff --git a/lib/editor/atto/plugins/strike/tests/behat/strike.feature b/lib/editor/atto/plugins/strike/tests/behat/strike.feature index dba4d44bb07..5c38924b921 100644 --- a/lib/editor/atto/plugins/strike/tests/behat/strike.feature +++ b/lib/editor/atto/plugins/strike/tests/behat/strike.feature @@ -6,7 +6,7 @@ Feature: Atto strike button Scenario: Strike some text Given I log in as "admin" And I follow "Profile" in the user menu - And I follow "Edit profile" + And I click on "Edit profile" "link" in the "region-main" "region" And I set the field "Description" to "MUA" And I select the text in the "Description" Atto editor And I click on "Show more buttons" "button" @@ -16,6 +16,6 @@ Feature: Atto strike button And I follow "Editor preferences" And I set the field "Text editor" to "Plain text area" And I press "Save changes" - And I follow "Edit profile" + And I click on "Edit profile" "link" in the "region-main" "region" Then I should see "MUA" diff --git a/lib/editor/atto/plugins/subscript/tests/behat/subscript.feature b/lib/editor/atto/plugins/subscript/tests/behat/subscript.feature index 9569b07569a..8581a8bfc9b 100644 --- a/lib/editor/atto/plugins/subscript/tests/behat/subscript.feature +++ b/lib/editor/atto/plugins/subscript/tests/behat/subscript.feature @@ -6,7 +6,7 @@ Feature: Atto subscript button Scenario: Subscript some text Given I log in as "admin" And I follow "Profile" in the user menu - And I follow "Edit profile" + And I click on "Edit profile" "link" in the "region-main" "region" And I set the field "Description" to "Submarine" And I select the text in the "Description" Atto editor And I click on "Show more buttons" "button" @@ -16,14 +16,14 @@ Feature: Atto subscript button And I follow "Editor preferences" And I set the field "Text editor" to "Plain text area" And I press "Save changes" - And I follow "Edit profile" + And I click on "Edit profile" "link" in the "region-main" "region" Then I should see "Submarine" @javascript Scenario: Subscript some text in enclosed in superscript Given I log in as "admin" And I follow "Profile" in the user menu - And I follow "Edit profile" + And I click on "Edit profile" "link" in the "region-main" "region" And I set the field "Description" to "Submarine" And I select the text in the "Description" Atto editor And I click on "Show more buttons" "button" @@ -33,6 +33,6 @@ Feature: Atto subscript button And I follow "Editor preferences" And I set the field "Text editor" to "Plain text area" And I press "Save changes" - And I follow "Edit profile" + And I click on "Edit profile" "link" in the "region-main" "region" Then I should see "Submarine" diff --git a/lib/editor/atto/plugins/superscript/tests/behat/superscript.feature b/lib/editor/atto/plugins/superscript/tests/behat/superscript.feature index 72ce449397a..2e3ed49cfff 100644 --- a/lib/editor/atto/plugins/superscript/tests/behat/superscript.feature +++ b/lib/editor/atto/plugins/superscript/tests/behat/superscript.feature @@ -6,7 +6,7 @@ Feature: Atto superscript button Scenario: Subscript some text Given I log in as "admin" And I follow "Profile" in the user menu - And I follow "Edit profile" + And I click on "Edit profile" "link" in the "region-main" "region" And I set the field "Description" to "Helicopter" And I select the text in the "Description" Atto editor And I click on "Show more buttons" "button" @@ -16,14 +16,14 @@ Feature: Atto superscript button And I follow "Editor preferences" And I set the field "Text editor" to "Plain text area" And I press "Save changes" - And I follow "Edit profile" + And I click on "Edit profile" "link" in the "region-main" "region" Then I should see "Helicopter" @javascript Scenario: Superscript some text that is enclosed in subscript Given I log in as "admin" And I follow "Profile" in the user menu - And I follow "Edit profile" + And I click on "Edit profile" "link" in the "region-main" "region" And I set the field "Description" to "Helicopter" And I select the text in the "Description" Atto editor And I click on "Show more buttons" "button" @@ -33,6 +33,6 @@ Feature: Atto superscript button And I follow "Editor preferences" And I set the field "Text editor" to "Plain text area" And I press "Save changes" - And I follow "Edit profile" + And I click on "Edit profile" "link" in the "region-main" "region" Then I should see "Helicopter" diff --git a/lib/editor/atto/plugins/title/tests/behat/title.feature b/lib/editor/atto/plugins/title/tests/behat/title.feature index 4f36ea82ac5..527f28456d9 100644 --- a/lib/editor/atto/plugins/title/tests/behat/title.feature +++ b/lib/editor/atto/plugins/title/tests/behat/title.feature @@ -6,7 +6,7 @@ Feature: Atto title Scenario: Create a heading Given I log in as "admin" And I follow "Profile" in the user menu - And I follow "Edit profile" + And I click on "Edit profile" "link" in the "region-main" "region" And I set the field "Description" to "How The Rock Has Made the WWE World Heavyweight Title More Important Than Ever" And I select the text in the "Description" Atto editor When I click on "Paragraph styles" "button" @@ -16,6 +16,6 @@ Feature: Atto title And I follow "Editor preferences" And I set the field "Text editor" to "Plain text area" And I press "Save changes" - And I follow "Edit profile" + And I click on "Edit profile" "link" in the "region-main" "region" Then I should see "

    How The Rock" diff --git a/lib/editor/atto/plugins/underline/tests/behat/underline.feature b/lib/editor/atto/plugins/underline/tests/behat/underline.feature index f4dd9917ce5..c30716cecb1 100644 --- a/lib/editor/atto/plugins/underline/tests/behat/underline.feature +++ b/lib/editor/atto/plugins/underline/tests/behat/underline.feature @@ -6,7 +6,7 @@ Feature: Atto underline button Scenario: Underline some text Given I log in as "admin" And I follow "Profile" in the user menu - And I follow "Edit profile" + And I click on "Edit profile" "link" in the "region-main" "region" And I set the field "Description" to "Deprecated HTML Tag" And I select the text in the "Description" Atto editor And I click on "Show more buttons" "button" @@ -16,6 +16,6 @@ Feature: Atto underline button And I follow "Editor preferences" And I set the field "Text editor" to "Plain text area" And I press "Save changes" - And I follow "Edit profile" + And I click on "Edit profile" "link" in the "region-main" "region" Then I should see "Deprecated HTML Tag" diff --git a/lib/editor/atto/plugins/unorderedlist/tests/behat/unorderedlist.feature b/lib/editor/atto/plugins/unorderedlist/tests/behat/unorderedlist.feature index 8dcf84fddbc..fdaaa7c7e3c 100644 --- a/lib/editor/atto/plugins/unorderedlist/tests/behat/unorderedlist.feature +++ b/lib/editor/atto/plugins/unorderedlist/tests/behat/unorderedlist.feature @@ -6,7 +6,7 @@ Feature: Atto unordered list button Scenario: Make a list from some text Given I log in as "admin" And I follow "Profile" in the user menu - And I follow "Edit profile" + And I click on "Edit profile" "link" in the "region-main" "region" And I set the field "Description" to "Things, dogs, clogs, they're awesome
    Rocks, clocks, and socks, they're awesome
    Figs, and wigs, and twigs, that's awesome
    Everything you see or think or say is awesome" And I select the text in the "Description" Atto editor When I click on "Unordered list" "button" @@ -15,6 +15,6 @@ Feature: Atto unordered list button And I follow "Editor preferences" And I set the field "Text editor" to "Plain text area" And I press "Save changes" - And I follow "Edit profile" + And I click on "Edit profile" "link" in the "region-main" "region" Then I should see "
    • Things, dogs, clogs" diff --git a/lib/editor/atto/tests/behat/autosave.feature b/lib/editor/atto/tests/behat/autosave.feature index 2f3d17ceacb..7a413eaed5c 100644 --- a/lib/editor/atto/tests/behat/autosave.feature +++ b/lib/editor/atto/tests/behat/autosave.feature @@ -62,7 +62,7 @@ Feature: Atto Autosave And I select the text in the "Course summary" Atto editor And I click on "Image" "button" And I click on "Browse repositories..." "button" - And I click on "Private files" "link" + And I click on "Private files" "link" in the ".fp-repo-area" "css_element" And I click on "moodle-logo.png" "link" And I click on "Select this file" "button" And I set the field "Describe this image" to "It's the Moodle" diff --git a/lib/form/advcheckbox.php b/lib/form/advcheckbox.php index 5d9a07984cb..4b9a724cf98 100644 --- a/lib/form/advcheckbox.php +++ b/lib/form/advcheckbox.php @@ -88,6 +88,7 @@ class MoodleQuickForm_advcheckbox extends HTML_QuickForm_advcheckbox implements } parent::__construct($elementName, $elementLabel, $text, $attributes, $values); + $this->_type = 'advcheckbox'; } /** @@ -142,7 +143,7 @@ class MoodleQuickForm_advcheckbox extends HTML_QuickForm_advcheckbox implements $context['selectedvalue'] = $this->_values[1]; $context['deselectedvalue'] = $this->_values[0]; - + $context['frozenvalue'] = $this->getValue(); return $context; } diff --git a/lib/form/checkbox.php b/lib/form/checkbox.php index 83e64992875..5366ebb57e1 100644 --- a/lib/form/checkbox.php +++ b/lib/form/checkbox.php @@ -41,7 +41,10 @@ require_once('templatable_form_element.php'); * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class MoodleQuickForm_checkbox extends HTML_QuickForm_checkbox implements templatable { - use templatable_form_element; + + use templatable_form_element { + export_for_template as export_for_template_base; + } /** @var string html for help button, if empty then no help */ var $_helpbutton=''; @@ -141,4 +144,10 @@ class MoodleQuickForm_checkbox extends HTML_QuickForm_checkbox implements templa } return $output; } + + public function export_for_template(renderer_base $output) { + $context = $this->export_for_template_base($output); + $context['frozenvalue'] = $this->getValue(); + return $context; + } } diff --git a/lib/form/templatable_form_element.php b/lib/form/templatable_form_element.php index 844a90ee6be..ad1b5996d2f 100644 --- a/lib/form/templatable_form_element.php +++ b/lib/form/templatable_form_element.php @@ -74,7 +74,7 @@ trait templatable_form_element { // Other attributes. $otherattributes = []; foreach ($this->getAttributes() as $attr => $value) { - if (!in_array($attr, $standardattributes) && $attr != 'class') { + if (!in_array($attr, $standardattributes) && $attr != 'class' && !is_object($value)) { $otherattributes[] = $attr . '="' . s($value) . '"'; } } diff --git a/lib/moodlelib.php b/lib/moodlelib.php index d0503f11495..b9c10aebed9 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -8885,36 +8885,37 @@ function get_performance_info() { global $CFG, $PERF, $DB, $PAGE; $info = array(); - $info['html'] = ''; // Holds userfriendly HTML representation. $info['txt'] = me() . ' '; // Holds log-friendly representation. + $info['html'] = ''; if (!empty($CFG->themedesignermode)) { // Attempt to avoid devs debugging peformance issues, when its caused by css building and so on. - $info['html'] = '

      Warning: Theme designer mode is enabled.

      '; + $info['html'] .= '

      Warning: Theme designer mode is enabled.

      '; } + $info['html'] .= '
        '; // Holds userfriendly HTML representation. $info['realtime'] = microtime_diff($PERF->starttime, microtime()); - $info['html'] .= ''.$info['realtime'].' secs '; + $info['html'] .= '
      • '.$info['realtime'].' secs
      • '; $info['txt'] .= 'time: '.$info['realtime'].'s '; if (function_exists('memory_get_usage')) { $info['memory_total'] = memory_get_usage(); $info['memory_growth'] = memory_get_usage() - $PERF->startmemory; - $info['html'] .= 'RAM: '.display_size($info['memory_total']).' '; + $info['html'] .= '
      • RAM: '.display_size($info['memory_total']).'
      • '; $info['txt'] .= 'memory_total: '.$info['memory_total'].'B (' . display_size($info['memory_total']).') memory_growth: '. $info['memory_growth'].'B ('.display_size($info['memory_growth']).') '; } if (function_exists('memory_get_peak_usage')) { $info['memory_peak'] = memory_get_peak_usage(); - $info['html'] .= 'RAM peak: '.display_size($info['memory_peak']).' '; + $info['html'] .= '
      • RAM peak: '.display_size($info['memory_peak']).'
      • '; $info['txt'] .= 'memory_peak: '.$info['memory_peak'].'B (' . display_size($info['memory_peak']).') '; } $inc = get_included_files(); $info['includecount'] = count($inc); - $info['html'] .= 'Included '.$info['includecount'].' files '; + $info['html'] .= '
      • Included '.$info['includecount'].' files
      • '; $info['txt'] .= 'includecount: '.$info['includecount'].' '; if (!empty($CFG->early_install_lang) or empty($PAGE)) { @@ -8927,7 +8928,7 @@ function get_performance_info() { list($filterinfo, $nicenames) = $filtermanager->get_performance_summary(); $info = array_merge($filterinfo, $info); foreach ($filterinfo as $key => $value) { - $info['html'] .= "$nicenames[$key]: $value "; + $info['html'] .= "
      • $nicenames[$key]: $value
      • "; $info['txt'] .= "$key: $value "; } } @@ -8937,23 +8938,23 @@ function get_performance_info() { list($filterinfo, $nicenames) = $stringmanager->get_performance_summary(); $info = array_merge($filterinfo, $info); foreach ($filterinfo as $key => $value) { - $info['html'] .= "$nicenames[$key]: $value "; + $info['html'] .= "
      • $nicenames[$key]: $value
      • "; $info['txt'] .= "$key: $value "; } } if (!empty($PERF->logwrites)) { $info['logwrites'] = $PERF->logwrites; - $info['html'] .= 'Log DB writes '.$info['logwrites'].' '; + $info['html'] .= '
      • Log DB writes '.$info['logwrites'].'
      • '; $info['txt'] .= 'logwrites: '.$info['logwrites'].' '; } $info['dbqueries'] = $DB->perf_get_reads().'/'.($DB->perf_get_writes() - $PERF->logwrites); - $info['html'] .= 'DB reads/writes: '.$info['dbqueries'].' '; + $info['html'] .= '
      • DB reads/writes: '.$info['dbqueries'].'
      • '; $info['txt'] .= 'db reads/writes: '.$info['dbqueries'].' '; $info['dbtime'] = round($DB->perf_get_queries_time(), 5); - $info['html'] .= 'DB queries time: '.$info['dbtime'].' secs '; + $info['html'] .= '
      • DB queries time: '.$info['dbtime'].' secs
      • '; $info['txt'] .= 'db queries time: ' . $info['dbtime'] . 's '; if (function_exists('posix_times')) { @@ -8962,7 +8963,7 @@ function get_performance_info() { foreach ($ptimes as $key => $val) { $info[$key] = $ptimes[$key] - $PERF->startposixtimes[$key]; } - $info['html'] .= "ticks: $info[ticks] user: $info[utime] sys: $info[stime] cuser: $info[cutime] csys: $info[cstime] "; + $info['html'] .= "
      • ticks: $info[ticks] user: $info[utime] sys: $info[stime] cuser: $info[cutime] csys: $info[cstime]
      • "; $info['txt'] .= "ticks: $info[ticks] user: $info[utime] sys: $info[stime] cuser: $info[cutime] csys: $info[cstime] "; } } @@ -8982,7 +8983,7 @@ function get_performance_info() { } if (!empty($serverload)) { $info['serverload'] = $serverload; - $info['html'] .= 'Load average: '.$info['serverload'].' '; + $info['html'] .= '
      • Load average: '.$info['serverload'].'
      • '; $info['txt'] .= "serverload: {$info['serverload']} "; } @@ -8994,8 +8995,8 @@ function get_performance_info() { } if ($stats = cache_helper::get_stats()) { - $html = ''; - $html .= 'Caches used (hits/misses/sets)'; + $html = '
          '; + $html .= '
        • Caches used (hits/misses/sets)
        • '; $text = 'Caches used (hits/misses/sets): '; $hits = 0; $misses = 0; @@ -9015,34 +9016,34 @@ function get_performance_info() { $mode = ' [r]'; break; } - $html .= ''; - $html .= ''.$definition.$mode.''; + $html .= '
            '; + $html .= '
          • '.$definition.$mode.'
          • '; $text .= "$definition {"; foreach ($details['stores'] as $store => $data) { $hits += $data['hits']; $misses += $data['misses']; $sets += $data['sets']; if ($data['hits'] == 0 and $data['misses'] > 0) { - $cachestoreclass = 'nohits'; + $cachestoreclass = 'nohits text-danger'; } else if ($data['hits'] < $data['misses']) { - $cachestoreclass = 'lowhits'; + $cachestoreclass = 'lowhits text-warning'; } else { - $cachestoreclass = 'hihits'; + $cachestoreclass = 'hihits text-success'; } $text .= "$store($data[hits]/$data[misses]/$data[sets]) "; - $html .= "$store: $data[hits] / $data[misses] / $data[sets]"; + $html .= "
          • $store: $data[hits] / $data[misses] / $data[sets]
          • "; } - $html .= ''; + $html .= '
          '; $text .= '} '; } - $html .= "Total: $hits / $misses / $sets"; - $html .= '
          '; + $html .= '
        '; + $html .= "
        Total: $hits / $misses / $sets
        "; $info['cachesused'] = "$hits / $misses / $sets"; $info['html'] .= $html; $info['txt'] .= $text.'. '; } else { $info['cachesused'] = '0 / 0 / 0'; - $info['html'] .= 'Caches used (hits/misses/sets): 0/0/0'; + $info['html'] .= '
        Caches used (hits/misses/sets): 0/0/0
        '; $info['txt'] .= 'Caches used (hits/misses/sets): 0/0/0 '; } diff --git a/lib/navigationlib.php b/lib/navigationlib.php index b6ebf72769d..76be37be26a 100644 --- a/lib/navigationlib.php +++ b/lib/navigationlib.php @@ -143,6 +143,8 @@ class navigation_node implements renderable { public $includesectionnum = false; /** @var bool does the node need to be loaded via ajax */ public $requiresajaxloading = false; + /** @var bool If set to true this node will be added to the "flat" navigation */ + public $showinflatnavigation = false; /** * Constructs a new navigation_node @@ -236,6 +238,65 @@ class navigation_node implements renderable { return false; } + /** + * True if this nav node has siblings in the tree. + * + * @return bool + */ + public function has_siblings() { + if (empty($this->parent) || empty($this->parent->children)) { + return false; + } + if ($this->parent->children instanceof navigation_node_collection) { + $count = $this->parent->children->count(); + } else { + $count = count($this->parent->children); + } + return ($count > 1); + } + + /** + * Recursively walk the tree looking for a node with a valid action. + * Depth first search. + * + * @return bool + */ + public function resolve_action() { + if ($this->action) { + return $this->action; + } + if (!empty($this->children)) { + foreach ($this->children as $child) { + $action = $child->resolve_action(); + if (!empty($action)) { + return $action; + } + } + } + return false; + } + + /** + * Get a list of sibling navigation nodes at the same level as this one. + * + * @return bool|array of navigation_node + */ + public function get_siblings() { + // Returns a list of the siblings of the current node for display in a flat navigation element. Either + // the in-page links or the breadcrumb links. + $siblings = false; + + if ($this->has_siblings()) { + $siblings = []; + foreach ($this->parent->children as $child) { + if ($child->display) { + $siblings[] = $child; + } + } + } + return $siblings; + } + /** * This sets the URL that the URL of new nodes get compared to when locating * the active node. @@ -381,6 +442,27 @@ class navigation_node implements renderable { return $this->children->find($key, $type); } + /** + * Walk the tree building up a list of all the flat navigation nodes. + * + * @param flat_navigation $nodes List of the found flat navigation nodes. + * @param boolean $showdivider Show a divider before the first node. + */ + public function build_flat_navigation_list(flat_navigation $nodes, $showdivider = false) { + if ($this->showinflatnavigation) { + $indent = 0; + if ($this->type == self::TYPE_COURSE) { + $indent = 1; + } + $flat = new flat_navigation_node($this, $indent); + $flat->set_showdivider($showdivider); + $nodes->add($flat); + } + foreach ($this->children as $child) { + $child->build_flat_navigation_list($nodes, false); + } + } + /** * Get the child of this node that has the given key + (optional) type. * @@ -1053,6 +1135,7 @@ class global_navigation extends navigation_node { // Use the parents constructor.... good good reuse parent::__construct($properties); + $this->showinflatnavigation = true; // Initalise and set defaults $this->page = $page; @@ -1106,10 +1189,12 @@ class global_navigation extends navigation_node { // The home element should be my moodle because the root element is the site if (isloggedin() && !isguestuser()) { // Makes no sense if you aren't logged in $this->rootnodes['home'] = $this->add(get_string('myhome'), new moodle_url('/my/'), self::TYPE_SETTING, null, 'home'); + $this->rootnodes['home']->showinflatnavigation = true; } } else { // The home element should be the site because the root node is my moodle $this->rootnodes['home'] = $this->add(get_string('sitehome'), new moodle_url('/'), self::TYPE_SETTING, null, 'home'); + $this->rootnodes['home']->showinflatnavigation = true; if (!empty($CFG->defaulthomepage) && ($CFG->defaulthomepage == HOMEPAGE_MY)) { // We need to stop automatic redirection $this->rootnodes['home']->action->param('redirect', '0'); @@ -1128,15 +1213,18 @@ class global_navigation extends navigation_node { $this->load_course_sections($SITE, $this->rootnodes['site']); $course = $this->page->course; + $this->load_courses_enrolled(); // $issite gets set to true if the current pages course is the sites frontpage course $issite = ($this->page->course->id == $SITE->id); + // Determine if the user is enrolled in any course. $enrolledinanycourse = enrol_user_sees_own_courses(); $this->rootnodes['currentcourse']->mainnavonly = true; if ($enrolledinanycourse) { $this->rootnodes['mycourses']->isexpandable = true; + $this->rootnodes['mycourses']->showinflatnavigation = true; if ($CFG->navshowallcourses) { // When we show all courses we need to show both the my courses and the regular courses branch. $this->rootnodes['courses']->isexpandable = true; @@ -1147,13 +1235,8 @@ class global_navigation extends navigation_node { // Load the users enrolled courses if they are viewing the My Moodle page AND the admin has not // set that they wish to keep the My Courses branch collapsed by default. - if (!empty($CFG->navexpandmycourses) && $this->page->pagelayout === 'mydashboard'){ - $this->rootnodes['mycourses']->forceopen = true; - $this->load_courses_enrolled(); - } else { - $this->rootnodes['mycourses']->collapse = true; - $this->rootnodes['mycourses']->make_inactive(); - } + $this->rootnodes['mycourses']->forceopen = true; + $this->load_courses_enrolled(); $canviewcourseprofile = true; @@ -2304,7 +2387,7 @@ class global_navigation extends navigation_node { $usercoursenode = $userscoursesnode->add($usercourseshortname, new moodle_url('/user/view.php', array('id' => $user->id, 'course' => $usercourse->id)), self::TYPE_CONTAINER); - $gradeavailable = has_capability('moodle/grade:viewall', $usercoursecontext); + $gradeavailable = has_capability('moodle/grade:view', $usercoursecontext); if (!$gradeavailable && !empty($usercourse->showgrades) && is_array($reports) && !empty($reports)) { foreach ($reports as $plugin => $plugindir) { if (has_capability('gradereport/'.$plugin.':view', $usercoursecontext)) { @@ -2428,6 +2511,14 @@ class global_navigation extends navigation_node { // This is the name that will be shown for the course. $coursename = empty($CFG->navshowfullcoursenames) ? $shortname : $fullname; + if ($coursetype == self::COURSE_CURRENT) { + if ($coursenode = $this->rootnodes['mycourses']->find($course->id, self::TYPE_COURSE)) { + return $coursenode; + } else { + $coursetype = self::COURSE_OTHER; + } + } + // Can the user expand the course to see its content. $canexpandcourse = true; if ($issite) { @@ -2468,6 +2559,7 @@ class global_navigation extends navigation_node { } $coursenode = $parent->add($coursename, $url, self::TYPE_COURSE, $shortname, $course->id); + $coursenode->showinflatnavigation = $coursetype == self::COURSE_MY; $coursenode->hidden = (!$course->visible); $coursenode->title(format_string($course->fullname, true, array('context' => $coursecontext, 'escape' => false))); if ($canexpandcourse) { @@ -2555,7 +2647,7 @@ class global_navigation extends navigation_node { return true; } - $navoptions = course_get_user_navigation_options($this->page->context); + $navoptions = course_get_user_navigation_options($this->page->context, $course); //Participants if ($navoptions->participants) { @@ -2582,11 +2674,21 @@ class global_navigation extends navigation_node { if ($navoptions->badges) { $url = new moodle_url('/badges/view.php', array('type' => 2, 'id' => $course->id)); - $coursenode->add(get_string('coursebadges', 'badges'), null, - navigation_node::TYPE_CONTAINER, null, 'coursebadges'); - $coursenode->get('coursebadges')->add(get_string('badgesview', 'badges'), $url, + $coursenode->add(get_string('coursebadges', 'badges'), $url, navigation_node::TYPE_SETTING, null, 'badgesview', - new pix_icon('i/badge', get_string('badgesview', 'badges'))); + new pix_icon('i/badge', get_string('coursebadges', 'badges'))); + } + + // Check access to the course and competencies page. + if ($navoptions->competencies) { + // Just a link to course competency. + $title = get_string('competencies', 'core_competency'); + $path = new moodle_url("/admin/tool/lp/coursecompetencies.php", array('courseid' => $course->id)); + $coursenode->add($title, $path, navigation_node::TYPE_SETTING, null, null, new pix_icon('i/competencies', '')); + } + if ($navoptions->grades) { + $url = new moodle_url('/grade/report/index.php', array('id'=>$course->id)); + $gradenode = $coursenode->add(get_string('grades'), $url, self::TYPE_SETTING, null, 'grades', new pix_icon('i/grades', '')); } return true; @@ -2603,7 +2705,7 @@ class global_navigation extends navigation_node { * @return bool True for successfull generation */ public function add_front_page_course_essentials(navigation_node $coursenode, stdClass $course) { - global $CFG; + global $CFG, $USER; require_once($CFG->dirroot . '/course/lib.php'); if ($coursenode == false || $coursenode->get('frontpageloaded', navigation_node::TYPE_CUSTOM)) { @@ -2657,7 +2759,18 @@ class global_navigation extends navigation_node { if ($navoptions->calendar) { // Calendar $calendarurl = new moodle_url('/calendar/view.php', array('view' => 'month')); - $coursenode->add(get_string('calendar', 'calendar'), $calendarurl, self::TYPE_CUSTOM, null, 'calendar'); + $node = $coursenode->add(get_string('calendar', 'calendar'), $calendarurl, self::TYPE_CUSTOM, null, 'calendar'); + $node->showinflatnavigation = true; + } + + if (isloggedin()) { + $usercontext = context_user::instance($USER->id); + if (has_capability('moodle/user:manageownfiles', $usercontext)) { + $url = new moodle_url('/user/files.php'); + $node = $coursenode->add(get_string('privatefiles'), $url, self::TYPE_SETTING); + $node->display = false; + $node->showinflatnavigation = true; + } } return true; @@ -3090,13 +3203,12 @@ class navbar extends navigation_node { public $includesettingsbase = false; /** @var breadcrumb_navigation_node[] $prependchildren */ protected $prependchildren = array(); + /** * The almighty constructor * * @param moodle_page $page */ - - public function __construct(moodle_page $page) { global $CFG; if (during_initial_install()) { @@ -3255,6 +3367,10 @@ class navbar extends navigation_node { $items = array_merge($items, array_reverse($this->prependchildren)); } + $last = reset($items); + if ($last) { + $last->set_last(true); + } $this->items = array_reverse($items); return $this->items; } @@ -3416,6 +3532,9 @@ class navbar extends navigation_node { */ class breadcrumb_navigation_node extends navigation_node { + /** @var $last boolean A flag indicating this is the last item in the list of breadcrumbs. */ + private $last = false; + /** * A proxy constructor * @@ -3436,6 +3555,184 @@ class breadcrumb_navigation_node extends navigation_node { } } + /** + * Getter for "last" + * @return boolean + */ + public function is_last() { + return $this->last; + } + + /** + * Setter for "last" + * @param $val boolean + */ + public function set_last($val) { + $this->last = $val; + } +} + +/** + * Subclass of navigation_node allowing different rendering for the flat navigation + * in particular allowing dividers and indents. + * + * @package core + * @category navigation + * @copyright 2016 Damyon Wiese + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ +class flat_navigation_node extends navigation_node { + + /** @var $indent integer The indent level */ + private $indent = 0; + + /** @var $showdivider bool Show a divider before this element */ + private $showdivider = false; + + /** + * A proxy constructor + * + * @param mixed $navnode A navigation_node or an array + */ + public function __construct($navnode, $indent) { + if (is_array($navnode)) { + parent::__construct($navnode); + } else if ($navnode instanceof navigation_node) { + + // Just clone everything. + $objvalues = get_object_vars($navnode); + foreach ($objvalues as $key => $value) { + $this->$key = $value; + } + } else { + throw coding_exception('Not a valid flat_navigation_node'); + } + $this->indent = $indent; + } + + /** + * Does this node represent a course section link. + * @return boolean + */ + public function is_section() { + return $this->type == navigation_node::TYPE_SECTION; + } + + /** + * Getter for "showdivider" + * @return boolean + */ + public function showdivider() { + return $this->showdivider; + } + + /** + * Setter for "showdivider" + * @param $val boolean + */ + public function set_showdivider($val) { + $this->showdivider = $val; + } + + /** + * Getter for "indent" + * @return boolean + */ + public function get_indent() { + return $this->indent; + } + + /** + * Setter for "indent" + * @param $val boolean + */ + public function set_indent($val) { + $this->indent = $val; + } + +} + +/** + * Class used to generate a collection of navigation nodes most closely related + * to the current page. + * + * @package core + * @copyright 2016 Damyon Wiese + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ +class flat_navigation extends navigation_node_collection { + /** @var moodle_page the moodle page that the navigation belongs to */ + protected $page; + + /** + * Constructor. + * + * @param moodle_page $page + */ + public function __construct(moodle_page &$page) { + if (during_initial_install()) { + return false; + } + $this->page = $page; + } + + /** + * Build the list of navigation nodes based on the current navigation and settings trees. + * + */ + public function initialise() { + global $PAGE, $USER, $OUTPUT, $CFG; + if (during_initial_install()) { + return; + } + + $current = false; + + $course = $PAGE->course; + + $this->page->navigation->initialise(); + + // First walk the nav tree looking for "flat_navigation" nodes. + if ($course->id > 1) { + // It's a real course. + $url = new moodle_url('/course/view.php', array('id' => $course->id)); + $flat = new flat_navigation_node(navigation_node::create($course->shortname, $url), 0); + $flat->key = 'coursehome'; + + $coursenode = $PAGE->navigation->find_active_node(); + while (!empty($coursenode) && ($coursenode->type != navigation_node::TYPE_COURSE)) { + $coursenode = $coursenode->parent; + } + // There is one very strange page in mod/feedback/view.php which thinks it is both site and course + // context at the same time. That page is broken but we need to handle it (hence the SITEID). + if ($coursenode && $coursenode->key != SITEID) { + $this->add($flat); + foreach ($coursenode->children as $child) { + if ($child->action) { + $flat = new flat_navigation_node($child, 0); + $this->add($flat); + } + } + } + + $this->page->navigation->build_flat_navigation_list($this, true); + } else { + $this->page->navigation->build_flat_navigation_list($this, false); + } + + $admin = $PAGE->settingsnav->find('siteadministration', navigation_node::TYPE_SITE_ADMIN); + if (!$admin) { + // Try again - crazy nav tree! + $admin = $PAGE->settingsnav->find('root', navigation_node::TYPE_SITE_ADMIN); + } + if ($admin) { + $flat = new flat_navigation_node($admin, 0); + $flat->set_showdivider(true); + $flat->key = 'sitesettings'; + $this->add($flat); + } + } + } /** @@ -3480,6 +3777,7 @@ class settings_navigation extends navigation_node { $this->cache = new navigation_cache(NAVIGATION_CACHE_NAME); $this->children = new navigation_node_collection(); } + /** * Initialise the settings navigation based on the current context * @@ -3561,7 +3859,7 @@ class settings_navigation extends navigation_node { $adminsettings->remove(); $adminsettings = false; } - $siteadminnode = $this->add(get_string('administrationsite'), new moodle_url('/admin'), self::TYPE_SITE_ADMIN, null, 'siteadministration'); + $siteadminnode = $this->add(get_string('administrationsite'), new moodle_url('/admin/search.php'), self::TYPE_SITE_ADMIN, null, 'siteadministration'); $siteadminnode->id = 'expandable_branch_'.$siteadminnode->type.'_'.clean_param($siteadminnode->key, PARAM_ALPHANUMEXT); $siteadminnode->requiresajaxloading = 'true'; } @@ -3681,7 +3979,7 @@ class settings_navigation extends navigation_node { // Disable the navigation from automatically finding the active node navigation_node::$autofindactive = false; - $referencebranch = $this->add(get_string('administrationsite'), null, self::TYPE_SITE_ADMIN, null, 'root'); + $referencebranch = $this->add(get_string('administrationsite'), '/admin/search.php', self::TYPE_SITE_ADMIN, null, 'root'); foreach ($adminroot->children as $adminbranch) { $this->load_administration_settings($referencebranch, $adminbranch); } @@ -3789,6 +4087,13 @@ class settings_navigation extends navigation_node { $coursenode->force_open(); } + + if ($adminoptions->update) { + // Add the course settings link + $url = new moodle_url('/course/edit.php', array('id'=>$course->id)); + $coursenode->add(get_string('editsettings'), $url, self::TYPE_SETTING, null, 'editsettings', new pix_icon('i/settings', '')); + } + if ($this->page->user_allowed_editing()) { // Add the turn on/off settings @@ -3813,9 +4118,6 @@ class settings_navigation extends navigation_node { } if ($adminoptions->update) { - // Add the course settings link - $url = new moodle_url('/course/edit.php', array('id'=>$course->id)); - $coursenode->add(get_string('editsettings'), $url, self::TYPE_SETTING, null, 'editsettings', new pix_icon('i/settings', '')); // Add the course completion settings link if ($CFG->enablecompletion && $course->enablecompletion) { @@ -3858,11 +4160,6 @@ class settings_navigation extends navigation_node { } } - if ($adminoptions->grades) { - $url = new moodle_url('/grade/report/index.php', array('id'=>$course->id)); - $gradenode = $coursenode->add(get_string('grades'), $url, self::TYPE_SETTING, null, 'grades', new pix_icon('i/grades', '')); - } - // Check if we can view the gradebook's setup page. if ($adminoptions->gradebook) { $url = new moodle_url('/grade/edit/tree/index.php', array('id' => $course->id)); @@ -3959,7 +4256,8 @@ class settings_navigation extends navigation_node { } } if (is_array($roles) && count($roles)>0) { - $switchroles = $this->add(get_string('switchroleto'), null, self::TYPE_CONTAINER, null, 'switchroleto'); + $url = new moodle_url('/course/switchrole.php', array('id'=>$course->id, 'switchrole'=>'-1', 'returnurl'=>$this->page->url->out_as_local_url(false))); + $switchroles = $coursenode->add(get_string('switchroleto'), $url, self::TYPE_CONTAINER, null, 'switchroleto'); if ((count($roles)==1 && array_key_exists(0, $roles))|| $assumedrole!==false) { $switchroles->force_open(); } @@ -4393,7 +4691,7 @@ class settings_navigation extends navigation_node { if (($currentuser || is_siteadmin($USER) || !is_siteadmin($user)) && has_capability('moodle/user:update', $systemcontext)) { $url = new moodle_url('/user/editadvanced.php', array('id'=>$user->id, 'course'=>$course->id)); - $useraccount->add(get_string('editmyprofile'), $url, self::TYPE_SETTING); + $useraccount->add(get_string('editmyprofile'), $url, self::TYPE_SETTING, null, 'editprofile'); } else if ((has_capability('moodle/user:editprofile', $usercontext) && !is_siteadmin($user)) || ($currentuser && has_capability('moodle/user:editownprofile', $systemcontext))) { if ($userauthplugin && $userauthplugin->can_edit_profile()) { @@ -4401,7 +4699,7 @@ class settings_navigation extends navigation_node { if (empty($url)) { $url = new moodle_url('/user/edit.php', array('id'=>$user->id, 'course'=>$course->id)); } - $useraccount->add(get_string('editmyprofile'), $url, self::TYPE_SETTING); + $useraccount->add(get_string('editmyprofile'), $url, self::TYPE_SETTING, null, 'editprofile'); } } } diff --git a/lib/outputcomponents.php b/lib/outputcomponents.php index edea6df9c58..157bb158d09 100644 --- a/lib/outputcomponents.php +++ b/lib/outputcomponents.php @@ -3905,6 +3905,15 @@ class action_menu implements renderable, templatable { $this->menutrigger = $trigger; } + /** + * Return true if there is at least one visible link in the menu. + * + * @return bool + */ + public function is_empty() { + return !count($this->primaryactions) && !count($this->secondaryactions); + } + /** * Initialises JS required fore the action menu. * The JS is only required once as it manages all action menu's on the page. diff --git a/lib/outputlib.php b/lib/outputlib.php index 726e99ff0ab..4f496f001da 100644 --- a/lib/outputlib.php +++ b/lib/outputlib.php @@ -344,6 +344,12 @@ class theme_config { */ public $doctype = 'html5'; + /** + * @var string undeletableblocktypes If set to a string, will list the block types that cannot be deleted. Defaults to + * navigation and settings. + */ + public $undeletableblocktypes = false; + //==Following properties are not configurable from theme config.php== /** @@ -524,7 +530,7 @@ class theme_config { $configurable = array( 'parents', 'sheets', 'parents_exclude_sheets', 'plugins_exclude_sheets', 'javascripts', 'javascripts_footer', 'parents_exclude_javascripts', - 'layouts', 'enable_dock', 'enablecourseajax', + 'layouts', 'enable_dock', 'enablecourseajax', 'undeletableblocktypes', 'rendererfactory', 'csspostprocess', 'editor_sheets', 'rarrow', 'larrow', 'uarrow', 'darrow', 'hidefromselector', 'doctype', 'yuicssmodules', 'blockrtlmanipulations', 'lessfile', 'extralesscallback', 'lessvariablescallback', 'blockrendermethod', diff --git a/lib/outputrenderers.php b/lib/outputrenderers.php index c5d29ca21f9..c4d7bb8f466 100644 --- a/lib/outputrenderers.php +++ b/lib/outputrenderers.php @@ -4086,18 +4086,6 @@ EOD; return $html; } - /** - * Returns the header bar. - * - * @since Moodle 2.9 - * @param array $headerinfo An array of header information, dependant on what type of header is being displayed. The following - * array example is user specific. - * heading => Override the page heading. - * user => User object. - * usercontext => user context. - * @param int $headinglevel What level the 'h' tag will be. - * @return string HTML for the header bar. - */ public function context_header($headerinfo = null, $headinglevel = 1) { global $DB, $USER, $CFG; $context = $this->page->context; @@ -4390,6 +4378,18 @@ EOD; } } + /** + * Render the login signup form into a nice template for the theme. + * + * @param mform $form + * @return string + */ + public function render_login_signup_form($form) { + $context = $form->export_for_template($this); + + return $this->render_from_template('core/signup_form_layout', $context); + } + /** * Renders a progress bar. * diff --git a/lib/pagelib.php b/lib/pagelib.php index 061335d9d9e..df546f5aa7d 100644 --- a/lib/pagelib.php +++ b/lib/pagelib.php @@ -286,6 +286,11 @@ class moodle_page { */ protected $_settingsnav = null; + /** + * @var flat_navigation Contains a list of nav nodes, most closely related to the current page. + */ + protected $_flatnav = null; + /** * @var navbar Contains the navbar structure. */ @@ -726,6 +731,18 @@ class moodle_page { return $this->_settingsnav; } + /** + * Returns the flat navigation object + * @return flat_navigation + */ + protected function magic_get_flatnav() { + if ($this->_flatnav === null) { + $this->_flatnav = new flat_navigation($this); + $this->_flatnav->initialise(); + } + return $this->_flatnav; + } + /** * Returns request IP address. * diff --git a/lib/templates/settings_link_page.mustache b/lib/templates/settings_link_page.mustache new file mode 100644 index 00000000000..608e64939e3 --- /dev/null +++ b/lib/templates/settings_link_page.mustache @@ -0,0 +1,43 @@ +{{! + This file is part of Moodle - http://moodle.org/ + + Moodle is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Moodle is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Moodle. If not, see . +}} +{{! + @template core_admin/admin_settings_links + + Displays the admin tree as a list of grouped links. + + Example context (json): + { + "name": "test", + "id": "test0", + "checked": true, + "label": "Do you like crackers?" + } +}} + +
        +
        +
        +
        +
        + {{#node}} + {{> core/settings_link_page_single }} + {{/node}} +
        +
        +
        +
        +
        diff --git a/lib/templates/settings_link_page_single.mustache b/lib/templates/settings_link_page_single.mustache new file mode 100644 index 00000000000..525e7bfb3bb --- /dev/null +++ b/lib/templates/settings_link_page_single.mustache @@ -0,0 +1,39 @@ +{{! + This file is part of Moodle - http://moodle.org/ + + Moodle is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Moodle is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Moodle. If not, see . +}} +{{! + @template core/settings_link_page_single + + Displays the admin tree as a list of grouped links. + + Example context (json): + { + } +}} + + diff --git a/lib/templates/signup_form_layout.mustache b/lib/templates/signup_form_layout.mustache new file mode 100644 index 00000000000..80bd360b253 --- /dev/null +++ b/lib/templates/signup_form_layout.mustache @@ -0,0 +1,2 @@ +

        {{#str}}newaccount{{/str}}

        +{{{formhtml}}} diff --git a/lib/tests/accesslib_test.php b/lib/tests/accesslib_test.php index 45ac0d38580..15959a62948 100644 --- a/lib/tests/accesslib_test.php +++ b/lib/tests/accesslib_test.php @@ -2354,7 +2354,6 @@ class core_accesslib_testcase extends advanced_testcase { $context = context_course::instance($testcourses[2]); $children = $context->get_child_contexts(); - $this->assertCount(7, $children); // Depends on number of default blocks. $context = context_module::instance($testpages[3]); $children = $context->get_child_contexts(); @@ -2401,7 +2400,7 @@ class core_accesslib_testcase extends advanced_testcase { context_helper::reset_caches(); context_helper::preload_course($SITE->id); $numfrontpagemodules = $DB->count_records('course_modules', array('course' => $SITE->id)); - $this->assertEquals(6 + $numfrontpagemodules, context_inspection::test_context_cache_size()); // Depends on number of default blocks. + $this->assertEquals(3 + $numfrontpagemodules, context_inspection::test_context_cache_size()); // Depends on number of default blocks. // Test assign_capability(), unassign_capability() functions. diff --git a/lib/tests/behat/behat_general.php b/lib/tests/behat/behat_general.php index 1455857d583..edc4cca71a1 100644 --- a/lib/tests/behat/behat_general.php +++ b/lib/tests/behat/behat_general.php @@ -86,6 +86,15 @@ class behat_general extends behat_base { $this->getSession()->visit($this->locate_path('/?redirect=0')); } + /** + * Opens course index page. + * + * @Given /^I am on course index$/ + */ + public function i_am_on_course_index() { + $this->getSession()->visit($this->locate_path('/course/index.php')); + } + /** * Reloads the current page. * diff --git a/lib/tests/behat/behat_permissions.php b/lib/tests/behat/behat_permissions.php index 67943bbf327..76cb49b54bc 100644 --- a/lib/tests/behat/behat_permissions.php +++ b/lib/tests/behat/behat_permissions.php @@ -82,7 +82,7 @@ class behat_permissions extends behat_base { ); if (!$this->running_javascript()) { - $this->execute("behat_forms::press_button", get_string('go')); + $this->execute("behat_general::i_click_on_in_the", [get_string('go'), 'button', 'region-main', 'region']); } $this->execute("behat_permissions::i_fill_the_capabilities_form_with_the_following_permissions", $table); diff --git a/lib/upgrade.txt b/lib/upgrade.txt index fed4655ef32..65dedb18e83 100644 --- a/lib/upgrade.txt +++ b/lib/upgrade.txt @@ -3,6 +3,7 @@ information provided here is intended especially for developers. === 3.2 === +* Admin setting "Show My courses expanded on Dashboard" has been removed. * MForms element 'submitlink' has been deprecated. * Node.js versions >=4 are now required to run grunt. * JQuery has been updated to 3.1.0. JQuery migrate plugins are no longer shipped - please read diff --git a/login/signup.php b/login/signup.php index 1e54597dbac..abe977e0e0b 100644 --- a/login/signup.php +++ b/login/signup.php @@ -87,10 +87,11 @@ $login = get_string('login'); $PAGE->navbar->add($login); $PAGE->navbar->add($newaccount); +$PAGE->set_pagelayout('login'); $PAGE->set_title($newaccount); $PAGE->set_heading($SITE->fullname); echo $OUTPUT->header(); -echo $OUTPUT->heading($newaccount); -$mform_signup->display(); + +echo $OUTPUT->render($mform_signup); echo $OUTPUT->footer(); diff --git a/login/signup_form.php b/login/signup_form.php index 185cb69ac66..07980d8bc0f 100644 --- a/login/signup_form.php +++ b/login/signup_form.php @@ -30,7 +30,7 @@ require_once($CFG->libdir.'/formslib.php'); require_once($CFG->dirroot.'/user/profile/lib.php'); require_once($CFG->dirroot . '/user/editlib.php'); -class login_signup_form extends moodleform { +class login_signup_form extends moodleform implements renderable, templatable { function definition() { global $USER, $CFG; @@ -142,4 +142,21 @@ class login_signup_form extends moodleform { return $errors; } + + /** + * Export this data so it can be used as the context for a mustache template. + * + * @param renderer_base $output Used to do a final render of any components that need to be rendered for export. + * @return array + */ + public function export_for_template(renderer_base $output) { + ob_start(); + $this->display(); + $formhtml = ob_get_contents(); + ob_end_clean(); + $context = [ + 'formhtml' => $formhtml + ]; + return $context; + } } diff --git a/login/tests/behat/change_password.feature b/login/tests/behat/change_password.feature index 93ffb843a82..0bddba3dd9f 100644 --- a/login/tests/behat/change_password.feature +++ b/login/tests/behat/change_password.feature @@ -20,7 +20,7 @@ Feature: Change password And I click on "Save changes" "button" Then I should see "Password has been changed" And I click on "Continue" "button" - And I should see "Preferences" in the "#region-main" "css_element" + And I should see "Preferences" in the "region-main" "region" And I log out And I follow "Log in" And I set the field "Username" to "testuser" diff --git a/mod/assign/feedback/editpdf/tests/behat/annotate_pdf.feature b/mod/assign/feedback/editpdf/tests/behat/annotate_pdf.feature index 98c0a3aca45..aa068197c8c 100644 --- a/mod/assign/feedback/editpdf/tests/behat/annotate_pdf.feature +++ b/mod/assign/feedback/editpdf/tests/behat/annotate_pdf.feature @@ -26,6 +26,7 @@ Feature: In an assignment, teacher can annotate PDF files during grading Then I should see "Changes saved" And I follow "Test ghostscript path" And I should see "The ghostscript path appears to be OK" + And I press "Continue" And I log out And I log in as "teacher1" And I follow "Course 1" diff --git a/mod/assign/feedback/file/tests/behat/feedback_file.feature b/mod/assign/feedback/file/tests/behat/feedback_file.feature index cdd2a026916..0cad53e21df 100644 --- a/mod/assign/feedback/file/tests/behat/feedback_file.feature +++ b/mod/assign/feedback/file/tests/behat/feedback_file.feature @@ -60,7 +60,7 @@ Feature: In an assignment, teacher can submit feedback files during grading Given I set the field "applytoall" to "0" And I press "Save changes" And I click on "Ok" "button" - And I follow "Course 1" + And I click on "Course 1" "link" in the "[data-region=assignment-info]" "css_element" And I log out And I log in as "student1" And I follow "Course 1" @@ -76,7 +76,7 @@ Feature: In an assignment, teacher can submit feedback files during grading Scenario: A teacher can provide a feedback file when grading an assignment and all students in the group will receive the file. Given I press "Save changes" And I click on "Ok" "button" - And I follow "Course 1" + And I click on "Course 1" "link" in the "[data-region=assignment-info]" "css_element" And I log out And I log in as "student1" And I follow "Course 1" @@ -86,4 +86,4 @@ Feature: In an assignment, teacher can submit feedback files during grading When I log in as "student2" And I follow "Course 1" And I follow "Test assignment name" - Then I should see "feedback.txt" \ No newline at end of file + Then I should see "feedback.txt" diff --git a/mod/assign/tests/behat/edit_student_submission.feature b/mod/assign/tests/behat/edit_student_submission.feature index f8527bdbc8b..0028337ceb6 100644 --- a/mod/assign/tests/behat/edit_student_submission.feature +++ b/mod/assign/tests/behat/edit_student_submission.feature @@ -38,14 +38,14 @@ Feature: In an assignment, the administrator can edit students' submissions And I follow "Test assignment name" And I follow "View all submissions" And I click on "Edit" "link" in the "Student 1" "table_row" - And I follow "Edit submission" + And I choose "Edit submission" in the open action menu And I set the following fields to these values: | Online text | Have you seen the movie Chef? | And I press "Save changes" And I follow "View all submissions" Then I should see "Have you seen the movie Chef?" And I click on "Edit" "link" in the "Student 1" "table_row" - And I follow "Edit submission" + And I choose "Edit submission" in the open action menu And I set the following fields to these values: | Online text | I have seen the movie chef. | And I press "Save changes" diff --git a/mod/assign/tests/behat/outcome_grading.feature b/mod/assign/tests/behat/outcome_grading.feature index 8dc65dbc037..a008b17879d 100644 --- a/mod/assign/tests/behat/outcome_grading.feature +++ b/mod/assign/tests/behat/outcome_grading.feature @@ -36,7 +36,7 @@ Feature: Outcome grading And I press "Save changes" And I am on site homepage And I follow "Course 1" - And I follow "Outcomes" + And I navigate to "Outcomes" node in "Course administration" And I set the field "Available standard outcomes" to "Outcome Test" And I click on "#add" "css_element" And I log out diff --git a/mod/assign/tests/behat/quickgrading.feature b/mod/assign/tests/behat/quickgrading.feature index 85a6aefe596..854325e871a 100644 --- a/mod/assign/tests/behat/quickgrading.feature +++ b/mod/assign/tests/behat/quickgrading.feature @@ -65,7 +65,7 @@ Feature: In an assignment, teachers grade multiple students on one page | enableoutcomes | 1 | When I log in as "teacher1" And I follow "Course 1" - And I follow "Outcomes" + And I navigate to "Outcomes" node in "Course administration" And I follow "Edit outcomes" And I press "Add a new outcome" And I follow "Add a new scale" @@ -74,7 +74,7 @@ Feature: In an assignment, teachers grade multiple students on one page | Scale | Noob, Nub, 1337, HaXor | And I press "Save changes" And I follow "Course 1" - And I follow "Outcomes" + And I navigate to "Outcomes" node in "Course administration" And I follow "Edit outcomes" And I press "Add a new outcome" And I set the following fields to these values: @@ -133,7 +133,7 @@ Feature: In an assignment, teachers grade multiple students on one page And I should see "I'm the teacher first feedback" And I should see "60.0" And I follow "Grades" in the user menu - And I follow "Course 1" + And I click on "Course 1" "link" in the "region-main" "region" And I should see "1337" And I log out And I log in as "student2" @@ -142,7 +142,7 @@ Feature: In an assignment, teachers grade multiple students on one page And I should not see "I'm the teacher first feedback" And I should not see "60.0" And I follow "Grades" in the user menu - And I follow "Course 1" + And I click on "Course 1" "link" in the "region-main" "region" And I should not see "1337" And I log out And I log in as "teacher1" @@ -172,7 +172,7 @@ Feature: In an assignment, teachers grade multiple students on one page And I should see "I'm the teacher first feedback" And I should see "60.0" And I follow "Grades" in the user menu - And I follow "Course 1" + And I click on "Course 1" "link" in the "region-main" "region" And I should see "1337" And I log out And I log in as "student2" @@ -181,5 +181,5 @@ Feature: In an assignment, teachers grade multiple students on one page And I should not see "I'm the teacher first feedback" And I should not see "60.0" And I follow "Grades" in the user menu - And I follow "Course 1" + And I click on "Course 1" "link" in the "region-main" "region" And I should not see "1337" diff --git a/mod/assign/tests/behat/steps_blind_marking.feature b/mod/assign/tests/behat/steps_blind_marking.feature index 35d7967415b..548cf29bc36 100644 --- a/mod/assign/tests/behat/steps_blind_marking.feature +++ b/mod/assign/tests/behat/steps_blind_marking.feature @@ -80,7 +80,7 @@ Feature: Assignments correctly add feedback to the grade report when workflow an And I log out And I log in as "student1" And I follow "Course 1" - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" And I set the field "Grade report" to "User report" Then I should see "50" And I should see "Great job! Lol, not really." @@ -108,7 +108,7 @@ Feature: Assignments correctly add feedback to the grade report when workflow an And I log out And I log in as "student1" And I follow "Course 1" - And I navigate to "Grades" node in "Course administration" + And I click on "Grades" "link" in the "Navigation" "block" And I set the field "Grade report" to "User report" Then I should see "50" And I should see "Great job! Lol, not really." diff --git a/mod/data/tests/behat/view_entries.feature b/mod/data/tests/behat/view_entries.feature index 92018305fe6..b8b5eabeaea 100644 --- a/mod/data/tests/behat/view_entries.feature +++ b/mod/data/tests/behat/view_entries.feature @@ -50,7 +50,7 @@ Feature: Users can view and search database entries And I follow "Next" And I should see "Teacher entry 2" And I should not see "Teacher entry 1" - And I follow "3" + And I click on "3" "link" in the "region-main" "region" And I should see "Teacher entry 3" And I should not see "Teacher entry 2" And I follow "Previous" diff --git a/mod/feedback/tests/behat/anonymous.feature b/mod/feedback/tests/behat/anonymous.feature index f18b618e426..70adbe3f840 100644 --- a/mod/feedback/tests/behat/anonymous.feature +++ b/mod/feedback/tests/behat/anonymous.feature @@ -28,8 +28,8 @@ Feature: Anonymous feedback | feedback | Course feedback | C1 | feedback1 | 1 | 1 | When I log in as "manager" And I am on site homepage - And I follow "Site feedback" - And I follow "Edit questions" + And I navigate to "Site feedback" node in "Site pages" + And I click on "Edit questions" "link" in the "[role=main]" "css_element" And I add a "Multiple choice" question to the feedback with: | Question | Do you like our site? | | Label | multichoice2 | @@ -48,7 +48,7 @@ Feature: Anonymous feedback Scenario: Complete anonymous feedback on the front page as an authenticated user And I log in as "user1" And I am on site homepage - When I follow "Site feedback" + When I navigate to "Site feedback" node in "Site pages" And I follow "Preview" And I should see "Do you like our site?" And I press "Continue" @@ -69,7 +69,7 @@ Feature: Anonymous feedback And I log out And I log in as "user1" And I am on site homepage - When I follow "Site feedback" + When I navigate to "Site feedback" node in "Site pages" And I follow "Preview" And I should see "Do you like our site?" And I press "Continue" @@ -81,7 +81,7 @@ Feature: Anonymous feedback And I log out And I log in as "user2" And I am on site homepage - When I follow "Site feedback" + And I navigate to "Site feedback" node in "Site pages" And I follow "Preview" And I should see "Do you like our site?" And I press "Continue" @@ -100,7 +100,7 @@ Feature: Anonymous feedback And I log out And I log in as "manager" And I am on site homepage - And I follow "Site feedback" + And I navigate to "Site feedback" node in "Site pages" And I follow "Show responses" And I should not see "Username" And I should see "Anonymous entries (2)" @@ -165,7 +165,7 @@ Feature: Anonymous feedback And I should see "1 (50.00 %)" in the "No" "table_row" And I log in as "manager" And I am on site homepage - And I follow "Site feedback" + And I navigate to "Site feedback" node in "Site pages" And I follow "Show responses" And I should see "Anonymous entries (2)" And I follow "Response number: 1" @@ -178,7 +178,7 @@ Feature: Anonymous feedback When I log in as "teacher" And I follow "Course 1" And I follow "Course feedback" - And I follow "Edit questions" + And I click on "Edit questions" "link" in the "[role=main]" "css_element" And I add a "Multiple choice" question to the feedback with: | Question | Do you like this course? | | Label | multichoice1 | @@ -236,7 +236,7 @@ Feature: Anonymous feedback And I should see "Response number: 2 (Anonymous)" And I should see "Prev" And I should not see "Next" - And I follow "Back" + And I click on "Back" "link" in the "[role=main]" "css_element" # Delete anonymous response And I click on "Delete entry" "link" in the "Response number: 1" "table_row" And I press "Yes" diff --git a/mod/feedback/tests/behat/coursemapping.feature b/mod/feedback/tests/behat/coursemapping.feature index 8943c07550b..fbb80664243 100644 --- a/mod/feedback/tests/behat/coursemapping.feature +++ b/mod/feedback/tests/behat/coursemapping.feature @@ -36,8 +36,8 @@ Feature: Mapping courses in a feedback | feedback | Another feedback | C1 | feedback1 | 1 | 1 | When I log in as "manager" And I am on site homepage - And I follow "Course feedback" - And I follow "Edit questions" + And I navigate to "Course feedback" node in "Site pages" + And I click on "Edit questions" "link" in the "[role=main]" "css_element" And I add a "Information" question to the feedback with: | Question | this is an information question | | Label | info | @@ -77,7 +77,7 @@ Feature: Mapping courses in a feedback Scenario: Site feedback is not mapped to any course And I log in as "user1" And I am on site homepage - And I follow "Course feedback" + And I navigate to "Course feedback" node in "Site pages" And I follow "Answer the questions..." And I should see "Acceptance test site" in the ".feedback_form" "css_element" And I set the following fields to these values: @@ -112,7 +112,7 @@ Feature: Mapping courses in a feedback And I log out And I log in as "manager" And I am on site homepage - And I follow "Course feedback" + And I navigate to "Course feedback" node in "Site pages" And I follow "Analysis" And I should see "All courses" in the "#feedback_course_filter [data-fieldtype=autocomplete] .form-autocomplete-selection [role=listitem]" "css_element" @@ -124,7 +124,7 @@ Feature: Mapping courses in a feedback And I follow "Sort by course" And I should see "2.50" in the "C1" "table_row" And I should see "1.00" in the "Acceptance test site" "table_row" - And I follow "Back" + And I click on "Back" "link" in the "region-main" "region" And I set the field "Filter by course" to "Course 1" And I press "Filter" And I should see "Course 1" in the "#feedback_course_filter [data-fieldtype=autocomplete] .form-autocomplete-selection [role=listitem]" "css_element" @@ -138,7 +138,7 @@ Feature: Mapping courses in a feedback Scenario: Site feedback is mapped to courses And I log in as "manager" And I am on site homepage - And I follow "Course feedback" + And I navigate to "Course feedback" node in "Site pages" And I follow "Map feedback to courses" And I set the field "Courses" to "Course 2" And I set the field "Courses" to "Course 3" @@ -147,7 +147,7 @@ Feature: Mapping courses in a feedback And I log in as "user1" And I am on site homepage - And I follow "Course feedback" + And I navigate to "Course feedback" node in "Site pages" And I should see "You can only access this feedback from a course" And I should not see "Answer the questions..." @@ -196,7 +196,7 @@ Feature: Mapping courses in a feedback And I log out And I log in as "manager" And I am on site homepage - And I follow "Course feedback" + And I navigate to "Course feedback" node in "Site pages" And I follow "Analysis" And I should see "All courses" in the "#feedback_course_filter [data-fieldtype=autocomplete] .form-autocomplete-selection [role=listitem]" "css_element" And I show chart data for the "multichoicerated" feedback @@ -207,7 +207,7 @@ Feature: Mapping courses in a feedback And I click on "Sort by course" "link" And I should see "3.00" in the "C3" "table_row" And I should see "2.50" in the "C2" "table_row" - And I follow "Back" + And I click on "Back" "link" in the "region-main" "region" And I set the field "Filter by course" to "Course 2" And I press "Filter" And I show chart data for the "multichoicerated" feedback @@ -234,8 +234,9 @@ Feature: Mapping courses in a feedback Scenario: Site feedback deletion hides feedback block completely When I log in as "manager" And I am on site homepage - And I follow "Turn editing on" + And I turn editing mode on And I add the "Feedback" block + And I add the "Main menu" block And I click on "Delete" "link" in the "//*[contains(@class,'block_site_main_menu')]//li[contains(.,'Course feedback')]" "xpath_element" And I press "Yes" And I follow "Turn editing off" diff --git a/mod/feedback/tests/behat/export_import.feature b/mod/feedback/tests/behat/export_import.feature index 63484185bd5..9ad877a6129 100644 --- a/mod/feedback/tests/behat/export_import.feature +++ b/mod/feedback/tests/behat/export_import.feature @@ -24,7 +24,7 @@ Feature: Exporting and importing feedbacks When I log in as "teacher" And I follow "Course 1" And I follow "Learning experience" - And I follow "Edit questions" + And I click on "Edit questions" "link" in the "[role=main]" "css_element" And I add a "Information" question to the feedback with: | Question | this is an information question | | Label | info | @@ -76,7 +76,7 @@ Feature: Exporting and importing feedbacks When I log in as "teacher" And I follow "Course 1" And I follow "Learning experience" - And I follow "Edit questions" + And I click on "Edit questions" "link" in the "[role=main]" "css_element" And I add a "Numeric answer" question to the feedback with: | Question | Existing question | | Label | numeric | @@ -85,7 +85,7 @@ Feature: Exporting and importing feedbacks And I follow "Import questions" And I upload "mod/feedback/tests/fixtures/testexport.xml" file to "File" filemanager And I press "Yes" - And I follow "Edit questions" + And I click on "Edit questions" "link" in the "[role=main]" "css_element" Then I should not see "Existing question" And I should see "this is an information question" And I should see "label text" @@ -103,7 +103,7 @@ Feature: Exporting and importing feedbacks When I log in as "teacher" And I follow "Course 1" And I follow "Learning experience" - And I follow "Edit questions" + And I click on "Edit questions" "link" in the "[role=main]" "css_element" And I add a "Numeric answer" question to the feedback with: | Question | Existing question | | Label | numeric | @@ -113,7 +113,7 @@ Feature: Exporting and importing feedbacks And I set the field "Append new items" to "1" And I upload "mod/feedback/tests/fixtures/testexport.xml" file to "File" filemanager And I press "Yes" - And I follow "Edit questions" + And I click on "Edit questions" "link" in the "[role=main]" "css_element" Then I should see "Existing question" And "Existing question" "text" should appear before "this is an information question" "text" And I should see "this is an information question" diff --git a/mod/feedback/tests/behat/groups.feature b/mod/feedback/tests/behat/groups.feature index 181188d6cbe..359e17fc989 100644 --- a/mod/feedback/tests/behat/groups.feature +++ b/mod/feedback/tests/behat/groups.feature @@ -52,8 +52,8 @@ Feature: Feedbacks in courses with groups | feedback | Course anon feedback | C1 | feedback2 | 1 | 1 | 1 | When I log in as "manager" And I am on site homepage - And I follow "Site feedback" - And I follow "Edit questions" + And I navigate to "Site feedback" node in "Site pages" + And I click on "Edit questions" "link" in the "[role=main]" "css_element" And I add a "Multiple choice" question to the feedback with: | Question | Do you like our site? | | Label | multichoice2 | @@ -67,7 +67,7 @@ Feature: Feedbacks in courses with groups When I log in as "teacher" And I follow "Course 1" And I follow "Course feedback" - And I follow "Edit questions" + And I click on "Edit questions" "link" in the "[role=main]" "css_element" And I add a "Multiple choice" question to the feedback with: | Question | Do you like this course? | | Label | multichoice1 | @@ -170,7 +170,7 @@ Feature: Feedbacks in courses with groups When I log in as "teacher" And I follow "Course 1" And I follow "Course anon feedback" - And I follow "Edit questions" + And I click on "Edit questions" "link" in the "[role=main]" "css_element" And I add a "Multiple choice" question to the feedback with: | Question | Do you like this course? | | Label | multichoice1 | diff --git a/mod/feedback/tests/behat/multichoice.feature b/mod/feedback/tests/behat/multichoice.feature index dc20d35562d..3468d1bbcc5 100644 --- a/mod/feedback/tests/behat/multichoice.feature +++ b/mod/feedback/tests/behat/multichoice.feature @@ -24,7 +24,7 @@ Feature: Testing multichoice questions in feedback And I log in as "teacher1" And I follow "Course 1" And I follow "Learning experience" - And I follow "Edit questions" + And I click on "Edit questions" "link" in the "[role=main]" "css_element" @javascript Scenario: Non-rated single-answer multiple choice questions in feedback @@ -157,7 +157,7 @@ Feature: Testing multichoice questions in feedback And I should not see "%" in the "option h" "table_row" And I should see "1 (100.00 %)" in the "option i" "table_row" # Change the settings so we don't analyse empty submits - And I follow "Edit questions" + And I click on "Edit questions" "link" in the "[role=main]" "css_element" And I open the action menu in "//div[contains(@class, 'feedback_itemlist') and contains(.,'multichoice1')]" "xpath_element" And I choose "Edit question" in the open action menu And I set the field "Do not analyse empty submits" to "Yes" @@ -301,7 +301,7 @@ Feature: Testing multichoice questions in feedback And I should not see "%" in the "option h" "table_row" And I should see "1 (100.00 %)" in the "option i" "table_row" # Change the settings so we don't analyse empty submits - And I follow "Edit questions" + And I click on "Edit questions" "link" in the "[role=main]" "css_element" And I open the action menu in "//div[contains(@class, 'feedback_itemlist') and contains(.,'multichoice1')]" "xpath_element" And I choose "Edit question" in the open action menu And I set the field "Do not analyse empty submits" to "Yes" @@ -424,7 +424,7 @@ Feature: Testing multichoice questions in feedback And I should not see "%" in the "option h" "table_row" And I should see "1 (100.00 %)" in the "option i" "table_row" # Change the settings so we don't analyse empty submits - And I follow "Edit questions" + And I click on "Edit questions" "link" in the "[role=main]" "css_element" And I open the action menu in "//div[contains(@class, 'feedback_itemlist') and contains(.,'multichoice1')]" "xpath_element" And I choose "Edit question" in the open action menu And I set the field "Do not analyse empty submits" to "Yes" diff --git a/mod/feedback/tests/behat/non_anonymous.feature b/mod/feedback/tests/behat/non_anonymous.feature index f657f773109..98419388450 100644 --- a/mod/feedback/tests/behat/non_anonymous.feature +++ b/mod/feedback/tests/behat/non_anonymous.feature @@ -28,8 +28,8 @@ Feature: Non anonymous feedback | feedback | Course feedback | C1 | feedback1 | 2 | 1 | When I log in as "manager" And I am on site homepage - And I follow "Site feedback" - And I follow "Edit questions" + And I navigate to "Site feedback" node in "Site pages" + And I click on "Edit questions" "link" in the "[role=main]" "css_element" And I add a "Multiple choice" question to the feedback with: | Question | Do you like our site? | | Label | multichoice2 | @@ -48,7 +48,7 @@ Feature: Non anonymous feedback Scenario: Complete non anonymous feedback on the front page as an authenticated user And I log in as "user1" And I am on site homepage - When I follow "Site feedback" + And I navigate to "Site feedback" node in "Site pages" And I follow "Preview" And I should see "Do you like our site?" And I press "Continue" @@ -69,7 +69,7 @@ Feature: Non anonymous feedback And I log out And I log in as "user1" And I am on site homepage - When I follow "Site feedback" + When I navigate to "Site feedback" node in "Site pages" And I follow "Answer the questions..." And I should see "Do you like our site?" And I set the following fields to these values: @@ -78,7 +78,7 @@ Feature: Non anonymous feedback And I log out And I log in as "user2" And I am on site homepage - When I follow "Site feedback" + When I navigate to "Site feedback" node in "Site pages" And I follow "Answer the questions..." And I set the following fields to these values: | Not at all | 1 | @@ -95,7 +95,7 @@ Feature: Non anonymous feedback And I log out And I log in as "manager" And I am on site homepage - And I follow "Site feedback" + And I navigate to "Site feedback" node in "Site pages" And I follow "Show responses" And I should see "Username" And I should see "Non anonymous entries (2)" @@ -111,7 +111,7 @@ Feature: Non anonymous feedback When I log in as "teacher" And I follow "Course 1" And I follow "Course feedback" - And I follow "Edit questions" + And I click on "Edit questions" "link" in the "[role=main]" "css_element" And I add a "Multiple choice" question to the feedback with: | Question | Do you like this course? | | Label | multichoice1 | @@ -163,7 +163,7 @@ Feature: Non anonymous feedback And I should see "(Username 2)" And I should not see "Next" And I should see "Prev" - And I follow "Back" + And I click on "Back" "link" in the "region-main" "region" # Delete non anonymous response And I click on "Delete entry" "link" in the "Username 1" "table_row" And I press "Yes" diff --git a/mod/feedback/tests/behat/question_types.feature b/mod/feedback/tests/behat/question_types.feature index 1fddcc3e1c0..96206aa6dc1 100644 --- a/mod/feedback/tests/behat/question_types.feature +++ b/mod/feedback/tests/behat/question_types.feature @@ -25,7 +25,7 @@ Feature: Test creating different types of feedback questions for anonymous feedb When I log in as "teacher1" And I follow "Course 1" And I follow "Learning experience" - And I follow "Edit questions" + And I click on "Edit questions" "link" in the "[role=main]" "css_element" And I add a "Information" question to the feedback with: | Question | this is an information question | | Label | info | diff --git a/mod/feedback/tests/behat/question_types_non_anon.feature b/mod/feedback/tests/behat/question_types_non_anon.feature index 834a146af92..51d2ef2ac9d 100644 --- a/mod/feedback/tests/behat/question_types_non_anon.feature +++ b/mod/feedback/tests/behat/question_types_non_anon.feature @@ -25,7 +25,7 @@ Feature: Test creating different types of feedback questions for non-anonymous f When I log in as "teacher1" And I follow "Course 1" And I follow "Learning experience" - And I follow "Edit questions" + And I click on "Edit questions" "link" in the "[role=main]" "css_element" And I add a "Information" question to the feedback with: | Question | this is an information question | | Label | info | diff --git a/mod/feedback/tests/behat/show_nonrespondents.feature b/mod/feedback/tests/behat/show_nonrespondents.feature index 73b40cb4308..1d3d63779cb 100644 --- a/mod/feedback/tests/behat/show_nonrespondents.feature +++ b/mod/feedback/tests/behat/show_nonrespondents.feature @@ -46,7 +46,7 @@ Feature: Show users who have not responded to the feedback survey | Record user names | User's name will be logged and shown with answers | | Access restrictions | Grouping: GX1 | And I follow "Frogs" - And I follow "Edit questions" + And I click on "Edit questions" "link" in the "[role=main]" "css_element" And I set the field "Add question" to "Short text answer" And I set the following fields to these values: | Question | Y/N? | diff --git a/mod/feedback/tests/behat/templates.feature b/mod/feedback/tests/behat/templates.feature index dbf7e1d467b..ae65cf53868 100644 --- a/mod/feedback/tests/behat/templates.feature +++ b/mod/feedback/tests/behat/templates.feature @@ -28,7 +28,7 @@ Feature: Saving, using and deleting feedback templates And I log in as "teacher" And I follow "Course 1" And I follow "Learning experience course 1" - And I follow "Edit questions" + And I click on "Edit questions" "link" in the "[role=main]" "css_element" And I add a "Multiple choice" question to the feedback with: | Question | this is a multiple choice 1 | | Label | multichoice1 | @@ -84,7 +84,7 @@ Feature: Saving, using and deleting feedback templates # Add questions to another feedback And I follow "Course 1" And I follow "Another feedback in course 1" - And I follow "Edit questions" + And I click on "Edit questions" "link" in the "[role=main]" "css_element" And I add a "Multiple choice" question to the feedback with: | Question | What is your favourite subject | | Label | subjectchoice | @@ -169,7 +169,7 @@ Feature: Saving, using and deleting feedback templates And I am on site homepage And I follow "Course 1" And I follow "Learning experience course 1" - And I follow "Templates" + And I click on "Templates" "link" in the "[role=main]" "css_element" And I set the field "Name" to "My public template" And I set the field "Public" to "1" And I press "Save as new template" diff --git a/mod/forum/tests/behat/advanced_search.feature b/mod/forum/tests/behat/advanced_search.feature index e38968ee16c..03c5e10fd85 100644 --- a/mod/forum/tests/behat/advanced_search.feature +++ b/mod/forum/tests/behat/advanced_search.feature @@ -20,6 +20,8 @@ Feature: The forum search allows users to perform advanced searches for forum po | student1 | C1 | student | And I log in as "teacher1" And I follow "Course 1" + And I turn editing mode on + And I add the "Latest announcements" block And I navigate to "Edit settings" node in "Course administration" And I set the field "id_newsitems" to "1" And I press "Save and display" diff --git a/mod/forum/tests/behat/edit_post_student.feature b/mod/forum/tests/behat/edit_post_student.feature index 8f42c7fb1eb..d73f74b0982 100644 --- a/mod/forum/tests/behat/edit_post_student.feature +++ b/mod/forum/tests/behat/edit_post_student.feature @@ -52,6 +52,7 @@ Feature: Students can edit or delete their forum posts within a set time limit And I am on site homepage And I follow "Course 1" And I turn editing mode on + And I add the "Recent activity" block And I add a "Forum" to section "1" and I fill the form with: | Forum name | Test forum name | | Forum type | Standard forum for general use | diff --git a/mod/lesson/tests/behat/duplicate_lesson_page.feature b/mod/lesson/tests/behat/duplicate_lesson_page.feature index 5f7774c3158..779de6d7d9d 100644 --- a/mod/lesson/tests/behat/duplicate_lesson_page.feature +++ b/mod/lesson/tests/behat/duplicate_lesson_page.feature @@ -40,9 +40,9 @@ Feature: In a lesson activity, a teacher can duplicate a lesson page | id_jumpto_1 | Previous page | # Atto needs focus to add image, select empty p tag to do so. And I select the text in the "id_contents_editor" Atto editor - And I click on "Image" "button" in the "#fitem_id_contents_editor" "css_element" + And I click on "Image" "button" in the "[data-fieldtype=editor]" "css_element" And I click on "Browse repositories..." "button" - And I click on "Private files" "link" + And I click on "Private files" "link" in the ".fp-repo-area" "css_element" And I click on "moodle_logo.jpg" "link" And I click on "Select this file" "button" And I set the field "Describe this image for someone who cannot see it" to "It's the logo" @@ -76,9 +76,9 @@ Feature: In a lesson activity, a teacher can duplicate a lesson page | id_score_1 | 0 | # Atto needs focus to add image, select empty p tag to do so. And I select the text in the "id_answer_editor_0" Atto editor - And I click on "Image" "button" in the "#fitem_id_answer_editor_0" "css_element" + And I click on "Image" "button" in the "//*[@id='id_answer_editor_0']/ancestor::*[@data-fieldtype='editor']" "xpath_element" And I click on "Browse repositories..." "button" - And I click on "Private files" "link" + And I click on "Private files" "link" in the ".fp-repo-area" "css_element" And I click on "moodle_logo.jpg" "link" And I click on "Select this file" "button" And I set the field "Describe this image for someone who cannot see it" to "It's the logo" @@ -113,9 +113,9 @@ Feature: In a lesson activity, a teacher can duplicate a lesson page | id_score_1 | 0 | # Atto needs focus to add image, select empty p tag to do so. And I select the text in the "id_response_editor_0" Atto editor - And I click on "Image" "button" in the "#fitem_id_response_editor_0" "css_element" + And I click on "Image" "button" in the "//*[@id='id_response_editor_0']/ancestor::*[@data-fieldtype='editor']" "xpath_element" And I click on "Browse repositories..." "button" - And I click on "Private files" "link" + And I click on "Private files" "link" in the ".fp-repo-area" "css_element" And I click on "moodle_logo.jpg" "link" And I click on "Select this file" "button" And I set the field "Describe this image for someone who cannot see it" to "It's the logo" diff --git a/mod/lesson/tests/behat/lesson_group_override.feature b/mod/lesson/tests/behat/lesson_group_override.feature index 78f4a862083..868c078e1e3 100644 --- a/mod/lesson/tests/behat/lesson_group_override.feature +++ b/mod/lesson/tests/behat/lesson_group_override.feature @@ -64,7 +64,7 @@ Feature: Lesson user override | deadline[minute] | 00 | And I press "Save" And I should see "Wednesday, 1 January 2020, 8:00" - Then I click on "Edit" "link" + Then I click on "Edit" "link" in the "region-main" "region" And I set the following fields to these values: | deadline[year] | 2030 | And I press "Save" diff --git a/mod/lesson/tests/behat/lesson_practice.feature b/mod/lesson/tests/behat/lesson_practice.feature index 65eeb3d6fb3..49900ff0a38 100644 --- a/mod/lesson/tests/behat/lesson_practice.feature +++ b/mod/lesson/tests/behat/lesson_practice.feature @@ -71,7 +71,7 @@ Feature: Practice mode in a lesson activity And I press "Submit" Then I should not see "View grades" And I follow "Grades" in the user menu - And I follow "Course 1" + And I click on "Course 1" "link" in the "Course 1" "table_row" And I should not see "Practice lesson" Scenario: Practice lesson with scale doesn't record grades in the gradebook @@ -92,5 +92,5 @@ Feature: Practice mode in a lesson activity And I press "Submit" Then I should not see "View grades" And I follow "Grades" in the user menu - And I follow "Course 1" + And I click on "Course 1" "link" in the "Course 1" "table_row" And I should not see "Practice lesson with scale" diff --git a/mod/lesson/tests/behat/lesson_user_override.feature b/mod/lesson/tests/behat/lesson_user_override.feature index 6cd33ce59af..90eb263e6f8 100644 --- a/mod/lesson/tests/behat/lesson_user_override.feature +++ b/mod/lesson/tests/behat/lesson_user_override.feature @@ -57,7 +57,7 @@ Feature: Lesson user override | deadline[minute] | 00 | And I press "Save" And I should see "Wednesday, 1 January 2020, 8:00" - Then I click on "Edit" "link" + Then I click on "Edit" "link" in the "Sam1 Student1" "table_row" And I set the following fields to these values: | deadline[year] | 2030 | And I press "Save" diff --git a/mod/lesson/tests/behat/questions_images.feature b/mod/lesson/tests/behat/questions_images.feature index c83a7c529a1..630ee850a78 100644 --- a/mod/lesson/tests/behat/questions_images.feature +++ b/mod/lesson/tests/behat/questions_images.feature @@ -49,7 +49,7 @@ Feature: In a lesson activity, teacher can add embedded images in questions answ And I select the text in the "id_answer_editor_2" Atto editor And I click on "Image" "button" in the "//*[@data-fieldtype='editor']/*[descendant::*[@id='id_answer_editor_2']]" "xpath_element" And I click on "Browse repositories..." "button" - And I click on "Private files" "link" + And I click on "Private files" "link" in the ".fp-repo-area" "css_element" And I click on "moodle_logo.jpg" "link" And I click on "Select this file" "button" And I set the field "Describe this image for someone who cannot see it" to "It's the logo" @@ -71,7 +71,7 @@ Feature: In a lesson activity, teacher can add embedded images in questions answ And I select the text in the "id_response_editor_0" Atto editor And I click on "Image" "button" in the "//*[@data-fieldtype='editor']/*[descendant::*[@id='id_response_editor_0']]" "xpath_element" And I click on "Browse repositories..." "button" - And I click on "Private files" "link" + And I click on "Private files" "link" in the ".fp-repo-area" "css_element" And I click on "moodle_logo.jpg" "link" And I click on "Select this file" "button" And I set the field "Describe this image for someone who cannot see it" to "It's the logo" diff --git a/mod/quiz/tests/behat/editing_repaginate.feature b/mod/quiz/tests/behat/editing_repaginate.feature index 2d7b438e847..c86865434ce 100644 --- a/mod/quiz/tests/behat/editing_repaginate.feature +++ b/mod/quiz/tests/behat/editing_repaginate.feature @@ -30,7 +30,7 @@ Feature: Edit quiz page - pagination Then I should see "Editing quiz: Quiz 1" # Add the first Essay question. - And I follow "Add" + And I click on "Add" "link" in the "region-main" "region" And I follow "a new question" And I set the field "item_qtype_essay" to "1" And I press "submitbutton" @@ -42,7 +42,7 @@ Feature: Edit quiz page - pagination And I should see "Essay 01 new" on quiz page "1" # Add the second Essay question. - And I follow "Add" + And I click on "Add" "link" in the "region-main" "region" And I follow "a new question" And I set the field "item_qtype_essay" to "1" And I press "submitbutton" @@ -67,7 +67,7 @@ Feature: Edit quiz page - pagination And I should not see "Page 2" # Add the third Essay question. - And I follow "Add" + And I click on "Add" "link" in the "region-main" "region" And I follow "a new question" And I set the field "item_qtype_essay" to "1" And I press "submitbutton" diff --git a/mod/quiz/tests/behat/settings_form_fields_disableif.feature b/mod/quiz/tests/behat/settings_form_fields_disableif.feature index 587e84b7809..431a0fc5e38 100644 --- a/mod/quiz/tests/behat/settings_form_fields_disableif.feature +++ b/mod/quiz/tests/behat/settings_form_fields_disableif.feature @@ -68,7 +68,7 @@ Feature: Settings form fields disabled if not required When I press "Save and display" And I navigate to "User overrides" node in "Quiz administration" - And I follow "Edit" + And I click on "Edit" "link" in the "region-main" "region" And I set the field "Attempts allowed" to "2" And I press "Save" And I navigate to "Edit settings" node in "Quiz administration" diff --git a/mod/wiki/tests/behat/page_history.feature b/mod/wiki/tests/behat/page_history.feature index 49ac414288c..49b38d8de72 100644 --- a/mod/wiki/tests/behat/page_history.feature +++ b/mod/wiki/tests/behat/page_history.feature @@ -61,7 +61,7 @@ Feature: A history of each wiki page is available And I follow "History" And I click on "3" "link" in the "Student 2" "table_row" And I should see "Third edition" - And I should see "Student 2" in the "#region-main" "css_element" + And I should see "Student 2" in the "region-main" "region" And I follow "History" And I click on "comparewith" "radio" in the "Student 1" "table_row" And I click on "compare" "radio" in the "Teacher 1" "table_row" diff --git a/mod/workshop/tests/behat/embedded_images.feature b/mod/workshop/tests/behat/embedded_images.feature index 03f298aa278..29fa1d2f4dd 100644 --- a/mod/workshop/tests/behat/embedded_images.feature +++ b/mod/workshop/tests/behat/embedded_images.feature @@ -31,9 +31,9 @@ Feature: Teachers can embed images into instructions and conclusion fields And I expand all fieldsets And I set the field "Instructions for submission" to "

        Image test

        " And I select the text in the "Instructions for submission" Atto editor - And I click on "Image" "button" in the "#fitem_id_instructauthorseditor" "css_element" + And I click on "Image" "button" in the "//*[@data-fieldtype='editor']/*[descendant::*[@id='id_instructauthorseditor']]" "xpath_element" And I click on "Browse repositories..." "button" - And I click on "Private files" "link" + And I click on "Private files" "link" in the ".fp-repo-area" "css_element" And I click on "moodlelogo.png" "link" And I click on "Select this file" "button" And I set the field "Describe this image for someone who cannot see it" to "How to submit" @@ -44,9 +44,9 @@ Feature: Teachers can embed images into instructions and conclusion fields And I expand all fieldsets And I set the field "Instructions for assessment" to "

        Image test

        " And I select the text in the "Instructions for assessment" Atto editor - And I click on "Image" "button" in the "#fitem_id_instructreviewerseditor" "css_element" + And I click on "Image" "button" in the "//*[@data-fieldtype='editor']/*[descendant::*[@id='id_instructreviewerseditor']]" "xpath_element" And I click on "Browse repositories..." "button" - And I click on "Private files" "link" + And I click on "Private files" "link" in the ".fp-repo-area" "css_element" And I click on "moodlelogo.png" "link" And I click on "Select this file" "button" And I set the field "Describe this image for someone who cannot see it" to "How to assess" @@ -57,9 +57,9 @@ Feature: Teachers can embed images into instructions and conclusion fields And I expand all fieldsets And I set the field "Conclusion" to "

        Image test

        " And I select the text in the "Conclusion" Atto editor - And I click on "Image" "button" in the "#fitem_id_conclusioneditor" "css_element" + And I click on "Image" "button" in the "//*[@data-fieldtype='editor']/*[descendant::*[@id='id_conclusioneditor']]" "xpath_element" And I click on "Browse repositories..." "button" - And I click on "Private files" "link" + And I click on "Private files" "link" in the ".fp-repo-area" "css_element" And I click on "moodlelogo.png" "link" And I click on "Select this file" "button" And I set the field "Describe this image for someone who cannot see it" to "Well done" diff --git a/notes/index.php b/notes/index.php index 6ba0099c6ef..8bff3392321 100644 --- a/notes/index.php +++ b/notes/index.php @@ -103,11 +103,6 @@ if ($userid && $course->id == SITEID) { $PAGE->navbar->add(get_string('notes', 'notes'), $notesurl); } else if ($course->id != SITEID) { $notenode = $PAGE->navigation->find('currentcoursenotes', null)->make_inactive(); - $participantsurl = new moodle_url('/user/view.php', array('id' => $userid, 'course' => $course->id)); - $currentcoursenode = $PAGE->navigation->find('currentcourse', null); - $participantsnode = $currentcoursenode->find('participants', null); - $usernode = $participantsnode->add(fullname($user), $participantsurl); - $usernode->make_active(); $notesurl = new moodle_url('/notes/index.php', array('user' => $userid, 'course' => $courseid)); $PAGE->navbar->add(get_string('notes', 'notes'), $notesurl); diff --git a/report/log/tests/behat/filter_log.feature b/report/log/tests/behat/filter_log.feature index 623ce581a05..96d25f44fca 100644 --- a/report/log/tests/behat/filter_log.feature +++ b/report/log/tests/behat/filter_log.feature @@ -25,7 +25,7 @@ Feature: In a report, admin can filter log data | loglegacy | 1 | logstore_legacy | And I follow "Home" And I follow "Course 1" - And I navigate to "Participants" node in "Current course > C1" + And I navigate to "Participants" node in "My courses > C1" And I follow "Student 1" And I click on "Log in as" "link" And I press "Continue" @@ -45,7 +45,7 @@ Feature: In a report, admin can filter log data @javascript Scenario: Filter log report for standard log reader Given I follow "Course 1" - And I navigate to "Participants" node in "Current course > C1" + And I navigate to "Participants" node in "My courses > C1" And I follow "Student 1" And I click on "Log in as" "link" And I press "Continue" diff --git a/report/log/tests/behat/user_log.feature b/report/log/tests/behat/user_log.feature index d8be3c70fe5..354c94af047 100644 --- a/report/log/tests/behat/user_log.feature +++ b/report/log/tests/behat/user_log.feature @@ -38,7 +38,7 @@ Feature: User can view activity log. Scenario: View Todays' and all log report for user Given I log in as "teacher1" And I follow "Course 1" - And I navigate to "Participants" node in "Current course > C1" + And I navigate to "Participants" node in "My courses > C1" And I follow "Student 1" When I follow "Today's logs" And I should see "Assignment: Test assignment name" @@ -54,7 +54,7 @@ Feature: User can view activity log. And I log out And I log in as "teacher1" And I follow "Course 1" - And I navigate to "Participants" node in "Current course > C1" + And I navigate to "Participants" node in "My courses > C1" And I follow "Student 1" When I follow "Today's logs" And I should see "No log reader enabled" diff --git a/report/outline/tests/behat/user.feature b/report/outline/tests/behat/user.feature index b27700ea5e6..98ade5ea365 100644 --- a/report/outline/tests/behat/user.feature +++ b/report/outline/tests/behat/user.feature @@ -48,12 +48,12 @@ Feature: View the user page for the outline report And I follow "URL name" And I follow "URL name" And I follow "Profile" in the user menu - And I follow "Course 1" + And I click on "Course 1" "link" in the "region-main" "region" When I follow "Outline report" Then I should see "4 views" in the "Folder name" "table_row" And I should see "3 views" in the "URL name" "table_row" And I follow "Profile" in the user menu - And I follow "Course 1" + And I click on "Course 1" "link" in the "region-main" "region" And I follow "Complete report" And I should see "4 views" And I should see "3 views" @@ -76,12 +76,12 @@ Feature: View the user page for the outline report And I follow "URL name" And I follow "URL name" And I follow "Profile" in the user menu - And I follow "Course 1" + And I click on "Course 1" "link" in the "region-main" "region" When I follow "Outline report" Then I should see "4 views" in the "Folder name" "table_row" And I should see "3 views" in the "URL name" "table_row" And I follow "Profile" in the user menu - And I follow "Course 1" + And I click on "Course 1" "link" in the "region-main" "region" When I follow "Complete report" And I should see "4 views" And I should see "3 views" @@ -106,12 +106,12 @@ Feature: View the user page for the outline report And I follow "URL name" And I follow "URL name" And I follow "Profile" in the user menu - And I follow "Course 1" + And I click on "Course 1" "link" in the "region-main" "region" When I follow "Outline report" Then I should see "4 views" in the "Folder name" "table_row" And I should see "3 views" in the "URL name" "table_row" And I follow "Profile" in the user menu - And I follow "Course 1" + And I click on "Course 1" "link" in the "region-main" "region" When I follow "Complete report" And I should see "4 views" And I should see "3 views" diff --git a/tag/tests/behat/collections.feature b/tag/tests/behat/collections.feature index ad3dd6994e4..0622be17da4 100644 --- a/tag/tests/behat/collections.feature +++ b/tag/tests/behat/collections.feature @@ -86,7 +86,7 @@ Feature: Managers can create and manage tag collections Scenario: Moving tags when changing tag collections And I follow "Preferences" in the user menu - And I follow "Edit profile" + And I click on "Edit profile" "link" in the "region-main" "region" And I expand all fieldsets And I set the field "List of interests" to "Swimming, Tag0, Tag3" And I press "Update profile" diff --git a/tag/tests/behat/standard_tags.feature b/tag/tests/behat/standard_tags.feature index ab40ffd8ba8..465c8ed1818 100644 --- a/tag/tests/behat/standard_tags.feature +++ b/tag/tests/behat/standard_tags.feature @@ -90,7 +90,7 @@ Feature: Manager can add standard tags and change the tag type of existing tags Scenario: Changing standard tags property of tag area When I log in as "manager1" And I follow "Profile" in the user menu - And I follow "Edit profile" + And I click on "Edit profile" "link" in the "region-main" "region" And I expand all fieldsets And I should not see "Manage standard tags" And I set the following fields to these values: @@ -101,7 +101,7 @@ Feature: Manager can add standard tags and change the tag type of existing tags And the field "Change showing standard tags in area User interests" matches value "Don't suggest" And I set the field "Change showing standard tags in area User interests" to "Suggest" And I follow "Profile" in the user menu - And I follow "Edit profile" + And I click on "Edit profile" "link" in the "region-main" "region" And I expand all fieldsets And I should see "Manage standard tags" And I navigate to "Manage tags" node in "Site administration > Appearance" @@ -111,7 +111,7 @@ Feature: Manager can add standard tags and change the tag type of existing tags And I follow "Profile" in the user menu And I should see "Tag3" And I should see "Tag2" - And I follow "Edit profile" + And I click on "Edit profile" "link" in the "region-main" "region" And I expand all fieldsets And I should see "Manage standard tags" And I press "Update profile" diff --git a/theme/boost/amd/build/blocks_drawer.min.js b/theme/boost/amd/build/blocks_drawer.min.js new file mode 100644 index 00000000000..6abe8582ffc --- /dev/null +++ b/theme/boost/amd/build/blocks_drawer.min.js @@ -0,0 +1 @@ +define(["jquery","core/custom_interaction_events","core/notification"],function(a,b,c){var d={CONTAINER_REGION:'[data-region="blocks-drawer"]',TOGGLE_REGION:'[data-region="blocks-drawer-toggle"]',TOGGLE_ACTION:'[data-action="toggle-blocks-drawer"]',BODY:"body"},e=function(){a(d.CONTAINER_REGION).length||c.exception({message:"Page is missing a blocks drawer region"}),a(d.TOGGLE_REGION).length||c.exception({message:"Page is missing a blocks drawer toggle region"}),a(d.TOGGLE_ACTION).length||c.exception({message:"Page is missing a blocks drawer toggle link"});var b=a(d.CONTAINER_REGION),e=a(d.TOGGLE_REGION),f="true"==b.attr("aria-hidden"),g=a(d.BODY);f?(b.addClass("closed"),e.addClass("closed"),b.attr("aria-hidden","true")):(g.addClass("blocks-drawer-open"),b.attr("aria-hidden","false")),this.registerEventListeners()};return e.prototype.toggleBlocksDrawer=function(){var b=a(d.CONTAINER_REGION),c=a(d.TOGGLE_REGION),e=a(d.BODY);e.addClass("blocks-drawer-ease");var f="true"==b.attr("aria-hidden");f?(b.removeClass("closed"),c.removeClass("closed"),b.attr("aria-hidden","false"),e.addClass("blocks-drawer-open"),M.util.set_user_preference("blocks-drawer-open","true")):(b.addClass("closed"),c.addClass("closed"),e.removeClass("blocks-drawer-open"),b.attr("aria-hidden","true"),M.util.set_user_preference("blocks-drawer-open","false"))},e.prototype.registerEventListeners=function(){var c=a(d.TOGGLE_ACTION);b.define(c,[b.events.activate]),c.on(b.events.activate,function(a,b){this.toggleBlocksDrawer(),b.originalEvent.preventDefault()}.bind(this))},{init:function(){return new e}}}); \ No newline at end of file diff --git a/theme/boost/amd/build/drawer.min.js b/theme/boost/amd/build/drawer.min.js new file mode 100644 index 00000000000..919a930e0a2 --- /dev/null +++ b/theme/boost/amd/build/drawer.min.js @@ -0,0 +1 @@ +define(["jquery","core/custom_interaction_events","core/log"],function(a,b,c){var d={TOGGLE_REGION:'[data-region="drawer-toggle"]',TOGGLE_ACTION:'[data-action="toggle-drawer"]',TOGGLE_TARGET:"aria-controls",TOGGLE_SIDE:"left",BODY:"body"},e=function(){a(d.TOGGLE_REGION).length||c.debug("Page is missing a drawer region"),a(d.TOGGLE_ACTION).length||c.debug("Page is missing a drawer toggle link"),a(d.TOGGLE_REGION).each(function(b,c){var e=a(c).find(d.TOGGLE_ACTION),f=e.attr("aria-controls"),g=a(document.getElementById(f)),h="false"==e.attr("aria-expanded"),i=e.attr("data-side"),j=a(d.BODY);g.on("mousewheel DOMMouseScroll",this.preventPageScroll),h?e.attr("aria-expanded","false"):(j.addClass("drawer-open-"+i),e.attr("aria-expanded","true"))}.bind(this)),this.registerEventListeners()};return e.prototype.closeAll=function(){a(d.TOGGLE_REGION).each(function(b,c){var e=a(c).find(d.TOGGLE_ACTION),f=e.attr("data-side"),g=a(d.BODY),h=e.attr("aria-controls"),i=a(document.getElementById(h)),j=e.attr("data-preference");e.attr("aria-expanded","false"),g.removeClass("drawer-open-"+f),i.attr("aria-hidden","true"),i.addClass("closed"),M.util.set_user_preference(j,"false")}.bind(this))},e.prototype.toggleDrawer=function(b){var c=a(b.target).closest("[data-action=toggle-drawer]"),e=c.attr("aria-controls"),f=a(document.getElementById(e)),g=a(d.BODY),h=c.attr("data-side"),i=c.attr("data-preference");g.addClass("drawer-ease");var j="true"==c.attr("aria-expanded");if(j)g.removeClass("drawer-open-"+h),c.attr("aria-expanded","false"),f.attr("aria-hidden","true"),f.addClass("closed"),M.util.set_user_preference(i,"false");else{var k=a(document).width()<512;k&&this.closeAll(),c.attr("aria-expanded","true"),f.attr("aria-hidden","false"),g.addClass("drawer-open-"+h),f.removeClass("closed"),M.util.set_user_preference(i,"true")}},e.prototype.preventPageScroll=function(b){var c=b.wheelDelta||b.originalEvent&&b.originalEvent.wheelDelta||-b.originalEvent.detail,d=this.scrollTop+a(this).outerHeight()-this.scrollHeight>=0,e=this.scrollTop<=0;(c<0&&d||c>0&&e)&&b.preventDefault()},e.prototype.registerEventListeners=function(){a(d.TOGGLE_ACTION).each(function(c,d){b.define(a(d),[b.events.activate]),a(d).on(b.events.activate,function(a,b){this.toggleDrawer(b.originalEvent),b.originalEvent.preventDefault()}.bind(this))}.bind(this))},{init:function(){return new e}}}); \ No newline at end of file diff --git a/theme/boost/amd/src/drawer.js b/theme/boost/amd/src/drawer.js new file mode 100644 index 00000000000..ce208babb85 --- /dev/null +++ b/theme/boost/amd/src/drawer.js @@ -0,0 +1,159 @@ +// This file is part of Moodle - http://moodle.org/ +// +// Moodle is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Moodle is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Moodle. If not, see . + +/** + * Contain the logic for a drawer. + * + * @package theme_boost + * @copyright 2016 Damyon Wiese + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ +define(['jquery', 'core/custom_interaction_events', 'core/log'], + function($, CustomEvents, Log) { + + var SELECTORS = { + TOGGLE_REGION: '[data-region="drawer-toggle"]', + TOGGLE_ACTION: '[data-action="toggle-drawer"]', + TOGGLE_TARGET: 'aria-controls', + TOGGLE_SIDE: 'left', + BODY: 'body' + }; + + /** + * Constructor for the Drawer. + * + * @param {object} root The root jQuery element for the modal + */ + var Drawer = function() { + + if (!$(SELECTORS.TOGGLE_REGION).length) { + Log.debug('Page is missing a drawer region'); + } + if (!$(SELECTORS.TOGGLE_ACTION).length) { + Log.debug('Page is missing a drawer toggle link'); + } + $(SELECTORS.TOGGLE_REGION).each(function(index, ele) { + var trigger = $(ele).find(SELECTORS.TOGGLE_ACTION); + var drawerid = trigger.attr('aria-controls'); + var drawer = $(document.getElementById(drawerid)); + var hidden = trigger.attr('aria-expanded') == 'false'; + var side = trigger.attr('data-side'); + var body = $(SELECTORS.BODY); + + drawer.on('mousewheel DOMMouseScroll', this.preventPageScroll); + + if (!hidden) { + body.addClass('drawer-open-' + side); + trigger.attr('aria-expanded', 'true'); + } else { + trigger.attr('aria-expanded', 'false'); + } + }.bind(this)); + + this.registerEventListeners(); + }; + + Drawer.prototype.closeAll = function() { + $(SELECTORS.TOGGLE_REGION).each(function(index, ele) { + var trigger = $(ele).find(SELECTORS.TOGGLE_ACTION); + var side = trigger.attr('data-side'); + var body = $(SELECTORS.BODY); + var drawerid = trigger.attr('aria-controls'); + var drawer = $(document.getElementById(drawerid)); + var preference = trigger.attr('data-preference'); + + trigger.attr('aria-expanded', 'false'); + body.removeClass('drawer-open-' + side); + drawer.attr('aria-hidden', 'true'); + drawer.addClass('closed'); + M.util.set_user_preference(preference, 'false'); + }.bind(this)); + }; + + /** + * Open / close the blocks drawer. + * + * @method toggleDrawer + * @param {Event} e + */ + Drawer.prototype.toggleDrawer = function(e) { + var trigger = $(e.target).closest('[data-action=toggle-drawer]'); + var drawerid = trigger.attr('aria-controls'); + var drawer = $(document.getElementById(drawerid)); + var body = $(SELECTORS.BODY); + var side = trigger.attr('data-side'); + var preference = trigger.attr('data-preference'); + + body.addClass('drawer-ease'); + var open = trigger.attr('aria-expanded') == 'true'; + if (!open) { + var small = $(document).width() < 512; + if (small) { + this.closeAll(); + } + // Open. + trigger.attr('aria-expanded', 'true'); + drawer.attr('aria-hidden', 'false'); + body.addClass('drawer-open-' + side); + drawer.removeClass('closed'); + M.util.set_user_preference(preference, 'true'); + } else { + // Close. + body.removeClass('drawer-open-' + side); + trigger.attr('aria-expanded', 'false'); + drawer.attr('aria-hidden', 'true'); + drawer.addClass('closed'); + M.util.set_user_preference(preference, 'false'); + } + }; + + /** + * Prevent the page from scrolling when the drawer is at max scroll. + * + * @method preventPageScroll + */ + Drawer.prototype.preventPageScroll = function(e) { + var delta = e.wheelDelta || (e.originalEvent && e.originalEvent.wheelDelta) || -e.originalEvent.detail, + bottomOverflow = (this.scrollTop + $(this).outerHeight() - this.scrollHeight) >= 0, + topOverflow = this.scrollTop <= 0; + + if ((delta < 0 && bottomOverflow) || (delta > 0 && topOverflow)) { + e.preventDefault(); + } + }; + + /** + * Set up all of the event handling for the modal. + * + * @method registerEventListeners + */ + Drawer.prototype.registerEventListeners = function() { + + $(SELECTORS.TOGGLE_ACTION).each(function(index, element) { + CustomEvents.define($(element), [CustomEvents.events.activate]); + $(element).on(CustomEvents.events.activate, function(e, data) { + this.toggleDrawer(data.originalEvent); + data.originalEvent.preventDefault(); + }.bind(this)); + }.bind(this)); + + }; + + return { + 'init': function() { + return new Drawer(); + } + }; +}); diff --git a/theme/boost/classes/output/core_renderer.php b/theme/boost/classes/output/core_renderer.php index afe5a60c9a9..85cb1e687bd 100644 --- a/theme/boost/classes/output/core_renderer.php +++ b/theme/boost/classes/output/core_renderer.php @@ -23,6 +23,8 @@ use tabtree; use custom_menu_item; use custom_menu; use block_contents; +use navigation_node; +use action_link; use stdClass; use moodle_url; use preferences_groups; @@ -72,7 +74,10 @@ class core_renderer extends \core_renderer { */ public function full_header() { $html = html_writer::start_tag('header', array('id' => 'page-header', 'class' => 'row')); - $html .= html_writer::start_div('col-xs-12 p-t-1 p-b-1'); + $html .= html_writer::start_div('col-xs-12 p-a-1'); + $html .= html_writer::start_div('card'); + $html .= html_writer::start_div('card-block'); + $html .= html_writer::div($this->context_header_settings_menu(), 'pull-xs-right context-header-settings-menu'); $html .= $this->context_header(); $html .= html_writer::start_div('clearfix', array('id' => 'page-navbar')); $html .= html_writer::tag('div', $this->navbar(), array('class' => 'breadcrumb-nav')); @@ -80,6 +85,8 @@ class core_renderer extends \core_renderer { $html .= html_writer::end_div(); $html .= html_writer::tag('div', $this->course_header(), array('id' => 'course-header')); $html .= html_writer::end_div(); + $html .= html_writer::end_div(); + $html .= html_writer::end_div(); $html .= html_writer::end_tag('header'); return $html; } @@ -112,6 +119,14 @@ class core_renderer extends \core_renderer { return $this->render_from_template('core/navbar', $this->page->navbar); } + /** + * We don't like these... + * + */ + public function edit_button(moodle_url $url) { + return ''; + } + /** * Override to inject the logo. * @@ -185,6 +200,38 @@ class core_renderer extends \core_renderer { return $this->render_custom_menu($custommenu); } + /** + * We want to show the custom menus as a list of links in the footer on small screens. + * Just return the menu object exported so we can render it differently. + */ + public function custom_menu_flat() { + global $CFG; + $custommenuitems = ''; + + if (empty($custommenuitems) && !empty($CFG->custommenuitems)) { + $custommenuitems = $CFG->custommenuitems; + } + $custommenu = new custom_menu($custommenuitems, current_language()); + $langs = get_string_manager()->get_list_of_translations(); + $haslangmenu = $this->lang_menu() != ''; + + if ($haslangmenu) { + $strlang = get_string('language'); + $currentlang = current_language(); + if (isset($langs[$currentlang])) { + $currentlang = $langs[$currentlang]; + } else { + $currentlang = $strlang; + } + $this->language = $custommenu->add($currentlang, new moodle_url('#'), $strlang, 10000); + foreach ($langs as $langtype => $langname) { + $this->language->add($langname, new moodle_url($this->page->url, array('lang' => $langtype)), $langname); + } + } + + return $custommenu->export_for_template($this); + } + /* * This renders the bootstrap top menu. * @@ -319,7 +366,7 @@ class core_renderer extends \core_renderer { * @return string */ public function body_css_classes(array $additionalclasses = array()) { - return $this->page->bodyclasses; + return $this->page->bodyclasses . ' ' . implode(' ', $additionalclasses); } /** @@ -347,6 +394,9 @@ class core_renderer extends \core_renderer { } } + if ($menu->is_empty()) { + return ''; + } $context = $menu->export_for_template($this); // We do not want the icon with the caret, the caret is added by Bootstrap. @@ -441,4 +491,186 @@ class core_renderer extends \core_renderer { } return $this->render_from_template('core/pix_icon', $data); } + + /** + * Renders the login form. + * + * @param \core_auth\output\login $form The renderable. + * @return string + */ + public function render_login(\core_auth\output\login $form) { + global $SITE; + + $context = $form->export_for_template($this); + + // Override because rendering is not supported in template yet. + $context->cookieshelpiconformatted = $this->help_icon('cookiesenabled'); + $context->errorformatted = $this->error_text($context->error); + $url = $this->get_logo_url(); + if ($url) { + $url = $url->out(false); + } + $context->logourl = $url; + $context->sitename = format_string($SITE->fullname, true, array('context' => context_course::instance(SITEID))); + + return $this->render_from_template('core/login', $context); + } + + /** + * Render the login signup form into a nice template for the theme. + * + * @param mform $form + * @return string + */ + public function render_login_signup_form($form) { + global $SITE; + + $context = $form->export_for_template($this); + $url = $this->get_logo_url(); + if ($url) { + $url = $url->out(false); + } + $context['logourl'] = $url; + $context['sitename'] = format_string($SITE->fullname, true, array('context' => context_course::instance(SITEID))); + + return $this->render_from_template('core/signup_form_layout', $context); + } + + /** + * This is an optional menu that can be added to a layout by a theme. It contains the + * menu for the course administration, only on the course main page. + * + * @return string + */ + public function context_header_settings_menu() { + $context = $this->page->context; + $menu = new action_menu(); + if ($context->contextlevel == CONTEXT_COURSE) { + // Get the course admin node from the settings navigation. + $items = $this->page->navbar->get_items(); + $node = end($items); + $settingsnode = false; + if (!empty($node) && $node->key === 'home') { + $settingsnode = $this->page->settingsnav->find('frontpage', navigation_node::TYPE_SETTING); + if ($settingsnode) { + // Build an action menu based on the visible nodes from this navigation tree. + $skipped = $this->build_action_menu_from_navigation($menu, $settingsnode, false, true); + + // We only add a list to the full settings menu if we didn't include every node in the short menu. + if ($skipped) { + $text = get_string('frontpagesettings'); + $url = new moodle_url('/course/admin.php', array('courseid' => $this->page->course->id)); + $link = new action_link($url, $text, null, null, new pix_icon('t/edit', $text)); + $menu->add_secondary_action($link); + } + } + } else if (!empty($node) && $node->type == navigation_node::TYPE_COURSE) { + $settingsnode = $this->page->settingsnav->find('courseadmin', navigation_node::TYPE_COURSE); + if ($settingsnode) { + // Build an action menu based on the visible nodes from this navigation tree. + $skipped = $this->build_action_menu_from_navigation($menu, $settingsnode, false, true); + + // We only add a list to the full settings menu if we didn't include every node in the short menu. + if ($skipped) { + $text = get_string('courseadministration'); + $url = new moodle_url('/course/admin.php', array('courseid' => $this->page->course->id)); + $link = new action_link($url, $text, null, null, new pix_icon('t/edit', $text)); + $menu->add_secondary_action($link); + } + } + } + } else if ($context->contextlevel == CONTEXT_USER) { + $items = $this->page->navbar->get_items(); + $node = end($items); + if (!empty($node) && ($node->key === 'myprofile')) { + // Get the course admin node from the settings navigation. + $node = $this->page->settingsnav->find('useraccount', navigation_node::TYPE_CONTAINER); + if ($node) { + // Build an action menu based on the visible nodes from this navigation tree. + $this->build_action_menu_from_navigation($menu, $node); + } + } + } + return $this->render($menu); + } + + /** + * This is an optional menu that can be added to a layout by a theme. It contains the + * menu for the most specific thing from the settings block. E.g. Module administration. + * + * @return string + */ + public function region_main_settings_menu() { + $context = $this->page->context; + $menu = new action_menu(); + + if ($context->contextlevel == CONTEXT_MODULE) { + + $node = $this->page->navigation->find_active_node(); + if (!empty($node) && ($node->type == navigation_node::TYPE_ACTIVITY || + $node->type == navigation_node::TYPE_RESOURCE)) { + + $items = $this->page->navbar->get_items(); + $navbarnode = end($items); + // We only want to show the menu on the first page of the activity. This means + // the breadcrumb has no additional nodes. + if ($navbarnode->key == $node->key && $navbarnode->type == $node->type) { + // Get the course admin node from the settings navigation. + $node = $this->page->settingsnav->find('modulesettings', navigation_node::TYPE_SETTING); + if ($node) { + // Build an action menu based on the visible nodes from this navigation tree. + $this->build_action_menu_from_navigation($menu, $node); + } + } + } + } + return $this->render($menu); + } + + /** + * Take a node in the nav tree and make an action menu out of it. + * The links are injected in the action menu. + * + * @param action_menu $menu + * @param navigation_node $node + * @param boolean $indent + * @param boolean $onlytopleafnodes + * @return boolean nodesskipped - True if nodes were skipped in building the menu + */ + private function build_action_menu_from_navigation(action_menu $menu, + navigation_node $node, + $indent = false, + $onlytopleafnodes = false) { + $skipped = false; + // Build an action menu based on the visible nodes from this navigation tree. + foreach ($node->children as $menuitem) { + if ($menuitem->display) { + if ($onlytopleafnodes && $menuitem->children->count()) { + $skipped = true; + continue; + } + if ($menuitem->action) { + $text = $menuitem->text; + if ($menuitem->action instanceof action_link) { + $link = $menuitem->action; + } else { + $link = new action_link($menuitem->action, $menuitem->text, null, null, $menuitem->icon); + } + if ($indent) { + $link->add_class('m-l-1'); + } + } else { + if ($onlytopleafnodes) { + $skipped = true; + continue; + } + $link = $menuitem->text; + } + $menu->add_secondary_action($link); + $skipped = $skipped || $this->build_action_menu_from_navigation($menu, $menuitem, true); + } + } + return $skipped; + } + } diff --git a/theme/boost/config.php b/theme/boost/config.php index f52949d803f..44c39f053b7 100644 --- a/theme/boost/config.php +++ b/theme/boost/config.php @@ -88,7 +88,7 @@ $THEME->layouts = [ 'defaultregion' => 'side-pre', ), 'login' => array( - 'file' => 'columns1.php', + 'file' => 'login.php', 'regions' => array(), 'options' => array('langmenu' => true), ), @@ -149,3 +149,4 @@ $THEME->extrascsscallback = 'theme_boost_get_extra_scss'; $THEME->prescsscallback = 'theme_boost_get_pre_scss'; $THEME->yuicssmodules = array(); $THEME->rendererfactory = 'theme_overridden_renderer_factory'; +$THEME->undeletableblocktypes = ''; diff --git a/theme/boost/lang/en/theme_boost.php b/theme/boost/lang/en/theme_boost.php index 0750bfeb1a3..99dc7cd343d 100644 --- a/theme/boost/lang/en/theme_boost.php +++ b/theme/boost/lang/en/theme_boost.php @@ -43,5 +43,4 @@ $string['rawscss'] = 'Raw SCSS'; $string['rawscss_desc'] = 'Use this field to provide SCSS code which will be injected at the end of the stylesheet.'; $string['rawscsspre'] = 'Raw initial SCSS'; $string['rawscsspre_desc'] = 'In this field you can provide initialising SCSS code, it will be injected before everything else. Most of the time you will use this setting to define variables.'; -$string['region-side-post'] = 'Right'; -$string['region-side-pre'] = 'Left'; +$string['region-side-pre'] = 'Right'; diff --git a/theme/boost/layout/columns1.php b/theme/boost/layout/columns1.php index 618eb77ed38..d1febaffacd 100644 --- a/theme/boost/layout/columns1.php +++ b/theme/boost/layout/columns1.php @@ -15,7 +15,7 @@ // along with Moodle. If not, see . /** - * A one column layout for the boost theme. + * A two column layout for the boost theme. * * @package theme_boost * @copyright 2016 Damyon Wiese @@ -24,9 +24,13 @@ defined('MOODLE_INTERNAL') || die(); +$bodyattributes = $OUTPUT->body_attributes([]); + $templatecontext = [ 'sitename' => format_string($SITE->shortname, true, array('context' => context_course::instance(SITEID))), - 'output' => $OUTPUT + 'output' => $OUTPUT, + 'bodyattributes' => $bodyattributes, ]; echo $OUTPUT->render_from_template('theme_boost/columns1', $templatecontext); + diff --git a/theme/boost/layout/columns2.php b/theme/boost/layout/columns2.php index 90c4fc1e18e..840925d14d8 100644 --- a/theme/boost/layout/columns2.php +++ b/theme/boost/layout/columns2.php @@ -24,10 +24,31 @@ defined('MOODLE_INTERNAL') || die(); +user_preference_allow_ajax_update('drawer-open-nav', PARAM_ALPHA); +require_once($CFG->libdir . '/behat/lib.php'); + +if (isloggedin() && !behat_is_test_site()) { + $navdraweropen = (get_user_preferences('drawer-open-nav', 'true') == 'true'); +} else { + $navdraweropen = false; +} +$extraclasses = []; +if ($navdraweropen) { + $extraclasses[] = 'drawer-open-left'; +} +$bodyattributes = $OUTPUT->body_attributes($extraclasses); +$blockshtml = $OUTPUT->blocks('side-pre'); +$hasblocks = strpos($blockshtml, 'data-block=') !== false; + $templatecontext = [ 'sitename' => format_string($SITE->shortname, true, array('context' => context_course::instance(SITEID))), 'output' => $OUTPUT, - 'sidepreblocks' => $OUTPUT->blocks('side-pre', 'col-md-4 pull-md-8'), + 'sidepreblocks' => $blockshtml, + 'hasblocks' => $hasblocks, + 'bodyattributes' => $bodyattributes, + 'navdraweropen' => $navdraweropen ]; +$templatecontext['flatnavigation'] = $PAGE->flatnav; echo $OUTPUT->render_from_template('theme_boost/columns2', $templatecontext); + diff --git a/theme/boost/layout/login.php b/theme/boost/layout/login.php new file mode 100644 index 00000000000..0ae675d0050 --- /dev/null +++ b/theme/boost/layout/login.php @@ -0,0 +1,36 @@ +. + +defined('MOODLE_INTERNAL') || die(); + +/** + * A two column layout for the boost theme. + * + * @package theme_boost + * @copyright 2016 Damyon Wiese + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +$bodyattributes = $OUTPUT->body_attributes(); + +$templatecontext = [ + 'sitename' => format_string($SITE->shortname, true, array('context' => context_course::instance(SITEID))), + 'output' => $OUTPUT, + 'bodyattributes' => $bodyattributes +]; + +echo $OUTPUT->render_from_template('theme_boost/login', $templatecontext); + diff --git a/theme/boost/layout/secure.php b/theme/boost/layout/secure.php index c1217901b7d..b0ae36aad9a 100644 --- a/theme/boost/layout/secure.php +++ b/theme/boost/layout/secure.php @@ -27,8 +27,7 @@ defined('MOODLE_INTERNAL') || die(); $templatecontext = [ 'sitename' => format_string($SITE->shortname, true, array('context' => context_course::instance(SITEID))), 'output' => $OUTPUT, - 'sidepreblocks' => $OUTPUT->blocks('side-pre', 'col-md-4 pull-md-8 col-lg-3 pull-lg-9'), - 'sidepostblocks' => $OUTPUT->blocks('side-post', 'col-md-3') + 'sidepreblocks' => $OUTPUT->blocks('side-pre'), ]; echo $OUTPUT->render_from_template('theme_boost/secure', $templatecontext); diff --git a/theme/boost/pix/blocksdrawer.png b/theme/boost/pix/blocksdrawer.png new file mode 100644 index 00000000000..a296436a705 Binary files /dev/null and b/theme/boost/pix/blocksdrawer.png differ diff --git a/theme/boost/pix/blocksdrawer.svg b/theme/boost/pix/blocksdrawer.svg new file mode 100644 index 00000000000..eac1f212149 --- /dev/null +++ b/theme/boost/pix/blocksdrawer.svg @@ -0,0 +1,22 @@ + + + + + + diff --git a/theme/boost/scss/moodle.scss b/theme/boost/scss/moodle.scss index 9080050c6a0..c92deac3508 100644 --- a/theme/boost/scss/moodle.scss +++ b/theme/boost/scss/moodle.scss @@ -17,14 +17,17 @@ $breadcrumb-divider-rtl: "◀" !default; @import "moodle/icons"; @import "moodle/admin"; @import "moodle/blocks"; +@import "moodle/bootswatch"; @import "moodle/calendar"; @import "moodle/course"; +@import "moodle/drawer"; @import "moodle/filemanager"; @import "moodle/message"; @import "moodle/question"; @import "moodle/user"; @import "moodle/search"; @import "moodle/forms"; +@import "moodle/login"; @import "moodle/modules"; @import "moodle/chat"; @import "moodle/reports"; diff --git a/theme/boost/scss/moodle/blocks.scss b/theme/boost/scss/moodle/blocks.scss index f1504fa528e..21ffa00110e 100644 --- a/theme/boost/scss/moodle/blocks.scss +++ b/theme/boost/scss/moodle/blocks.scss @@ -13,10 +13,6 @@ margin-left: 0; } -.block .card-title { - word-break: break-all; -} - .block .block-controls { .dropdown-toggle { /* So that the caret takes the colour of the icon. */ @@ -27,3 +23,20 @@ } } } + +$blocks-column-width: 250px !default; + +[data-region="blocks-column"] { + width: $blocks-column-width; + float: right; +} + +$blocks-plus-gutter: $blocks-column-width + $grid-gutter-width; + +#region-main.has-blocks { + display: inline-block; + width: calc(100% - #{$blocks-plus-gutter}); + @include media-breakpoint-down(md) { + width: 100%; + } +} diff --git a/theme/boost/scss/moodle/bootswatch.scss b/theme/boost/scss/moodle/bootswatch.scss new file mode 100644 index 00000000000..60afab5b269 --- /dev/null +++ b/theme/boost/scss/moodle/bootswatch.scss @@ -0,0 +1,10 @@ +// Adjustments to make bootstrap 4 work better with some variables from bootstrap 3 bootswatches +$navbar-height: 60px !default; + +.navbar { + max-height: $navbar-height; +} + +.navbar-brand { + margin-top: (($font-size-base * $line-height-base) - ($font-size-lg * $line-height-base)) / 2; +} diff --git a/theme/boost/scss/moodle/core.scss b/theme/boost/scss/moodle/core.scss index ffa9548305d..2918202d07d 100644 --- a/theme/boost/scss/moodle/core.scss +++ b/theme/boost/scss/moodle/core.scss @@ -1,5 +1,25 @@ /* core.less */ +#region-main > .card { + overflow-x: auto; + overflow-y: visible; + min-height: 45rem; +} + +.context-header-settings-menu, +.region-main-settings-menu { + float: right; + width: 4em; + height: 2em; + display: block; +} + +.context-header-settings-menu .dropdown-toggle > .icon, +.region-main-settings-menu .dropdown-toggle > .icon { + height: 24px; + width: auto; +} + /** Page layout CSS starts **/ .layout-option-noheader #page-header, .layout-option-nonavbar #page-navbar, @@ -254,14 +274,8 @@ form.popupform div { .arrow_button input { overflow: hidden; } -/** The 1-pixel padding is there to avoid phantom scroll bars on OS X (FF, Safari and Chrome)**/ .no-overflow { overflow: auto; - padding-bottom: 1px; -} - -.pagelayout-report .no-overflow { - overflow: visible; } .no-overflow > .generaltable { @@ -1227,11 +1241,6 @@ body#page-lib-editor-tinymce-plugins-moodlemedia-preview { } } -/** Moodle modals. */ -.modal.show { - display: block; -} - /* Moodle Dialogue Settings (moodle-core-dialogue) */ .moodle-dialogue-base .moodle-dialogue-lightbox { background-color: $gray; @@ -1920,38 +1929,6 @@ img#persona_signin { .breadcrumb-nav .breadcrumb { margin: 0; } -/** Navbar */ -.navbar-brand { - .logo { - display: inline-block; - margin: -$navbar-brand-padding-y 0; - } - - .site-name { - display: inline-block; - } - - &.has-logo { - .site-name { - margin-left: $spacer / 2; - } - } -} - -@include media-breakpoint-down(xs) { - .navbar { - .navbar-brand { - max-width: 80%; - margin-right: 0; - - &.has-logo { - .site-name { - display: none; - } - } - } - } -} /** Page header */ #page-header { @@ -2207,3 +2184,31 @@ ul { } } } + +#region-flat-nav { + padding-right: 0; + padding-left: 0; + .nav { + margin-right: $grid-gutter-width / 2; + background-color: $card-bg; + } + @include media-breakpoint-down(sm) { + .nav { + margin-top: $grid-gutter-width; + margin-right: 0; + } + } +} + +$footer-link-color: $brand-primary !default; +#page-footer a { + color: $footer-link-color; +} + +// Make links in a menu clickable anywhere in the row. +.dropdown-item a { + display: block; + width: 100%; + color: $body-color; +} + diff --git a/theme/boost/scss/moodle/course.scss b/theme/boost/scss/moodle/course.scss index 3e7e55b123e..6e5616ee6e8 100644 --- a/theme/boost/scss/moodle/course.scss +++ b/theme/boost/scss/moodle/course.scss @@ -54,7 +54,9 @@ &.right { float: right; + clear: right; } + margin-top: 0.5rem; } .spinner { @@ -423,10 +425,6 @@ margin-right: 5px; } -.path-course-view .section .summary { - line-height: normal; -} - .path-site li.activity > div, .path-course-view li.activity > div { position: relative; @@ -494,7 +492,6 @@ span.editinstructions { top: 0; margin-top: -22px; margin-left: 30px; - line-height: 16px; font-size: $font-size-sm; padding: .1em .4em; background-color: $state-info-bg; @@ -607,7 +604,6 @@ span.editinstructions { .coursebox > .info > h3.coursename { margin: 5px; - line-height: 1; } .coursebox > .info > .coursename { @@ -825,7 +821,6 @@ span.editinstructions { .listing-actions { text-align: center; padding: 0.4rem 0.3rem 0.3rem; - line-height: 2.2em; > .moodle-actionmenu { display: inline-block; @@ -841,8 +836,7 @@ span.editinstructions { } } - li { - line-height: 2.2em; + .listitem { > div { &:hover { @@ -865,18 +859,7 @@ span.editinstructions { margin-right: 1em; display: inline-block; - > a img, - .menubar img { - margin: 0 4px; - height: 12px; - padding: 0; - vertical-align: inherit; - } - &.show .menu { - li { - line-height: 20px; - } img { width: 12px; @@ -1036,7 +1019,6 @@ span.editinstructions { > * { display: inline-block; - line-height: 2.2rem; } .pair-key { @@ -1113,7 +1095,6 @@ span.editinstructions { > div { display: inline-block; float: right; - line-height: 40px; > div { margin: 10px 0 10px 1em; @@ -1204,3 +1185,8 @@ span.editinstructions { } } } + +.page-settings-menu .menubar > a > .icon { + width: auto; + height: 32px; +} diff --git a/theme/boost/scss/moodle/debug.scss b/theme/boost/scss/moodle/debug.scss index 64f0d0d2ca1..9d7ee0dfd19 100644 --- a/theme/boost/scss/moodle/debug.scss +++ b/theme/boost/scss/moodle/debug.scss @@ -3,9 +3,14 @@ // for fixed positioned elements that end up obscuring the item thus // leading to errors that could be avoided by scrolling an additional amount. body.behat-site { - .navbar-fixed-top { + .navbar-static-top { position: absolute; } + + // We need more spacing in action menus so behat does not click on the wrong menu item. + .dropdown-item { + margin-top: 4px ! important; + } } .phpinfo table, @@ -38,75 +43,3 @@ body.behat-site { font-weight: bold; } -#page-footer .performanceinfo { - margin: 0 20%; -} - -#page-footer .performanceinfo span { - display: block; -} - -#page-footer .validators { - margin-top: 40px; - padding-top: 5px; - border-top: 1px dotted gray; -} - -#page-footer .validators ul { - margin: 0; - padding: 0; - list-style-type: none; -} - -#page-footer .validators ul li { - display: inline; - margin-right: 10px; - margin-left: 10px; -} - -/** Cache stats styles **/ -#page-footer .performanceinfo .cachesused { - margin-top: 1em; - - .cache-stats-heading, - .cache-total-stats { - font-weight: bold; - font-size: 110%; - margin-top: 0.3em; - } - - .cache-definition-stats { - margin: .3em; - display: inline-block; - vertical-align: top; - @extend .card; - - .cache-definition-stats-heading span { - display: inline-block; - cursor: default; - } - - .cache-store-stats { - padding: 0 1.3em; - - &.nohits { - background-color: $state-danger-bg; - } - - &.lowhits { - background-color: $state-warning-bg; - } - - &.hihits { - background-color: $state-success-bg; - } - } - } -} - -#page-footer, -#page-footer .validators, -#page-footer .purgecaches, -#page-footer .performanceinfo { - text-align: center; -} diff --git a/theme/boost/scss/moodle/drawer.scss b/theme/boost/scss/moodle/drawer.scss new file mode 100644 index 00000000000..1c5eb3c3100 --- /dev/null +++ b/theme/boost/scss/moodle/drawer.scss @@ -0,0 +1,67 @@ +/* Anchor link offset fix. This makes hash links scroll 60px down to account for the fixed header. */ +$fixed-header-y: $navbar-height; + +$drawer-width: 285px; +$drawer-padding-x: 20px; +$drawer-padding-y: 20px; +$drawer-offscreen-gutter: 20px; + +:target { + padding-top: ($fixed-header-y + 30px) ! important; /* negative fixed header height */ + margin-top: -$fixed-header-y ! important; /* negative fixed header height */ +} +.pagelayout-embedded :target { + padding-top: initial; + margin-top: initial; +} + +#nav-drawer.closed { + left: -($drawer-width + $drawer-offscreen-gutter); +} +#page { + margin-top: $navbar-height; +} + +/* Use a variable for the drawer background colors. */ +$drawer-bg: $gray-lighter !default; + +[data-region="drawer"] { + position: fixed; + padding: $drawer-padding-x $drawer-padding-y; + width: $drawer-width; + top: $fixed-header-y; + height: 100%; + overflow-y: auto; + -webkit-overflow-scrolling: touch; + z-index: $zindex-dropdown - 1; + background-color: $drawer-bg; + -webkit-transition: right 0.5s ease, left 0.5s ease; + -moz-transition: right 0.5s ease, left 0.5s ease; + transition: right 0.5s ease, left 0.5s ease; +} +#nav-drawer { + right: auto; + left: 0px; +} +#page { + margin-top: $fixed-header-y; +} +.pagelayout-embedded #page { + margin-top: 0; +} +body.drawer-ease { + -webkit-transition: margin-left 0.5s ease, margin-right 0.5s ease; + -moz-transition: margin-left 0.5s ease, margin-right 0.5s ease; + transition: margin-left 0.5s ease, margin-right 0.5s ease; +} + +body.drawer-open-left { + @include media-breakpoint-up(md) { + margin-left: $drawer-width; + } +} +body.drawer-open-right { + @include media-breakpoint-up(md) { + margin-right: $drawer-width; + } +} diff --git a/theme/boost/scss/moodle/grade.scss b/theme/boost/scss/moodle/grade.scss index 0a7281760a1..183c0656782 100644 --- a/theme/boost/scss/moodle/grade.scss +++ b/theme/boost/scss/moodle/grade.scss @@ -26,6 +26,10 @@ } } +.path-grade-report #maincontent + .urlselect { + float: right; +} + // Rubrics #page-grade-grading-manage { #activemethodselector { diff --git a/theme/boost/scss/moodle/icons.scss b/theme/boost/scss/moodle/icons.scss index eb2f8029412..70887e8044e 100644 --- a/theme/boost/scss/moodle/icons.scss +++ b/theme/boost/scss/moodle/icons.scss @@ -36,3 +36,7 @@ a:first-of-type > .icon { margin-left: 0; } } + +[data-action=toggle-drawer] .icon { + margin: 0px; +} diff --git a/theme/boost/scss/moodle/login.scss b/theme/boost/scss/moodle/login.scss new file mode 100644 index 00000000000..c96744bd9fe --- /dev/null +++ b/theme/boost/scss/moodle/login.scss @@ -0,0 +1,8 @@ +.pagelayout-login .card-img-top { + max-width: 100%; +} + +.pagelayout-login #region-main { + border: 0; + background-color: inherit; +} diff --git a/theme/boost/scss/moodle/modules.scss b/theme/boost/scss/moodle/modules.scss index 57fe38d4471..37e93f0f353 100644 --- a/theme/boost/scss/moodle/modules.scss +++ b/theme/boost/scss/moodle/modules.scss @@ -21,6 +21,10 @@ select { margin-bottom: -2rem; } +.path-mod-feedback .itemactions { + float: right; +} + // Forum module .path-mod-forum .forumsearch { @@ -150,10 +154,6 @@ select { margin: 0; } -#page-footer { - border-top: 2px solid $table-border-color; -} - .maincalendar .calendarmonth td, .maincalendar .calendarmonth th { border: 1px dotted $table-border-color; @@ -461,6 +461,9 @@ div#dock { .path-mod-assign [data-region="grade-actions-panel"] [data-region="grade-actions"] .collapse-buttons { top: auto; } +.path-mod-assign .no-overflow { + overflow: initial; +} .path-mod-assign [data-region="grade-panel"] .has-popout { background-color: $card-bg; @@ -495,8 +498,13 @@ div#dock { line-height: 40px; } +.path-mod-assign [data-region="assignment-info"] { + overflow-y: hidden; +} + .path-mod-assign [data-region="grading-navigation"] { padding: 6px; + overflow-y: hidden; } .path-mod-assign [data-region="grade-actions"] { diff --git a/theme/boost/scss/moodle/sticky-footer.scss b/theme/boost/scss/moodle/sticky-footer.scss index f09d3661d20..725ffb63671 100644 --- a/theme/boost/scss/moodle/sticky-footer.scss +++ b/theme/boost/scss/moodle/sticky-footer.scss @@ -22,4 +22,5 @@ body { #page-footer { min-height: $footer-min-height; -} \ No newline at end of file + text-align: left; +} diff --git a/theme/boost/scss/preset-default.scss b/theme/boost/scss/preset-default.scss index c61bb463348..bd3991b148d 100644 --- a/theme/boost/scss/preset-default.scss +++ b/theme/boost/scss/preset-default.scss @@ -14,10 +14,10 @@ $gray-lightest: #f7f7f9 !default; $brand-primary: #00acdf !default; $brand-success: #77b300 !default; -$brand-info: #9954bb !default; $brand-warning: #ff8800 !default; $brand-danger: #ff4136 !default; $brand-inverse: $gray-dark !default; +$navbar-height: 50px !default; // Spacing $spacer: 1rem !default; @@ -141,51 +141,6 @@ $breadcrumb-divider-rtl: "/" !default; padding-left: 0; } -#block-region-side-post { - padding-right: 0; -} - -#page-header { - background-color: #fff; - border: $border-width solid $card-border-color; - margin-top: $spacer; - margin-bottom: $spacer; -} - -#region-main { - background-color: #fff; - border: $border-width solid $card-border-color; - padding-top: $spacer; - padding-bottom: $spacer; -} - -#page-footer { - color: #fff; - text-align: right; - background-color: #333; - border-top: none; -} - -/** - * Login page. - */ -.pagelayout-login { - &.notloggedin { - #region-main { - background-color: transparent; - border: 0; - padding: 0; - } - .login-wrapper { - background-color: #fff; - border: $border-width solid $card-border-color; - } - } - #notice { - text-align: center; - } -} - /** * Dashboard styling. */ @@ -239,3 +194,5 @@ $breadcrumb-divider-rtl: "/" !default; .form-inline .form-group { margin-top: 0; } + + diff --git a/theme/boost/templates/blocks-drawer.mustache b/theme/boost/templates/blocks-drawer.mustache new file mode 100644 index 00000000000..e353e034e37 --- /dev/null +++ b/theme/boost/templates/blocks-drawer.mustache @@ -0,0 +1,3 @@ +
        + {{{ sidepreblocks }}} +
        diff --git a/theme/boost/templates/columns1.mustache b/theme/boost/templates/columns1.mustache index 67dbd8a1acc..6f0f9305a28 100644 --- a/theme/boost/templates/columns1.mustache +++ b/theme/boost/templates/columns1.mustache @@ -7,46 +7,30 @@ - +
        {{{ output.standard_top_of_body_html }}} - {{>theme_boost/header}} - -
        - {{{ output.full_header }}} - +
        -
        -
        - {{{ output.course_content_header }}} - {{{ output.main_content }}} - {{{ output.course_content_footer }}} -
        -
        +
        +
        + + {{{ output.region_main_settings_menu }}} + + {{{ output.course_content_header }}} + {{{ output.main_content }}} + {{{ output.course_content_footer }}} +
        +
        -
        -
        - - - {{# output.page_doc_link }} - - {{/ output.page_doc_link }} - - {{{ output.login_info }}} - {{{ output.home_link }}} - {{{ output.standard_footer_html }}} - - {{{ output.standard_end_of_body_html }}} -
        -
        - +{{{ output.standard_end_of_body_html }}} {{#js}} diff --git a/theme/boost/templates/columns2.mustache b/theme/boost/templates/columns2.mustache index 98668cc58f5..413431cb81b 100644 --- a/theme/boost/templates/columns2.mustache +++ b/theme/boost/templates/columns2.mustache @@ -7,7 +7,7 @@ - +
        @@ -15,25 +15,35 @@ {{>theme_boost/header}} -
        +
        {{{ output.full_header }}}
        -
        -
        -
        - {{{ output.course_content_header }}} - {{{ output.main_content }}} - {{{ output.course_content_footer }}} -
        -
        +
        + {{#hasblocks}} +
        + {{{ sidepreblocks }}} +
        +
        + {{/hasblocks}} + {{^hasblocks}} +
        + {{/hasblocks}} +
        + + {{{ output.region_main_settings_menu }}} + + {{{ output.course_content_header }}} + {{{ output.main_content }}} + {{{ output.course_content_footer }}} +
        +
        - {{{ sidepreblocks }}}
        -
        + {{> theme_boost/nav-drawer }}
        -