mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
Merge branch 'migration-nov26' of https://github.com/Chocolate-lightning/moodle
This commit is contained in:
commit
d29c09344e
150 changed files with 944 additions and 445 deletions
|
@ -59,7 +59,7 @@ if ($data = data_submitted() and confirm_sesskey() and isset($data->action) and
|
|||
}
|
||||
}
|
||||
|
||||
$PAGE->has_secondary_navigation_setter(false);
|
||||
$PAGE->set_primary_active_tab('siteadminnode');
|
||||
|
||||
// and finally, if we get here, then there are matching settings and we have to print a form
|
||||
// to modify them
|
||||
|
|
|
@ -385,6 +385,7 @@ Feature: Set up contextual data for tests
|
|||
| enableoutcomes | 1 |
|
||||
When I log in as "admin"
|
||||
And I am on "Course 1" course homepage
|
||||
And I navigate to "Grades" in current page administration
|
||||
And I follow "Outcomes"
|
||||
Then I should see "Grade outcome 1" in the "#addoutcomes" "css_element"
|
||||
And I should see "Grade outcome 2" in the "#removeoutcomes" "css_element"
|
||||
|
|
|
@ -49,7 +49,7 @@ Feature: Manage data registry defaults
|
|||
And the field "categoryid" matches value "Not set (use the default value)"
|
||||
And the field "purposeid" matches value "Not set (use the default value)"
|
||||
And I should see "3 years"
|
||||
And I click on "Courses" "link"
|
||||
And I click on "Courses" "link" in the ".data-registry" "css_element"
|
||||
And I wait until the page is ready
|
||||
And I click on "Physics 101" "link"
|
||||
And I wait until the page is ready
|
||||
|
@ -80,7 +80,7 @@ Feature: Manage data registry defaults
|
|||
Then the field "categoryid" matches value "Category 2"
|
||||
And the field "purposeid" matches value "Purpose 2"
|
||||
And I should see "5 years"
|
||||
And I click on "Courses" "link"
|
||||
And I click on "Courses" "link" in the ".data-registry" "css_element"
|
||||
And I wait until the page is ready
|
||||
# Physics 101 is also a category, so it will get the category default.
|
||||
And I click on "Physics 101" "link"
|
||||
|
@ -102,7 +102,7 @@ Feature: Manage data registry defaults
|
|||
Then the field "categoryid" matches value "Category 2"
|
||||
And the field "purposeid" matches value "Purpose 2"
|
||||
And I should see "5 years"
|
||||
And I click on "Courses" "link"
|
||||
And I click on "Courses" "link" in the ".data-registry" "css_element"
|
||||
And I wait until the page is ready
|
||||
# Physics 101 is also a category, so it will get the category default.
|
||||
And I click on "Physics 101" "link"
|
||||
|
@ -138,7 +138,7 @@ Feature: Manage data registry defaults
|
|||
Given I set the category and purpose for the course "Physics 101" to "Category 2" and "Purpose 2"
|
||||
And I navigate to "Users > Privacy and policies > Data registry" in site administration
|
||||
And I click on "Set defaults" "link"
|
||||
And I click on "Courses" "link"
|
||||
And I click on "Courses" "link" in the "#region-main" "css_element"
|
||||
And I should see "Inherit"
|
||||
And I should not see "Add a new module default"
|
||||
And I press "Edit"
|
||||
|
@ -150,7 +150,7 @@ Feature: Manage data registry defaults
|
|||
And I navigate to "Users > Privacy and policies > Data registry" in site administration
|
||||
And I click on "Science and technology" "link"
|
||||
And I wait until the page is ready
|
||||
And I click on "Courses" "link"
|
||||
And I click on "Courses" "link" in the ".data-registry" "css_element"
|
||||
And I wait until the page is ready
|
||||
And I click on "Physics 101" "link"
|
||||
And I wait until the page is ready
|
||||
|
@ -168,7 +168,7 @@ Feature: Manage data registry defaults
|
|||
Given I set the category and purpose for the course "Physics 101" to "Category 2" and "Purpose 2"
|
||||
And I navigate to "Users > Privacy and policies > Data registry" in site administration
|
||||
And I click on "Set defaults" "link"
|
||||
And I click on "Courses" "link"
|
||||
And I click on "Courses" "link" in the "#region-main" "css_element"
|
||||
And I should see "Inherit"
|
||||
And I should not see "Add a new module default"
|
||||
And I press "Edit"
|
||||
|
@ -181,7 +181,7 @@ Feature: Manage data registry defaults
|
|||
And I navigate to "Users > Privacy and policies > Data registry" in site administration
|
||||
And I click on "Science and technology" "link"
|
||||
And I wait until the page is ready
|
||||
And I click on "Courses" "link"
|
||||
And I click on "Courses" "link" in the ".data-registry" "css_element"
|
||||
And I wait until the page is ready
|
||||
And I click on "Physics 101" "link"
|
||||
And I wait until the page is ready
|
||||
|
@ -211,7 +211,7 @@ Feature: Manage data registry defaults
|
|||
And I navigate to "Users > Privacy and policies > Data registry" in site administration
|
||||
And I click on "Science and technology" "link"
|
||||
And I wait until the page is ready
|
||||
And I click on "Courses" "link"
|
||||
And I click on "Courses" "link" in the ".data-registry" "css_element"
|
||||
And I wait until the page is ready
|
||||
And I click on "Physics 101" "link"
|
||||
And I wait until the page is ready
|
||||
|
@ -240,7 +240,7 @@ Feature: Manage data registry defaults
|
|||
And I navigate to "Users > Privacy and policies > Data registry" in site administration
|
||||
And I click on "Science and technology" "link"
|
||||
And I wait until the page is ready
|
||||
And I click on "Courses" "link"
|
||||
And I click on "Courses" "link" in the ".data-registry" "css_element"
|
||||
And I wait until the page is ready
|
||||
And I click on "Physics 101" "link"
|
||||
And I wait until the page is ready
|
||||
|
@ -273,7 +273,7 @@ Feature: Manage data registry defaults
|
|||
And I navigate to "Users > Privacy and policies > Data registry" in site administration
|
||||
And I click on "Science and technology" "link"
|
||||
And I wait until the page is ready
|
||||
And I click on "Courses" "link"
|
||||
And I click on "Courses" "link" in the ".data-registry" "css_element"
|
||||
And I wait until the page is ready
|
||||
And I click on "Physics 101" "link"
|
||||
And I wait until the page is ready
|
||||
|
@ -303,7 +303,7 @@ Feature: Manage data registry defaults
|
|||
And I navigate to "Users > Privacy and policies > Data registry" in site administration
|
||||
And I click on "Science and technology" "link"
|
||||
And I wait until the page is ready
|
||||
And I click on "Courses" "link"
|
||||
And I click on "Courses" "link" in the ".data-registry" "css_element"
|
||||
And I wait until the page is ready
|
||||
And I click on "Physics 101" "link"
|
||||
And I wait until the page is ready
|
||||
|
@ -331,7 +331,7 @@ Feature: Manage data registry defaults
|
|||
And I navigate to "Users > Privacy and policies > Data registry" in site administration
|
||||
And I click on "Science and technology" "link"
|
||||
And I wait until the page is ready
|
||||
And I click on "Courses" "link"
|
||||
And I click on "Courses" "link" in the ".data-registry" "css_element"
|
||||
And I wait until the page is ready
|
||||
And I click on "Physics 101" "link"
|
||||
And I wait until the page is ready
|
||||
|
@ -360,7 +360,7 @@ Feature: Manage data registry defaults
|
|||
And I navigate to "Users > Privacy and policies > Data registry" in site administration
|
||||
And I click on "Science and technology" "link"
|
||||
And I wait until the page is ready
|
||||
And I click on "Courses" "link"
|
||||
And I click on "Courses" "link" in the ".data-registry" "css_element"
|
||||
And I wait until the page is ready
|
||||
And I click on "Physics 101" "link"
|
||||
And I wait until the page is ready
|
||||
|
|
|
@ -25,7 +25,7 @@ Feature: See the competencies for an activity on the course competencies page.
|
|||
| page | PageName1 | PageDesc1 | C1 | PAGE1 | 1 | 1 |
|
||||
| page | PageName2 | PageDesc2 | C1 | PAGE2 | 1 | 1 |
|
||||
And I am on the "Course 1" course page logged in as admin
|
||||
And I follow "Competencies"
|
||||
And I navigate to "Competencies" in current page administration
|
||||
And I press "Add competencies to course"
|
||||
And "Competency picker" "dialogue" should be visible
|
||||
And I select "Test-Comp1" of the competency tree
|
||||
|
|
|
@ -152,7 +152,7 @@ Feature: Manage plearning plan
|
|||
And I create a course with:
|
||||
| Course full name | New course fullname |
|
||||
| Course short name | New course shortname |
|
||||
And I follow "Competencies"
|
||||
And I navigate to "Competencies" in current page administration
|
||||
And I press "Add competencies to course"
|
||||
And "Competency picker" "dialogue" should be visible
|
||||
And I select "comp1" of the competency tree
|
||||
|
|
|
@ -22,7 +22,8 @@ Feature: In a course administration page, navigate through report page, test for
|
|||
And I navigate to "Reports > Event monitoring rules" in site administration
|
||||
And I click on "Enable" "link"
|
||||
And I am on "Course 1" course homepage
|
||||
When I navigate to "Reports > Event monitoring rules" in current page administration
|
||||
When I navigate to "Reports" in current page administration
|
||||
And I select "Event monitoring rules" from the "Report type" singleselect
|
||||
Then "Report" "field" should exist
|
||||
And the "Report" select box should contain "Event monitoring rules"
|
||||
And the field "Report" matches value "Event monitoring rules"
|
||||
|
|
|
@ -18,7 +18,8 @@ Feature: tool_monitor_rule
|
|||
And I navigate to "Reports > Event monitoring rules" in site administration
|
||||
And I click on "Enable" "link"
|
||||
And I am on "Course 1" course homepage
|
||||
And I navigate to "Reports > Event monitoring rules" in current page administration
|
||||
And I navigate to "Reports" in current page administration
|
||||
And I select "Event monitoring rules" from the "Report type" singleselect
|
||||
And I press "Add a new rule"
|
||||
And I set the following fields to these values:
|
||||
| name | New rule course level |
|
||||
|
@ -45,7 +46,8 @@ Feature: tool_monitor_rule
|
|||
Scenario: Add a rule on course level
|
||||
Given I log in as "teacher1"
|
||||
And I am on "Course 1" course homepage
|
||||
And I navigate to "Reports > Event monitoring rules" in current page administration
|
||||
And I navigate to "Reports" in current page administration
|
||||
And I select "Event monitoring rules" from the "Report type" singleselect
|
||||
When I press "Add a new rule"
|
||||
And I set the following fields to these values:
|
||||
| name | New rule |
|
||||
|
@ -65,7 +67,8 @@ Feature: tool_monitor_rule
|
|||
Scenario: Delete a rule on course level
|
||||
Given I log in as "teacher1"
|
||||
And I am on "Course 1" course homepage
|
||||
And I navigate to "Reports > Event monitoring rules" in current page administration
|
||||
And I navigate to "Reports" in current page administration
|
||||
And I select "Event monitoring rules" from the "Report type" singleselect
|
||||
When I click on "Delete rule" "link"
|
||||
Then I should see "Are you sure you want to delete the rule \"New rule course level\"?"
|
||||
And I press "Continue"
|
||||
|
@ -75,7 +78,8 @@ Feature: tool_monitor_rule
|
|||
Scenario: Edit a rule on course level
|
||||
Given I log in as "teacher1"
|
||||
And I am on "Course 1" course homepage
|
||||
And I navigate to "Reports > Event monitoring rules" in current page administration
|
||||
And I navigate to "Reports" in current page administration
|
||||
And I select "Event monitoring rules" from the "Report type" singleselect
|
||||
When I click on "Edit rule" "link"
|
||||
And I set the following fields to these values:
|
||||
| name | New rule quiz |
|
||||
|
@ -94,7 +98,8 @@ Feature: tool_monitor_rule
|
|||
Scenario: Duplicate a rule on course level
|
||||
Given I log in as "teacher1"
|
||||
And I am on "Course 1" course homepage
|
||||
And I navigate to "Reports > Event monitoring rules" in current page administration
|
||||
And I navigate to "Reports" in current page administration
|
||||
And I select "Event monitoring rules" from the "Report type" singleselect
|
||||
When I click on "Duplicate rule" "link" in the "New rule course level" "table_row"
|
||||
Then I should see "Rule successfully duplicated"
|
||||
And "#toolmonitorrules_r1" "css_element" should appear before "#toolmonitorrules_r2" "css_element"
|
||||
|
@ -153,7 +158,8 @@ Feature: tool_monitor_rule
|
|||
Scenario: Duplicate a rule on site level
|
||||
Given I log in as "teacher1"
|
||||
And I am on "Course 1" course homepage
|
||||
And I navigate to "Reports > Event monitoring rules" in current page administration
|
||||
And I navigate to "Reports" in current page administration
|
||||
And I select "Event monitoring rules" from the "Report type" singleselect
|
||||
When I click on "Duplicate rule" "link" in the "New rule site level" "table_row"
|
||||
Then I should see "Rule successfully duplicated"
|
||||
And "#toolmonitorrules_r2" "css_element" should appear after "#toolmonitorrules_r1" "css_element"
|
||||
|
|
|
@ -23,7 +23,8 @@ Feature: tool_monitor_subscriptions
|
|||
And I navigate to "Reports > Event monitoring rules" in site administration
|
||||
And I click on "Enable" "link"
|
||||
And I am on "Course 1" course homepage
|
||||
And I navigate to "Reports > Event monitoring rules" in current page administration
|
||||
And I navigate to "Reports" in current page administration
|
||||
And I select "Event monitoring rules" from the "Report type" singleselect
|
||||
And I press "Add a new rule"
|
||||
And I set the following fields to these values:
|
||||
| name | New rule course level |
|
||||
|
|
|
@ -465,7 +465,7 @@ Feature: User must accept policy managed by this plugin when logging in and sign
|
|||
When I press "Log in as a guest"
|
||||
Then I should see "If you continue browsing this website, you agree to our policies"
|
||||
# Confirm when navigating, the pop-up policies are displayed.
|
||||
When I follow "Home"
|
||||
When I am on the "My courses" page
|
||||
Then I should see "If you continue browsing this website, you agree to our policies"
|
||||
And I should see "This site policy"
|
||||
And I should see "This guests policy"
|
||||
|
|
|
@ -124,8 +124,7 @@ Feature: Basic recycle bin functionality
|
|||
Scenario: Show recycle bin on category action menu
|
||||
Given I log in as "admin"
|
||||
And I navigate to "Courses > Manage courses and categories" in site administration
|
||||
And I click on "Actions menu" "link"
|
||||
And I click on "Recycle bin" "link"
|
||||
And I navigate to "Recycle bin" in current page administration
|
||||
Then I should see "There are no items in the recycle bin."
|
||||
|
||||
@javascript
|
||||
|
|
|
@ -129,16 +129,14 @@ Feature: Upload users
|
|||
And I press "Upload users"
|
||||
And I should see "Users created: 4"
|
||||
And I press "Continue"
|
||||
And I log out
|
||||
# Boost check.
|
||||
And I log in as "jonest"
|
||||
And I am on "Maths" course homepage
|
||||
And "Calendar" "link" should be visible
|
||||
And I log out
|
||||
And I navigate to "Users > Accounts > Browse list of users" in site administration
|
||||
And I click on ".icon[title=Edit]" "css_element" in the "jonest@example.com" "table_row"
|
||||
And I should see "Boost"
|
||||
# Classic check.
|
||||
And I log in as "reznor"
|
||||
And I am on "Maths" course homepage
|
||||
And "Calendar" "link" should not be visible
|
||||
And I navigate to "Users > Accounts > Browse list of users" in site administration
|
||||
And I click on ".icon[title=Edit]" "css_element" in the "reznor@example.com" "table_row"
|
||||
And I should see "Classic"
|
||||
|
||||
@javascript
|
||||
Scenario: Upload users setting their user theme when allowuserthemes is false
|
||||
|
|
|
@ -42,6 +42,7 @@ Feature: Confirm that availability_completion works with previous activity setti
|
|||
|
||||
# Remove Page 2 and check Page3 depends now on Page1.
|
||||
When I turn editing mode on
|
||||
And I change window size to "large"
|
||||
And I delete "Page2" activity
|
||||
And I turn editing mode off
|
||||
Then I should see "Not available unless: The activity Page1 is marked complete" in the "region-main" "region"
|
||||
|
@ -92,6 +93,7 @@ Feature: Confirm that availability_completion works with previous activity setti
|
|||
|
||||
# Test if I disable completion tracking on Page2 section 5 depends on Page2.
|
||||
When I turn editing mode on
|
||||
And I change window size to "large"
|
||||
When I open "Page2" actions menu
|
||||
And I click on "Edit settings" "link" in the "Page2" activity
|
||||
And I set the following fields to these values:
|
||||
|
@ -120,6 +122,7 @@ Feature: Confirm that availability_completion works with previous activity setti
|
|||
|
||||
# Remove Page 2 and check Section 4 depends now on Page1.
|
||||
When I turn editing mode on
|
||||
And I change window size to "large"
|
||||
And I delete "Page2" activity
|
||||
And I turn editing mode off
|
||||
Then I should see "Not available unless: The activity Page1 is marked complete" in the "region-main" "region"
|
||||
|
@ -160,6 +163,7 @@ Feature: Confirm that availability_completion works with previous activity setti
|
|||
Scenario: Test previous activities on empty sections
|
||||
Given I log in as "teacher1"
|
||||
And I am on "Course 1" course homepage with editing mode on
|
||||
And I change window size to "large"
|
||||
|
||||
# Set section 2 restriction to Previous Activity with completion.
|
||||
When I edit the section "2"
|
||||
|
|
|
@ -88,7 +88,7 @@ Feature: Award badges
|
|||
# Teacher 1 should have access to manage/create badges in the Badges navigation section.
|
||||
When I log in as "teacher1"
|
||||
And I am on "Course 1" course homepage
|
||||
And I follow "Badges"
|
||||
And I navigate to "Badges > Manage badges" in current page administration
|
||||
Then I should see "Course Badge 1"
|
||||
And I should see "Course Badge 2"
|
||||
And I should see "Manage badges"
|
||||
|
|
|
@ -27,8 +27,7 @@ Feature: Award badges based on competency completion
|
|||
Scenario: Award badge for completing a competency in a course
|
||||
# Add a competency to the course
|
||||
When I am on "Course 1" course homepage
|
||||
And I follow "Competencies"
|
||||
And I press "Add competencies to course"
|
||||
And I navigate to "Competencies > Add competencies to course" in current page administration
|
||||
And "Competency picker" "dialogue" should be visible
|
||||
And I select "comp1" of the competency tree
|
||||
And I click on "Add" "button" in the "Competency picker" "dialogue"
|
||||
|
@ -58,7 +57,7 @@ Feature: Award badges based on competency completion
|
|||
And I press "Continue"
|
||||
# Rate the competency in the course
|
||||
And I am on "Course 1" course homepage
|
||||
And I follow "Competencies"
|
||||
And I navigate to "Competencies" in current page administration
|
||||
And I click on "comp1" "link" in the "[data-region='coursecompetencies']" "css_element"
|
||||
And I press "Rate"
|
||||
And I set the following fields to these values:
|
||||
|
@ -75,8 +74,7 @@ Feature: Award badges based on competency completion
|
|||
Scenario: Award badge for completing a competency in the site
|
||||
# Add a competency to the course
|
||||
When I am on "Course 1" course homepage
|
||||
And I follow "Competencies"
|
||||
And I press "Add competencies to course"
|
||||
And I navigate to "Competencies > Add competencies to course" in current page administration
|
||||
And "Competency picker" "dialogue" should be visible
|
||||
And I select "comp1" of the competency tree
|
||||
And I click on "Add" "button" in the "Competency picker" "dialogue"
|
||||
|
@ -110,7 +108,7 @@ Feature: Award badges based on competency completion
|
|||
And I press "Continue"
|
||||
# Rate the competency in the course
|
||||
And I am on "Course 1" course homepage
|
||||
And I follow "Competencies"
|
||||
And I navigate to "Competencies" in current page administration
|
||||
And I click on "comp1" "link" in the "[data-region='coursecompetencies']" "css_element"
|
||||
And I press "Rate"
|
||||
And I set the following fields to these values:
|
||||
|
@ -127,8 +125,7 @@ Feature: Award badges based on competency completion
|
|||
Scenario: Award badge for completing all competencies in the site
|
||||
# Add a competency to the course
|
||||
When I am on "Course 1" course homepage
|
||||
And I follow "Competencies"
|
||||
And I press "Add competencies to course"
|
||||
And I navigate to "Competencies > Add competencies to course" in current page administration
|
||||
And "Competency picker" "dialogue" should be visible
|
||||
And I select "comp1" of the competency tree
|
||||
And I click on "Add" "button" in the "Competency picker" "dialogue"
|
||||
|
@ -164,7 +161,7 @@ Feature: Award badges based on competency completion
|
|||
And I press "Continue"
|
||||
# Rate the competency in the course
|
||||
And I am on "Course 1" course homepage
|
||||
And I follow "Competencies"
|
||||
And I navigate to "Competencies" in current page administration
|
||||
And I click on "comp1" "link" in the "[data-region='coursecompetencies']" "css_element"
|
||||
And I press "Rate"
|
||||
And I set the following fields to these values:
|
||||
|
@ -180,7 +177,7 @@ Feature: Award badges based on competency completion
|
|||
# Rate the other competency.
|
||||
And I log in as "admin"
|
||||
And I am on "Course 1" course homepage
|
||||
And I follow "Competencies"
|
||||
And I navigate to "Competencies" in current page administration
|
||||
And I click on "comp2" "link" in the "[data-region='coursecompetencies']" "css_element"
|
||||
And I press "Rate"
|
||||
And I set the following fields to these values:
|
||||
|
|
|
@ -36,7 +36,8 @@ Feature: Enable Block Completion in a course using manual completion by others
|
|||
And I log out
|
||||
And I log in as "teacher1"
|
||||
And I am on "Course 1" course homepage
|
||||
And I navigate to "Reports > Course completion" in current page administration
|
||||
And I navigate to "Reports" in current page administration
|
||||
And I select "Course completion" from the "Report type" singleselect
|
||||
And I follow "Click to mark user complete"
|
||||
# Running completion task just after clicking sometimes fail, as record
|
||||
# should be created before the task runs.
|
||||
|
@ -71,7 +72,8 @@ Feature: Enable Block Completion in a course using manual completion by others
|
|||
And I log out
|
||||
And I log in as "teacher1"
|
||||
And I am on "Course 1" course homepage
|
||||
And I navigate to "Reports > Course completion" in current page administration
|
||||
And I navigate to "Reports" in current page administration
|
||||
And I select "Course completion" from the "Report type" singleselect
|
||||
And I follow "Click to mark user complete"
|
||||
And I log out
|
||||
And I log in as "student1"
|
||||
|
@ -85,7 +87,8 @@ Feature: Enable Block Completion in a course using manual completion by others
|
|||
And I log out
|
||||
And I log in as "teacher2"
|
||||
And I am on "Course 1" course homepage
|
||||
And I navigate to "Reports > Course completion" in current page administration
|
||||
And I navigate to "Reports" in current page administration
|
||||
And I select "Course completion" from the "Report type" singleselect
|
||||
And I follow "Click to mark user complete"
|
||||
# Running completion task just after clicking sometimes fail, as record
|
||||
# should be created before the task runs.
|
||||
|
|
|
@ -9,7 +9,7 @@ Feature: Course summary block used on the frontpage
|
|||
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" in current page administration
|
||||
And I navigate to "Front page settings" in site administration
|
||||
And I set the following fields to these values:
|
||||
| summary | Proved the summary block works! |
|
||||
And I press "Save changes"
|
||||
|
|
|
@ -47,7 +47,7 @@ class behat_blocks extends behat_base {
|
|||
*/
|
||||
public function i_add_the_block($blockname) {
|
||||
$addblock = get_string('addblock');
|
||||
$this->execute('behat_navigation::i_select_from_flat_navigation_drawer', $addblock);
|
||||
$this->execute('behat_general::i_click_on_in_the', [$addblock, 'link_exact', '.block_fake', 'css_element']);
|
||||
|
||||
if (!$this->running_javascript()) {
|
||||
$this->execute('behat_general::i_click_on_in_the', [$blockname, 'link_exact', '#region-main', 'css_element']);
|
||||
|
@ -121,7 +121,8 @@ class behat_blocks extends behat_base {
|
|||
*/
|
||||
public function the_add_block_selector_should_contain_block($blockname) {
|
||||
$addblock = get_string('addblock');
|
||||
$this->execute('behat_navigation::i_select_from_flat_navigation_drawer', $addblock);
|
||||
$this->execute('behat_general::i_click_on', [$addblock, 'link_exact']);
|
||||
|
||||
|
||||
$cancelstr = get_string('cancel');
|
||||
if (!$this->running_javascript()) {
|
||||
|
@ -141,7 +142,8 @@ class behat_blocks extends behat_base {
|
|||
*/
|
||||
public function the_add_block_selector_should_not_contain_block($blockname) {
|
||||
$addblock = get_string('addblock');
|
||||
$this->execute('behat_navigation::i_select_from_flat_navigation_drawer', $addblock);
|
||||
$this->execute('behat_general::i_click_on', [$addblock, 'link_exact']);
|
||||
|
||||
|
||||
$cancelstr = get_string('cancel');
|
||||
if (!$this->running_javascript()) {
|
||||
|
|
|
@ -46,7 +46,7 @@ Feature: Add and configure blocks throughout the site
|
|||
And I press "Save changes"
|
||||
And I am on "Course 1" course homepage
|
||||
# The first block matching the pattern should be top-left block
|
||||
And I should see "Comments" in the "//*[@id='region-pre' or @id='block-region-side-pre']/descendant::*[contains(concat(' ', normalize-space(@class), ' '), ' block ')]" "xpath_element"
|
||||
And I should see "Comments" in the "//*[@id='region-pre' or @id='block-region-side-pre']/descendant::*[contains(concat(' ', normalize-space(@class), ' '), ' block_comments ')]" "xpath_element"
|
||||
|
||||
Scenario: Blocks on the dashboard page can have roles assigned to them
|
||||
Given I log in as "manager1"
|
||||
|
|
|
@ -58,7 +58,6 @@ Feature: Block appearances
|
|||
And I set the following fields to these values:
|
||||
| Visible | No |
|
||||
And I press "Save changes"
|
||||
And I click on "Topic 1" "link"
|
||||
And I turn editing mode off
|
||||
And I am on "Course 1" course homepage with editing mode off
|
||||
And I click on "Test book name" "link" in the "region-main" "region"
|
||||
Then I should not see "Comments"
|
||||
|
|
|
@ -87,7 +87,8 @@ class behat_completion extends behat_base {
|
|||
$reportsnode = get_string('reports');
|
||||
|
||||
$this->execute("behat_navigation::i_navigate_to_in_current_page_administration",
|
||||
$reportsnode . ' > ' . $completionnode);
|
||||
$reportsnode);
|
||||
$this->execute("behat_forms::i_select_from_the_singleselect", [$completionnode, "Report type"]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -50,7 +50,7 @@ Feature: H5P file upload to content bank for admins
|
|||
And I navigate to "Plugins > Content bank > Manage content types" in site administration
|
||||
And I click on "Disable" "icon" in the "H5P" "table_row"
|
||||
And I wait until the page is ready
|
||||
When I click on "Content bank" "link"
|
||||
When I navigate to "Plugins > Content bank" in site administration
|
||||
Then I should not see "filltheblanks.h5p"
|
||||
|
||||
Scenario: Contents in a context are not available from other contexts
|
||||
|
|
|
@ -35,6 +35,8 @@ Feature: Replace H5P file from an existing content requires special capabilities
|
|||
And I click on "Content bank" "link"
|
||||
# Force the content deploy
|
||||
And I click on "admincontent" "link"
|
||||
And I am on "Course 1" course homepage
|
||||
And I expand "Site pages" node
|
||||
And I click on "Content bank" "link"
|
||||
|
||||
Scenario: Teacher can replace its own H5P files
|
||||
|
|
|
@ -17,7 +17,8 @@ Feature: Access permission to content Bank
|
|||
|
||||
Scenario: Admins access content bank
|
||||
Given I log in as "admin"
|
||||
Then "Content bank" "link" should exist
|
||||
And I am on "Course 1" course homepage
|
||||
Then "Content bank" "link" should exist in current page administration
|
||||
|
||||
Scenario: Editing teachers can access content bank at course level
|
||||
Given I log in as "teacher1"
|
||||
|
|
|
@ -195,6 +195,6 @@ Feature: Content bank use editor feature
|
|||
And I click on "Content bank" "link"
|
||||
And I follow "ipsums.h5p"
|
||||
Then "Edit" "link" should exist in the "region-main" "region"
|
||||
And I click on "Content bank" "link"
|
||||
And I navigate to "Content bank" in current page administration
|
||||
And I follow "filltheblanks.h5p"
|
||||
Then "Edit" "link" should not exist in the "region-main" "region"
|
||||
|
|
|
@ -30,8 +30,7 @@ Feature: Course index depending on role
|
|||
Given I am on the "C1" "Course" page logged in as "teacher1"
|
||||
Given the "multilang" filter is "on"
|
||||
And the "multilang" filter applies to "content and headings"
|
||||
And I am on the "C1" "Course" page logged in as "teacher1"
|
||||
When I click on "Side panel" "button"
|
||||
When I am on the "C1" "Course" page logged in as "teacher1"
|
||||
Then I should see "Open course index drawer"
|
||||
And I am on the "Activity sample 1" "assign activity editing" page
|
||||
And I set the field "Assignment name" in the "General" "fieldset" to "<span lang=\"en\" class=\"multilang\">Activity</span><span lang=\"de\" class=\"multilang\">Aktivität</span> sample 1"
|
||||
|
@ -44,7 +43,6 @@ Feature: Course index depending on role
|
|||
Scenario: Course index as a teacher
|
||||
Given I log in as "teacher1"
|
||||
And I am on "Course 1" course homepage
|
||||
And I click on "Side panel" "button"
|
||||
When I click on "Open course index drawer" "button"
|
||||
Then I should see "Topic 1" in the "courseindex-content" "region"
|
||||
And I should see "Topic 2" in the "courseindex-content" "region"
|
||||
|
@ -63,7 +61,6 @@ Feature: Course index depending on role
|
|||
And I log out
|
||||
And I log in as "teacher1"
|
||||
And I am on "Course 1" course homepage
|
||||
And I click on "Side panel" "button"
|
||||
When I click on "Open course index drawer" "button"
|
||||
Then I should see "Topic 1" in the "courseindex-content" "region"
|
||||
And I should see "Topic 2" in the "courseindex-content" "region"
|
||||
|
@ -82,7 +79,6 @@ Feature: Course index depending on role
|
|||
And I log out
|
||||
And I log in as "student1"
|
||||
And I am on "Course 1" course homepage
|
||||
And I click on "Side panel" "button"
|
||||
When I click on "Open course index drawer" "button"
|
||||
Then I should see "Topic 1" in the "courseindex-content" "region"
|
||||
And I should not see "Topic 2" in the "courseindex-content" "region"
|
||||
|
@ -95,7 +91,6 @@ Feature: Course index depending on role
|
|||
Scenario: Delete an activity as a teacher
|
||||
Given I log in as "teacher1"
|
||||
And I am on "Course 1" course homepage with editing mode on
|
||||
And I click on "Side panel" "button"
|
||||
When I delete "Activity sample 2" activity
|
||||
And I click on "Open course index drawer" "button"
|
||||
Then I should not see "Activity sample 2" in the "courseindex-content" "region"
|
||||
|
@ -104,7 +99,6 @@ Feature: Course index depending on role
|
|||
Scenario: Highlight sections are represented in the course index.
|
||||
Given I log in as "teacher1"
|
||||
And I am on "Course 1" course homepage with editing mode on
|
||||
And I click on "Side panel" "button"
|
||||
And I turn section "2" highlighting on
|
||||
And I click on "Open course index drawer" "button"
|
||||
# Current section is only marked visually in the course index.
|
||||
|
@ -124,7 +118,6 @@ Feature: Course index depending on role
|
|||
| book | Second activity in section 1 | Test book description | C1 | sample4 | 1 |
|
||||
And I log in as "teacher1"
|
||||
And I am on "Course 1" course homepage
|
||||
And I click on "Side panel" "button"
|
||||
When I click on "Open course index drawer" "button"
|
||||
# Sections should be opened by default.
|
||||
Then I should see "Topic 1" in the "courseindex-content" "region"
|
||||
|
@ -174,7 +167,6 @@ Feature: Course index depending on role
|
|||
@javascript
|
||||
Scenario: Course index section preferences
|
||||
Given I am on the "C1" "Course" page logged in as "teacher1"
|
||||
And I click on "Side panel" "button"
|
||||
When I click on "Open course index drawer" "button"
|
||||
Then I should see "Topic 1" in the "courseindex-content" "region"
|
||||
And I should see "Activity sample 1" in the "courseindex-content" "region"
|
||||
|
@ -205,6 +197,7 @@ Feature: Course index depending on role
|
|||
And I delete section "1"
|
||||
And I click on "Delete" "button" in the ".modal" "css_element"
|
||||
And I reload the page
|
||||
And I click on "Open course index drawer" "button"
|
||||
And I should not see "Activity sample 1" in the "courseindex-content" "region"
|
||||
And I should see "Topic 1" in the "courseindex-content" "region"
|
||||
And I should see "Activity sample 2" in the "courseindex-content" "region"
|
||||
|
@ -215,7 +208,6 @@ Feature: Course index depending on role
|
|||
Scenario: Adding section should alter the course index
|
||||
Given I log in as "teacher1"
|
||||
And I am on "Course 1" course homepage with editing mode on
|
||||
And I click on "Side panel" "button"
|
||||
And I click on "Open course index drawer" "button"
|
||||
When I click on "Add topic after" "link" in the "Topic 4" "section"
|
||||
Then I should see "Topic 5" in the "courseindex-content" "region"
|
||||
|
@ -224,7 +216,6 @@ Feature: Course index depending on role
|
|||
Scenario: Remove a section should alter the course index
|
||||
Given I log in as "teacher1"
|
||||
And I am on "Course 1" course homepage with editing mode on
|
||||
And I click on "Side panel" "button"
|
||||
And I click on "Open course index drawer" "button"
|
||||
When I delete section "4"
|
||||
Then I should not see "Topic 4" in the "courseindex-content" "region"
|
||||
|
@ -233,7 +224,6 @@ Feature: Course index depending on role
|
|||
Scenario: Delete a previous section should alter the course index unnamed sections
|
||||
Given I log in as "teacher1"
|
||||
And I am on "Course 1" course homepage with editing mode on
|
||||
And I click on "Side panel" "button"
|
||||
And I click on "Open course index drawer" "button"
|
||||
When I delete section "1"
|
||||
And I click on "Delete" "button" in the ".modal" "css_element"
|
||||
|
|
|
@ -26,7 +26,6 @@ Feature: Course index completion icons
|
|||
@javascript
|
||||
Scenario: Teacher does not see completion icons.
|
||||
Given I am on the "C1" "Course" page logged in as "teacher1"
|
||||
And I click on "Side panel" "button"
|
||||
When I click on "Open course index drawer" "button"
|
||||
Then I should see "Topic 1" in the "courseindex-content" "region"
|
||||
And I should see "Activity sample 1" in the "courseindex-content" "region"
|
||||
|
@ -35,7 +34,6 @@ Feature: Course index completion icons
|
|||
@javascript
|
||||
Scenario: User should see the completion icons
|
||||
Given I am on the "C1" "Course" page logged in as "student1"
|
||||
And I click on "Side panel" "button"
|
||||
When I click on "Open course index drawer" "button"
|
||||
Then I should see "Topic 1" in the "courseindex-content" "region"
|
||||
And I should see "Activity sample 1" in the "courseindex-content" "region"
|
||||
|
@ -44,7 +42,6 @@ Feature: Course index completion icons
|
|||
@javascript
|
||||
Scenario: Manual completion shoudl update the course index completion
|
||||
Given I am on the "C1" "Course" page logged in as "student1"
|
||||
And I click on "Side panel" "button"
|
||||
And I click on "Open course index drawer" "button"
|
||||
And "To do" "icon" should exist in the "courseindex-content" "region"
|
||||
When I press "Mark as done"
|
||||
|
@ -57,7 +54,6 @@ Feature: Course index completion icons
|
|||
@javascript
|
||||
Scenario: Refresh the page should keep the completion consistent
|
||||
Given I am on the "C1" "Course" page logged in as "student1"
|
||||
And I click on "Side panel" "button"
|
||||
And I click on "Open course index drawer" "button"
|
||||
And "To do" "icon" should exist in the "courseindex-content" "region"
|
||||
When I press "Mark as done"
|
||||
|
@ -72,7 +68,6 @@ Feature: Course index completion icons
|
|||
| assign | Activity sample 2 | Test assignment description | C1 | sample2 | 1 | 1 | 1 |
|
||||
When I am on the "sample2" "Activity" page logged in as "student1"
|
||||
And I am on the "C1" "Course" page
|
||||
And I click on "Side panel" "button"
|
||||
And I click on "Open course index drawer" "button"
|
||||
Then "Done" "icon" should exist in the "courseindex-content" "region"
|
||||
|
||||
|
@ -94,7 +89,6 @@ Feature: Course index completion icons
|
|||
| slot | response |
|
||||
| 1 | False |
|
||||
When I am on the "C1" "Course" page logged in as "student1"
|
||||
And I click on "Side panel" "button"
|
||||
And I click on "Open course index drawer" "button"
|
||||
And "Failed" "icon" should exist in the "courseindex-content" "region"
|
||||
|
||||
|
@ -116,6 +110,5 @@ Feature: Course index completion icons
|
|||
| slot | response |
|
||||
| 1 | True |
|
||||
When I am on the "C1" "Course" page logged in as "student1"
|
||||
And I click on "Side panel" "button"
|
||||
And I click on "Open course index drawer" "button"
|
||||
And "Done" "icon" should exist in the "courseindex-content" "region"
|
||||
|
|
|
@ -17,7 +17,6 @@ Feature: Verify that courseindex is usable with the keyboard
|
|||
| book | Activity sample 2 | Test book description | C1 | sample2 | 2 |
|
||||
| choice | Activity sample 3 | Test choice description | C1 | sample3 | 3 |
|
||||
Given I am on the "C1" "Course" page logged in as "admin"
|
||||
And I click on "Side panel" "button"
|
||||
And I click on "Open course index drawer" "button"
|
||||
And I should see "Topic 1" in the "courseindex-content" "region"
|
||||
And the focused element is "[data-preference='drawer-open-index'] .drawertoggle" "css_element"
|
||||
|
|
|
@ -1938,7 +1938,7 @@ class behat_course extends behat_base {
|
|||
* @Given /^I navigate to course participants$/
|
||||
*/
|
||||
public function i_navigate_to_course_participants() {
|
||||
$this->execute('behat_navigation::i_select_from_flat_navigation_drawer', get_string('participants'));
|
||||
$this->execute('behat_navigation::i_select_from_secondary_navigation', get_string('participants'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -155,7 +155,7 @@ Feature: Collapse course sections
|
|||
| Course layout | Show one section per page |
|
||||
And I press "Save and display"
|
||||
And "[data-toggle=collapse]" "css_element" should not exist in the "region-main" "region"
|
||||
And I follow "Topic 2"
|
||||
And I click on "Topic 2" "link" in the "region-main" "region"
|
||||
And I should see "Assignment 2" in the "region-main" "region"
|
||||
And "[data-toggle=collapse]" "css_element" should not exist in the "region-main" "region"
|
||||
Then "Topic 1" "section" should not exist
|
||||
|
@ -178,7 +178,7 @@ Feature: Collapse course sections
|
|||
| Course layout | Show one section per page |
|
||||
And I press "Save and display"
|
||||
And "[data-toggle=collapse]" "css_element" should not exist in the "region-main" "region"
|
||||
And I follow "8 May - 14 May"
|
||||
And I click on "8 May - 14 May" "link" in the "region-main" "region"
|
||||
And I should see "Assignment 2" in the "region-main" "region"
|
||||
And "[data-toggle=collapse]" "css_element" should not exist in the "region-main" "region"
|
||||
Then "1 May - 7 May" "section" should not exist
|
||||
|
|
|
@ -27,9 +27,8 @@ Feature: Course activity controls works as expected
|
|||
| user | course | role |
|
||||
| teacher1 | C1 | editingteacher |
|
||||
And I log in as "teacher1"
|
||||
And I am on "Course 1" course homepage
|
||||
When I follow <targetpage>
|
||||
And I turn editing mode on
|
||||
And I am on "Course 1" course homepage with editing mode on
|
||||
When I follow the breadcrumb <targetpage>
|
||||
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"
|
||||
|
@ -99,9 +98,8 @@ Feature: Course activity controls works as expected
|
|||
| forum | Test forum name 1 | Test forum description 1 | C1 | 0001 | 1 |
|
||||
| forum | Test forum name 2 | Test forum description 2 | C1 | 0002 | 1 |
|
||||
And I log in as "teacher1"
|
||||
And I am on "Course 1" course homepage
|
||||
When I follow <targetpage>
|
||||
And I turn editing mode on
|
||||
And I am on "Course 1" course homepage with editing mode on
|
||||
When I follow the breadcrumb <targetpage>
|
||||
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"
|
||||
|
|
|
@ -27,7 +27,7 @@ Feature: Managers can create courses
|
|||
And I log out
|
||||
And I am on the Announcements "forum activity" page logged in as student1
|
||||
And "Add a new topic" "link" should not exist
|
||||
And "Forced subscription" "text" should exist in current page administration
|
||||
And "Forced subscription" "text" should exist
|
||||
|
||||
Scenario: Create a course from the management interface and return to it
|
||||
Given the following "courses" exist:
|
||||
|
|
|
@ -27,11 +27,13 @@ Feature: Access to downloading course content can be controlled
|
|||
And I navigate to "Settings" in current page administration
|
||||
And I set the field "Enable download course content" to "Yes"
|
||||
And I press "Save and display"
|
||||
And "Download course content" "link" should exist in current page administration
|
||||
And I navigate to "Course administration" in current page administration
|
||||
And "Download course content" "link" should exist
|
||||
When the following config values are set as admin:
|
||||
| downloadcoursecontentallowed | 0 |
|
||||
And I am on "Hockey 101" course homepage
|
||||
Then "Download course content" "link" should not exist in current page administration
|
||||
And I navigate to "Course administration" in current page administration
|
||||
And "Download course content" "link" should not exist
|
||||
And I navigate to "Settings" in current page administration
|
||||
And I should not see "Enable download course content"
|
||||
|
||||
|
@ -43,7 +45,8 @@ Feature: Access to downloading course content can be controlled
|
|||
And I set the field "Enable download course content" to "Yes"
|
||||
And I press "Save changes"
|
||||
And I am on "Hockey 101" course homepage
|
||||
Then "Download course content" "link" should exist in current page administration
|
||||
And I navigate to "Course administration" in current page administration
|
||||
Then "Download course content" "link" should exist
|
||||
|
||||
Scenario: A teacher can enable and disable the download course content feature when it is available
|
||||
Given I log in as "teacher1"
|
||||
|
@ -53,11 +56,13 @@ Feature: Access to downloading course content can be controlled
|
|||
And I should see "Enable download course content"
|
||||
And I set the field "Enable download course content" to "Yes"
|
||||
And I press "Save and display"
|
||||
Then "Download course content" "link" should exist in current page administration
|
||||
And I navigate to "Course administration" in current page administration
|
||||
Then "Download course content" "link" should exist
|
||||
And I navigate to "Settings" in current page administration
|
||||
And I set the field "Enable download course content" to "No"
|
||||
And I press "Save and display"
|
||||
And "Download course content" "link" should not exist in current page administration
|
||||
And I navigate to "Course administration" in current page administration
|
||||
And "Download course content" "link" should not exist
|
||||
|
||||
Scenario: Teachers require a capability to access the download course content feature or modify its availability in a course
|
||||
Given I log in as "admin"
|
||||
|
@ -68,7 +73,8 @@ Feature: Access to downloading course content can be controlled
|
|||
# Check teacher can see download option and enable dropdown.
|
||||
And I log in as "teacher1"
|
||||
And I am on "Hockey 101" course homepage
|
||||
And "Download course content" "link" should exist in current page administration
|
||||
And I navigate to "Course administration" in current page administration
|
||||
And "Download course content" "link" should exist
|
||||
And I navigate to "Settings" in current page administration
|
||||
And "Enable download course content" "select" should exist
|
||||
And I log out
|
||||
|
@ -82,7 +88,8 @@ Feature: Access to downloading course content can be controlled
|
|||
# Check teacher can no longer see download option, and that enable value is visible, but dropdown no longer available.
|
||||
When I log in as "teacher1"
|
||||
And I am on "Hockey 101" course homepage
|
||||
Then "Download course content" "link" should not exist in current page administration
|
||||
And I navigate to "Course administration" in current page administration
|
||||
Then "Download course content" "link" should not exist
|
||||
And I navigate to "Settings" in current page administration
|
||||
And I should see "Enable download course content"
|
||||
And I should see "Site default (Yes)"
|
||||
|
|
|
@ -14,8 +14,7 @@ Feature: Course files
|
|||
| legacyfilesaddallowed | 1 |
|
||||
When I log in as "admin"
|
||||
And I am on "Course 1" course homepage
|
||||
Then "Legacy course files" "link" should exist in current page administration
|
||||
And I navigate to "Legacy course files" in current page administration
|
||||
Then I navigate to "Legacy course files" in current page administration
|
||||
And I press "Edit legacy course files"
|
||||
And "Add..." "link" should be visible
|
||||
And "Create folder" "link" should be visible
|
||||
|
@ -30,8 +29,7 @@ Feature: Course files
|
|||
| legacyfilesaddallowed | 0 |
|
||||
When I log in as "admin"
|
||||
And I am on "Course 1" course homepage
|
||||
Then "Legacy course files" "link" should exist in current page administration
|
||||
And I navigate to "Legacy course files" in current page administration
|
||||
Then I navigate to "Legacy course files" in current page administration
|
||||
And I press "Edit legacy course files"
|
||||
And "Add..." "link" should not be visible
|
||||
And "Create folder" "link" should not be visible
|
||||
|
|
|
@ -36,6 +36,7 @@ Feature: Marking guides can be created and edited
|
|||
And I press "Save and return to course"
|
||||
# Defining a marking guide
|
||||
When I go to "Test assignment 1 name" advanced grading definition page
|
||||
And I change window size to "large"
|
||||
And I set the following fields to these values:
|
||||
| Name | Assignment 1 marking guide |
|
||||
| Description | Marking guide test description |
|
||||
|
@ -85,7 +86,8 @@ Feature: Marking guides can be created and edited
|
|||
@javascript
|
||||
Scenario: Grading and viewing graded marking guide
|
||||
# Grading a student.
|
||||
When I go to "Student 1" "Test assignment 1 name" activity advanced grading page
|
||||
When I navigate to "Assignment" in current page administration
|
||||
And I go to "Student 1" "Test assignment 1 name" activity advanced grading page
|
||||
And I grade by filling the marking guide with:
|
||||
| Guide criterion A | 25 | Very good |
|
||||
| Guide criterion B | 20 | |
|
||||
|
@ -97,8 +99,7 @@ Feature: Marking guides can be created and edited
|
|||
And I wait "1" seconds
|
||||
Then the field "Guide criterion B criterion remark" matches value "Comment \"4\""
|
||||
When I press "Save changes"
|
||||
And I follow "Edit settings"
|
||||
And I follow "Test assignment 1 name"
|
||||
And I follow "Assignment: Test assignment 1 name"
|
||||
And I follow "View all submissions"
|
||||
# Checking that the user grade is correct.
|
||||
Then I should see "80" in the "Student 1" "table_row"
|
||||
|
|
|
@ -49,6 +49,7 @@ Feature: Rubrics can be created and edited
|
|||
And I press "Save rubric and make it ready"
|
||||
Then I should see "Ready for use"
|
||||
# Grading two students.
|
||||
And I navigate to "Assignment" in current page administration
|
||||
And I go to "Student 1" "Test assignment 1 name" activity advanced grading page
|
||||
And I grade by filling the rubric with:
|
||||
| Criterion 1 | 50 | Very good |
|
||||
|
@ -64,6 +65,7 @@ Feature: Rubrics can be created and edited
|
|||
# Checking that the user grade is correct.
|
||||
And I should see "65" in the "Student 1" "table_row"
|
||||
# Updating the user grade.
|
||||
And I am on the "Test assignment 1 name" "assign activity" page
|
||||
And I go to "Student 1" "Test assignment 1 name" activity advanced grading page
|
||||
And I grade by filling the rubric with:
|
||||
| Criterion 1 | 20 | Bad, I changed my mind |
|
||||
|
|
|
@ -35,6 +35,7 @@ Feature: Converting rubric score to grades
|
|||
| Criterion 2 | Level 21 | 20 | Level 22 | 25 | Level 23 | 30 | | |
|
||||
| Criterion 3 | Level 31 | 10 | Level 32 | 20 | | | | |
|
||||
And I press "Save rubric and make it ready"
|
||||
And I navigate to "Assignment" in current page administration
|
||||
# Grading a student.
|
||||
And I go to "Student 1" "Test assignment 1" activity advanced grading page
|
||||
And I grade by filling the rubric with:
|
||||
|
|
|
@ -39,18 +39,21 @@ Feature: Rubrics can have levels with negative scores
|
|||
| Criterion 3 | Level 31 | 10 | Level 32 | 20 | | | | |
|
||||
And I press "Save rubric and make it ready"
|
||||
# Grading a student.
|
||||
And I navigate to "Assignment" in current page administration
|
||||
And I go to "Student 1" "Test assignment 1" activity advanced grading page
|
||||
And I grade by filling the rubric with:
|
||||
| Criterion 1 | 25 | |
|
||||
| Criterion 2 | 30 | |
|
||||
| Criterion 3 | 10 | |
|
||||
And I save the advanced grading form
|
||||
And I am on the "Test assignment 1" "assign activity" page
|
||||
And I go to "Student 2" "Test assignment 1" activity advanced grading page
|
||||
And I grade by filling the rubric with:
|
||||
| Criterion 1 | 25 | |
|
||||
| Criterion 2 | -20 | |
|
||||
| Criterion 3 | 10 | |
|
||||
And I save the advanced grading form
|
||||
And I am on the "Test assignment 1" "assign activity" page
|
||||
And I go to "Student 3" "Test assignment 1" activity advanced grading page
|
||||
And I grade by filling the rubric with:
|
||||
| Criterion 1 | -11 | |
|
||||
|
|
|
@ -47,7 +47,11 @@ class behat_grading extends behat_base {
|
|||
*/
|
||||
public function i_go_to_advanced_grading_page($activityname) {
|
||||
|
||||
$this->execute("behat_general::i_click_on_in_the", [$this->escape($activityname), 'link', 'page', 'region']);
|
||||
try {
|
||||
$this->execute("behat_general::i_click_on_in_the", [$this->escape($activityname), 'link', 'page', 'region']);
|
||||
} catch (Exception $e) {
|
||||
$this->execute('behat_navigation::go_to_breadcrumb_location', $this->escape($activityname));
|
||||
}
|
||||
|
||||
$this->execute('behat_navigation::i_navigate_to_in_current_page_administration',
|
||||
get_string('gradingmanagement', 'grading'));
|
||||
|
|
|
@ -325,7 +325,7 @@ class behat_grade extends behat_base {
|
|||
// If we are not on one of the gradebook pages already, follow "Grades" link in the navigation drawer.
|
||||
$xpath = '//div[contains(@class,\'grade-navigation\')]';
|
||||
if (!$this->getSession()->getPage()->findAll('xpath', $xpath)) {
|
||||
$this->execute('behat_navigation::i_select_from_flat_navigation_drawer', get_string('grades'));
|
||||
$this->execute('behat_navigation::i_select_from_secondary_navigation', get_string('grades'));
|
||||
}
|
||||
|
||||
$this->select_in_gradebook_tabs($gradepath);
|
||||
|
|
|
@ -36,7 +36,8 @@ Feature: We can customise the letter boundary of a course.
|
|||
And I turn editing mode on
|
||||
And I give the grade "57" to the user "Student 1" for the grade item "Test assignment one"
|
||||
And I press "Save changes"
|
||||
And I turn editing mode off
|
||||
And I am on "Course 1" course homepage with editing mode off
|
||||
And I navigate to "View > Grader report" in the course gradebook
|
||||
Then the following should exist in the "user-grades" table:
|
||||
| -1- | -4- | -5- |
|
||||
| Student 1 | D | D |
|
||||
|
|
|
@ -37,7 +37,8 @@ Feature: We can customise the letter boundary of a course in gradebook version 2
|
|||
And I turn editing mode on
|
||||
And I give the grade "57" to the user "Student 1" for the grade item "Test assignment one"
|
||||
And I press "Save changes"
|
||||
And I turn editing mode off
|
||||
And I am on "Course 1" course homepage with editing mode off
|
||||
And I navigate to "View > Grader report" in the course gradebook
|
||||
Then the following should exist in the "user-grades" table:
|
||||
| -1- | -4- | -5- |
|
||||
| Student 1 | F | F |
|
||||
|
|
|
@ -98,6 +98,13 @@ $PAGE->set_title($SITE->fullname);
|
|||
$PAGE->set_heading($SITE->fullname);
|
||||
$PAGE->has_secondary_navigation_setter(false);
|
||||
$courserenderer = $PAGE->get_renderer('core', 'course');
|
||||
|
||||
if ($hassiteconfig) {
|
||||
$editurl = new moodle_url('/course/view.php', ['id' => SITEID, 'sesskey' => sesskey()]);
|
||||
$editbutton = $OUTPUT->edit_button($editurl);
|
||||
$PAGE->set_button($editbutton);
|
||||
}
|
||||
|
||||
echo $OUTPUT->header();
|
||||
|
||||
$siteformatoptions = course_get_format($SITE)->get_format_options();
|
||||
|
|
2
lib/amd/build/addblockmodal.min.js
vendored
2
lib/amd/build/addblockmodal.min.js
vendored
|
@ -1,2 +1,2 @@
|
|||
define ("core/addblockmodal",["exports","core/modal_factory","core/templates","core/str","core/ajax"],function(a,b,c,d,e){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.init=void 0;b=f(b);c=f(c);e=f(e);function f(a){return a&&a.__esModule?a:{default:a}}function g(a,b,c,d,e,f,g){try{var h=a[f](g),i=h.value}catch(a){c(a);return}if(h.done){b(i)}else{Promise.resolve(i).then(d,e)}}function h(a){return function(){var b=this,c=arguments;return new Promise(function(d,e){var i=a.apply(b,c);function f(a){g(i,d,e,f,h,"next",a)}function h(a){g(i,d,e,f,h,"throw",a)}f(void 0)})}}var i={ADD_BLOCK:"[data-key=\"addblock\"]"},j=null,k=function(a,b,c){document.addEventListener("click",function(d){if(d.target.closest(i.ADD_BLOCK)){d.preventDefault();if(j){j.show()}else{l().then(function(d){j=d;var e=m(c,a,b);d.setBody(e);d.show();return e}).catch(function(){j.destroy();j=null})}}})},l=function(){return b.default.create({type:b.default.types.CANCEL,title:(0,d.get_string)("addblock")})},m=function(){var a=h(regeneratorRuntime.mark(function a(b,d,e){var f;return regeneratorRuntime.wrap(function(a){while(1){switch(a.prev=a.next){case 0:a.next=2;return n(d,e);case 2:f=a.sent;return a.abrupt("return",c.default.render("core/add_block_body",{blocks:f,url:b}));case 4:case"end":return a.stop();}}},a)}));return function(){return a.apply(this,arguments)}}(),n=function(){var a=h(regeneratorRuntime.mark(function a(b,c){var d;return regeneratorRuntime.wrap(function(a){while(1){switch(a.prev=a.next){case 0:d={methodname:"core_block_fetch_addable_blocks",args:{pagecontextid:M.cfg.contextid,pagetype:b,pagelayout:c}};return a.abrupt("return",e.default.call([d])[0]);case 2:case"end":return a.stop();}}},a)}));return function(){return a.apply(this,arguments)}}();a.init=function init(a,b,c){k(a,b,c)}});
|
||||
define ("core/addblockmodal",["exports","core/modal_factory","core/templates","core/str","core/ajax"],function(a,b,c,d,e){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.init=void 0;b=f(b);c=f(c);e=f(e);function f(a){return a&&a.__esModule?a:{default:a}}function g(a,b,c,d,e,f,g){try{var h=a[f](g),i=h.value}catch(a){c(a);return}if(h.done){b(i)}else{Promise.resolve(i).then(d,e)}}function h(a){return function(){var b=this,c=arguments;return new Promise(function(d,e){var i=a.apply(b,c);function f(a){g(i,d,e,f,h,"next",a)}function h(a){g(i,d,e,f,h,"throw",a)}f(void 0)})}}var i={ADD_BLOCK:"[data-key=\"addblock\"]"},j=null,k=function(a,b,c){document.addEventListener("click",function(d){if(d.target.closest(i.ADD_BLOCK)){d.preventDefault();if(null===c){c=d.target.closest(i.ADD_BLOCK).dataset.url}if(j){j.show()}else{l().then(function(d){j=d;var e=m(c,a,b);d.setBody(e);d.show();return e}).catch(function(){j.destroy();j=null})}}})},l=function(){return b.default.create({type:b.default.types.CANCEL,title:(0,d.get_string)("addblock")})},m=function(){var a=h(regeneratorRuntime.mark(function a(b,d,e){var f;return regeneratorRuntime.wrap(function(a){while(1){switch(a.prev=a.next){case 0:a.next=2;return n(d,e);case 2:f=a.sent;return a.abrupt("return",c.default.render("core/add_block_body",{blocks:f,url:b}));case 4:case"end":return a.stop();}}},a)}));return function(){return a.apply(this,arguments)}}(),n=function(){var a=h(regeneratorRuntime.mark(function a(b,c){var d;return regeneratorRuntime.wrap(function(a){while(1){switch(a.prev=a.next){case 0:d={methodname:"core_block_fetch_addable_blocks",args:{pagecontextid:M.cfg.contextid,pagetype:b,pagelayout:c}};return a.abrupt("return",e.default.call([d])[0]);case 2:case"end":return a.stop();}}},a)}));return function(){return a.apply(this,arguments)}}();a.init=function init(a,b){var c=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;k(a,b,c)}});
|
||||
//# sourceMappingURL=addblockmodal.min.js.map
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -38,7 +38,7 @@ let addBlockModal = null;
|
|||
* @method registerListenerEvents
|
||||
* @param {String} pageType The type of the page
|
||||
* @param {String} pageLayout The layout of the page
|
||||
* @param {String} addBlockUrl The add block URL
|
||||
* @param {String|null} addBlockUrl The add block URL
|
||||
*/
|
||||
const registerListenerEvents = (pageType, pageLayout, addBlockUrl) => {
|
||||
document.addEventListener('click', e => {
|
||||
|
@ -46,6 +46,10 @@ const registerListenerEvents = (pageType, pageLayout, addBlockUrl) => {
|
|||
if (e.target.closest(SELECTORS.ADD_BLOCK)) {
|
||||
e.preventDefault();
|
||||
|
||||
if (addBlockUrl === null) {
|
||||
addBlockUrl = e.target.closest(SELECTORS.ADD_BLOCK).dataset.url;
|
||||
}
|
||||
|
||||
if (addBlockModal) { // The 'add block' modal has been already created.
|
||||
// Display the 'add block' modal.
|
||||
addBlockModal.show();
|
||||
|
@ -128,8 +132,8 @@ const getAddableBlocks = async(pageType, pageLayout) => {
|
|||
* @method init
|
||||
* @param {String} pageType The type of the page
|
||||
* @param {String} pageLayout The layout of the page
|
||||
* @param {String} addBlockUrl The add block URL
|
||||
* @param {String|null} addBlockUrl The add block URL
|
||||
*/
|
||||
export const init = (pageType, pageLayout, addBlockUrl) => {
|
||||
export const init = (pageType, pageLayout, addBlockUrl = null) => {
|
||||
registerListenerEvents(pageType, pageLayout, addBlockUrl);
|
||||
};
|
||||
|
|
|
@ -837,12 +837,23 @@ class block_manager {
|
|||
}
|
||||
}
|
||||
|
||||
public function add_block_at_end_of_default_region($blockname) {
|
||||
/**
|
||||
* When passed a block name create a new instance of the block in the specified region.
|
||||
*
|
||||
* @param string $blockname Name of the block to add.
|
||||
* @param null|string $blockregion If defined add the new block to the specified region.
|
||||
*/
|
||||
public function add_block_at_end_of_default_region($blockname, $blockregion = null) {
|
||||
if (empty($this->birecordsbyregion)) {
|
||||
// No blocks or block regions exist yet.
|
||||
return;
|
||||
}
|
||||
$defaulregion = $this->get_default_region();
|
||||
|
||||
if ($blockregion === null) {
|
||||
$defaulregion = $this->get_default_region();
|
||||
} else {
|
||||
$defaulregion = $blockregion;
|
||||
}
|
||||
|
||||
$lastcurrentblock = end($this->birecordsbyregion[$defaulregion]);
|
||||
if ($lastcurrentblock) {
|
||||
|
@ -1458,6 +1469,8 @@ class block_manager {
|
|||
global $CFG, $PAGE, $OUTPUT;
|
||||
|
||||
$blocktype = optional_param('bui_addblock', null, PARAM_PLUGIN);
|
||||
$blockregion = optional_param('bui_blockregion', null, PARAM_TEXT);
|
||||
|
||||
if ($blocktype === null) {
|
||||
return false;
|
||||
}
|
||||
|
@ -1519,7 +1532,7 @@ class block_manager {
|
|||
throw new moodle_exception('cannotaddthisblocktype', '', $this->page->url->out(), $blocktype);
|
||||
}
|
||||
|
||||
$this->add_block_at_end_of_default_region($blocktype);
|
||||
$this->add_block_at_end_of_default_region($blocktype, $blockregion);
|
||||
|
||||
// If the page URL was a guess, it will contain the bui_... param, so we must make sure it is not there.
|
||||
$this->page->ensure_param_not_in_url('bui_addblock');
|
||||
|
|
|
@ -58,6 +58,10 @@ class secondary extends view {
|
|||
'outcomes' => 2.2,
|
||||
'coursecompletion' => 6,
|
||||
'filtermanagement' => 9,
|
||||
'unenrolself' => 10,
|
||||
'coursetags' => 11,
|
||||
'download' => 12,
|
||||
'contextlocking' => 13,
|
||||
],
|
||||
];
|
||||
$nodes['navigation'] = [
|
||||
|
|
|
@ -515,6 +515,7 @@ function enrol_add_course_navigation(navigation_node $coursenode, $course) {
|
|||
if ($unenrollink = $plugin->get_unenrolself_link($instance)) {
|
||||
$shortname = format_string($course->shortname, true, array('context' => $coursecontext));
|
||||
$coursenode->add(get_string('unenrolme', 'core_enrol', $shortname), $unenrollink, navigation_node::TYPE_SETTING, null, 'unenrolself', new pix_icon('i/user', ''));
|
||||
$coursenode->get('unenrolself')->set_force_into_more_menu();
|
||||
break;
|
||||
//TODO. deal with multiple unenrol links - not likely case, but still...
|
||||
}
|
||||
|
|
|
@ -844,6 +844,24 @@ class navigation_node implements renderable {
|
|||
return $this->action;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return an array consisting of the additional attributes for the action url.
|
||||
*
|
||||
* @return array Formatted array to parse in a template
|
||||
*/
|
||||
public function actionattributes() {
|
||||
if ($this->action instanceof action_link) {
|
||||
return array_map(function($key, $value) {
|
||||
return [
|
||||
'name' => $key,
|
||||
'value' => $value
|
||||
];
|
||||
}, array_keys($this->action->attributes), $this->action->attributes);
|
||||
}
|
||||
|
||||
return [];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets whether the node and its children should be added into a "more" menu whenever possible.
|
||||
*
|
||||
|
@ -4100,27 +4118,8 @@ class flat_navigation extends navigation_node_collection {
|
|||
$flat->icon = new pix_icon('t/preferences', '');
|
||||
$this->add($flat);
|
||||
}
|
||||
|
||||
// Add-a-block in editing mode.
|
||||
if (isset($this->page->theme->addblockposition) &&
|
||||
$this->page->theme->addblockposition == BLOCK_ADDBLOCK_POSITION_FLATNAV &&
|
||||
$PAGE->user_is_editing() && $PAGE->user_can_edit_blocks()) {
|
||||
$url = new moodle_url($PAGE->url, ['bui_addblock' => '', 'sesskey' => sesskey()]);
|
||||
$addablock = navigation_node::create(get_string('addblock'), $url);
|
||||
$flat = new flat_navigation_node($addablock, 0);
|
||||
$flat->set_showdivider(true, get_string('blocksaddedit'));
|
||||
$flat->key = 'addblock';
|
||||
$flat->icon = new pix_icon('i/addblock', '');
|
||||
$this->add($flat);
|
||||
|
||||
$addblockurl = "?{$url->get_query_string(false)}";
|
||||
|
||||
$PAGE->requires->js_call_amd('core/addblockmodal', 'init',
|
||||
[$PAGE->pagetype, $PAGE->pagelayout, $addblockurl]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Override the parent so we can set a label for this collection if it has not been set yet.
|
||||
*
|
||||
|
@ -4518,6 +4517,7 @@ class settings_navigation extends navigation_node {
|
|||
if (!$adminoptions->update && $adminoptions->tags) {
|
||||
$url = new moodle_url('/course/tags.php', array('id' => $course->id));
|
||||
$coursenode->add(get_string('coursetags', 'tag'), $url, self::TYPE_SETTING, null, 'coursetags', new pix_icon('i/settings', ''));
|
||||
$coursenode->get('coursetags')->set_force_into_more_menu();
|
||||
}
|
||||
|
||||
// add enrol nodes
|
||||
|
@ -4654,6 +4654,7 @@ class settings_navigation extends navigation_node {
|
|||
|
||||
$coursenode->add($linkattr->displaystring, $actionlink, self::TYPE_SETTING, null, 'download',
|
||||
new pix_icon('t/download', ''));
|
||||
$coursenode->get('download')->set_force_into_more_menu();
|
||||
}
|
||||
|
||||
// Return we are done
|
||||
|
|
41
lib/templates/add_block_button.mustache
Normal file
41
lib/templates/add_block_button.mustache
Normal file
|
@ -0,0 +1,41 @@
|
|||
{{!
|
||||
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 <http://www.gnu.org/licenses/>.
|
||||
}}
|
||||
{{!
|
||||
@template core/add_block_button
|
||||
|
||||
Template for the body of the fake 'add block' block.
|
||||
|
||||
Example context (json):
|
||||
{
|
||||
"link" : "/my/index.php?bui_addblock&bui_blockregion=content&sesskey=M3mes",
|
||||
"escapedlink" : "?bui_addblock&bui_blockregion=content&sesskey=M3mes",
|
||||
"pageType" : "my-index",
|
||||
"pageLayout" : "mydashboard"
|
||||
}
|
||||
|
||||
}}
|
||||
<a href="{{link}}" id="addblock-{{uniqid}}" class="btn btn-link block-add text-left" data-key="addblock" data-url="{{escapedlink}}">
|
||||
{{#str}}addblock{{/str}}
|
||||
<i class="fa fa-plus-square pull-right py-1" aria-hidden="true"></i>
|
||||
</a>
|
||||
|
||||
{{#js}}
|
||||
// Initialise the JS for the modal window which displays the blocks available to add.
|
||||
require(['core/addblockmodal'], function(addBlockModal) {
|
||||
addBlockModal.init('{{pageType}}', '{{pageLayout}}');
|
||||
});
|
||||
{{/js}}
|
|
@ -48,16 +48,10 @@
|
|||
</div>
|
||||
<div class="d-sm-flex align-items-center">
|
||||
{{#contextheader}}
|
||||
<div class="mr-auto">
|
||||
{{{contextheader}}}
|
||||
</div>
|
||||
<div class="mr-auto">
|
||||
{{{contextheader}}}
|
||||
</div>
|
||||
{{/contextheader}}
|
||||
|
||||
{{#settingsmenu}}
|
||||
<div class="context-header-settings-menu">
|
||||
{{{settingsmenu}}}
|
||||
</div>
|
||||
{{/settingsmenu}}
|
||||
<div class="header-actions-container flex-shrink-0" data-region="header-actions-container">
|
||||
{{#headeractions}}
|
||||
<div class="header-action ml-2">{{{.}}}</div>
|
||||
|
|
|
@ -50,12 +50,12 @@
|
|||
{{^haschildren}}
|
||||
<li class="nav-item" role="none" data-forceintomoremenu="{{#forceintomoremenu}}true{{/forceintomoremenu}}{{^forceintomoremenu}}false{{/forceintomoremenu}}">
|
||||
{{#tab}}
|
||||
<a role="menuitem" class="nav-link {{#isactive}}active{{/isactive}} {{#classes}}{{.}} {{/classes}}" href="{{tab}}" data-toggle="tab" data-text="{{{text}}}" aria-current="false" tabindex="-1">
|
||||
<a role="menuitem" class="nav-link {{#isactive}}active{{/isactive}} {{#classes}}{{.}} {{/classes}}" {{#actionattributes}}{{name}}="{{value}}"{{/actionattributes}} href="{{tab}}" data-toggle="tab" data-text="{{{text}}}" aria-current="false" tabindex="-1">
|
||||
{{{text}}}
|
||||
</a>
|
||||
{{/tab}}
|
||||
{{^tab}}
|
||||
<a role="menuitem" class="nav-link {{#isactive}}active{{/isactive}} {{#classes}}{{.}} {{/classes}}" href="{{{url}}}{{{action}}}" {{#isactive}}aria-current="true"{{/isactive}} tabindex="-1">
|
||||
<a role="menuitem" class="nav-link {{#isactive}}active{{/isactive}} {{#classes}}{{.}} {{/classes}}" {{#actionattributes}}{{name}}="{{value}}"{{/actionattributes}} href="{{{url}}}{{{action}}}" {{#isactive}}aria-current="true"{{/isactive}} tabindex="-1">
|
||||
{{{text}}}
|
||||
</a>
|
||||
{{/tab}}
|
||||
|
|
|
@ -36,11 +36,6 @@
|
|||
}
|
||||
}
|
||||
}}
|
||||
{{#secondarynavigation}}
|
||||
<div class="secondary-navigation">
|
||||
{{> core/moremenu}}
|
||||
</div>
|
||||
{{/secondarynavigation}}
|
||||
{{^secondarynavigation}}
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
<!-- First the top most node and immediate children -->
|
||||
|
|
|
@ -250,7 +250,8 @@ Feature: Initials bar
|
|||
And I click on "Save changes" "button"
|
||||
And I log out
|
||||
And I am on the "C1" "Course" page logged in as "teacher"
|
||||
And I navigate to "Reports > Activity completion" in current page administration
|
||||
And I navigate to "Reports" in current page administration
|
||||
And I select "Activity completion" from the "Report type" singleselect
|
||||
And ".initialbarall.page-item.active" "css_element" should exist in the ".initialbar.firstinitial" "css_element"
|
||||
And ".initialbarall.page-item.active" "css_element" should exist in the ".initialbar.lastinitial" "css_element"
|
||||
And ".page-item.active.B" "css_element" should not exist in the ".initialbar.firstinitial" "css_element"
|
||||
|
@ -275,7 +276,8 @@ Feature: Initials bar
|
|||
And I should see "Bstudent Astudent"
|
||||
And I should not see "Cstudent Cstudent"
|
||||
And I am on "Course 1" course homepage
|
||||
And I navigate to "Reports > Activity completion" in current page administration
|
||||
And I navigate to "Reports" in current page administration
|
||||
And I select "Activity completion" from the "Report type" singleselect
|
||||
And ".initialbarall.page-item.active" "css_element" should not exist in the ".initialbar.firstinitial" "css_element"
|
||||
And ".initialbarall.page-item.active" "css_element" should not exist in the ".initialbar.lastinitial" "css_element"
|
||||
And ".page-item.active.B" "css_element" should exist in the ".initialbar.firstinitial" "css_element"
|
||||
|
|
|
@ -81,4 +81,18 @@ class behat_deprecated extends behat_base {
|
|||
throw new Exception($message);
|
||||
}
|
||||
|
||||
/**
|
||||
* Clicks link with specified id|title|alt|text in the flat navigation drawer.
|
||||
*
|
||||
* @When /^I select "(?P<link_string>(?:[^"]|\\")*)" from flat navigation drawer$/
|
||||
* @throws ElementNotFoundException Thrown by behat_base::find
|
||||
* @param string $link
|
||||
* @deprecated Since Moodle 4.0
|
||||
*/
|
||||
public function i_select_from_flat_navigation_drawer(string $link) {
|
||||
self::deprecated_message(['i_select_from_primary_navigation', 'i_select_from_secondary_navigation'], true);
|
||||
|
||||
$this->i_open_flat_navigation_drawer();
|
||||
$this->execute('behat_general::i_click_on_in_the', [$link, 'link', '#nav-drawer', 'css_element']);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -444,7 +444,9 @@ class behat_navigation extends behat_base {
|
|||
$nodetext = end($nodes);
|
||||
|
||||
// Find administration menu.
|
||||
$menuxpath = $this->find_header_administration_menu() ?: $this->find_page_administration_menu(true);
|
||||
if (!$menuxpath = $this->find_page_action_menu()) {
|
||||
$menuxpath = $this->find_header_administration_menu() ?: $this->find_page_administration_menu(true);
|
||||
}
|
||||
|
||||
$this->toggle_page_administration_menu($menuxpath);
|
||||
$this->execute('behat_general::should_exist_in_the', [$nodetext, $selectortype, $menuxpath, 'xpath_element']);
|
||||
|
@ -489,7 +491,7 @@ class behat_navigation extends behat_base {
|
|||
*/
|
||||
public function i_navigate_to_in_site_administration($nodetext) {
|
||||
$nodelist = array_map('trim', explode('>', $nodetext));
|
||||
$this->i_select_from_flat_navigation_drawer(get_string('administrationsite'));
|
||||
$this->i_select_from_primary_navigation(get_string('administrationsite'));
|
||||
$this->select_on_administration_page($nodelist);
|
||||
}
|
||||
|
||||
|
@ -911,15 +913,28 @@ class behat_navigation extends behat_base {
|
|||
}
|
||||
|
||||
/**
|
||||
* Clicks link with specified id|title|alt|text in the flat navigation drawer.
|
||||
* Clicks link with specified id|title|alt|text in the primary navigation
|
||||
*
|
||||
* @When /^I select "(?P<link_string>(?:[^"]|\\")*)" from flat navigation drawer$/
|
||||
* @When /^I select "(?P<link_string>(?:[^"]|\\")*)" from primary navigation$/
|
||||
* @throws ElementNotFoundException Thrown by behat_base::find
|
||||
* @param string $link
|
||||
*/
|
||||
public function i_select_from_flat_navigation_drawer($link) {
|
||||
$this->i_open_flat_navigation_drawer();
|
||||
$this->execute('behat_general::i_click_on_in_the', [$link, 'link', '#nav-drawer', 'css_element']);
|
||||
public function i_select_from_primary_navigation(string $link) {
|
||||
$this->execute('behat_general::i_click_on_in_the',
|
||||
[$link, 'link', '.primary-navigation .moremenu.navigation', 'css_element']
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Clicks link with specified id|title|alt|text in the secondary navigation
|
||||
*
|
||||
* @throws ElementNotFoundException Thrown by behat_base::find
|
||||
* @param string $link
|
||||
*/
|
||||
public function i_select_from_secondary_navigation(string $link) {
|
||||
$this->execute('behat_general::i_click_on_in_the',
|
||||
[$link, 'link', '.secondary-navigation .moremenu.navigation', 'css_element']
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -928,7 +943,9 @@ class behat_navigation extends behat_base {
|
|||
protected function go_to_main_course_page() {
|
||||
$url = $this->getSession()->getCurrentUrl();
|
||||
if (!preg_match('|/course/view.php\?id=[\d]+$|', $url)) {
|
||||
$node = $this->find('xpath', '//header//div[@id=\'page-navbar\']//a[contains(@href,\'/course/view.php?id=\')]');
|
||||
$node = $this->find('xpath',
|
||||
'//header//div[@id=\'page-navbar\']//a[contains(@href,\'/course/view.php?id=\')]'
|
||||
);
|
||||
$this->execute('behat_general::i_click_on', [$node, 'NodeElement']);
|
||||
}
|
||||
}
|
||||
|
@ -993,11 +1010,16 @@ class behat_navigation extends behat_base {
|
|||
|
||||
// Find a link and click on it.
|
||||
$linkname = behat_context_helper::escape($lastnode);
|
||||
$xpath .= '//a[contains(normalize-space(.), ' . $linkname . ')]';
|
||||
if (!$node = $this->getSession()->getPage()->find('xpath', $xpath)) {
|
||||
throw new ElementNotFoundException($this->getSession(), 'Link "' . join(' > ', $nodelist) . '"');
|
||||
$xpathlink = $xpathbutton = $xpath;
|
||||
$xpathlink .= '//a[contains(normalize-space(.), ' . $linkname . ')]';
|
||||
$xpathbutton .= '//button[contains(normalize-space(.), ' . $linkname . ')]';
|
||||
if ($node = $this->getSession()->getPage()->find('xpath', $xpathbutton)) {
|
||||
$this->execute('behat_general::i_click_on', [$node, 'NodeElement']);
|
||||
} else if (!$node = $this->getSession()->getPage()->find('xpath', $xpathlink)) {
|
||||
throw new ElementNotFoundException($this->getSession(), 'Link "' . join(' > ', $nodelist) . '"');
|
||||
} else {
|
||||
$this->execute('behat_general::i_click_on', [$node, 'NodeElement']);
|
||||
}
|
||||
$this->execute('behat_general::i_click_on', [$node, 'NodeElement']);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1007,7 +1029,8 @@ class behat_navigation extends behat_base {
|
|||
* @return null|string
|
||||
*/
|
||||
protected function find_header_administration_menu($mustexist = false) {
|
||||
$menuxpath = '//header[@id=\'page-header\']//div[contains(@class,\'moodle-actionmenu\')]';
|
||||
$menuxpath = '//div[contains(@class,\'secondary-navigation\')]//nav[contains(@class,\'moremenu\')]';
|
||||
|
||||
if ($mustexist) {
|
||||
$exception = new ElementNotFoundException($this->getSession(), 'Page header administration menu');
|
||||
$this->find('xpath', $menuxpath, $exception);
|
||||
|
@ -1034,6 +1057,24 @@ class behat_navigation extends behat_base {
|
|||
return $menuxpath;
|
||||
}
|
||||
|
||||
/**
|
||||
* Locates the action menu on the page (but not in the header) and returns its xpath
|
||||
*
|
||||
* @param null|bool $mustexist if specified throws an exception if menu is not found
|
||||
* @return null|string
|
||||
*/
|
||||
protected function find_page_action_menu($mustexist = false) {
|
||||
$menuxpath = '//div[@id=\'action-menu-0-menubar\']';
|
||||
|
||||
if ($mustexist) {
|
||||
$exception = new ElementNotFoundException($this->getSession(), 'Page check');
|
||||
$this->find('xpath', $menuxpath, $exception);
|
||||
} else if (!$this->getSession()->getPage()->find('xpath', $menuxpath)) {
|
||||
return null;
|
||||
}
|
||||
return $menuxpath;
|
||||
}
|
||||
|
||||
/**
|
||||
* Toggles administration menu
|
||||
*
|
||||
|
@ -1045,7 +1086,9 @@ class behat_navigation extends behat_base {
|
|||
}
|
||||
if ($menuxpath && $this->running_javascript()) {
|
||||
$node = $this->find('xpath', $menuxpath . '//a[@data-toggle=\'dropdown\']');
|
||||
$this->execute('behat_general::i_click_on', [$node, 'NodeElement']);
|
||||
if ($node->isVisible()) {
|
||||
$this->execute('behat_general::i_click_on', [$node, 'NodeElement']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1062,6 +1105,8 @@ class behat_navigation extends behat_base {
|
|||
// Find administration menu.
|
||||
if ($menuxpath = $this->find_header_administration_menu()) {
|
||||
$isheader = true;
|
||||
} else if ($menuxpath = $this->find_page_action_menu(true)) {
|
||||
$isheader = false;
|
||||
} else {
|
||||
$menuxpath = $this->find_page_administration_menu(true);
|
||||
$isheader = false;
|
||||
|
@ -1069,6 +1114,12 @@ class behat_navigation extends behat_base {
|
|||
|
||||
$this->execute('behat_navigation::toggle_page_administration_menu', [$menuxpath]);
|
||||
|
||||
$firstnode = $nodelist[0];
|
||||
$firstlinkname = behat_context_helper::escape($firstnode);
|
||||
$firstlink = $this->getSession()->getPage()->find('xpath',
|
||||
$menuxpath . '//a[contains(normalize-space(.), ' . $firstlinkname . ')]'
|
||||
);
|
||||
|
||||
if (!$isheader || count($nodelist) == 1) {
|
||||
$lastnode = end($nodelist);
|
||||
$linkname = behat_context_helper::escape($lastnode);
|
||||
|
@ -1077,16 +1128,32 @@ class behat_navigation extends behat_base {
|
|||
$this->execute('behat_general::i_click_on', [$link, 'NodeElement']);
|
||||
return;
|
||||
}
|
||||
} else if ($firstlink) {
|
||||
$this->execute('behat_general::i_click_on', [$firstlink, 'NodeElement']);
|
||||
array_splice($nodelist, 0, 1);
|
||||
$this->select_on_administration_page($nodelist);
|
||||
return;
|
||||
}
|
||||
|
||||
if ($isheader) {
|
||||
// Course administration and Front page administration will have subnodes under "More...".
|
||||
// Front page administration will have subnodes under "More...".
|
||||
$linkname = behat_context_helper::escape(get_string('morenavigationlinks'));
|
||||
$link = $this->getSession()->getPage()->find('xpath', $menuxpath . '//a[contains(normalize-space(.), ' . $linkname . ')]');
|
||||
$link = $this->getSession()->getPage()->find('xpath',
|
||||
$menuxpath . '//a[contains(normalize-space(.), ' . $linkname . ')]'
|
||||
);
|
||||
// Course administration will have subnodes under "Course administration".
|
||||
$courselinkname = behat_context_helper::escape(get_string('courseadministration'));
|
||||
$courselink = $this->getSession()->getPage()->find('xpath',
|
||||
$menuxpath . '//a[contains(normalize-space(.), ' . $courselinkname . ')]'
|
||||
);
|
||||
if ($link) {
|
||||
$this->execute('behat_general::i_click_on', [$link, 'NodeElement']);
|
||||
$this->select_on_administration_page($nodelist);
|
||||
return;
|
||||
} else if ($courselink) {
|
||||
$this->execute('behat_general::i_click_on', [$courselink, 'NodeElement']);
|
||||
$this->select_on_administration_page($nodelist);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1115,6 +1182,7 @@ class behat_navigation extends behat_base {
|
|||
* First checks to see if we are on this page via the breadcrumb. If not we then attempt to follow the link name given.
|
||||
*
|
||||
* @param string $pagename Name of the breadcrumb item to check and follow.
|
||||
* @Given /^I follow the breadcrumb "(?P<url_string>(?:[^"]|\\")*)"$/
|
||||
*/
|
||||
public function go_to_breadcrumb_location(string $pagename): void {
|
||||
$link = $this->getSession()->getPage()->find(
|
||||
|
|
|
@ -124,7 +124,5 @@ Feature: In an assignment, teacher can annotate PDF files during grading
|
|||
And I draw on the pdf
|
||||
And I press "Save changes"
|
||||
And I should see "The changes to the grade and feedback were saved"
|
||||
And I click on "Edit settings" "link"
|
||||
And I follow "Test assignment name"
|
||||
And I follow "View all submissions"
|
||||
And I should see "View annotated PDF..." in the "student2@example.com" "table_row"
|
||||
|
|
|
@ -39,8 +39,6 @@ Feature: In an assignment, teachers can edit a students submission inline
|
|||
| Feedback comments | I'm the teacher feedback |
|
||||
And I upload "lib/tests/fixtures/empty.txt" file to "Feedback files" filemanager
|
||||
And I press "Save changes"
|
||||
And I click on "Edit settings" "link"
|
||||
And I follow "Test assignment name"
|
||||
And I follow "View all submissions"
|
||||
Then I should see "50.00" in the "Student 1" "table_row"
|
||||
And I should see "Submitted for grading" in the "Student 1" "table_row"
|
||||
|
|
|
@ -33,8 +33,6 @@ Feature: Check that the assignment grade can be updated correctly
|
|||
And I set the field "Grade out of 100" to "50"
|
||||
And I set the field "Notify students" to "0"
|
||||
And I press "Save changes"
|
||||
And I click on "Edit settings" "link"
|
||||
And I follow "Test assignment name"
|
||||
And I follow "View all submissions"
|
||||
And "Student 1" row "Grade" column of "generaltable" table should contain "50.00"
|
||||
|
||||
|
@ -69,7 +67,5 @@ Feature: Check that the assignment grade can be updated correctly
|
|||
And I set the field "Grade out of 100" to "50"
|
||||
And I set the field "Notify students" to "0"
|
||||
And I press "Save changes"
|
||||
And I click on "Edit settings" "link"
|
||||
And I follow "Test assignment name"
|
||||
And I follow "View all submissions"
|
||||
Then "Student 1" row "Grade" column of "generaltable" table should contain "50.00"
|
||||
|
|
|
@ -65,8 +65,6 @@ Feature: View the grading status of an assignment
|
|||
And I should see "1 of 1"
|
||||
And I set the field "Marking workflow state" to "Released"
|
||||
And I press "Save changes"
|
||||
And I click on "Edit settings" "link"
|
||||
And I follow "Test assignment name"
|
||||
And I follow "View all submissions"
|
||||
And I should see "Released" in the "Student 1" "table_row"
|
||||
And I log out
|
||||
|
|
|
@ -32,7 +32,6 @@ Feature: In an assignment, teachers grade multiple students on one page
|
|||
And I follow "View all submissions"
|
||||
When I click on "Grade" "link" in the "Student 1" "table_row"
|
||||
And I press "Save changes"
|
||||
And I click on "Edit settings" "link"
|
||||
And I follow "Test assignment name"
|
||||
Then I should see "1" in the "Needs grading" "table_row"
|
||||
|
||||
|
@ -100,8 +99,6 @@ Feature: In an assignment, teachers grade multiple students on one page
|
|||
| M8d skillZ! | 1337 |
|
||||
| Feedback comments | I'm the teacher first feedback |
|
||||
And I press "Save changes"
|
||||
And I click on "Edit settings" "link"
|
||||
And I follow "Test assignment name"
|
||||
And I follow "View all submissions"
|
||||
Then I click on "Quick grading" "checkbox"
|
||||
And I set the field "User grade" to "60.0"
|
||||
|
|
|
@ -32,8 +32,6 @@ Feature: Check that the assignment grade can be rescaled when the max grade is c
|
|||
And I click on "Grade" "link" in the "Student 1" "table_row"
|
||||
And I set the field "Grade out of 100" to "40"
|
||||
And I press "Save changes"
|
||||
And I follow "Edit settings"
|
||||
And I follow "Test assignment name"
|
||||
And I follow "View all submissions"
|
||||
And "Student 1" row "Grade" column of "generaltable" table should contain "40.00"
|
||||
And I am on the "Test assignment name" "assign activity" page
|
||||
|
|
|
@ -42,8 +42,6 @@ Feature: Assignments correctly add feedback to the grade report when workflow an
|
|||
And I set the field "Feedback comments" to "Great job! Lol, not really."
|
||||
And I set the field "Notify students" to "0"
|
||||
And I press "Save changes"
|
||||
And I click on "Edit settings" "link"
|
||||
And I follow "Test assignment name"
|
||||
And I follow "View all submissions"
|
||||
And I should see "In review" in the "I'm the student's first submission" "table_row"
|
||||
|
||||
|
@ -53,15 +51,11 @@ Feature: Assignments correctly add feedback to the grade report when workflow an
|
|||
And I set the field "Marking workflow state" to "Ready for release"
|
||||
And I set the field "Notify students" to "0"
|
||||
And I press "Save changes"
|
||||
And I click on "Edit settings" "link"
|
||||
And I follow "Test assignment name"
|
||||
And I follow "View all submissions"
|
||||
And I should see "Ready for release" in the "I'm the student's first submission" "table_row"
|
||||
And I click on "Grade" "link" in the "I'm the student's first submission" "table_row"
|
||||
And I set the field "Marking workflow state" to "Released"
|
||||
And I press "Save changes"
|
||||
And I click on "Edit settings" "link"
|
||||
And I follow "Test assignment name"
|
||||
And I follow "View all submissions"
|
||||
And I should see "Released" in the "I'm the student's first submission" "table_row"
|
||||
And I set the field "Grading action" to "Reveal student identities"
|
||||
|
@ -79,8 +73,6 @@ Feature: Assignments correctly add feedback to the grade report when workflow an
|
|||
And I set the field "Marking workflow state" to "Ready for release"
|
||||
And I set the field "Notify students" to "0"
|
||||
And I press "Save changes"
|
||||
And I click on "Edit settings" "link"
|
||||
And I follow "Test assignment name"
|
||||
And I follow "View all submissions"
|
||||
And I should see "Ready for release" in the "I'm the student's first submission" "table_row"
|
||||
And I set the field "Grading action" to "Reveal student identities"
|
||||
|
@ -88,8 +80,6 @@ Feature: Assignments correctly add feedback to the grade report when workflow an
|
|||
And I click on "Grade" "link" in the "Student 1" "table_row"
|
||||
And I set the field "Marking workflow state" to "Released"
|
||||
And I press "Save changes"
|
||||
And I click on "Edit settings" "link"
|
||||
And I follow "Test assignment name"
|
||||
And I follow "View all submissions"
|
||||
And I should see "Released" in the "Student 1" "table_row"
|
||||
And I log out
|
||||
|
|
|
@ -98,8 +98,6 @@ Feature: In an assignment, students can comment in their submissions
|
|||
| Grade out of 100 | 50 |
|
||||
| Feedback comments | I'm the teacher feedback |
|
||||
And I press "Save changes"
|
||||
And I click on "Edit settings" "link"
|
||||
And I follow "Test assignment name"
|
||||
And I follow "View all submissions"
|
||||
Then I should see "50.00" in the "Student 1" "table_row"
|
||||
And I should see "I'm the teacher feedback" in the "Student 1" "table_row"
|
||||
|
|
|
@ -43,6 +43,13 @@ $urlparams = array('id' => $id,
|
|||
|
||||
$url = new moodle_url('/mod/assign/view.php', $urlparams);
|
||||
$PAGE->set_url($url);
|
||||
// MDL-71915 Will remove this place holder.
|
||||
if (defined('BEHAT_SITE_RUNNING')) {
|
||||
$PAGE->has_secondary_navigation_setter(false);
|
||||
if ($urlparams['action'] !== 'grader') {
|
||||
$PAGE->add_header_action($OUTPUT->region_main_settings_menu());
|
||||
}
|
||||
}
|
||||
|
||||
// Update module completion status.
|
||||
$assign->set_module_viewed();
|
||||
|
|
|
@ -33,35 +33,36 @@ Feature: In a book, verify log entries
|
|||
And I click on "Next" "link"
|
||||
And I click on "Previous" "link"
|
||||
And I navigate to "Print book" in current page administration
|
||||
And I am on the "Test book" "book activity" page
|
||||
And I navigate to "Download IMS CP" in current page administration
|
||||
And I am on the "Test book" "book activity" page
|
||||
And I navigate to "Logs" in current page administration
|
||||
Then I should see "Book exported"
|
||||
And I should see "Book printed"
|
||||
And I should see "Chapter viewed" in the "#report_log_r2_c5" "css_element"
|
||||
And I should see "Chapter viewed" in the "#report_log_r3_c5" "css_element"
|
||||
And I should see "Chapter viewed" in the "#report_log_r4_c5" "css_element"
|
||||
And I should see "Chapter updated" in the "#report_log_r5_c5" "css_element"
|
||||
And I should see "Chapter viewed" in the "#report_log_r6_c5" "css_element"
|
||||
And I should see "Chapter created" in the "#report_log_r7_c5" "css_element"
|
||||
And I should see "Chapter created" in the "#report_log_r9_c5" "css_element"
|
||||
And I click on "Chapter viewed" "link" in the "#report_log_r2_c5" "css_element"
|
||||
And I should see "Chapter viewed" in the "#report_log_r7_c5" "css_element"
|
||||
And I should see "Chapter viewed" in the "#report_log_r8_c5" "css_element"
|
||||
And I should see "Chapter updated" in the "#report_log_r9_c5" "css_element"
|
||||
And I should see "Chapter viewed" in the "#report_log_r10_c5" "css_element"
|
||||
And I should see "Chapter created" in the "#report_log_r11_c5" "css_element"
|
||||
And I click on "Chapter viewed" "link" in the "#report_log_r6_c5" "css_element"
|
||||
And I switch to "action" window
|
||||
And I change window size to "large"
|
||||
And I should see "1. First chapter edited" in the ".book_content" "css_element"
|
||||
And I switch to the main window
|
||||
And I click on "Chapter viewed" "link" in the "#report_log_r3_c5" "css_element"
|
||||
And I click on "Chapter viewed" "link" in the "#report_log_r7_c5" "css_element"
|
||||
And I switch to "action" window
|
||||
And I should see "2. Second chapter" in the ".book_content" "css_element"
|
||||
And I switch to the main window
|
||||
And I click on "Chapter updated" "link" in the "#report_log_r5_c5" "css_element"
|
||||
And I click on "Chapter updated" "link" in the "#report_log_r9_c5" "css_element"
|
||||
And I switch to "action" window
|
||||
And I should see "1. First chapter edited" in the ".book_content" "css_element"
|
||||
And I switch to the main window
|
||||
And I click on "Chapter created" "link" in the "#report_log_r7_c5" "css_element"
|
||||
And I click on "Chapter created" "link" in the "#report_log_r11_c5" "css_element"
|
||||
And I switch to "action" window
|
||||
And I should see "2. Second chapter" in the ".book_content" "css_element"
|
||||
And I switch to the main window
|
||||
And I click on "Chapter created" "link" in the "#report_log_r9_c5" "css_element"
|
||||
And I click on "Chapter created" "link" in the "#report_log_r13_c5" "css_element"
|
||||
And I switch to "action" window
|
||||
And I should see "1. First chapter edited" in the ".book_content" "css_element"
|
||||
And I switch to the main window
|
||||
|
|
|
@ -45,7 +45,8 @@ Feature: Automatic completion in the choice activity
|
|||
@javascript
|
||||
Scenario: Overriding automatic choice completion for a user
|
||||
Given I am on the "Course 1" course page logged in as teacher1
|
||||
And I navigate to "Reports > Activity completion" in current page administration
|
||||
And I navigate to "Reports" in current page administration
|
||||
And I select "Activity completion" from the "Report type" singleselect
|
||||
And I click on "Student 1, What to drink?: Not completed" "link"
|
||||
And I press "Save changes"
|
||||
And I log out
|
||||
|
|
|
@ -53,7 +53,8 @@ Feature: Manual completion in the choice activity
|
|||
@javascript
|
||||
Scenario: Overriding a manual choice completion for a user to done
|
||||
Given I am on the "Course 1" course page logged in as teacher1
|
||||
And I navigate to "Reports > Activity completion" in current page administration
|
||||
And I navigate to "Reports" in current page administration
|
||||
And I select "Activity completion" from the "Report type" singleselect
|
||||
And I click on "Student 1, What to drink?: Not completed" "link"
|
||||
And I press "Save changes"
|
||||
And I log out
|
||||
|
@ -69,7 +70,8 @@ Feature: Manual completion in the choice activity
|
|||
And I wait until the page is ready
|
||||
And I log out
|
||||
And I am on the "Course 1" course page logged in as teacher1
|
||||
And I navigate to "Reports > Activity completion" in current page administration
|
||||
And I navigate to "Reports" in current page administration
|
||||
And I select "Activity completion" from the "Report type" singleselect
|
||||
And I click on "Student 1, What to drink?: Completed" "link"
|
||||
And I press "Save changes"
|
||||
And I log out
|
||||
|
|
|
@ -45,7 +45,6 @@ Feature: Multiple option choice response
|
|||
And I log in as "teacher1"
|
||||
And I am on "Course 1" course homepage with editing mode on
|
||||
And I follow "Choice name"
|
||||
And I click on "Actions menu" "link"
|
||||
And I follow "Settings"
|
||||
And I set the following fields to these values:
|
||||
| Limit 1 | 1 |
|
||||
|
|
|
@ -57,7 +57,7 @@ Feature: Anonymous feedback
|
|||
And I set the following fields to these values:
|
||||
| Yes | 1 |
|
||||
And I press "Submit your answers"
|
||||
And I should not see "Submitted answers"
|
||||
And I should not see "Analysis"
|
||||
And I press "Continue"
|
||||
|
||||
@javascript
|
||||
|
@ -89,7 +89,7 @@ Feature: Anonymous feedback
|
|||
And I set the following fields to these values:
|
||||
| No | 1 |
|
||||
And I press "Submit your answers"
|
||||
And I follow "Submitted answers"
|
||||
And I follow "Analysis"
|
||||
And I should see "Submitted answers: 2"
|
||||
And I should see "Questions: 1"
|
||||
# And I should not see "multichoice2" # TODO MDL-29303 do not show labels to users who can not edit feedback
|
||||
|
@ -121,7 +121,7 @@ Feature: Anonymous feedback
|
|||
And I set the following fields to these values:
|
||||
| Yes | 1 |
|
||||
And I press "Submit your answers"
|
||||
And I should not see "Submitted answers"
|
||||
And I should not see "Analysis"
|
||||
And I press "Continue"
|
||||
|
||||
@javascript
|
||||
|
@ -153,7 +153,7 @@ Feature: Anonymous feedback
|
|||
And I set the following fields to these values:
|
||||
| No | 1 |
|
||||
And I press "Submit your answers"
|
||||
And I follow "Submitted answers"
|
||||
And I follow "Analysis"
|
||||
And I should see "Submitted answers: 2"
|
||||
And I should see "Questions: 1"
|
||||
# And I should not see "multichoice2" # TODO MDL-29303
|
||||
|
@ -202,7 +202,7 @@ Feature: Anonymous feedback
|
|||
And I set the following fields to these values:
|
||||
| No | 1 |
|
||||
And I press "Submit your answers"
|
||||
And I follow "Submitted answers"
|
||||
And I follow "Analysis"
|
||||
And I should see "Submitted answers: 2"
|
||||
And I should see "Questions: 1"
|
||||
# And I should not see "multichoice2" # TODO MDL-29303
|
||||
|
@ -274,7 +274,7 @@ Feature: Anonymous feedback
|
|||
And I click on "," "link" in the "Username 1" "table_row"
|
||||
And I should see "(Username 1)"
|
||||
And I should see "usertext"
|
||||
And I follow "Back"
|
||||
And I navigate to "Responses" in current page administration
|
||||
And I follow "Response number: 1"
|
||||
And I should see "Response number: 1 (Anonymous)"
|
||||
Then I should see "anontext"
|
||||
|
|
|
@ -67,7 +67,6 @@ Feature: Mapping courses in a feedback
|
|||
And I am on "Course 1" course homepage
|
||||
And I follow "Another feedback"
|
||||
And I should not see "Mapped courses"
|
||||
And I should not see "Map feedback to courses"
|
||||
|
||||
@javascript
|
||||
Scenario: Site feedback is not mapped to any course
|
||||
|
@ -135,7 +134,7 @@ Feature: Mapping courses in a feedback
|
|||
And I log in as "manager"
|
||||
And I am on site homepage
|
||||
And I follow "Course feedback"
|
||||
And I follow "Map feedback to courses"
|
||||
And I follow "Mapped courses"
|
||||
And I set the field "Courses" to "Course 2, Course 3"
|
||||
And I press "Save changes"
|
||||
And I should see "Course mapping has been changed"
|
||||
|
|
|
@ -87,7 +87,7 @@ Feature: Feedbacks in courses with groups
|
|||
| I don't know | 1 |
|
||||
# View analysis, user1 should only see one group - group 1
|
||||
And I am on the "Course feedback" "feedback activity" page logged in as user1
|
||||
And I follow "Submitted answers"
|
||||
And I follow "Analysis"
|
||||
And I should see "Separate groups: Group 1"
|
||||
And I show chart data for the "multichoice1" feedback
|
||||
And I should see "2 (50.00 %)" in the "Yes of course" "table_row"
|
||||
|
@ -95,7 +95,7 @@ Feature: Feedbacks in courses with groups
|
|||
And I log out
|
||||
# View analysis, user3 should only see one group - group 2
|
||||
And I am on the "Course feedback" "feedback activity" page logged in as user3
|
||||
And I follow "Submitted answers"
|
||||
And I follow "Analysis"
|
||||
And I should see "Separate groups: Group 2"
|
||||
And I show chart data for the "multichoice1" feedback
|
||||
And I should see "0" in the "Yes of course" "table_row"
|
||||
|
@ -103,7 +103,7 @@ Feature: Feedbacks in courses with groups
|
|||
And I log out
|
||||
# View analysis, user2 should see a group selector and be able to change the group but not view all.
|
||||
And I am on the "Course feedback" "feedback activity" page logged in as user2
|
||||
And I follow "Submitted answers"
|
||||
And I follow "Analysis"
|
||||
And the field "Separate groups" matches value "Group 1"
|
||||
And I show chart data for the "multichoice1" feedback
|
||||
And I should see "2 (50.00 %)" in the "Yes of course" "table_row"
|
||||
|
@ -116,7 +116,7 @@ Feature: Feedbacks in courses with groups
|
|||
And I log out
|
||||
# User without group can see all participants only
|
||||
And I am on the "Course feedback" "feedback activity" page logged in as user7
|
||||
And I follow "Submitted answers"
|
||||
And I follow "Analysis"
|
||||
And I should see "Separate groups: All participants"
|
||||
And I show chart data for the "multichoice1" feedback
|
||||
And I should see "2 (28.57 %)" in the "Yes of course" "table_row"
|
||||
|
@ -165,7 +165,7 @@ Feature: Feedbacks in courses with groups
|
|||
And I log in as "user1" and complete feedback "Course anon feedback" in course "Course 1" with:
|
||||
| Not at all | 1 |
|
||||
And I am on the "Course anon feedback" "feedback activity" page logged in as user1
|
||||
And I follow "Submitted answers"
|
||||
And I follow "Analysis"
|
||||
And I should see "There are insufficient responses for this group"
|
||||
And I should not see "Yes of course"
|
||||
And I log out
|
||||
|
@ -183,7 +183,7 @@ Feature: Feedbacks in courses with groups
|
|||
| I don't know | 1 |
|
||||
# View analysis, user1 should only see one group - group 1
|
||||
And I am on the "Course anon feedback" "feedback activity" page logged in as user1
|
||||
And I follow "Submitted answers"
|
||||
And I follow "Analysis"
|
||||
And I should see "Separate groups: Group 1"
|
||||
And I show chart data for the "multichoice1" feedback
|
||||
And I should see "2 (50.00 %)" in the "Yes of course" "table_row"
|
||||
|
@ -191,7 +191,7 @@ Feature: Feedbacks in courses with groups
|
|||
And I log out
|
||||
# View analysis, user3 should only see one group - group 2
|
||||
And I am on the "Course anon feedback" "feedback activity" page logged in as user3
|
||||
And I follow "Submitted answers"
|
||||
And I follow "Analysis"
|
||||
And I should see "Separate groups: Group 2"
|
||||
And I show chart data for the "multichoice1" feedback
|
||||
And I should see "0" in the "Yes of course" "table_row"
|
||||
|
@ -199,7 +199,7 @@ Feature: Feedbacks in courses with groups
|
|||
And I log out
|
||||
# View analysis, user2 should see a group selector and be able to change the group but not view all.
|
||||
And I am on the "Course anon feedback" "feedback activity" page logged in as user2
|
||||
And I follow "Submitted answers"
|
||||
And I follow "Analysis"
|
||||
And the field "Separate groups" matches value "Group 1"
|
||||
And I show chart data for the "multichoice1" feedback
|
||||
And I should see "2 (50.00 %)" in the "Yes of course" "table_row"
|
||||
|
@ -212,7 +212,7 @@ Feature: Feedbacks in courses with groups
|
|||
And I log out
|
||||
# User without group can see all participants only
|
||||
And I am on the "Course anon feedback" "feedback activity" page logged in as user7
|
||||
And I follow "Submitted answers"
|
||||
And I follow "Analysis"
|
||||
And I should see "Separate groups: All participants"
|
||||
And I show chart data for the "multichoice1" feedback
|
||||
And I should see "2 (28.57 %)" in the "Yes of course" "table_row"
|
||||
|
|
|
@ -53,7 +53,7 @@ Feature: Non anonymous feedback
|
|||
And I set the following fields to these values:
|
||||
| Yes of course | 1 |
|
||||
And I press "Submit your answers"
|
||||
And I should not see "Submitted answers"
|
||||
And I should not see "Analysis"
|
||||
And I press "Continue"
|
||||
|
||||
@javascript
|
||||
|
@ -75,7 +75,7 @@ Feature: Non anonymous feedback
|
|||
And I set the following fields to these values:
|
||||
| Not at all | 1 |
|
||||
And I press "Submit your answers"
|
||||
And I follow "Submitted answers"
|
||||
And I follow "Analysis"
|
||||
And I should see "Submitted answers: 2"
|
||||
And I should see "Questions: 1"
|
||||
# And I should not see "multichoice2" # TODO MDL-29303 do not show labels to users who can not edit feedback
|
||||
|
@ -92,7 +92,6 @@ Feature: Non anonymous feedback
|
|||
And I click on "," "link" in the "Username 1" "table_row"
|
||||
And I should see "(Username 1)"
|
||||
And I should see "Yes of course"
|
||||
And I follow "Back"
|
||||
And I log out
|
||||
|
||||
@javascript
|
||||
|
@ -119,7 +118,7 @@ Feature: Non anonymous feedback
|
|||
And I set the following fields to these values:
|
||||
| Not at all | 1 |
|
||||
And I press "Submit your answers"
|
||||
And I follow "Submitted answers"
|
||||
And I follow "Analysis"
|
||||
And I should see "Submitted answers: 2"
|
||||
And I should see "Questions: 1"
|
||||
# And I should not see "multichoice2" # TODO MDL-29303
|
||||
|
|
|
@ -107,6 +107,11 @@ $PAGE->add_body_class('forumtype-' . $forum->get_type());
|
|||
$PAGE->set_heading($course->fullname);
|
||||
$PAGE->add_header_action(forum_search_form($course, $search));
|
||||
|
||||
// MDL-71915 Will remove this place holder.
|
||||
if (defined('BEHAT_SITE_RUNNING')) {
|
||||
$PAGE->has_secondary_navigation_setter(false);
|
||||
}
|
||||
|
||||
if ($istypesingle && $displaymode == FORUM_MODE_NESTED_V2) {
|
||||
$PAGE->add_body_class('nested-v2-display-mode reset-style');
|
||||
$settingstrigger = $OUTPUT->render_from_template('mod_forum/settings_drawer_trigger', null);
|
||||
|
|
|
@ -24,7 +24,7 @@ Feature: Importing glossary entries
|
|||
And I am on "Course 1" course homepage with editing mode on
|
||||
And I add the "Recent activity" block
|
||||
And I am on the "Glossary 1" "glossary activity" page
|
||||
And I navigate to "Import entries" in current page administration
|
||||
And I press "Import entries"
|
||||
And I upload "mod/glossary/tests/fixtures/texfilter_glossary_en.xml" file to "File to import" filemanager
|
||||
When I press "Submit"
|
||||
Then I should see "103" in the "Total entries:" "table_row"
|
||||
|
@ -39,7 +39,7 @@ Feature: Importing glossary entries
|
|||
And I am on "Course 1" course homepage with editing mode on
|
||||
And I add the "Tags" block
|
||||
And I am on the "Glossary 1" "glossary activity" page
|
||||
And I navigate to "Import entries" in current page administration
|
||||
And I press "Import entries"
|
||||
And I upload "mod/glossary/tests/fixtures/musicians.xml" file to "File to import" filemanager
|
||||
When I press "Submit"
|
||||
And I am on "Course 1" course homepage
|
||||
|
|
|
@ -48,7 +48,7 @@ Feature: Change grading options in an H5P activity
|
|||
|
||||
@javascript
|
||||
Scenario: Default grading is max attempt grade
|
||||
Given I am on the "Awesome H5P package" "h5pactivity activity" page logged in as teacher1
|
||||
Given I am on the "Course 1" course page logged in as teacher1
|
||||
When I navigate to "View > User report" in the course gradebook
|
||||
And I set the field "Select all or one user" to "Student 1"
|
||||
Then the following should exist in the "user-grade" table:
|
||||
|
|
|
@ -71,7 +71,9 @@ class behat_mod_lesson_behat extends behat_base {
|
|||
try {
|
||||
$this->execute("behat_general::click_link", [get_string('edit', 'mod_lesson')]);
|
||||
} catch (ElementNotFoundException $e) {
|
||||
$this->execute("behat_general::i_click_on", [get_string('edit', 'mod_lesson'), 'button']);
|
||||
$this->execute("behat_general::i_click_on_in_the",
|
||||
[get_string('edit', 'mod_lesson'), 'button', 'region-main', 'region']
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -43,7 +43,7 @@ Feature: Basic use of the Manual grading report
|
|||
# Check report shows nothing when there are no attempts.
|
||||
When I am on the "Quiz 1" "mod_quiz > View" page logged in as "teacher1"
|
||||
And I navigate to "Results > Manual grading" in current page administration
|
||||
Then I should see "Manual grading"
|
||||
Then I should see "Quiz 1" in the "//nav[contains(concat(' ', normalize-space(@aria-label), ' '), ' Navigation bar ')]" "xpath_element"
|
||||
And I should see "Quiz 1"
|
||||
And I should see "Nothing to display"
|
||||
And I follow "Also show questions that have been graded automatically"
|
||||
|
|
|
@ -50,7 +50,7 @@ Feature: Basic use of the Grades report
|
|||
Scenario: Using the Grades report
|
||||
# Basic check of the Grades report
|
||||
When I am on the "Quiz 1" "quiz activity" page logged in as teacher1
|
||||
And I navigate to "Results > Grades" in current page administration
|
||||
And I navigate to "Results" in current page administration
|
||||
Then I should see "Attempts: 2"
|
||||
# Check student1's grade
|
||||
And I should see "25.00" in the "S1 Student1" "table_row"
|
||||
|
@ -85,6 +85,6 @@ Feature: Basic use of the Grades report
|
|||
Given the following config values are set as admin:
|
||||
| showuseridentity | email,profile_field_fruit |
|
||||
And I am on the "Quiz 1" "quiz activity" page logged in as teacher1
|
||||
And I navigate to "Results > Grades" in current page administration
|
||||
And I navigate to "Results" in current page administration
|
||||
Then I should see "Apple" in the "S1 Student1" "table_row"
|
||||
And I should see "Banana" in the "S2 Student2" "table_row"
|
||||
|
|
|
@ -43,7 +43,7 @@ Feature: Regrading quiz attempts using the Grades report
|
|||
|
||||
Scenario: Regrade all attempts
|
||||
Given I am on the "Quiz for testing regrading" "quiz activity" page logged in as teacher
|
||||
And I navigate to "Results > Grades" in current page administration
|
||||
And I navigate to "Results" in current page administration
|
||||
When I press "Regrade all"
|
||||
|
||||
# Note, the order is not defined, so we can only check part of the message.
|
||||
|
@ -60,7 +60,7 @@ Feature: Regrading quiz attempts using the Grades report
|
|||
|
||||
Scenario: Regrade selected attempts
|
||||
Given I am on the "Quiz for testing regrading" "quiz activity" page logged in as teacher
|
||||
And I navigate to "Results > Grades" in current page administration
|
||||
And I navigate to "Results" in current page administration
|
||||
When I click on "Select attempt" "checkbox" in the "Student Two" "table_row"
|
||||
|
||||
And I press "Regrade selected attempts"
|
||||
|
|
|
@ -86,6 +86,7 @@ Feature: Allow students to redo questions in a practice quiz, without starting a
|
|||
And I switch to the main window
|
||||
And the state of "First question" question is shown as "Not answered"
|
||||
And I should not see "Submit" in the ".history" "css_element"
|
||||
And I am on the "Quiz 1" "mod_quiz > View" page
|
||||
And I navigate to "Results > Statistics" in current page administration
|
||||
And I follow "TF1"
|
||||
And "False" row "Frequency" column of "quizresponseanalysis" table should contain "100.00%"
|
||||
|
|
|
@ -59,7 +59,8 @@ Feature: Set a quiz to be marked complete when the student uses all attempts all
|
|||
And I follow "Test quiz name"
|
||||
And "Test quiz name" should have the "Receive a pass grade or complete all available attempts" completion condition
|
||||
And I am on "Course 1" course homepage
|
||||
And I navigate to "Reports > Activity completion" in current page administration
|
||||
And I navigate to "Reports" in current page administration
|
||||
And I select "Activity completion" from the "Report type" singleselect
|
||||
And "<expectedactivitycompletion>" "icon" should exist in the "Student 1" "table_row"
|
||||
|
||||
Examples:
|
||||
|
|
|
@ -57,5 +57,6 @@ Feature: Set a quiz to be marked complete when the student completes a minimum a
|
|||
And I follow "Test quiz name"
|
||||
And "Test quiz name" should have the "Make attempts: 2" completion condition
|
||||
And I am on "Course 1" course homepage
|
||||
And I navigate to "Reports > Activity completion" in current page administration
|
||||
And I navigate to "Reports" in current page administration
|
||||
And I select "Activity completion" from the "Report type" singleselect
|
||||
And "Completed" "icon" should exist in the "Student 1" "table_row"
|
||||
|
|
|
@ -51,5 +51,6 @@ Feature: Set a quiz to be marked complete when the student passes
|
|||
And I log out
|
||||
And I log in as "teacher1"
|
||||
And I am on "Course 1" course homepage
|
||||
And I navigate to "Reports > Activity completion" in current page administration
|
||||
And I navigate to "Reports" in current page administration
|
||||
And I select "Activity completion" from the "Report type" singleselect
|
||||
And "Completed" "icon" should exist in the "Student 1" "table_row"
|
||||
|
|
|
@ -120,7 +120,7 @@ Feature: Edit quiz page - adding things
|
|||
Then I press "id_submitbutton"
|
||||
And I should see "Subcat 2"
|
||||
|
||||
And I follow "Question bank"
|
||||
And I click on "Questions" "link"
|
||||
Then I should see "Question bank"
|
||||
And I should see "Select a category"
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ Feature: Adding questions to a quiz from the question bank
|
|||
Scenario: The questions can be filtered by tag
|
||||
Given I log in as "teacher1"
|
||||
And I am on "Course 1" course homepage
|
||||
When I navigate to "Question bank > Questions" in current page administration
|
||||
When I navigate to "Question bank" in current page administration
|
||||
And I choose "Edit question" action for "question 01 name" in the question bank
|
||||
And I set the following fields to these values:
|
||||
| Tags | foo |
|
||||
|
|
|
@ -75,7 +75,8 @@ Feature: View activity completion in the quiz activity
|
|||
And I log out
|
||||
And I log in as "teacher1"
|
||||
And I am on "Course 1" course homepage
|
||||
And I navigate to "Reports > Activity completion" in current page administration
|
||||
And I navigate to "Reports" in current page administration
|
||||
And I select "Activity completion" from the "Report type" singleselect
|
||||
And "<expectedactivitycompletion>" "icon" should exist in the "Student 1" "table_row"
|
||||
|
||||
Examples:
|
||||
|
|
|
@ -58,7 +58,6 @@ Feature: Settings form fields disabled if not required
|
|||
| Override user | Student1 |
|
||||
| Attempts allowed | 3 |
|
||||
And I press "Save"
|
||||
And I follow "Test quiz"
|
||||
And I navigate to "Settings" in current page administration
|
||||
And I expand all fieldsets
|
||||
And I set the field "Attempts allowed" to "1"
|
||||
|
@ -72,7 +71,6 @@ Feature: Settings form fields disabled if not required
|
|||
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 follow "Test quiz"
|
||||
And I navigate to "Settings" in current page administration
|
||||
And I expand all fieldsets
|
||||
And I set the field "Attempts allowed" to "1"
|
||||
|
@ -88,7 +86,6 @@ Feature: Settings form fields disabled if not required
|
|||
| Override user | Student2 |
|
||||
| Attempts allowed | Unlimited |
|
||||
And I press "Save"
|
||||
And I follow "Test quiz"
|
||||
And I navigate to "Settings" in current page administration
|
||||
And I expand all fieldsets
|
||||
And I set the field "Attempts allowed" to "1"
|
||||
|
|
|
@ -144,6 +144,11 @@ $title = $course->shortname . ': ' . format_string($quiz->name);
|
|||
$PAGE->set_title($title);
|
||||
$PAGE->set_heading($course->fullname);
|
||||
$output = $PAGE->get_renderer('mod_quiz');
|
||||
// MDL-71915 Will remove this place holder.
|
||||
if (defined('BEHAT_SITE_RUNNING')) {
|
||||
$PAGE->has_secondary_navigation_setter(false);
|
||||
}
|
||||
$PAGE->add_header_action($OUTPUT->region_main_settings_menu());
|
||||
|
||||
// Print table with existing attempts.
|
||||
if ($attempts) {
|
||||
|
|
|
@ -91,6 +91,10 @@ $PAGE->set_title($pagetitle);
|
|||
$PAGE->set_heading($header);
|
||||
$PAGE->has_secondary_navigation_setter(false);
|
||||
|
||||
if ($block = my_page_add_block_center()) {
|
||||
$PAGE->blocks->add_fake_block($block, 'content');
|
||||
}
|
||||
|
||||
if (!isguestuser()) { // Skip default home page for guests
|
||||
if (get_home_page() != HOMEPAGE_MY) {
|
||||
if (optional_param('setdefaulthome', false, PARAM_BOOL)) {
|
||||
|
|
|
@ -70,6 +70,10 @@ $PAGE->set_title($header);
|
|||
$PAGE->set_heading($header);
|
||||
$PAGE->blocks->add_region('content');
|
||||
|
||||
if ($block = my_page_add_block_center()) {
|
||||
$PAGE->blocks->add_fake_block($block, 'content');
|
||||
}
|
||||
|
||||
// Get the My Moodle page info. Should always return something unless the database is broken.
|
||||
if (!$currentpage = my_get_page(null, MY_PAGE_PRIVATE)) {
|
||||
print_error('mymoodlesetup');
|
||||
|
|
32
my/lib.php
32
my/lib.php
|
@ -295,6 +295,38 @@ function my_reset_page_for_all_users(
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Within /my we need to be able to add a block to the center content region directly as well as show
|
||||
* the standard add a block information.
|
||||
*
|
||||
* @return block_contents|null
|
||||
*/
|
||||
function my_page_add_block_center(): ?block_contents {
|
||||
global $PAGE, $OUTPUT;
|
||||
// Add-a-block in editing mode.
|
||||
if (isset($PAGE->theme->addblockposition) &&
|
||||
$PAGE->user_is_editing() &&
|
||||
$PAGE->user_can_edit_blocks() &&
|
||||
!defined('BEHAT_SITE_RUNNING')
|
||||
) {
|
||||
$url = new moodle_url($PAGE->url, ['bui_addblock' => '', 'bui_blockregion' => 'content', 'sesskey' => sesskey()]);
|
||||
|
||||
$block = new block_contents;
|
||||
$block->content = $OUTPUT->render_from_template('core/add_block_button',
|
||||
[
|
||||
'link' => $url->out(false),
|
||||
'escapedlink' => "?{$url->get_query_string(false)}",
|
||||
'pageType' => $PAGE->pagetype,
|
||||
'pageLayout' => $PAGE->pagelayout,
|
||||
]
|
||||
);
|
||||
|
||||
return $block;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
class my_syspage_block_manager extends block_manager {
|
||||
// HACK WARNING!
|
||||
// TODO: figure out a better way to do this
|
||||
|
|
|
@ -27,7 +27,7 @@ Feature: A Teacher can comment in a question
|
|||
Scenario: Add a comment in question
|
||||
Given I log in as "teacher1"
|
||||
And I am on the "Test quiz" "quiz activity" page
|
||||
And I navigate to "Question bank > Questions" in current page administration
|
||||
And I navigate to "Question bank" in current page administration
|
||||
And I set the field "Select a category" to "Test questions"
|
||||
And I should see "0" on the comments column
|
||||
When I click "0" on the row on the comments column
|
||||
|
@ -41,7 +41,7 @@ Feature: A Teacher can comment in a question
|
|||
Scenario: Delete a comment from question
|
||||
Given I log in as "teacher1"
|
||||
And I am on the "Test quiz" "quiz activity" page
|
||||
And I navigate to "Question bank > Questions" in current page administration
|
||||
And I navigate to "Question bank" in current page administration
|
||||
And I set the field "Select a category" to "Test questions"
|
||||
And I should see "0" on the comments column
|
||||
When I click "0" on the row on the comments column
|
||||
|
@ -60,7 +60,7 @@ Feature: A Teacher can comment in a question
|
|||
Scenario: Preview question with comments
|
||||
Given I log in as "teacher1"
|
||||
And I am on the "Test quiz" "quiz activity" page
|
||||
And I navigate to "Question bank > Questions" in current page administration
|
||||
And I navigate to "Question bank" in current page administration
|
||||
And I set the field "Select a category" to "Test questions"
|
||||
And I choose "Preview" action for "First question" in the question bank
|
||||
Then I should see "Save comment"
|
||||
|
@ -86,7 +86,7 @@ Feature: A Teacher can comment in a question
|
|||
And I log out
|
||||
Then I log in as "teacher1"
|
||||
And I am on the "Test quiz" "quiz activity" page
|
||||
And I navigate to "Question bank > Questions" in current page administration
|
||||
And I navigate to "Question bank" in current page administration
|
||||
And I set the field "Select a category" to "Test questions"
|
||||
And I choose "Preview" action for "First question" in the question bank
|
||||
Then I should not see "Save comment"
|
||||
|
@ -104,7 +104,7 @@ Feature: A Teacher can comment in a question
|
|||
And I log out
|
||||
Then I log in as "teacher2"
|
||||
And I am on the "Test quiz" "quiz activity" page
|
||||
And I navigate to "Question bank > Questions" in current page administration
|
||||
And I navigate to "Question bank" in current page administration
|
||||
And I set the field "Select a category" to "Test questions"
|
||||
And I choose "Preview" action for "First question" in the question bank
|
||||
Then I should not see "Save comment"
|
||||
|
|
|
@ -23,10 +23,10 @@ Feature: Use the qbank plugin manager page for comment
|
|||
And I should see "Question comments"
|
||||
And I click on "Disable" "link" in the "Question comments" "table_row"
|
||||
And I am on the "Test quiz" "quiz activity" page
|
||||
And I navigate to "Question bank > Questions" in current page administration
|
||||
And I navigate to "Question bank" in current page administration
|
||||
Then "#categoryquestions .header.commentcount" "css_element" should not be visible
|
||||
And I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
|
||||
And I click on "Enable" "link" in the "Question comments" "table_row"
|
||||
And I am on the "Test quiz" "quiz activity" page
|
||||
And I navigate to "Question bank > Questions" in current page administration
|
||||
And I navigate to "Question bank" in current page administration
|
||||
And "#categoryquestions .header.commentcount" "css_element" should be visible
|
||||
|
|
|
@ -24,13 +24,13 @@ Feature: Use the qbank plugin manager page for deletequestion
|
|||
And I click on "Disable" "link" in the "Delete question" "table_row"
|
||||
And I am on the "Test quiz" "quiz activity" page
|
||||
And I navigate to "Question bank > Questions" in current page administration
|
||||
And I click on "#action-menu-toggle-2" "css_element" in the "First question" "table_row"
|
||||
And I click on "#action-menu-toggle-1" "css_element" in the "First question" "table_row"
|
||||
Then I should not see "Delete" in the "region-main" "region"
|
||||
And I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
|
||||
And I click on "Enable" "link" in the "Delete question" "table_row"
|
||||
And I am on the "Test quiz" "quiz activity" page
|
||||
And I navigate to "Question bank > Questions" in current page administration
|
||||
And I click on "#action-menu-toggle-2" "css_element" in the "First question" "table_row"
|
||||
And I click on "#action-menu-toggle-1" "css_element" in the "First question" "table_row"
|
||||
And I should see "Delete" in the "region-main" "region"
|
||||
|
||||
@javascript
|
||||
|
|
|
@ -22,12 +22,12 @@ Feature: Use the qbank plugin manager page for exporttoxml
|
|||
And I should see "Export to XML"
|
||||
And I click on "Disable" "link" in the "Export to XML" "table_row"
|
||||
And I am on the "Test quiz" "quiz activity" page
|
||||
And I navigate to "Question bank > Questions" in current page administration
|
||||
And I click on "#action-menu-toggle-2" "css_element" in the "First question" "table_row"
|
||||
And I navigate to "Question bank" in current page administration
|
||||
And I click on "#action-menu-toggle-1" "css_element" in the "First question" "table_row"
|
||||
Then I should not see "Export as Moodle XML"
|
||||
And I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
|
||||
And I click on "Enable" "link" in the "Export to XML" "table_row"
|
||||
And I am on the "Test quiz" "quiz activity" page
|
||||
And I navigate to "Question bank > Questions" in current page administration
|
||||
And I click on "#action-menu-toggle-2" "css_element" in the "First question" "table_row"
|
||||
And I navigate to "Question bank" in current page administration
|
||||
And I click on "#action-menu-toggle-1" "css_element" in the "First question" "table_row"
|
||||
And I should see "Export as Moodle XML"
|
||||
|
|
|
@ -25,7 +25,7 @@ Feature: A teacher can preview questions in the question bank
|
|||
| Test questions | numerical | Test question to be previewed |
|
||||
And I log in as "teacher1"
|
||||
And I am on the "Test quiz" "quiz activity" page
|
||||
And I navigate to "Question bank > Questions" in current page administration
|
||||
And I navigate to "Question bank" in current page administration
|
||||
When I choose "Preview" action for "Test question to be previewed" in the question bank
|
||||
|
||||
Scenario: Question preview shows the question and other information
|
||||
|
|
|
@ -22,15 +22,17 @@ Feature: Use the qbank plugin manager page for previewquestion
|
|||
When I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
|
||||
And I should see "Preview question"
|
||||
And I click on "Disable" "link" in the "Preview question" "table_row"
|
||||
And I am on the "C1" "Course" page
|
||||
And I am on the "Test quiz" "quiz activity" page
|
||||
And I navigate to "Question bank > Questions" in current page administration
|
||||
And I click on "#action-menu-toggle-2" "css_element" in the "First question" "table_row"
|
||||
And I navigate to "Question bank" in current page administration
|
||||
And I click on ".action-menu" "css_element" in the "First question" "table_row"
|
||||
Then I should not see "Preview" in the "region-main" "region"
|
||||
And I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
|
||||
And I click on "Enable" "link" in the "Preview question" "table_row"
|
||||
And I am on the "C1" "Course" page
|
||||
And I am on the "Test quiz" "quiz activity" page
|
||||
And I navigate to "Question bank > Questions" in current page administration
|
||||
And I click on "#action-menu-toggle-2" "css_element" in the "First question" "table_row"
|
||||
And I navigate to "Question bank" in current page administration
|
||||
And I click on ".action-menu" "css_element" in the "First question" "table_row"
|
||||
And I should see "Preview" in the "region-main" "region"
|
||||
|
||||
Scenario: Enable/disable preview button from question edit form
|
||||
|
@ -39,12 +41,12 @@ Feature: Use the qbank plugin manager page for previewquestion
|
|||
And I should see "Preview question"
|
||||
And I click on "Disable" "link" in the "Preview question" "table_row"
|
||||
And I am on the "Test quiz" "quiz activity" page
|
||||
And I navigate to "Question bank > Questions" in current page administration
|
||||
And I navigate to "Question bank" in current page administration
|
||||
And I choose "Edit question" action for "First question" in the question bank
|
||||
Then I should not see "Preview" in the "region-main" "region"
|
||||
And I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
|
||||
And I click on "Enable" "link" in the "Preview question" "table_row"
|
||||
And I am on the "Test quiz" "quiz activity" page
|
||||
And I navigate to "Question bank > Questions" in current page administration
|
||||
And I navigate to "Question bank" in current page administration
|
||||
And I choose "Edit question" action for "First question" in the question bank
|
||||
And I should see "Preview" in the "region-main" "region"
|
||||
|
|
|
@ -22,14 +22,14 @@ Feature: Use the qbank plugin manager page for tagquestion
|
|||
And I should see "Tag question"
|
||||
And I click on "Disable" "link" in the "Tag question" "table_row"
|
||||
And I am on the "Test quiz" "quiz activity" page
|
||||
And I navigate to "Question bank > Questions" in current page administration
|
||||
And I click on "#action-menu-toggle-2" "css_element" in the "First question" "table_row"
|
||||
And I navigate to "Question bank" in current page administration
|
||||
And I click on "#action-menu-toggle-1" "css_element" in the "First question" "table_row"
|
||||
Then I should not see "Manage tags"
|
||||
And I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
|
||||
And I click on "Enable" "link" in the "Tag question" "table_row"
|
||||
And I am on the "Test quiz" "quiz activity" page
|
||||
And I navigate to "Question bank > Questions" in current page administration
|
||||
And I click on "#action-menu-toggle-2" "css_element" in the "First question" "table_row"
|
||||
And I navigate to "Question bank" in current page administration
|
||||
And I click on "#action-menu-toggle-1" "css_element" in the "First question" "table_row"
|
||||
And I should see "Manage tags"
|
||||
|
||||
Scenario: Enable/disable tagquestion section from question edit form
|
||||
|
@ -38,12 +38,12 @@ Feature: Use the qbank plugin manager page for tagquestion
|
|||
And I should see "Tag question"
|
||||
And I click on "Disable" "link" in the "Tag question" "table_row"
|
||||
And I am on the "Test quiz" "quiz activity" page
|
||||
And I navigate to "Question bank > Questions" in current page administration
|
||||
And I navigate to "Question bank" in current page administration
|
||||
And I choose "Edit question" action for "First question" in the question bank
|
||||
Then I should not see "Tags" in the "region-main" "region"
|
||||
And I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
|
||||
And I click on "Enable" "link" in the "Tag question" "table_row"
|
||||
And I am on the "Test quiz" "quiz activity" page
|
||||
And I navigate to "Question bank > Questions" in current page administration
|
||||
And I navigate to "Question bank" in current page administration
|
||||
And I choose "Edit question" action for "First question" in the question bank
|
||||
And I should see "Tags" in the "region-main" "region"
|
||||
|
|
|
@ -22,12 +22,12 @@ Feature: Use the qbank plugin manager page for viewcreator plugin
|
|||
And I should see "View creator"
|
||||
When I click on "Disable" "link" in the "View creator" "table_row"
|
||||
And I am on the "Test quiz" "quiz activity" page
|
||||
And I navigate to "Question bank > Questions" in current page administration
|
||||
And I navigate to "Question bank" in current page administration
|
||||
Then I should not see "Created by"
|
||||
And I should not see "Last modified by"
|
||||
And I navigate to "Plugins > Question bank plugins > Manage question bank plugins" in site administration
|
||||
And I click on "Enable" "link" in the "View creator" "table_row"
|
||||
And I am on the "Test quiz" "quiz activity" page
|
||||
And I navigate to "Question bank > Questions" in current page administration
|
||||
And I navigate to "Question bank" in current page administration
|
||||
Then I should see "Created by"
|
||||
And I should see "Last modified by"
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue