Merge branch 'MDL-72179-master' of git://github.com/andrewnicols/moodle

This commit is contained in:
Ilya Tregubov
2021-07-27 12:36:38 +02:00
175 changed files with 1999 additions and 3004 deletions
@@ -48,7 +48,7 @@ Feature: Verify that all form fields values can be get and set
And the "Unenrol users" select box should not contain "Baker"
And the "Unenrol users" select box should not contain "President, Baker"
And I am on "Course 1" course homepage with editing mode on
And I follow "Test this one"
And I am on the "Test this one" "wiki activity" page
And I press "Create page"
# Text (textarea & editor) & Select (multi-select) - Checking "I set the following fields to these values".
When I set the following fields to these values:
@@ -61,8 +61,7 @@ Feature: Verify that all form fields values can be get and set
# Checkbox - Checking "I set the field" and "The field matches value" ticked.
And I set the field "Force format" to "1"
And I press "Save and return to course"
And I should see "Test this one"
And I follow "Test this one"
And I am on the "Test this one" "wiki activity" page
And I navigate to "Edit settings" in current page administration
And I expand all fieldsets
And the field "Force format" matches value "1"
@@ -70,8 +69,7 @@ Feature: Verify that all form fields values can be get and set
# Checkbox - Checking "I set the field" and "The field matches value" unticked.
And I set the field "Force format" to ""
And I press "Save and return to course"
And I should see "Test this one"
And I follow "Test this one"
And I am on the "Test this one" "wiki activity" page
And I navigate to "Edit settings" in current page administration
And I expand all fieldsets
And the field "Force format" matches value ""
@@ -80,8 +78,7 @@ Feature: Verify that all form fields values can be get and set
And I set the following fields to these values:
| Force format | 1 |
And I press "Save and return to course"
And I should see "Test this one"
And I follow "Test this one"
And I am on the "Test this one" "wiki activity" page
And I navigate to "Edit settings" in current page administration
And I expand all fieldsets
And the following fields match these values:
@@ -92,8 +89,7 @@ Feature: Verify that all form fields values can be get and set
And I set the following fields to these values:
| Force format | |
And I press "Save and return to course"
And I should see "Test this one"
And I follow "Test this one"
And I am on the "Test this one" "wiki activity" page
And I navigate to "Edit settings" in current page administration
And I expand all fieldsets
And the following fields match these values:
@@ -126,14 +122,13 @@ Feature: Verify that all form fields values can be get and set
| section | 1 |
| allowupdate | 1 |
And I am on "Course 1" course homepage
And I follow "Test choice name"
And I navigate to "Edit settings" in current page administration
And I am on the "Test choice name" "choice activity editing" page
And I set the field "Option 1" to "one"
And I set the field "Option 2" to "two"
And I set the field "Option 3" to "three"
And I press "Save and return to course"
And I am on "Course 1" course homepage
And I follow "Test choice name"
And I am on the "Test choice name" "choice activity" page
And I set the field "one" to "1"
And I press "Save my choice"
And the field "one" matches value "1"
@@ -183,31 +178,23 @@ Feature: Verify that all form fields values can be get and set
And I press "Cancel"
# Advanced checkbox requires real browser to allow uncheck to work. MDL-58681. MDL-55386.
# Advanced checkbox - Checking "I set the field" and "The field matches value" ticked.
And I am on "Course 1" course homepage
And I follow "Test this one"
And I navigate to "Edit settings" in current page administration
And I am on the "Test choice name" "choice activity editing" page
And I set the field "Display description on course page" to "1"
And I press "Save and return to course"
And I should see "Test this one"
And I follow "Test this one"
And I navigate to "Edit settings" in current page administration
And I am on the "Test choice name" "choice activity editing" page
And the field "Display description on course page" matches value "1"
And the field "Display description on course page" does not match value ""
# Advanced checkbox - Checking "I set the field" and "The field matches value" unticked.
And I set the field "Display description on course page" to ""
And I press "Save and return to course"
And I should see "Test this one"
And I follow "Test this one"
And I navigate to "Edit settings" in current page administration
And I am on the "Test choice name" "choice activity editing" page
And the field "Display description on course page" matches value ""
And the field "Display description on course page" does not match value "1"
# Advanced checkbox - Checking "I set the following fields to these values:" and "The following fields match these values" ticked.
And I set the following fields to these values:
| Display description on course page | 1 |
And I press "Save and return to course"
And I should see "Test this one"
And I follow "Test this one"
And I navigate to "Edit settings" in current page administration
And I am on the "Test choice name" "choice activity editing" page
And the following fields match these values:
| Display description on course page | 1 |
And the following fields do not match these values:
@@ -216,9 +203,7 @@ Feature: Verify that all form fields values can be get and set
And I set the following fields to these values:
| Display description on course page | |
And I press "Save and return to course"
And I should see "Test this one"
And I follow "Test this one"
And I navigate to "Edit settings" in current page administration
And I am on the "Test choice name" "choice activity editing" page
And the following fields match these values:
| Display description on course page | |
And the following fields do not match these values:
@@ -0,0 +1,85 @@
@tool @tool_behat
Feature: Use core page resolvers for the I am on the page steps
In order to write tests correctly
As a developer
I need to have steps which take me straight to a page
Scenario Outline: When I am on an instance
Given the following "categories" exist:
| name | category | idnumber |
| Cat 1 | 0 | CAT1 |
And the following "course" exists:
| fullname | Economics 101 |
| shortname | ECON101 |
| idnumber | 2021-econ101 |
And the following "activity" exists:
| course | ECON101 |
| activity | forum |
| name | Fundamentals of Economics |
| idnumber | fundamentalsofeconomics |
And I log in as "admin"
When I am on the <identifier> <type> page
Then I should see "<shouldsee>"
Examples:
| description | identifier | type | shouldsee |
| Course Category idnumber | CAT1 | category | Add a new course |
| Course Category name | "Cat 1" | Category | Add a new course |
| Course Full name | "Economics 101" | course | Fundamentals of Economics |
| Course Short name | ECON101 | COURSE | Fundamentals of Economics |
| Course idnumber | "2021-econ101" | Course | Fundamentals of Economics |
| Forum idnumber | fundamentalsofeconomics | Activity | Add a new discussion |
| Generic activity editing | fundamentalsofeconomics | "Activity editing" | Updating: Forum |
| Forum name | "Fundamentals of Economics" | "Forum activity" | Add a new discussion |
| Forum name editing | "Fundamentals of Economics" | "Forum activity editing" | Updating: Forum |
| Forum name permissions | "Fundamentals of Economics" | "Forum activity permissions" | Permissions in Forum: Fun |
| Forum name roles | "Fundamentals of Economics" | "Forum activity roles" | Assign roles in Forum: Fun |
Scenario Outline: When I am on an instance logged in as
Given the following "categories" exist:
| name | category | idnumber |
| Cat 1 | 0 | CAT1 |
And the following "course" exists:
| fullname | Economics 101 |
| shortname | ECON101 |
| idnumber | 2021-econ101 |
And the following "activity" exists:
| course | ECON101 |
| activity | forum |
| name | Fundamentals of Economics |
| idnumber | fundamentalsofeconomics |
When I am on the <identifier> <type> page logged in as admin
Then I should see "<shouldsee>"
Examples:
| description | identifier | type | shouldsee |
| Course Category idnumber | CAT1 | category | Add a new course |
| Course Category name | "Cat 1" | Category | Add a new course |
| Course Full name | "Economics 101" | course | Fundamentals of Economics |
| Course Short name | ECON101 | COURSE | Fundamentals of Economics |
| Course idnumber | "2021-econ101" | Course | Fundamentals of Economics |
| Forum idnumber | fundamentalsofeconomics | Activity | Add a new discussion |
| Generic activity editing | fundamentalsofeconomics | "Activity editing" | Updating: Forum |
| Forum name | "Fundamentals of Economics" | "Forum activity" | Add a new discussion |
| Forum name editing | "Fundamentals of Economics" | "Forum activity editing" | Updating: Forum |
| Forum name permissions | "Fundamentals of Economics" | "Forum activity permissions" | Permissions in Forum: Fun |
| Forum name roles | "Fundamentals of Economics" | "Forum activity roles" | Assign roles in Forum: Fun |
Scenario Outline: When I am on a named page
Given I log in as "admin"
When I am on the <identifier> page
Then I should see "<shouldsee>"
Examples:
| description | identifier | shouldsee |
| Admin page | "Admin notifications" | Check for available updates |
| Home page | Homepage | Recently accessed courses |
Scenario Outline: When I am on a named page logged in as
When I am on the <identifier> page logged in as admin
Then I should see "<shouldsee>"
Examples:
| description | identifier | shouldsee |
| Admin page | "Admin notifications" | Check for available updates |
| Home page | Homepage | Recently accessed courses |
@@ -24,9 +24,7 @@ Feature: See the competencies for an activity on the course competencies page.
| activity | name | intro | course | idnumber | completion | completionview |
| page | PageName1 | PageDesc1 | C1 | PAGE1 | 1 | 1 |
| page | PageName2 | PageDesc2 | C1 | PAGE2 | 1 | 1 |
And I log in as "admin"
And I am on site homepage
And I follow "Course 1"
And I am on the "Course 1" course page logged in as admin
And I follow "Competencies"
And I press "Add competencies to course"
And "Competency picker" "dialogue" should be visible
@@ -36,9 +34,7 @@ Feature: See the competencies for an activity on the course competencies page.
And "Competency picker" "dialogue" should be visible
And I select "Test-Comp2" of the competency tree
And I click on "Add" "button" in the "Competency picker" "dialogue"
And I am on "Course 1" course homepage
And I follow "PageName1"
And I navigate to "Edit settings" in current page administration
And I am on the PageName1 "page activity editing" page
And I follow "Expand all"
And I set the field "Course competencies" to "Test-Comp1"
And I press "Save and return to course"
@@ -46,10 +42,8 @@ Feature: See the competencies for an activity on the course competencies page.
@javascript
Scenario: Go to the competency course competencies page.
When I log in as "student1"
And I am on site homepage
And I follow "Course 1"
And I follow "Competencies"
Given I am on the "Course 1" course page logged in as student1
When I follow "Competencies"
Then I should see "Test-Comp1"
And I should see "Test-Comp2"
And I set the field "Filter competencies by resource or activity" to "PageName1"
@@ -64,12 +58,5 @@ Feature: See the competencies for an activity on the course competencies page.
@javascript
Scenario: None course competencies page.
When I log in as "student1"
And I am on site homepage
And I follow "Course 1"
And I follow "PageName1"
Then I should see "Test page content"
And I am on site homepage
And I follow "Course 1"
And I follow "PageName1"
When I am on the PageName1 "page activity" page logged in as student1
Then I should see "Test page content"
@@ -42,9 +42,7 @@ Feature: Backup user data
| Feedback for the response 'True'. | So you think it is true |
| Feedback for the response 'False'. | So you think it is false |
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Quiz 1"
When I am on the "Quiz 1" "quiz activity" page logged in as student1
And I press "Attempt quiz now"
And I click on "True" "radio" in the "First question" "question"
And I click on "False" "radio" in the "Second question" "question"
@@ -48,10 +48,10 @@ Feature: Confirm that conditions on completion no longer cause a bug
And I click on "Activity completion" "button" in the "Add restriction..." "dialogue"
And I set the field with xpath "//div[contains(concat(' ', normalize-space(@class), ' '), ' availability-item ')][preceding-sibling::div]//select[@name='cm']" to "Page2"
And I press "Save and return to course"
And I should see "Not available unless:" in the ".activity.glossary" "css_element"
Then I should see "Not available unless:" in the ".activity.glossary" "css_element"
And I should see "The activity Page1 is marked complete" in the ".activity.glossary" "css_element"
And I should see "The activity Page2 is marked complete" in the ".activity.glossary" "css_element"
And I follow "TestGlossary"
# Behat will automatically check there is no error on this page.
Then I should see "TestGlossary"
And I am on the TestGlossary "glossary activity" page
And I should see "TestGlossary"
@@ -86,13 +86,12 @@ Feature: availability_grade
And I set the field "Minimum grade percentage (inclusive)" to "10"
And I press "Save and return to course"
And I log out
# Log in as student without a grade yet.
When I log out
And I log in as "student1"
And I am on "Course 1" course homepage
When I am on the "A1" "assign activity" page logged in as student1
# Do the assignment.
And I follow "A1"
And I click on "Add submission" "button"
And I set the field "Online text" to "Q"
And I click on "Save changes" "button"
@@ -103,25 +102,22 @@ Feature: availability_grade
And I should not see "P3" in the "region-main" "region"
And I should not see "P4" in the "region-main" "region"
And I should see "A1" in the "region-main" "region"
And I log out
# Log back in as teacher.
When I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
When I am on the "A1" "assign activity" page logged in as teacher1
# Give the assignment 40%.
And I follow "A1"
And I navigate to "View all submissions" in current page administration
# Pick the grade link in the row that has [email protected] in it.
And I click on "Grade" "link" in the "s@example.com" "table_row"
And I set the field "Grade out of 100" to "40"
And I click on "Save changes" "button"
And I click on "Edit settings" "link"
And I log out
# Log back in as student.
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I am on the "Course 1" course page logged in as student1
# Check pages are visible.
Then I should see "P2" in the "region-main" "region"
@@ -96,8 +96,7 @@ Feature: availability_profile
And I click on "Save and return to course" "button"
# Edit it again and check the setting still works.
When I follow "P1"
And I navigate to "Edit settings" in current page administration
When I am on the P1 "page activity editing" page
And I expand all fieldsets
Then the field "User profile field" matches value "Super field"
And the field "Value to compare against" matches value "Bananaman"
+5 -5
View File
@@ -51,19 +51,19 @@ Feature: Award badges based on activity completion
And I log out
Scenario: Student earns a badge using activity completion, but does not get passing grade
When I log in as "student1"
Given I log in as "student1"
And I am on "Course 1" course homepage
And the "Receive a grade" completion condition of "Test quiz name" is displayed as "failed"
And the "Receive a pass grade or complete all available attempts" completion condition of "Test quiz name" is displayed as "todo"
And I follow "Test quiz name"
When I am on the "Test quiz name" "quiz activity" page
And I press "Re-attempt quiz"
And I set the field "False" to "1"
And I press "Finish attempt ..."
And I press "Submit all and finish"
And I click on "Submit all and finish" "button" in the "Confirmation" "dialogue"
And I log out
Then I log in as "teacher1"
And I am on "Course 1" course homepage
And I am on the "Course 1" course page logged in as teacher1
And I navigate to "Badges > Manage badges" in current page administration
And I follow "Course Badge"
And I should see "Recipients (1)"
Then I should see "Recipients (1)"
@@ -27,9 +27,7 @@ Feature: Course overview block show users their progress on courses
Then I should not see "0%" in the "Course overview" "block"
Scenario: User complete activity and verify his progress
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I follow "Test choice 1"
Given I am on the "Test choice 1" "choice activity" page logged in as teacher1
And I navigate to "Edit settings" in current page administration
And I set the following fields to these values:
| Completion tracking | Show activity as complete when conditions are met |
@@ -40,8 +38,8 @@ Feature: Course overview block show users their progress on courses
And I click on "All (except removed from view)" "button" in the "Course overview" "block"
Then I should see "Course 1" in the "Course overview" "block"
And I should see "0%" in the "Course overview" "block"
And I am on "Course 1" course homepage
And I follow "Test choice 1"
And I am on the "Test choice 1" "choice activity" page
And I follow "Dashboard" in the user menu
And I click on "All (except removed from view)" "button" in the "Course overview" "block"
And I should see "100%" in the "Course overview" "block"
@@ -19,7 +19,7 @@ Feature: The private files block allows users to store files privately in moodle
| page | C1 | page1 | Test page name | Test page description |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I follow "Test page name"
And I am on the "Test page name" "page activity" page
And I add the "Private files" block
And I should see "No files available" in the "Private files" "block"
When I follow "Manage private files..."
@@ -16,24 +16,20 @@ Feature: The recently accessed items block allows users to easily access their m
| user | course | role |
| student1 | C1 | student |
| student1 | C2 | student |
And I log in as "admin"
And I am on "Course 1" course homepage
And I turn editing mode on
And I add a "Forum" to section "1" and I fill the form with:
| Forum name | Test forum name |
| Forum type | Standard forum for general use |
| Description | Test forum description |
And I log out
And the following "activity" exists:
| course | C1 |
| activity | forum |
| idnumber | Test forum name |
| name | Test forum name |
And I log in as "student1"
When I press "Customise this page"
And I press "Customise this page"
And I add the "Recently accessed items" block
Scenario: User has not accessed any item
Then I should see "No recent items" in the "Recently accessed items" "block"
Scenario: User has accessed some items
Given I am on "Course 1" course homepage
When I follow "Test forum name"
Given I change window size to "large"
When I am on the "Test forum name" "forum activity" page
And I follow "Dashboard" in the user menu
And I change window size to "large"
Then I should see "Test forum name" in the "Recently accessed items" "block"
@@ -36,12 +36,10 @@ Feature: Restrict activity availability through date conditions
| x[year] | 2037 |
And I press "Save and return to course"
And I log out
When I log in as "student1"
And I am on "Course 1" course homepage
When I am on the "Course 1" course page logged in as student1
Then I should see "Available from 31 December 2037"
And "Test assignment 1" "link" should not exist in the "page" "region"
And "Test assignment 1" activity should be dimmed
And "Test assignment 1" "link" should not exist
And I log out
@javascript
Scenario: Show activity hidden to students when available until date is in past
@@ -60,6 +58,5 @@ Feature: Restrict activity availability through date conditions
And I click on ".availability-item .availability-eye img" "css_element"
And I press "Save and return to course"
And I log out
When I log in as "student1"
And I am on "Course 1" course homepage
Then I should not see "Test assignment 2"
When I am on the "Course 1" course page logged in as student1
Then I should not see "Test assignment 2" in the "page" "region"
@@ -17,13 +17,16 @@ Feature: Restrict activity availability through grade conditions
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And I log in as "teacher1"
And the following "activity" exists:
| course | C1 |
| activity | assign |
| idnumber | Grade assignment |
| name | Grade assignment |
| assignsubmission_onlinetext_enabled | 1 |
| assignsubmission_file_enabled | 0 |
| submissiondrafts | 0 |
And I am on the "Course 1" course page logged in as teacher1
And I am on "Course 1" course homepage with editing mode on
And I add a "Assignment" to section "1" and I fill the form with:
| Assignment name | Grade assignment |
| Description | Grade this assignment to revoke restriction on restricted assignment |
| assignsubmission_onlinetext_enabled | 1 |
| assignsubmission_file_enabled | 0 |
# Adding the page like this because id_availableform_enabled needs to be clicked to trigger the action.
And I add a "Page" to section "2"
And I expand all fieldsets
@@ -31,15 +34,15 @@ Feature: Restrict activity availability through grade conditions
And I click on "Grade" "button" in the "Add restriction..." "dialogue"
And I click on "min" "checkbox"
And I set the following fields to these values:
| Name | Test page name |
| Description | Restricted page, till grades in Grade assignment is at least 20% |
| Page content | Test page contents |
| id | Grade assignment |
| minval | 20 |
| Name | Test page name |
| Description | Restricted page, till grades in Grade assignment is at least 20% |
| Page content | Test page contents |
| id | Grade assignment |
| minval | 20 |
And I press "Save and return to course"
And I log out
When I log in as "student1"
And I am on "Course 1" course homepage
When I am on the "Course 1" course page logged in as student1
Then I should see "Not available unless: You achieve a required score in Grade assignment"
And "Test page name" activity should be dimmed
And "Test page name" "link" should not exist
@@ -50,9 +53,8 @@ Feature: Restrict activity availability through grade conditions
And I press "Save changes"
And I should see "Submitted for grading"
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Grade assignment"
And I am on the "Grade assignment" "assign activity" page logged in as teacher1
And I navigate to "View all submissions" in current page administration
And I click on "Grade" "link" in the "Student First" "table_row"
And I set the following fields to these values:
@@ -60,7 +62,7 @@ Feature: Restrict activity availability through grade conditions
And I press "Save changes"
And I follow "Edit settings"
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I am on the "Course 1" course page logged in as student1
And "Test page name" activity should be visible
And I should not see "Not available unless: You achieve a required score in Grade assignment"
@@ -76,16 +76,14 @@ Feature: Restrict sections availability through completion or grade conditions
And I am on "Course 1" course homepage
Then I should see "Not available unless: You achieve a required score in Grade assignment"
And "Test page name" activity should be hidden
And I follow "Grade assignment"
And I am on the "Grade assignment" "assign activity" page
And I press "Add submission"
And I set the following fields to these values:
| Online text | I'm the student submission |
And I press "Save changes"
And I should see "Submitted for grading"
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Grade assignment"
And I am on the "Grade assignment" "assign activity" page logged in as teacher1
And I navigate to "View all submissions" in current page administration
And I click on "Grade" "link" in the "Student First" "table_row"
And I set the following fields to these values:
@@ -93,7 +91,6 @@ Feature: Restrict sections availability through completion or grade conditions
And I press "Save changes"
And I follow "Edit settings"
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I am on the "Course 1" Course page logged in as student1
And "Test page name" activity should be visible
And I should not see "Not available unless: You achieve a required score in Grade assignment"
@@ -11,25 +11,23 @@ Feature: Edit completion settings of an activity
And the following "activities" exist:
| activity | course | idnumber | intro | name | completion | completionview |
| page | C1 | p1 | x | TestPage | 2 | 1 |
And I log in as "admin"
And I am on "Course 1" course homepage with editing mode on
Scenario: Completion is not locked when the activity has not yet been viewed
Given I click on "Edit settings" "link" in the "TestPage" activity
Given I am on the TestPage "Page Activity editing" page logged in as admin
When I expand all fieldsets
Then I should see "Completion tracking"
And I should not see "Completion options locked"
Scenario: Completion is locked after the activity has been viewed
Given I follow "TestPage"
When I follow "Edit settings"
Given I am on the TestPage "Page Activity" page logged in as admin
When I am on the TestPage "Page Activity editing" page
And I expand all fieldsets
Then I should see "Completion options locked"
@javascript
Scenario: Pressing the unlock button allows the user to edit completion settings
Given I follow "TestPage"
When I navigate to "Edit settings" in current page administration
Given I am on the TestPage "Page Activity" page logged in as admin
When I am on the TestPage "Page Activity editing" page
And I expand all fieldsets
And I press "Unlock completion options"
Then I should see "Completion options unlocked"
@@ -41,8 +39,8 @@ Feature: Edit completion settings of an activity
@javascript
Scenario: Even when completion is locked, the user can still set the date
Given I follow "TestPage"
When I navigate to "Edit settings" in current page administration
Given I am on the TestPage "Page Activity" page logged in as admin
And I am on the TestPage "Page Activity editing" page
And I expand all fieldsets
When I click on "id_completionexpected_enabled" "checkbox"
And I set the field "id_completionexpected_year" to "2013"
@@ -45,9 +45,7 @@ Feature: Activity navigation involving activities with access restrictions
@javascript
Scenario: Activity navigation involving activities with access restrictions
Given I log in as "student1"
And I am on "Course 1" course homepage
When I follow "Page 1"
Given I am on the "Page 1" "page activity" page logged in as student1
Then I should see "Page 2" in the "#next-activity-link" "css_element"
# Activity that has access restriction should not show up in the dropdown.
And the "Jump to..." select box should not contain "Page 3"
@@ -56,7 +54,7 @@ Feature: Activity navigation involving activities with access restrictions
And I should see "Page 2" in the "#prev-activity-link" "css_element"
And the "Jump to..." select box should not contain "Page 3"
# Navigate to Page 2.
And I follow "Page 2"
And I click on "Page 2" "link" in the "page-content" "region"
# Since Page 2 has now been viewed and deemed completed, Page 3 can now be accessed.
And I should see "Page 3" in the "#next-activity-link" "css_element"
And the "Jump to..." select box should contain "Page 3"
-38
View File
@@ -1330,44 +1330,6 @@ class behat_course extends behat_base {
return $this->getSession()->getPage()->findButton(get_string('turneditingoff')) ? true : false;
}
/**
* Returns the id of the category with the given idnumber.
*
* Please note that this function requires the category to exist. If it does not exist an ExpectationException is thrown.
*
* @param string $idnumber
* @return string
* @throws ExpectationException
*/
protected function get_category_id($idnumber) {
global $DB;
try {
return $DB->get_field('course_categories', 'id', array('idnumber' => $idnumber), MUST_EXIST);
} catch (dml_missing_record_exception $ex) {
throw new ExpectationException(sprintf("There is no category in the database with the idnumber '%s'", $idnumber),
$this->getSession());
}
}
/**
* Returns the id of the course with the given idnumber.
*
* Please note that this function requires the category to exist. If it does not exist an ExpectationException is thrown.
*
* @param string $idnumber
* @return string
* @throws ExpectationException
*/
protected function get_course_id($idnumber) {
global $DB;
try {
return $DB->get_field('course', 'id', array('idnumber' => $idnumber), MUST_EXIST);
} catch (dml_missing_record_exception $ex) {
throw new ExpectationException(sprintf("There is no course in the database with the idnumber '%s'", $idnumber),
$this->getSession());
}
}
/**
* Returns the category node from within the listing on the management page.
*
+2 -5
View File
@@ -20,15 +20,12 @@ Feature: Managers can create courses
When I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add the "Latest announcements" block
Then "Latest announcements" "block" should exist
And I follow "Announcements"
And I am on the Announcements "forum activity" page
And "Add a new topic" "link" should exist
And "Subscription mode > Forced subscription" "link" should not exist in current page administration
And "Subscription mode > Forced subscription" "text" should exist in current page administration
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Announcements"
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
@@ -20,8 +20,7 @@ Feature: View subfolders in a course in-line
| Name | Test folder |
| Display folder contents | On a separate page |
| Show subfolders expanded | |
And I should see "Test folder"
And I follow "Test folder"
And I am on the "Test folder" "folder activity" page
And I press "Edit"
And I press "Create folder"
And I set the field "New folder name" to "Test subfolder 1"
@@ -32,7 +31,7 @@ Feature: View subfolders in a course in-line
Scenario: Add a folder with two subfolders - view on separate page
Given I am on "Course 1" course homepage
And I should not see "Test subfolder 1"
And I follow "Test folder"
And I am on the "Test folder" "folder activity" page
And I should see "Test subfolder 1"
And I press "Edit"
And I press "Create folder"
@@ -41,13 +40,13 @@ Feature: View subfolders in a course in-line
And I press "Save changes"
When I am on "Course 1" course homepage
Then I should not see "Test subfolder 2"
And I follow "Test folder"
And I am on the "Test folder" "folder activity" page
And I should see "Test subfolder 2"
Given I navigate to "Edit settings" in current page administration
And I am on the "Test folder" "folder activity editing" page
And I set the field "Show subfolders expanded" to "1"
When I am on "Course 1" course homepage
Then I should not see "Test subfolder 2"
And I follow "Test folder"
And I am on the "Test folder" "folder activity" page
And I should see "Test subfolder 2"
@javascript
@@ -63,8 +62,7 @@ Feature: View subfolders in a course in-line
And I press "Save and return to course"
Then I should see "Test subfolder 1"
And I should not see "Test sub subfolder"
Given I open "Test folder" actions menu
When I click on "Edit settings" "link" in the "Test folder" activity
And I am on the "Test folder" "folder activity editing" page
And I set the field "Show subfolders expanded" to "1"
And I press "Save and return to course"
Then I should see "Test subfolder 1"
@@ -24,10 +24,7 @@ Feature: Render H5P content using filters
@javascript @external
Scenario: Render an external H5P content URL.
Given I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "PageName1"
And I navigate to "Edit settings" in current page administration
Given I am on the PageName1 "page activity editing" page logged in as teacher1
And I set the field "Page content" to "<div>Go for it</div>https://moodle.h5p.com/content/1290772960722742119/embed"
When I click on "Save and display" "button"
And I wait until the page is ready
@@ -36,10 +33,7 @@ Feature: Render H5P content using filters
@javascript
Scenario: Add an external H5P content URL in a link with the URL. Should be rendered.
Given I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "PageName1"
And I navigate to "Edit settings" in current page administration
Given I am on the PageName1 "page activity editing" page logged in as teacher1
# This content won't be displayed, so this scenario shouldn't be labeled as external.
And I set the field "Page content" to "<a href='https://moodle.h5p.com/content/1290772960722742119/embed'>https://moodle.h5p.com/content/1290772960722742119/embed</a>"
When I click on "Save and display" "button"
@@ -48,10 +42,7 @@ Feature: Render H5P content using filters
Then I should see "Lorum ipsum"
Scenario: Add an external H5P content URL in a link with text. Shouldn't be rendered.
Given I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "PageName1"
And I navigate to "Edit settings" in current page administration
Given I am on the PageName1 "page activity editing" page logged in as teacher1
# This content won't be displayed, so this scenario shouldn't be labeled as external.
And I set the field "Page content" to "<a href='https://moodle.h5p.com/content/1290772960722742119/embed'>Here you are the content</a>"
When I click on "Save and display" "button"
@@ -67,8 +58,7 @@ Feature: Render H5P content using filters
| Name | ipsumFile |
And I upload "h5p/tests/fixtures/ipsums.h5p" file to "Select files" filemanager
And I press "Save and return to course"
And I follow "PageName1"
And I navigate to "Edit settings" in current page administration
And I am on the PageName1 "page activity editing" page
And I click on "Insert H5P" "button" in the "#fitem_id_page" "css_element"
And I click on "Browse repositories..." "button" in the "Insert H5P" "dialogue"
And I click on "Server files" "link" in the ".fp-repo-area" "css_element"
@@ -85,9 +75,7 @@ Feature: Render H5P content using filters
Then I should see "Lorum ipsum"
And I switch to the main frame
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "PageName1"
And I am on the PageName1 "page activity" page logged in as student1
# Switch to iframe created by filter
And I switch to "h5p-iframe" class iframe
# Switch to iframe created by embed.php page
@@ -104,8 +92,7 @@ Feature: Render H5P content using filters
| Name | ipsumFile |
And I upload "h5p/tests/fixtures/ipsums.h5p" file to "Select files" filemanager
And I press "Save and return to course"
And I follow "PageName1"
And I navigate to "Edit settings" in current page administration
And I am on the PageName1 "page activity editing" page
And I click on "Insert H5P" "button" in the "#fitem_id_page" "css_element"
And I click on "Browse repositories..." "button" in the "Insert H5P" "dialogue"
And I click on "Server files" "link" in the ".fp-repo-area" "css_element"
@@ -129,8 +116,7 @@ Feature: Render H5P content using filters
| Name | ipsumFileTeacher |
And I upload "h5p/tests/fixtures/ipsums.h5p" file to "Select files" filemanager
And I press "Save and return to course"
And I follow "PageName1"
And I navigate to "Edit settings" in current page administration
And I am on the PageName1 "page activity editing" page
And I click on "Insert H5P" "button" in the "#fitem_id_page" "css_element"
And I click on "Browse repositories..." "button" in the "Insert H5P" "dialogue"
And I click on "Server files" "link" in the ".fp-repo-area" "css_element"
@@ -153,8 +139,7 @@ Feature: Render H5P content using filters
| Name | ipsumFile |
And I upload "h5p/tests/fixtures/ipsums.h5p" file to "Select files" filemanager
And I press "Save and return to course"
And I follow "PageName2"
And I navigate to "Edit settings" in current page administration
And I am on the PageName2 "page activity editing" page
And I click on "Insert H5P" "button" in the "#fitem_id_page" "css_element"
And I click on "Browse repositories..." "button" in the "Insert H5P" "dialogue"
And I click on "Server files" "link" in the ".fp-repo-area" "css_element"
@@ -172,9 +157,7 @@ Feature: Render H5P content using filters
And I should see "Lorum ipsum"
And I switch to the main frame
And I log out
When I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "PageName1"
And I am on the PageName1 "page activity" page logged in as teacher1
# Switch to iframe created by filter
And I switch to "h5p-iframe" class iframe
# Switch to iframe created by embed.php page
@@ -195,9 +178,8 @@ Feature: Render H5P content using filters
And I click on "Upload H5P content types" "button" in the "#fitem_id_uploadlibraries" "css_element"
And I click on "Disable" "link" in the "Accordion" "table_row"
# Add H5P content to the page.
And I am on "Course 1" course homepage with editing mode on
And I follow "PageName1"
And I navigate to "Edit settings" in current page administration
And I am on "Course 1" course homepage
And I am on the PageName1 "page activity editing" page
When I click on "Insert H5P" "button" in the "#fitem_id_page" "css_element"
And I click on "Browse repositories..." "button" in the "Insert H5P" "dialogue"
And I click on "Private files" "link" in the ".fp-repo-area" "css_element"
@@ -212,9 +194,8 @@ Feature: Render H5P content using filters
And I switch to the main frame
And I navigate to "H5P > Manage H5P content types" in site administration
And I click on "Enable" "link" in the "Accordion" "table_row"
And I am on "Course 1" course homepage
# Content should be deployed now that main library is enabled.
And I follow "PageName1"
And I am on the PageName1 "page activity" page
# Switch to iframe created by filter.
And I switch to "h5p-iframe" class iframe
# Switch to iframe created by embed.php page.
@@ -224,9 +205,8 @@ Feature: Render H5P content using filters
And I switch to the main frame
And I navigate to "H5P > Manage H5P content types" in site administration
And I click on "Disable" "link" in the "Accordion" "table_row"
And I am on "Course 1" course homepage
# Library is disabled again, so an error should be displayed.
And I follow "PageName1"
And I am on the PageName1 "page activity" page
And I switch to "h5p-iframe" class iframe
And I should see "This file can't be displayed because its content type is disabled."
And I should not see "Lorum ipsum"
@@ -20,7 +20,7 @@ Feature: Marking guides can be created and edited
| activity | assign |
| course | C1 |
| idnumber | assign1 |
| name | Test assignment 1 name |
| name | Test assignment 1 name |
| intro | Test assignment description |
| section | 1 |
| assignsubmission_file_enabled | 1 |
@@ -30,10 +30,7 @@ Feature: Marking guides can be created and edited
| assignfeedback_comments_enabled | 1 |
| assignfeedback_file_enabled | 1 |
| assignfeedback_comments_commentinline | 1 |
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Test assignment 1 name"
And I navigate to "Edit settings" in current page administration
And I am on the "Test assignment 1 name" "assign activity editing" page logged in as teacher1
And I set the following fields to these values:
| Grading method | Marking guide |
And I press "Save and return to course"
@@ -65,7 +62,8 @@ Feature: Marking guides can be created and edited
@javascript
Scenario: Deleting criterion and comment
# Deleting criterion
When I go to "Test assignment 1 name" advanced grading definition page
When I am on "Course 1" course homepage
And I go to "Test assignment 1 name" advanced grading definition page
And I click on "Delete criterion" "button" in the "Guide criterion B" "table_row"
And I press "Yes"
And I press "Save"
@@ -74,7 +72,8 @@ Feature: Marking guides can be created and edited
And I should see "WARNING: Your marking guide has a maximum grade of 70 points"
But I should not see "Guide criterion B"
# Deleting a frequently used comment
When I go to "Test assignment 1 name" advanced grading definition page
When I am on "Course 1" course homepage
And I go to "Test assignment 1 name" advanced grading definition page
And I click on "Delete comment" "button" in the "Comment 3" "table_row"
And I press "Yes"
And I press "Save"
@@ -105,9 +104,7 @@ Feature: Marking guides can be created and edited
Then I should see "80" in the "Student 1" "table_row"
And I log out
# Viewing it as a student.
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test assignment 1 name"
And I am on the "Test assignment 1 name" "assign activity" page logged in as student1
And I should see "80" in the ".feedback" "css_element"
And I should see "Marking guide test description" in the ".feedback" "css_element"
And I should see "Very good"
@@ -70,9 +70,7 @@ Feature: Rubrics can be created and edited
And I should see "35" in the "Student 1" "table_row"
And I log out
# Viewing it as a student.
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test assignment 1 name"
And I am on the "Test assignment 1 name" "assign activity" page logged in as student1
And I should see "35" in the ".feedback" "css_element"
And I should see "Rubric test description" in the ".feedback" "css_element"
And I should see "In general... work harder..."
@@ -80,8 +78,7 @@ Feature: Rubrics can be created and edited
And the level with "20" points is selected for the rubric criterion "Criterion 1"
And the level with "5" points is selected for the rubric criterion "Criterion 3"
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I am on the "Course 1" course page logged in as teacher1
# Editing a rubric definition without regrading students.
And I go to "Test assignment 1 name" advanced grading definition page
And "Save as draft" "button" should not exist
@@ -93,9 +90,7 @@ Feature: Rubrics can be created and edited
And I press "Continue"
And I log out
# Check that the student still sees the grade.
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test assignment 1 name"
And I am on the "Test assignment 1 name" "assign activity" page logged in as student1
And I should see "35" in the ".feedback" "css_element"
And the level with "20" points is selected for the rubric criterion "Criterion 1"
And I log out
@@ -110,30 +105,23 @@ Feature: Rubrics can be created and edited
And I press "Continue"
And I log out
# Check that the student doesn't see the grade.
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test assignment 1 name"
And I am on the "Test assignment 1 name" "assign activity" page logged in as student1
And I should see "35" in the ".feedback" "css_element"
And the level with "20" points is not selected for the rubric criterion "Criterion 1"
And I log out
# Regrade student.
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Test assignment 1 name"
And I am on the "Test assignment 1 name" "assign activity" page logged in as teacher1
And I go to "Student 1" "Test assignment 1 name" activity advanced grading page
And I should see "The rubric definition was changed after this student had been graded. The student can not see this rubric until you check the rubric and update the grade."
And I save the advanced grading form
And I log out
# Check that the student sees the grade again.
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test assignment 1 name"
And I am on the "Test assignment 1 name" "assign activity" page logged in as student1
And I should see "31.82" in the ".feedback" "css_element"
And the level with "20" points is not selected for the rubric criterion "Criterion 1"
# Hide all rubric info for students
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I am on the "Course 1" course page logged in as teacher1
And I go to "Test assignment 1 name" advanced grading definition page
And I set the field "Allow users to preview rubric (otherwise it will only be displayed after grading)" to ""
And I set the field "Display rubric description during evaluation" to ""
@@ -145,9 +133,7 @@ Feature: Rubrics can be created and edited
And I press "Continue"
And I log out
# Students should not see anything.
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test assignment 1 name"
And I am on the "Test assignment 1 name" "assign activity" page logged in as student1
And I should not see "Criterion 1" in the ".submissionstatustable" "css_element"
And I should not see "Criterion 2" in the ".submissionstatustable" "css_element"
And I should not see "Criterion 3" in the ".submissionstatustable" "css_element"
@@ -18,10 +18,7 @@ Feature: Reuse my rubrics in other activities
| activity | name | intro | course | section | idnumber |
| assign | Test assignment 1 name | Test assignment 1 description | C1 | 1 | assign1 |
| assign | Test assignment 2 name | Test assignment 2 description | C1 | 1 | assign1 |
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Test assignment 1"
And I navigate to "Edit settings" in current page administration
And I am on the "Test assignment 1 name" "assign activity editing" page logged in as teacher1
And I set the following fields to these values:
| Grading method | Rubric |
And I press "Save and return to course"
@@ -34,10 +31,7 @@ Feature: Reuse my rubrics in other activities
| Criterion 2 | Level 21 | 21 | Level 22 | 22 | Level 3 | 23 |
| Criterion 3 | Level 31 | 31 | Level 32 | 32 | | |
And I press "Save rubric and make it ready"
And I am on "Course 1" course homepage
And I am on "Course 1" course homepage
And I follow "Test assignment 2"
And I navigate to "Edit settings" in current page administration
And I am on the "Test assignment 2 name" "assign activity editing" page
And I set the following fields to these values:
| Grading method | Rubric |
And I press "Save and return to course"
@@ -51,7 +45,6 @@ Feature: Reuse my rubrics in other activities
And I should see "Criterion 1"
And I should see "Criterion 2"
And I should see "Criterion 3"
And I press "Cancel"
@javascript
Scenario: A teacher can reuse one of his/her previously created rubrics, with Javascript enabled
@@ -28,16 +28,13 @@ Feature: We can change what we are viewing on the grader report
| Description | Submit your online text |
| assignsubmission_onlinetext_enabled | 1 |
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test assignment name 1"
And I am on the "Test assignment name 1" "assign activity" page logged in as student1
When I press "Add submission"
And I set the following fields to these values:
| Online text | This is a submission for assignment 1 |
And I press "Save changes"
Then I should see "Submitted for grading"
And I am on "Course 1" course homepage
And I follow "Test assignment name 2"
And I am on the "Test assignment name 2" "assign activity" page
When I press "Add submission"
And I set the following fields to these values:
| Online text | This is a submission for assignment 2 |
@@ -55,7 +52,7 @@ Feature: We can change what we are viewing on the grader report
@javascript
Scenario: View and minimise the grader report containing hidden activities
And I am on "Course 1" course homepage with editing mode on
When I am on "Course 1" course homepage with editing mode on
And I open "Test assignment name 2" actions menu
And I click on "Hide" "link" in the "Test assignment name 2" activity
And I am on "Course 1" course homepage
@@ -83,7 +80,7 @@ Feature: We can change what we are viewing on the grader report
@javascript
Scenario: View and minimise the grader report containing hidden activities without the 'moodle/grade:viewhidden' capability
And I am on "Course 1" course homepage with editing mode on
When I am on "Course 1" course homepage with editing mode on
And I open "Test assignment name 2" actions menu
And I click on "Hide" "link" in the "Test assignment name 2" activity
And I log out
@@ -30,9 +30,7 @@ Feature: We can bulk insert grades for students in a course
| assign | C1 | a4 | Test assignment four | Submit nothing! |
Scenario: I can bulk insert grades and check their override flags for grade view.
Given I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Test assignment one"
Given I am on the "Test assignment one" "assign activity" page logged in as teacher1
And I navigate to "View all submissions" in current page administration
And I click on "Grade" "link" in the "Student 1" "table_row"
And I set the following fields to these values:
@@ -70,9 +68,7 @@ Feature: We can bulk insert grades for students in a course
And the field "Override for Student 4" matches value "1"
Scenario: I can bulk insert grades and check their override flags for user view.
Given I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Test assignment two"
Given I am on the "Test assignment two" "assign activity" page logged in as teacher1
And I navigate to "View all submissions" in current page administration
And I click on "Grade" "link" in the "Student 1" "table_row"
And I set the following fields to these values:
@@ -101,8 +97,7 @@ Feature: We can bulk insert grades for students in a course
And the field "Override for Test assignment four" matches value "1"
Scenario: I can not update grades if the value is out of bounds.
Given I log in as "teacher1"
And I am on "Course 1" course homepage
Given I am on the "Course 1" course page logged in as teacher1
And I navigate to "View > Grader report" in the course gradebook
And I follow "Single view for Test assignment one"
And I set the field "Perform bulk insert" to "1"
+18 -26
View File
@@ -11,8 +11,8 @@ Feature: We can change the grading type and maximum grade point values
| fullname | shortname | category | format |
| Course 1 | C1 | 0 | topics |
Given the following "activities" exist:
| activity | course | idnumber | name | intro |
| assign | C1 | assign1| Test Assignment 1 | Test Assignment 1 |
| activity | course | idnumber | name | intro |
| assign | C1 | assign1 | Test Assignment 1 | Test Assignment 1 |
And I log in as "admin"
And I navigate to "Grades > General settings" in site administration
And I set the following fields to these values:
@@ -23,9 +23,8 @@ Feature: We can change the grading type and maximum grade point values
@javascript
Scenario: Validate that switching the type of grading used correctly disables input form elements
When I follow "Test Assignment 1"
And I navigate to "Edit settings" in current page administration
And I expand all fieldsets
Given I am on the "Test Assignment 1" "assign activity editing" page
When I expand all fieldsets
And I set the field "grade[modgrade_type]" to "Point"
Then the "Scale" "select" should be disabled
And the "Maximum grade" "field" should be enabled
@@ -39,46 +38,42 @@ Feature: We can change the grading type and maximum grade point values
@javascript
Scenario: Create an activity with a maximum grade point value less than the system maximum
When I follow "Test Assignment 1"
And I navigate to "Edit settings" in current page administration
And I expand all fieldsets
Given I am on the "Test Assignment 1" "assign activity editing" page
When I expand all fieldsets
And I set the field "grade[modgrade_type]" to "point"
And I set the field "grade[modgrade_point]" to "600"
And I press "Save and display"
And I navigate to "Edit settings" in current page administration
And I am on the "Test Assignment 1" "assign activity editing" page
Then the field "grade[modgrade_point]" matches value "600"
And the "Scale" "select" should be disabled
And I press "Save and return to course"
@javascript
Scenario: Create an activity with a scale as the grade type
When I follow "Test Assignment 1"
And I navigate to "Edit settings" in current page administration
And I expand all fieldsets
Given I am on the "Test Assignment 1" "assign activity editing" page
When I expand all fieldsets
And I set the field "grade[modgrade_type]" to "Scale"
And I set the field "grade[modgrade_scale]" to "Separate and Connected ways of knowing"
And I press "Save and display"
And I navigate to "Edit settings" in current page administration
And I am on the "Test Assignment 1" "assign activity editing" page
Then the field "grade[modgrade_scale]" matches value "Separate and Connected ways of knowing"
And the "Maximum grade" "field" should be disabled
And I press "Save and return to course"
@javascript
Scenario: Create an activity with no grade as the grade type
When I follow "Test Assignment 1"
And I navigate to "Edit settings" in current page administration
And I expand all fieldsets
Given I am on the "Test Assignment 1" "assign activity editing" page
When I expand all fieldsets
And I set the field "grade[modgrade_type]" to "None"
And I press "Save and display"
And I navigate to "Edit settings" in current page administration
And I am on the "Test Assignment 1" "assign activity editing" page
And the "Scale" "select" should be disabled
And the "Maximum grade" "field" should be disabled
And I press "Save and return to course"
Scenario: Create an activity with a maximum grade point value higher than the system maximum
When I follow "Test Assignment 1"
And I navigate to "Edit settings" in current page administration
And I expand all fieldsets
Given I am on the "Test Assignment 1" "assign activity editing" page
When I expand all fieldsets
And I set the field "grade[modgrade_type]" to "Point"
And I set the field "grade[modgrade_point]" to "20000"
And I press "Save and display"
@@ -86,9 +81,8 @@ Feature: We can change the grading type and maximum grade point values
And I press "Cancel"
Scenario: Create an activity with a valid maximum grade point and then change the system maximum to be lower
When I follow "Test Assignment 1"
And I navigate to "Edit settings" in current page administration
And I expand all fieldsets
Given I am on the "Test Assignment 1" "assign activity editing" page
When I expand all fieldsets
And I set the field "grade[modgrade_type]" to "point"
And I set the field "grade[modgrade_point]" to "600"
And I press "Save and display"
@@ -96,9 +90,7 @@ Feature: We can change the grading type and maximum grade point values
And I set the following fields to these values:
| Grade point maximum | 100 |
And I press "Save changes"
And I am on "Course 1" course homepage
And I follow "Test Assignment 1"
And I navigate to "Edit settings" in current page administration
And I am on the "Test Assignment 1" "assign activity editing" page
And I press "Save and display"
Then I should see "Invalid grade value. This must be an integer between 1 and 100"
And I press "Cancel"
@@ -23,8 +23,7 @@ Feature: Regrading grades does not unnecessarily mark some as overriden
And I navigate to "Grades > Grade category settings" in site administration
And I set the field "Available aggregation types" to "Weighted mean of grades"
And I press "Save changes"
And I am on "Course 1" course homepage
And I follow "Assignment 1"
And I am on the "Assignment 1" "assign activity" page
And I navigate to "View all submissions" in current page administration
And I click on "Grade" "link" in the "Student 1" "table_row"
And I set the field "Grade out of 100" to "80"
@@ -58,8 +57,7 @@ Feature: Regrading grades does not unnecessarily mark some as overriden
@javascript
Scenario: Confirm overridden course total does not get regraded when activity grade is changed
Given I am on "Course 1" course homepage
And I follow "Assignment 1"
Given I am on the "Assignment 1" "assign activity" page
And I navigate to "View all submissions" in current page administration
And I click on "Grade" "link" in the "Student 1" "table_row"
And I set the field "Grade out of 100" to "90"
+1 -4
View File
@@ -43,10 +43,7 @@ Feature: View gradebook when scales are used
And the following "activities" exist:
| activity | course | idnumber | name | intro | gradecategory |
| assign | C1 | a1 | Test assignment one | Submit something! | Sub category 1 |
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Test assignment one"
And I navigate to "Edit settings" in current page administration
And I am on the "Test assignment one" "assign activity editing" page logged in as teacher1
And I expand all fieldsets
And I set the field "grade[modgrade_type]" to "Scale"
And I set the field "grade[modgrade_scale]" to "EN Letterscale"
@@ -39,10 +39,7 @@ Feature: View gradebook when single item scales are used
| assign | C1 | a1 | Test assignment one | Submit something! | <span lang="en" class="multilang">EN</span><span lang="fr" class="multilang">FR</span> Sub category 1 |
And the "multilang" filter is "on"
And the "multilang" filter applies to "content and headings"
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Test assignment one"
And I navigate to "Edit settings" in current page administration
And I am on the "Test assignment one" "assign activity editing" page logged in as teacher1
And I expand all fieldsets
And I set the field "grade[modgrade_type]" to "Scale"
And I set the field "grade[modgrade_scale]" to "EN Singleitem"
@@ -531,4 +531,46 @@ abstract class behat_generator_base {
}
return $id;
}
/**
* Get a coursemodule from an activity name or idnumber.
*
* @param string $activity
* @param string $identifier
* @return cm_info
*/
protected function get_cm_by_activity_name(string $activity, string $identifier): cm_info {
global $DB;
$coursetable = new \core\dml\table('course', 'c', 'c');
$courseselect = $coursetable->get_field_select();
$coursefrom = $coursetable->get_from_sql();
$cmtable = new \core\dml\table('course_modules', 'cm', 'cm');
$cmfrom = $cmtable->get_from_sql();
$acttable = new \core\dml\table($activity, 'act', 'act');
$actselect = $acttable->get_field_select();
$actfrom = $acttable->get_from_sql();
$sql = <<<EOF
SELECT cm.id as cmid, {$courseselect}, {$actselect}
FROM {$cmfrom}
INNER JOIN {$coursefrom} ON c.id = cm.course
INNER JOIN {modules} m ON m.id = cm.module AND m.name = :modname
INNER JOIN {$actfrom} ON cm.instance = act.id
WHERE cm.idnumber = :idnumber OR act.name = :name
EOF;
$result = $DB->get_record_sql($sql, [
'modname' => $activity,
'idnumber' => $identifier,
'name' => $identifier,
], MUST_EXIST);
$course = $coursetable->extract_from_result($result);
$instancedata = $acttable->extract_from_result($result);
return get_fast_modinfo($course)->get_cm($result->cmid);
}
}
+133
View File
@@ -1443,4 +1443,137 @@ EOF;
$timeout = self::get_real_timeout(30) * 1000 * $factor;
$driver->getWebDriver()->getCommandExecutor()->setRequestTimeout($timeout);
}
/**
* Get the course category id from an identifier.
*
* The category idnumber, and name are checked.
*
* @param string $identifier
* @return int|null
*/
protected function get_category_id(string $identifier): ?int {
global $DB;
$sql = <<<EOF
SELECT id
FROM {course_categories}
WHERE idnumber = :idnumber
OR name = :name
EOF;
$result = $DB->get_field_sql($sql, [
'idnumber' => $identifier,
'name' => $identifier,
]);
return $result ?: null;
}
/**
* Get the course id from an identifier.
*
* The course idnumber, shortname, and fullname are checked.
*
* @param string $identifier
* @return int|null
*/
protected function get_course_id(string $identifier): ?int {
global $DB;
$sql = <<<EOF
SELECT id
FROM {course}
WHERE idnumber = :idnumber
OR shortname = :shortname
OR fullname = :fullname
EOF;
$result = $DB->get_field_sql($sql, [
'idnumber' => $identifier,
'shortname' => $identifier,
'fullname' => $identifier,
]);
return $result ?: null;
}
/**
* Get the activity course module id from its idnumber.
*
* Note: Only idnumber is supported here, not name at this time.
*
* @param string $identifier
* @return cm_info|null
*/
protected function get_course_module_for_identifier(string $identifier): ?cm_info {
global $DB;
$coursetable = new \core\dml\table('course', 'c', 'c');
$courseselect = $coursetable->get_field_select();
$coursefrom = $coursetable->get_from_sql();
$cmtable = new \core\dml\table('course_modules', 'cm', 'cm');
$cmfrom = $cmtable->get_from_sql();
$sql = <<<EOF
SELECT {$courseselect}, cm.id as cmid
FROM {$cmfrom}
INNER JOIN {$coursefrom} ON c.id = cm.course
WHERE cm.idnumber = :idnumber
EOF;
$result = $DB->get_record_sql($sql, [
'idnumber' => $identifier,
]);
if ($result) {
$course = $coursetable->extract_from_result($result);
return get_fast_modinfo($course)->get_cm($result->cmid);
}
return null;
}
/**
* Get a coursemodule from an activity name or idnumber.
*
* @param string $activity
* @param string $identifier
* @return cm_info
*/
protected function get_cm_by_activity_name(string $activity, string $identifier): cm_info {
global $DB;
$coursetable = new \core\dml\table('course', 'c', 'c');
$courseselect = $coursetable->get_field_select();
$coursefrom = $coursetable->get_from_sql();
$cmtable = new \core\dml\table('course_modules', 'cm', 'cm');
$cmfrom = $cmtable->get_from_sql();
$acttable = new \core\dml\table($activity, 'act', 'act');
$actselect = $acttable->get_field_select();
$actfrom = $acttable->get_from_sql();
$sql = <<<EOF
SELECT cm.id as cmid, {$courseselect}, {$actselect}
FROM {$cmfrom}
INNER JOIN {$coursefrom} ON c.id = cm.course
INNER JOIN {modules} m ON m.id = cm.module AND m.name = :modname
INNER JOIN {$actfrom} ON cm.instance = act.id
WHERE cm.idnumber = :idnumber OR act.name = :name
EOF;
$result = $DB->get_record_sql($sql, [
'modname' => $activity,
'idnumber' => $identifier,
'name' => $identifier,
], MUST_EXIST);
$course = $coursetable->extract_from_result($result);
$instancedata = $acttable->extract_from_result($result);
return get_fast_modinfo($course)->get_cm($result->cmid);
}
}
@@ -21,11 +21,8 @@ Feature: Add h5ps to Atto
@javascript @external
Scenario: Insert an embedded h5p
Given I log in as "admin"
And I change window size to "large"
And I am on "Course 1" course homepage
And I follow "PageName1"
And I navigate to "Edit settings" in current page administration
Given I change window size to "large"
And I am on the PageName1 "page activity editing" page logged in as admin
And I click on "Insert H5P" "button" in the "#fitem_id_page" "css_element"
And I set the field with xpath "//input[@data-region='h5pfile']" to "https://moodle.h5p.com/content/1290772960722742119"
And I click on "Insert H5P" "button" in the "Insert H5P" "dialogue"
@@ -42,9 +39,7 @@ Feature: Add h5ps to Atto
And I follow "Manage private files..."
And I upload "h5p/tests/fixtures/guess-the-answer.h5p" file to "Files" filemanager
And I click on "Save changes" "button"
And I am on "Course 1" course homepage
And I follow "PageName1"
And I navigate to "Edit settings" in current page administration
And I am on the PageName1 "page activity editing" page
And I click on "Insert H5P" "button" in the "#fitem_id_page" "css_element"
And I click on "Browse repositories..." "button" in the "Insert H5P" "dialogue"
And I click on "Private files" "link" in the ".fp-repo-area" "css_element"
@@ -57,11 +52,8 @@ Feature: Add h5ps to Atto
@javascript
Scenario: Test an invalid url
Given I log in as "admin"
And I change window size to "large"
And I am on "Course 1" course homepage
And I follow "PageName1"
And I navigate to "Edit settings" in current page administration
Given I change window size to "large"
And I am on the PageName1 "page activity editing" page logged in as admin
And I click on "Insert H5P" "button" in the "#fitem_id_page" "css_element"
# This is not a real external URL, so this scenario shouldn't be labeled as external.
And I set the field with xpath "//input[@data-region='h5pfile']" to "ftp://moodle.h5p.com/content/1290772960722742119"
@@ -75,10 +67,7 @@ Feature: Add h5ps to Atto
| capability | permission | role | contextlevel | reference |
| atto/h5p:addembed | Prohibit | editingteacher | Course | C1 |
| moodle/h5p:deploy | Prohibit | editingteacher | Course | C1 |
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "PageName1"
When I navigate to "Edit settings" in current page administration
When I am on the PageName1 "page activity editing" page logged in as teacher1
Then "Insert H5P" "button" should not exist
@javascript
@@ -86,10 +75,7 @@ Feature: Add h5ps to Atto
Given the following "permission overrides" exist:
| capability | permission | role | contextlevel | reference |
| atto/h5p:addembed | Prohibit | editingteacher | Course | C1 |
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "PageName1"
When I navigate to "Edit settings" in current page administration
And I am on the PageName1 "page activity editing" page logged in as teacher1
And I click on "Insert H5P" "button"
Then I should not see "H5P URL" in the "Insert H5P" "dialogue"
And I should see "H5P file upload" in the "Insert H5P" "dialogue"
@@ -100,10 +86,7 @@ Feature: Add h5ps to Atto
Given the following "permission overrides" exist:
| capability | permission | role | contextlevel | reference |
| moodle/h5p:deploy | Prohibit | editingteacher | Course | C1 |
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "PageName1"
When I navigate to "Edit settings" in current page administration
When I am on the PageName1 "page activity editing" page logged in as teacher1
And I click on "Insert H5P" "button"
Then I should not see "H5P file upload" in the "Insert H5P" "dialogue"
And I should see "H5P URL" in the "Insert H5P" "dialogue"
@@ -115,9 +98,7 @@ Feature: Add h5ps to Atto
And I follow "Manage private files..."
And I upload "lib/editor/atto/tests/fixtures/drag.h5p" file to "Files" filemanager
And I click on "Save changes" "button"
And I am on "Course 1" course homepage
And I follow "PageName1"
And I navigate to "Edit settings" in current page administration
And I am on the PageName1 "page activity editing" page
And I click on "Insert H5P" "button" in the "#fitem_id_page" "css_element"
# H5P file content
And I click on "Browse repositories..." "button" in the "Insert H5P" "dialogue"
@@ -151,9 +132,7 @@ Feature: Add h5ps to Atto
And I follow "Manage private files..."
And I upload "h5p/tests/fixtures/guess-the-answer.h5p" file to "Files" filemanager
And I click on "Save changes" "button"
And I am on "Course 1" course homepage
And I follow "PageName1"
And I navigate to "Edit settings" in current page administration
And I am on the PageName1 "page activity editing" page
And I click on "Insert H5P" "button" in the "#fitem_id_page" "css_element"
And I click on "Browse repositories..." "button" in the "Insert H5P" "dialogue"
And I click on "Private files" "link" in the ".fp-repo-area" "css_element"
@@ -205,11 +184,8 @@ Feature: Add h5ps to Atto
@javascript @external
Scenario: H5P options are ignored for H5P URLs
Given I log in as "admin"
And I change window size to "large"
And I am on "Course 1" course homepage
And I follow "PageName1"
And I navigate to "Edit settings" in current page administration
Given I change window size to "large"
And I am on the PageName1 "page activity editing" page logged in as admin
And I click on "Insert H5P" "button" in the "#fitem_id_page" "css_element"
And I set the field with xpath "//input[@data-region='h5pfile']" to "https://moodle.h5p.com/content/1291366510035871129"
And I click on "H5P options" "link"
@@ -239,9 +215,7 @@ Feature: Add h5ps to Atto
And I follow "Manage private files..."
And I upload "h5p/tests/fixtures/guess-the-answer.h5p" file to "Files" filemanager
And I click on "Save changes" "button"
And I am on "Course 1" course homepage
And I follow "PageName1"
And I navigate to "Edit settings" in current page administration
And I am on the PageName1 "page activity editing" page
And I click on "Insert H5P" "button" in the "#fitem_id_page" "css_element"
And I click on "Browse repositories..." "button" in the "Insert H5P" "dialogue"
And I click on "Private files" "link" in the ".fp-repo-area" "css_element"
@@ -251,9 +225,7 @@ Feature: Add h5ps to Atto
And I wait until the page is ready
And I click on "Save and display" "button"
And I log out
When I log in as "student1"
And I am on "Course 1" course homepage
And I follow "PageName1"
When I am on the PageName1 "page activity" page logged in as student1
Then I switch to "h5pcontent" iframe
And I switch to "h5p-iframe" class iframe
And I should see "reveal"
+3 -3
View File
@@ -48,7 +48,7 @@ class behat_core_form extends behat_question_base {
* @throws Exception with a meaningful error message if the specified page cannot be found.
*/
protected function resolve_page_url(string $page): moodle_url {
switch ($page) {
switch (strtolower($page)) {
default:
throw new Exception('Unrecognised core_form page type "' . $page . '."');
}
@@ -70,8 +70,8 @@ class behat_core_form extends behat_question_base {
* @throws Exception with a meaningful error message if the specified page cannot be found.
*/
protected function resolve_page_instance_url(string $type, string $identifier): moodle_url {
switch ($type) {
case 'Fixture':
switch (strtolower($type)) {
case 'fixture':
return new moodle_url('/lib/form/tests/fixtures/' .
clean_param($identifier, PARAM_ALPHAEXT) . '.php');
@@ -22,16 +22,13 @@ Feature: Using the database activities which support point scale
@javascript
Scenario: Database rescale grade should not be possible when users are graded
Given I log in as "teacher1"
And I am on "Course 1" course homepage
Given I am on the "Course 1" course page logged in as teacher1
And I add a "Text input" field to "Test database name" database and I fill the form with:
| Field name | Test field name |
| Field description | Test field description |
And I follow "Templates"
And I wait until the page is ready
And I am on "Course 1" course homepage
And I follow "Test database name"
And I navigate to "Edit settings" in current page administration
And I am on the "Test database name" "data activity editing" page
And I expand all fieldsets
And I set the field "Ratings > Aggregate type" to "Count of ratings"
And I set the field "Ratings > Type" to "Point"
@@ -44,13 +41,9 @@ Feature: Using the database activities which support point scale
| Test field name | Student original entry 2 |
And I press "Save and view"
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Test database name"
And I am on the "Test database name" "data activity" page logged in as teacher1
And I follow "View single"
And I set the field "rating" to "51"
And I am on "Course 1" course homepage
And I follow "Test database name"
When I navigate to "Edit settings" in current page administration
And I am on the "Test database name" "data activity editing" page
And I expand all fieldsets
Then the "Maximum grade" "field" should be disabled
@@ -25,25 +25,19 @@ Feature: Using the forum activities which support point scale
@javascript
Scenario: Forum rescale grade should not be possible when users are graded
Given I log in as "student1"
And I am on "Course 1" course homepage
Given I am on the "Course 1" course page logged in as student1
And I add a new discussion to "Test forum name" forum with:
| Subject | Discussion subject |
| Message | Test post in forum 1 |
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Test forum name"
And I navigate to "Edit settings" in current page administration
And I am on the "Test forum name" "forum activity editing" page logged in as teacher1
And I expand all fieldsets
And I set the field "Ratings > Aggregate type" to "Count of ratings"
And I set the field "Ratings > Type" to "Point"
And I press "Save and return to course"
And I follow "Test forum name"
And I am on the "Test forum name" "forum activity" page
And I follow "Discussion subject"
And I set the field "rating" to "30"
And I am on "Course 1" course homepage
And I follow "Test forum name"
When I navigate to "Edit settings" in current page administration
When I am on the "Test forum name" "forum activity editing" page
And I expand all fieldsets
Then the "Maximum grade" "field" should be disabled
@@ -25,27 +25,20 @@ Feature: Using the glossary activities which support point scale
@javascript
Scenario: Glossary rescale grade should not be possible when users are graded
Given I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test glossary name"
Given I am on the "Test glossary name" "glossary activity" page logged in as student1
And I press "Add a new entry"
And I set the following fields to these values:
| Concept | Testing score |
| Definition | Scoring high on tests |
And I press "Save changes"
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Test glossary name"
And I navigate to "Edit settings" in current page administration
And I am on the "Test glossary name" "glossary activity editing" page logged in as teacher1
And I expand all fieldsets
And I set the field "Ratings > Aggregate type" to "Count of ratings"
And I set the field "Ratings > Type" to "Point"
And I press "Save and return to course"
And I follow "Test glossary name"
And I am on the "Test glossary name" "glossary activity" page
And I set the field "rating" to "50"
And I am on "Course 1" course homepage
And I follow "Test glossary name"
When I navigate to "Edit settings" in current page administration
When I am on the "Test glossary name" "glossary activity editing" page
And I expand all fieldsets
Then the "Maximum grade" "field" should be disabled
@@ -25,9 +25,7 @@ Feature: Using the lesson activities which support point scale
@javascript
Scenario: Lesson rescale grade should not be possible when users are graded
Given I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Test lesson name"
Given I am on the "Test lesson name" "lesson activity" page logged in as teacher1
And I follow "Add a question page"
And I set the field "Select a question type" to "Numerical"
And I press "Add a question page"
@@ -40,15 +38,10 @@ Feature: Using the lesson activities which support point scale
| id_jumpto_6 | Next page |
And I press "Save page"
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test lesson name"
And I am on the "Test lesson name" "lesson activity" page logged in as student1
And I set the field "Your answer" to "5"
And I press "Submit"
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Test lesson name"
When I navigate to "Edit settings" in current page administration
And I am on the "Test lesson name" "lesson activity editing" page logged in as teacher1
And I expand all fieldsets
Then the "Maximum grade" "field" should be disabled
@@ -31,13 +31,10 @@ Feature: Using the activity grade form element
| Scale | Disappointing, Good, Very good, Excellent |
And I press "Save changes"
And I log out
And I log in as "teacher1"
And the following "activities" exist:
| activity | name | intro | course | idnumber |
| forum | Test forum name | Test forum description | C1 | forum1 |
And I am on "Course 1" course homepage
And I follow "Test forum name"
And I navigate to "Edit settings" in current page administration
And I am on the "Test forum name" "forum activity editing" page logged in as teacher1
And I set the following fields to these values:
| Forum type | Standard forum for general use |
| Aggregate type | Average of ratings |
@@ -45,9 +42,7 @@ Feature: Using the activity grade form element
| scale[modgrade_point] | 100 |
| Group mode | No groups |
And I press "Save and return to course"
And I am on "Course 1" course homepage
And I follow "Test forum name"
And I navigate to "Edit settings" in current page administration
And I am on the "Test forum name" "forum activity editing" page
When I expand all fieldsets
Then I should not see "Some grades have already been awarded, so the grade type"
And I set the field "scale[modgrade_type]" to "Scale"
@@ -94,21 +89,17 @@ Feature: Using the activity grade form element
| scale[modgrade_scale] | ABCDEF |
| Group mode | No groups |
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test forum name"
And I am on the "Test forum name" "forum activity" page logged in as student1
And I click on "Add a new discussion topic" "link"
And I set the following fields to these values:
| Subject | Discussion subject |
| Message | Discussion message |
And I press "Post to forum"
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Test forum name"
And I am on the "Test forum name" "forum activity" page logged in as teacher1
And I follow "Discussion subject"
And I set the field "rating" to "D"
And I follow "Test forum name"
And I am on the "Test forum name" "forum activity" page
And I navigate to "Edit settings" in current page administration
When I expand all fieldsets
Then I should see "Some grades have already been awarded, so the grade type and scale cannot be changed"
@@ -143,8 +134,7 @@ Feature: Using the activity grade form element
| Description | Test assignment description |
| grade[modgrade_type] | Scale |
| grade[modgrade_scale] | ABCDEF |
And I am on "Course 1" course homepage
And I follow "Test assignment name"
And I am on the "Test assignment name" "assign activity" page
And I navigate to "View all submissions" in current page administration
And I click on "Grade" "link" in the "Student 1" "table_row"
And I set the field "Grade" to "C"
@@ -161,13 +151,10 @@ Feature: Using the activity grade form element
@javascript
Scenario: Attempting to change the maximum grade when ratings exist
Given I log in as "teacher1"
And the following "activities" exist:
Given the following "activities" exist:
| activity | name | intro | course | idnumber | section |
| forum | Test forum name | Test forum description | C1 | forum1 | 1 |
And I am on "Course 1" course homepage
And I follow "Test forum name"
And I navigate to "Edit settings" in current page administration
And I am on the "Test forum name" "forum activity editing" page logged in as teacher1
And I set the following fields to these values:
| Forum type | Standard forum for general use |
| Aggregate type | Average of ratings |
@@ -176,21 +163,17 @@ Feature: Using the activity grade form element
| Group mode | No groups |
And I press "Save and return to course"
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test forum name"
And I am on the "Test forum name" "forum activity" page logged in as student1
And I click on "Add a new discussion topic" "link"
And I set the following fields to these values:
| Subject | Discussion subject |
| Message | Discussion message |
And I press "Post to forum"
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Test forum name"
And I am on the "Test forum name" "forum activity" page logged in as teacher1
And I follow "Discussion subject"
And I set the field "rating" to "100"
And I follow "Test forum name"
And I am on the "Test forum name" "forum activity" page
And I navigate to "Edit settings" in current page administration
When I expand all fieldsets
Then I should see "You cannot change the type, as grades already exist for this item."
@@ -198,13 +181,11 @@ Feature: Using the activity grade form element
@javascript
Scenario: Attempting to change the maximum grade when no rescaling option has been chosen
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add a "Assignment" to section "1" and I fill the form with:
| Assignment name | Test assignment name |
| Description | Test assignment description |
And I am on "Course 1" course homepage
And I follow "Test assignment name"
Given the following "activity" exists:
| course | C1 |
| activity | assign |
| name | Test assign name |
And I am on the "Test assign name" "assign activity" page logged in as teacher1
And I navigate to "View all submissions" in current page administration
And I click on "Grade" "link" in the "Student 1" "table_row"
And I set the field "Grade out of 100" to "50"
+1 -2
View File
@@ -240,8 +240,7 @@ Feature: Initials bar
Given the following "activities" exist:
| activity | course | idnumber | name | intro | assignsubmission_onlinetext_enabled | assignsubmission_file_enabled |
| assign | C1 | assign1 | TestAssignment | Test assignment description | 0 | 0 |
And I am on the "assign1" "Activity" page logged in as "admin"
And I navigate to "Edit settings" in current page administration
And I am on the "assign1" "assign Activity editing" page logged in as "admin"
And I expand all fieldsets
And I set the field "Completion tracking" to "1"
And I click on "Save and return to course" "button"
+81 -19
View File
@@ -543,7 +543,9 @@ class behat_navigation extends behat_base {
*
* For pages belonging to core, the 'core > ' bit is omitted.
*
* @When I am on the :page page
* @When /^I am on the (?<page>[^ "]*) page$/
* @When /^I am on the "(?<page>[^"]*)" page$/
*
* @param string $page the component and page name.
* E.g. 'Admin notifications' or 'core_user > Preferences'.
* @throws Exception if the specified page cannot be determined.
@@ -561,7 +563,11 @@ class behat_navigation extends behat_base {
* but with the advantage that you go straight to the desired page, without
* having to wait for the Dashboard to load.
*
* @When I am on the :page page logged in as :username
* @When /^I am on the (?<page>[^ "]*) page logged in as (?<username>[^ "]*)$/
* @When /^I am on the "(?<page>[^"]*)" page logged in as (?<username>[^ "]*)$/
* @When /^I am on the (?<page>[^ "]*) page logged in as "(?<username>[^ "]*)"$/
* @When /^I am on the "(?<page>[^"]*)" page logged in as "(?<username>[^ "]*)"$/
*
* @param string $page the type of page. E.g. 'Admin notifications' or 'core_user > Preferences'.
* @param string $username the name of the user to log in as. E.g. 'admin'.
* @throws Exception if the specified page cannot be determined.
@@ -622,7 +628,11 @@ class behat_navigation extends behat_base {
*
* For pages belonging to core, the 'core > ' bit is omitted.
*
* @When I am on the :identifier :type page
* @When /^I am on the (?<identifier>[^ "]*) (?<type>[^ "]*) page$/
* @When /^I am on the "(?<identifier>[^"]*)" "(?<type>[^"]*)" page$/
* @When /^I am on the (?<identifier>[^ "]*) "(?<type>[^"]*)" page$/
* @When /^I am on the "(?<identifier>[^"]*)" (?<type>[^ "]*) page$/
*
* @param string $identifier identifies the particular page. E.g. 'Test quiz'.
* @param string $type the component and page type. E.g. 'mod_quiz > View'.
* @throws Exception if the specified page cannot be determined.
@@ -640,7 +650,15 @@ class behat_navigation extends behat_base {
* but with the advantage that you go straight to the desired page, without
* having to wait for the Dashboard to load.
*
* @When I am on the :identifier :type page logged in as :username
* @When /^I am on the (?<identifier>[^ "]*) (?<type>[^ "]*) page logged in as (?<username>[^ "]*)$/
* @When /^I am on the "(?<identifier>[^"]*)" "(?<type>[^"]*)" page logged in as (?<username>[^ "]*)$/
* @When /^I am on the (?<identifier>[^ "]*) "(?<type>[^"]*)" page logged in as (?<username>[^ "]*)$/
* @When /^I am on the "(?<identifier>[^"]*)" (?<type>[^ "]*) page logged in as (?<username>[^ "]*)$/
* @When /^I am on the (?<identifier>[^ "]*) (?<type>[^ "]*) page logged in as "(?<username>[^"]*)"$/
* @When /^I am on the "(?<identifier>[^"]*)" "(?<type>[^"]*)" page logged in as "(?<username>[^"]*)"$/
* @When /^I am on the (?<identifier>[^ "]*) "(?<type>[^"]*)" page logged in as "(?<username>[^"]*)"$/
* @When /^I am on the "(?<identifier>[^"]*)" (?<type>[^ "]*) page logged in as "(?<username>[^"]*)"$/
*
* @param string $identifier identifies the particular page. E.g. 'Test quiz'.
* @param string $type the component and page type. E.g. 'mod_quiz > View'.
* @param string $username the name of the user to log in as. E.g. 'student'.
@@ -697,10 +715,17 @@ class behat_navigation extends behat_base {
* Convert page names to URLs for steps like 'When I am on the "[identifier]" "[page type]" page'.
*
* Recognised page names are:
* | Page type | Identifier meaning | description |
* | Category page | category idnumber | List of courses in that category. |
* | Course | course shortname | Main course home pag |
* | Activity | activity idnumber | Start page for that activity |
* | Page type | Identifier meaning | description |
* | Category | category idnumber | List of courses in that category. |
* | Course | course shortname | Main course home pag |
* | Activity | activity idnumber | Start page for that activity |
* | Activity editing | activity idnumber | Edit settings page for that activity |
* | [modname] Activity | activity name or idnumber | Start page for that activity |
* | [modname] Activity editing | activity name or idnumber | Edit settings page for that activity |
*
* Examples:
*
* When I am on the "Welcome to ECON101" "forum activity" page logged in as student1
*
* @param string $type identifies which type of page this is, e.g. 'Category page'.
* @param string $identifier identifies the particular page, e.g. 'test-cat'.
@@ -710,33 +735,70 @@ class behat_navigation extends behat_base {
protected function resolve_core_page_instance_url(string $type, string $identifier): moodle_url {
global $DB;
$type = strtolower($type);
switch ($type) {
case 'Category page':
$categoryid = $DB->get_field('course_categories', 'id', ['idnumber' => $identifier]);
case 'category':
$categoryid = $this->get_category_id($identifier);
if (!$categoryid) {
throw new Exception('The specified category with idnumber "' . $identifier . '" does not exist');
}
return new moodle_url('/course/category.php', ['id' => $categoryid]);
return new moodle_url('/course/index.php', ['categoryid' => $categoryid]);
case 'Course':
$courseid = $DB->get_field_select('course', 'id', 'shortname = ?', [$identifier], IGNORE_MISSING);
case 'course':
$courseid = $this->get_course_id($identifier);
if (!$courseid) {
throw new Exception('The specified course with shortname, fullname, or idnumber "' .
$identifier . '" does not exist');
}
return new moodle_url('/course/view.php', ['id' => $courseid]);
case 'Activity':
$cm = $DB->get_record('course_modules', ['idnumber' => $identifier], 'id, course', IGNORE_MISSING);
case 'activity':
$cm = $this->get_course_module_for_identifier($identifier);
if (!$cm) {
throw new Exception('The specified activity with idnumber "' . $identifier . '" does not exist');
}
$modinfo = get_fast_modinfo($cm->course);
return $modinfo->cms[$cm->id]->url;
return $cm->url;
default:
throw new Exception('Unrecognised core page type "' . $type . '."');
case 'activity editing':
$cm = $this->get_course_module_for_identifier($identifier);
if (!$cm) {
throw new Exception('The specified activity with idnumber "' . $identifier . '" does not exist');
}
return new moodle_url('/course/modedit.php', [
'update' => $cm->id,
]);
}
$parts = explode(' ', $type);
if (count($parts) > 1) {
if ($parts[1] === 'activity') {
$modname = $parts[0];
$cm = $this->get_cm_by_activity_name($modname, $identifier);
if (count($parts) == 2) {
// View page.
return new moodle_url($cm->url);
}
if ($parts[2] === 'editing') {
// Edit settings page.
return new moodle_url('/course/modedit.php', ['update' => $cm->id]);
}
if ($parts[2] === 'roles') {
// Locally assigned roles page.
return new moodle_url('/admin/roles/assign.php', ['contextid' => $cm->context->id]);
}
if ($parts[2] === 'permissions') {
// Permissions page.
return new moodle_url('/admin/roles/permissions.php', ['contextid' => $cm->context->id]);
}
}
}
throw new Exception('Unrecognised core page type "' . $type . '."');
}
/**
+1 -3
View File
@@ -12,9 +12,7 @@ Feature: Any day / month / year combination in date form elements works ok.
And the following "activity" exist:
| activity | name | intro | course | idnumber |
| assign | Assignment 01 | Assign activity to test some dates | C1 | assign01 |
Given I am on the "C1" "Course" page logged in as "admin"
And I follow "Assignment 01"
And I navigate to "Edit settings" in current page administration
And I am on the "Assignment 01" "assign activity editing" page logged in as admin
And I expand all fieldsets
And I set the field "Due date" to "<initial_date>"
And I set the field "Due date" to "<final_date>"
+5 -6
View File
@@ -31,12 +31,11 @@ Feature: Override permissions on a context
Then "Add announcementsmod/forum:addnews" row "Prohibited" column of "permissions" table should contain "Student"
Scenario: Module capabilities overrides
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add a "Forum" to section "1" and I fill the form with:
| Forum name | Forum 1 |
And I follow "Forum 1"
And I navigate to "Permissions" in current page administration
Given the following "activity" exists:
| course | C1 |
| activity | forum |
| name | Forum 1 |
And I am on the "Forum 1" "forum activity permissions" page logged in as admin
When I click on "Allow" "icon" in the "mod/forum:addnews" "table_row"
And I press "Student"
Then "Add announcementsmod/forum:addnews" row "Roles with permission" column of "permissions" table should contain "Student"
@@ -24,23 +24,17 @@ Feature: Notification popover unread notifications
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add a "Assignment" to section "1" and I fill the form with:
| Assignment name | Test assignment name |
| Description | Submit your online text |
| assignsubmission_onlinetext_enabled | 1 |
| assignsubmission_file_enabled | 0 |
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test assignment name"
And I press "Add submission"
And the following "activity" exists:
| activity | assign |
| course | C1 |
| name | Test assignment name |
| assignsubmission_onlinetext_enabled | 1 |
| assignsubmission_file_enabled | 0 |
| submissiondrafts | 0 |
# This should generate a notification.
And I set the following fields to these values:
| Online text | I'm the student first submission |
And I press "Save changes"
And I log out
And the following "mod_assign > submissions" exist:
| assign | user | onlinetext |
| Test assignment name | student1 | I'm the student1 submission |
Scenario: Notification popover shows correct unread count
When I log in as "student1"
@@ -10,20 +10,12 @@ Feature: View activity completion in the assignment activity
| student1 | Vinnie | Student1 | student1@example.com |
| teacher1 | Darrell | Teacher1 | teacher1@example.com |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
| fullname | shortname | enablecompletion | showcompletionconditions |
| Course 1 | C1 | 1 | 1 |
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
| teacher1 | C1 | editingteacher |
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I navigate to "Edit settings" in current page administration
And I expand all fieldsets
And I set the following fields to these values:
| Enable completion tracking | Yes |
| Show activity completion conditions | Yes |
And I press "Save and display"
And the following "activity" exists:
| activity | assign |
| course | C1 |
@@ -36,7 +28,7 @@ Feature: View activity completion in the assignment activity
@javascript
Scenario: The manual completion button will be shown on the course page if the Show activity completion conditions is set to Yes
Given I am on "Course 1" course homepage
Given I am on the "Course 1" course page logged in as teacher1
# Teacher view.
And the manual completion button for "Music history" should exist
And the manual completion button for "Music history" should be disabled
@@ -51,43 +43,37 @@ Feature: View activity completion in the assignment activity
@javascript
Scenario: The manual completion button will not be shown on the course page if the Show activity completion conditions is set to No
Given I am on "Course 1" course homepage with editing mode on
Given I am on the "Course 1" course page logged in as teacher1
And I navigate to "Edit settings" in current page administration
And I expand all fieldsets
And I set the field "Show activity completion conditions" to "No"
And I press "Save and display"
# Teacher view.
And the manual completion button for "Music history" should not exist
And I follow "Music history"
And I am on the "Music history" "assign activity" page
And the manual completion button for "Music history" should exist
And the manual completion button for "Music history" should be disabled
And I log out
# Student view.
When I log in as "student1"
And I am on "Course 1" course homepage
When I am on the "Course 1" course page logged in as "student1"
Then the manual completion button for "Music history" should not exist
And I follow "Music history"
And I am on the "Music history" "assign activity" page
And the manual completion button for "Music history" should exist
@javascript
Scenario: Use manual completion from the activity page
Given I am on "Course 1" course homepage
And I follow "Music history"
Given I am on the "Music history" "assign activity" page logged in as teacher1
# Teacher view.
And the manual completion button for "Music history" should be disabled
And I log out
# Student view.
When I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Music history"
And I am on the "Music history" "assign activity" page logged in as student1
Then the manual completion button of "Music history" is displayed as "Mark as done"
And I toggle the manual completion state of "Music history"
And the manual completion button of "Music history" is displayed as "Done"
Scenario: View automatic completion items as a teacher
Given I am on "Course 1" course homepage
And I follow "Music history"
And I navigate to "Edit settings" in current page administration
Given I am on the "Music history" "assign activity editing" page logged in as teacher1
And I expand all fieldsets
And I set the following fields to these values:
| Completion tracking | Show activity as complete when conditions are met |
@@ -101,9 +87,7 @@ Feature: View activity completion in the assignment activity
@javascript
Scenario: View automatic completion items as a student
Given I am on "Course 1" course homepage
And I follow "Music history"
And I navigate to "Edit settings" in current page administration
Given I am on the "Music history" "assign activity editing" page logged in as teacher1
And I expand all fieldsets
And I set the following fields to these values:
| assignsubmission_onlinetext_enabled | 1 |
@@ -113,14 +97,11 @@ Feature: View activity completion in the assignment activity
| completionsubmit | 1 |
And I press "Save and display"
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Music history"
And I am on the "Music history" "assign activity" page logged in as student1
And the "View" completion condition of "Music history" is displayed as "done"
And the "Make a submission" completion condition of "Music history" is displayed as "todo"
And the "Receive a grade" completion condition of "Music history" is displayed as "todo"
And I am on "Course 1" course homepage
And I follow "Music history"
And I am on the "Music history" "assign activity" page
And I press "Add submission"
And I set the field "Online text" to "History of playing with drumsticks reversed"
And I press "Save changes"
@@ -130,9 +111,7 @@ Feature: View activity completion in the assignment activity
And the "Make a submission" completion condition of "Music history" is displayed as "done"
And the "Receive a grade" completion condition of "Music history" is displayed as "todo"
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Music history"
And I am on the "Music history" "assign activity" page logged in as teacher1
And I navigate to "View all submissions" in current page administration
And I click on "Grade" "link" in the "Vinnie Student1" "table_row"
And I set the field "Grade out of 100" to "33"
@@ -140,9 +119,7 @@ Feature: View activity completion in the assignment activity
And I press "Save changes"
And I follow "View all submissions"
And I log out
When I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Music history"
When I am on the "Music history" "assign activity" page logged in as student1
Then the "View" completion condition of "Music history" is displayed as "done"
And the "Make a submission" completion condition of "Music history" is displayed as "done"
And the "Receive a grade" completion condition of "Music history" is displayed as "done"
+20 -59
View File
@@ -23,7 +23,6 @@ Feature: View the grading status of an assignment
Scenario: View the grading status for an assignment with marking workflow enabled
Given the following "activity" exists:
| activity | assign |
| idnumber | ass1 |
| course | C1 |
| name | Test assignment name |
| intro | Submit your online text |
@@ -32,20 +31,11 @@ Feature: View the grading status of an assignment
| assignfeedback_comments_enabled | 1 |
| assignsubmission_onlinetext_enabled | 1 |
# Add a submission.
And I log in as "student1"
And I am on "Course 1" course homepage
When I follow "Test assignment name"
Then I should not see "Feedback"
And I should see "Not marked" in the "Grading status" "table_row"
And I press "Add submission"
And I set the following fields to these values:
| Online text | I'm the student's first submission |
And I press "Save changes"
And I log out
And the following "mod_assign > submissions" exist:
| assign | user | onlinetext |
| Test assignment name | student1 | I'm the student first submission |
# Mark the submission.
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Test assignment name"
And I am on the "Test assignment name" "assign activity" page logged in as teacher1
And I navigate to "View all submissions" in current page administration
And I should see "Not marked" in the "Student 1" "table_row"
And I click on "Grade" "link" in the "Student 1" "table_row"
@@ -58,22 +48,17 @@ Feature: View the grading status of an assignment
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 am on the "Test assignment name" "assign activity" page
And I navigate to "View all submissions" in current page administration
And I should see "In review" in the "Student 1" "table_row"
And I log out
# View the grading status as a student.
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test assignment name"
And I am on the "Test assignment name" "assign activity" page logged in as student1
And I should see "In review" in the "Grading status" "table_row"
And I should not see "Great job! Lol, not really."
And I log out
# Mark the submission again but set the marking workflow to 'Released'.
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Test assignment name"
And I am on the "Test assignment name" "assign activity" page logged in as teacher1
And I navigate to "View all submissions" in current page administration
And I should see "In review" in the "Student 1" "table_row"
And I click on "Grade" "link" in the "Student 1" "table_row"
@@ -86,16 +71,12 @@ Feature: View the grading status of an assignment
And I should see "Released" in the "Student 1" "table_row"
And I log out
# View the grading status as a student.
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test assignment name"
And I am on the "Test assignment name" "assign activity" page logged in as student1
And I should see "Released" in the "Grading status" "table_row"
And I should see "Great job! Lol, not really."
And I log out
# Now, change the status from 'Released' to 'In marking' (this will remove the grade from the gradebook).
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Test assignment name"
And I am on the "Test assignment name" "assign activity" page logged in as teacher1
And I navigate to "View all submissions" in current page administration
And I should see "Released" in the "Student 1" "table_row"
And I click on "Grade" "link" in the "Student 1" "table_row"
@@ -103,8 +84,7 @@ Feature: View the grading status of an assignment
And I set the field "Marking workflow state" to "In marking"
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 am on the "Test assignment name" "assign activity" page
And I navigate to "View all submissions" in current page administration
And I should see "In marking" in the "Student 1" "table_row"
# The grade should also remain displayed as it's stored in the assign DB tables, but the final grade should be empty.
@@ -114,13 +94,11 @@ Feature: View the grading status of an assignment
And I click on "Change filters" "link"
And I set the field "Workflow filter" to "In review"
And I should see "0 of 0"
And I follow "Test assignment name"
@javascript
Scenario: View the grading status for an assignment with marking workflow disabled
Given the following "activity" exists:
| activity | assign |
| idnumber | ass1 |
| course | C1 |
| name | Test assignment name |
| intro | Submit your online text |
@@ -129,20 +107,11 @@ Feature: View the grading status of an assignment
| markingworkflow | 0 |
| assignsubmission_onlinetext_enabled | 1 |
# Add a submission.
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test assignment name"
And I should not see "Feedback"
And I should see "Not graded" in the "Grading status" "table_row"
And I press "Add submission"
And I set the following fields to these values:
| Online text | I'm the student's first submission |
And I press "Save changes"
And I log out
And the following "mod_assign > submissions" exist:
| assign | user | onlinetext |
| Test assignment name | student1 | I'm the student first submission |
# Mark the submission.
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Test assignment name"
And I am on the "Test assignment name" "assign activity" page logged in as teacher1
And I navigate to "View all submissions" in current page administration
And I should not see "Graded" in the "Student 1" "table_row"
And I click on "Grade" "link" in the "Student 1" "table_row"
@@ -154,30 +123,24 @@ Feature: View the grading status of an assignment
And I set the field "Feedback comments" to "Great job! Lol, not really."
And I press "Save changes"
And I click on "Edit settings" "link"
And I follow "Test assignment name"
And I am on the "Test assignment name" "assign activity" page
And I navigate to "View all submissions" in current page administration
And I should see "Graded" in the "Student 1" "table_row"
And I log out
# View the grading status as a student.
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test assignment name"
And I am on the "Test assignment name" "assign activity" page logged in as student1
And I should see "Graded" in the "Grading status" "table_row"
And I should see "Great job! Lol, not really."
And I log out
# Student makes a subsequent submission.
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test assignment name"
And I am on the "Test assignment name" "assign activity" page logged in as student1
And I press "Edit submission"
And I set the following fields to these values:
| Online text | I'm the student's second submission |
And I press "Save changes"
And I log out
# Teacher marks the submission again after noticing the 'Graded - follow-up submission received'.
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Test assignment name"
And I am on the "Test assignment name" "assign activity" page logged in as teacher1
And I navigate to "View all submissions" in current page administration
And I should see "Graded - follow-up submission received" in the "Student 1" "table_row"
And I wait "10" seconds
@@ -187,13 +150,11 @@ Feature: View the grading status of an assignment
And I set the field "Feedback comments" to "Even better job! Really."
And I press "Save changes"
And I click on "Edit settings" "link"
And I follow "Test assignment name"
And I am on the "Test assignment name" "assign activity" page
And I navigate to "View all submissions" in current page administration
And I should see "Graded" in the "Student 1" "table_row"
And I log out
# View the grading status as a student again.
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test assignment name"
And I am on the "Test assignment name" "assign activity" page logged in as student1
And I should see "Graded" in the "Grading status" "table_row"
And I should see "Even better job! Really."
+19 -27
View File
@@ -44,29 +44,26 @@ Feature: Outcome grading
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add a "Assignment" to section "1" and I fill the form with:
| Assignment name | Test assignment name |
| Description | Test assignment description |
| assignsubmission_onlinetext_enabled | 1 |
| Outcome Test | 1 |
| Assignment name | Test assignment name |
| ID number | Test assignment name |
| Description | Test assignment description |
| assignsubmission_onlinetext_enabled | 1 |
| Outcome Test | 1 |
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test assignment name"
And I am on the "Test assignment name" "assign activity" page logged in as student1
And I press "Add submission"
And I set the following fields to these values:
| Online text | My online text |
And I press "Save changes"
And I log out
When I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Test assignment name"
When I am on the "Test assignment name" "assign activity" page logged in as teacher1
And I navigate to "View all submissions" in current page administration
And I click on "Grade" "link" in the "Student 0" "table_row"
And I set the following fields to these values:
| Outcome Test: | Excellent |
And I press "Save changes"
And I click on "Edit settings" "link"
And I follow "Test assignment name"
When I am on the "Test assignment name" "assign activity" page
And I navigate to "View all submissions" in current page administration
Then I should see "Outcome Test: Excellent" in the "Student 0" "table_row"
And I should not see "Outcome Test: Excellent" in the "Student 1" "table_row"
@@ -88,32 +85,28 @@ Feature: Outcome grading
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add a "Assignment" to section "1" and I fill the form with:
| Assignment name | Test assignment name |
| Description | Test assignment description |
| assignsubmission_onlinetext_enabled | 1 |
| Students submit in groups | Yes |
| Group mode | No groups |
| Outcome Test | 1 |
| Assignment name | Test assignment name |
| Description | Test assignment description |
| ID number | Test assignment name |
| assignsubmission_onlinetext_enabled | 1 |
| Students submit in groups | Yes |
| Group mode | No groups |
| Outcome Test | 1 |
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test assignment name"
And I am on the "Test assignment name" "assign activity" page logged in as student1
And I press "Add submission"
And I set the following fields to these values:
| Online text | My online text |
And I press "Save changes"
And I log out
When I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Test assignment name"
When I am on the "Test assignment name" "assign activity" page logged in as teacher1
And I navigate to "View all submissions" in current page administration
And I click on "Grade" "link" in the "Student 0" "table_row"
And I set the following fields to these values:
| Outcome Test: | Excellent |
| Apply grades and feedback to entire group | Yes |
And I press "Save changes"
And I click on "Edit settings" "link"
And I follow "Test assignment name"
And I am on the "Test assignment name" "assign activity" page
And I navigate to "View all submissions" in current page administration
Then I should see "Outcome Test: Excellent" in the "Student 0" "table_row"
And I should see "Outcome Test: Excellent" in the "Student 1" "table_row"
@@ -123,8 +116,7 @@ Feature: Outcome grading
| Outcome Test: | Disappointing |
| Apply grades and feedback to entire group | No |
And I press "Save changes"
And I click on "Edit settings" "link"
And I follow "Test assignment name"
And I am on the "Test assignment name" "assign activity" page
And I navigate to "View all submissions" in current page administration
And I should see "Outcome Test: Excellent" in the "Student 0" "table_row"
And I should see "Outcome Test: Disappointing" in the "Student 1" "table_row"
@@ -11,11 +11,11 @@ Feature: Submit assignment without group
| Course 2 | C2 | 0 | 1 |
| Course 3 | C3 | 0 | 1 |
And the following "activities" exist:
| activity | course | idnumber | name | intro | assignsubmission_onlinetext_enabled | preventsubmissionnotingroup | teamsubmission |
| assign | C1 | assign1 | Allow default group | Test assignment description | 1 | 0 | 1 |
| assign | C1 | assign2 | Require group membership | Test assignment description | 1 | 1 | 1 |
| assign | C2 | assign2 | Require group membership | Test assignment description | 1 | 1 | 1 |
| assign | C3 | assign2 | Require group membership | Test assignment description | 1 | 1 | 1 |
| activity | course | idnumber | name | intro | assignsubmission_onlinetext_enabled | preventsubmissionnotingroup | teamsubmission |
| assign | C1 | c1assign1 | Allow default group | Test assignment description | 1 | 0 | 1 |
| assign | C1 | c1assign2 | Require group membership | Test assignment description | 1 | 1 | 1 |
| assign | C2 | c2assign1 | Require group membership | Test assignment description | 1 | 1 | 1 |
| assign | C3 | c3assign1 | Require group membership | Test assignment description | 1 | 1 | 1 |
And the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@example.com |
@@ -44,9 +44,7 @@ Feature: Submit assignment without group
| student3 | GC31 |
| student3 | GC32 |
# Student 1 can only submit assignment in course 2.
When I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Allow default group"
When I am on the "c1assign1" "assign activity" page logged in as student1
Then I should not see "Not a member of any group"
And I should not see "This assignment requires submission in groups. You are not a member of any group"
And I should see "Nothing has been submitted for this assignment"
@@ -57,14 +55,12 @@ Feature: Submit assignment without group
And I press "Submit assignment"
And I press "Continue"
And I should see "Submitted for grading"
And I am on "Course 1" course homepage
And I follow "Require group membership"
And I am on the "c1assign2" "assign activity" page
And I should see "Not a member of any group"
And I should see "This assignment requires submission in groups. You are not a member of any group"
And I should see "Nothing has been submitted for this assignment"
And I should not see "Add submission"
And I am on "Course 2" course homepage
And I follow "Require group membership"
And I am on the "c2assign1" "assign activity" page
And I should not see "Not a member of any group"
And I should see "Nothing has been submitted for this assignment"
And I press "Add submission"
@@ -76,18 +72,13 @@ Feature: Submit assignment without group
And I should see "Submitted for grading"
And I log out
# Student 2 should see submitted for grading.
And I log in as "student2"
And I am on "Course 1" course homepage
And I follow "Allow default group"
And I am on the "c1assign1" "assign activity" page logged in as student2
And I should see "Submitted for grading"
And I am on "Course 2" course homepage
And I follow "Require group membership"
And I am on the "c2assign1" "assign activity" page
And I should see "Submitted for grading"
And I log out
# Teacher should see student 1 and student 2 has submitted assignment.
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Allow default group"
And I am on the "c1assign1" "assign activity" page logged in as teacher1
And I should see "1" in the "Groups" "table_row"
And I should not see "The setting 'Require group to make submission\' is enabled and some users are either not a member of any group, or are a member of more than one group, so are unable to make submissions."
And I navigate to "View all submissions" in current page administration
@@ -95,8 +86,7 @@ Feature: Submit assignment without group
And I should see "Default group" in the "Student 2" "table_row"
And I should see "Submitted for grading" in the "Student 1" "table_row"
And I should see "Submitted for grading" in the "Student 2" "table_row"
And I am on "Course 1" course homepage
And I follow "Require group membership"
And I am on the "c1assign2" "assign activity" page
And I should see "0" in the "Groups" "table_row"
And I should see "The setting 'Require group to make submission' is enabled and some users are either not a member of any group, or are a member of more than one group, so are unable to make submissions."
And I navigate to "View all submissions" in current page administration
@@ -104,8 +94,7 @@ Feature: Submit assignment without group
And I should see "Not a member of any group, so unable to make submissions." in the "Student 2" "table_row"
And I should not see "Submitted for grading" in the "Student 1" "table_row"
And I should not see "Submitted for grading" in the "Student 2" "table_row"
And I am on "Course 2" course homepage
And I follow "Require group membership"
And I am on the "c2assign1" "assign activity" page
And I should see "1" in the "Groups" "table_row"
And I should not see "The setting 'Require group to make submission' is enabled and some users are either not a member of any group, or are a member of more than one group, so are unable to make submissions."
And I navigate to "View all submissions" in current page administration
@@ -115,17 +104,13 @@ Feature: Submit assignment without group
And I should see "Submitted for grading" in the "Student 2" "table_row"
And I log out
# Test student 3 (in multiple groups) should not be able to submit.
And I log in as "student3"
And I am on "Course 3" course homepage
And I follow "Require group membership"
And I am on the "c3assign1" "assign activity" page logged in as student3
And I should see "Member of more than one group"
And I should see "The assignment requires submission in groups. You are a member of more than one group."
And I should see "Nothing has been submitted for this assignment"
And I should not see "Add submission"
And I log out
And I log in as "teacher1"
And I am on "Course 3" course homepage
And I follow "Require group membership"
And I am on the "c3assign1" "assign activity" page logged in as teacher1
And I should see "The setting 'Require group to make submission' is enabled and some users are either not a member of any group, or are a member of more than one group, so are unable to make submissions."
And I navigate to "View all submissions" in current page administration
And I should see "Member of more than one group, so unable to make submissions." in the "Student 3" "table_row"
@@ -155,9 +140,7 @@ Feature: Submit assignment without group
| user | group |
| student1 | G1 |
| student2 | G2 |
When I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Allow default group"
When I am on the "Allow default group" "assign activity" page logged in as teacher1
Then I should not see "The setting 'Require group to make submission\' is enabled and some users are either not a member of any group, or are a member of more than one group, so are unable to make submissions."
And I should not see "The setting 'Students submit in groups' is enabled and some users are either not a member of any group, or are a member of more than one group. Please be aware that these students will submit as members of the 'Default group'."
@@ -185,9 +168,7 @@ Feature: Submit assignment without group
And the following "group members" exist:
| user | group |
| student1 | G1 |
When I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Allow default group"
When I am on the "Allow default group" "assign activity" page logged in as teacher1
Then I should not see "The setting 'Require group to make submission\' is enabled and some users are either not a member of any group, or are a member of more than one group, so are unable to make submissions."
And I should see "The setting 'Students submit in groups' is enabled and some users are either not a member of any group, or are a member of more than one group. Please be aware that these students will submit as members of the 'Default group'."
@@ -217,8 +198,6 @@ Feature: Submit assignment without group
| student1 | G1 |
| student2 | G1 |
| student2 | G2 |
When I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Allow default group"
When I am on the "Allow default group" "assign activity" page logged in as teacher1
Then I should not see "The setting 'Require group to make submission\' is enabled and some users are either not a member of any group, or are a member of more than one group, so are unable to make submissions."
And I should see "The setting 'Students submit in groups' is enabled and some users are either not a member of any group, or are a member of more than one group. Please be aware that these students will submit as members of the 'Default group'."
@@ -10,20 +10,12 @@ Feature: View activity completion information in the book activity
| student1 | Vinnie | Student1 | student1@example.com |
| teacher1 | Darrell | Teacher1 | teacher1@example.com |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
| fullname | shortname | enablecompletion | showcompletionconditions |
| Course 1 | C1 | 1 | 1 |
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
| teacher1 | C1 | editingteacher |
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I navigate to "Edit settings" in current page administration
And I expand all fieldsets
And I set the following fields to these values:
| Enable completion tracking | Yes |
| Show activity completion conditions | Yes |
And I press "Save and display"
And the following "activity" exists:
| activity | book |
| course | C1 |
@@ -32,32 +24,22 @@ Feature: View activity completion information in the book activity
| section | 1 |
| completion | 2 |
| completionview | 1 |
And I log out
Scenario: View automatic completion items
Given I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Music history"
And I set the following fields to these values:
| Chapter title | Drum theory |
| Content | Rudiments are important |
And I press "Save changes"
# Teacher view.
And I follow "Music history"
Given the following "mod_book > chapter" exists:
| book | Music history |
| title | Drum theory |
| content | Rudiments are important |
And I am on the "Music history" "book activity" page logged in as teacher1
And "Music history" should have the "View" completion condition
And I log out
# Student view.
When I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Music history"
When I am on the "Music history" "book activity" page logged in as student1
Then the "View" completion condition of "Music history" is displayed as "done"
@javascript
Scenario: Use manual completion
Given I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Music history"
And I navigate to "Edit settings" in current page administration
Given I am on the "Music history" "book activity editing" page logged in as teacher1
And I expand all fieldsets
And I set the field "Completion tracking" to "Students can manually mark the activity as completed"
And I press "Save and display"
@@ -65,14 +47,12 @@ Feature: View activity completion information in the book activity
| Chapter title | Drum theory |
| Content | Rudiments are important |
And I press "Save changes"
And I follow "Music history"
And I am on the "Music history" "book activity" page
# Teacher view.
And the manual completion button for "Music history" should be disabled
And I log out
# Student view.
When I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Music history"
Given I am on the "Music history" "book activity" page logged in as student1
Then the manual completion button of "Music history" is displayed as "Mark as done"
And I toggle the manual completion state of "Music history"
And the manual completion button of "Music history" is displayed as "Done"
+2 -6
View File
@@ -24,9 +24,7 @@ Feature: Edited book chapters handle tags correctly
| student1 | C1 | student |
Scenario: Book chapter edition of custom tags works as expected
Given I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Test book"
Given I am on the "Test book" "book activity" page logged in as teacher1
And I set the following fields to these values:
| Chapter title | Dummy first chapter |
| Content | Dream is the start of a journey |
@@ -50,9 +48,7 @@ Feature: Edited book chapters handle tags correctly
And I set the field "Enter comma-separated list of new tags" to "OT1, OT2, OT3"
And I press "Continue"
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Test book"
And I am on the "Test book" "book activity" page logged in as teacher1
And I open the autocomplete suggestions list
And I should see "OT1" in the ".form-autocomplete-suggestions" "css_element"
And I should see "OT2" in the ".form-autocomplete-suggestions" "css_element"
+6 -5
View File
@@ -9,12 +9,13 @@ Feature: In a book, verify log entries
Given the following "courses" exist:
| fullname | shortname | category | groupmode |
| Course 1 | C1 | 0 | 1 |
And I log in as "admin"
And the following "activity" exists:
| course | C1 |
| activity | book |
| name | Test book |
And I am on the "Course 1" course page logged in as admin
And I am on "Course 1" course homepage with editing mode on
When I add a "Book" to section "1" and I fill the form with:
| Name | Test book |
| Description | A book about dreams! |
And I follow "Test book"
And I am on the "Test book" "book activity" page
And I set the following fields to these values:
| Chapter title | First chapter |
| Content | First chapter |
@@ -16,16 +16,16 @@ Feature: Book activity chapter visibility management
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add a "Book" to section "1" and I fill the form with:
| Name | Test book |
| Description | A book about dreams! |
And I follow "Test book"
And the following "activity" exists:
| course | C1 |
| activity | book |
| name | Test book |
And I am on the "Test book" "book activity" page logged in as teacher1
And I set the following fields to these values:
| Chapter title | First chapter |
| Content | First chapter |
And I press "Save changes"
And I turn editing mode on
And I click on "Add new chapter after \"First chapter\"" "link"
And I set the following fields to these values:
| Chapter title | Second chapter |
@@ -53,9 +53,8 @@ Feature: Book activity chapter visibility management
Scenario: Show/hide chapters and subchapters
When I follow "Hide chapter \"2. Second chapter\""
And I follow "Hide chapter \"2. Third chapter\""
And I am on the "Test book" "book activity" page
And I turn editing mode off
And I am on "Course 1" course homepage
And I follow "Test book"
Then the "class" attribute of "a[title='Second chapter']" "css_element" should contain "dimmed_text"
And the "class" attribute of "a[title='Third chapter']" "css_element" should contain "dimmed_text"
And I turn editing mode on
@@ -70,13 +69,11 @@ Feature: Book activity chapter visibility management
And I should see "Fourth chapter" in the ".book_content" "css_element"
And I follow "Exit book"
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test book"
And I am on the "Test book" "book activity" page logged in as student1
And I should not see "Second chapter" in the "Table of contents" "block"
And I should not see "Third chapter" in the "Table of contents" "block"
And I follow "Next"
And I should see "Fourth chapter" in the ".book_content" "css_element"
And I follow "Exit book"
And I follow "Test book"
And I am on the "Test book" "book activity" page
And I should see "First chapter" in the ".book_content" "css_element"
@@ -0,0 +1,58 @@
<?php
// 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/>.
/**
* Behat data generator for mod_book.
*
* @package mod_book
* @category test
* @copyright 2021 Andrew Lyons <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
/**
* Behat data generator for mod_book.
*
* @copyright 2019 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class behat_mod_book_generator extends behat_generator_base {
protected function get_creatable_entities(): array {
return [
'chapters' => [
'singular' => 'chapter',
'datagenerator' => 'chapter',
'required' => ['book', 'title', 'content'],
'switchids' => ['book' => 'bookid'],
],
];
}
/**
* Look up the id of a book from its name.
*
* @param string $bookname the book name, for example 'Test book'.
* @return int corresponding id.
*/
protected function get_book_id(string $bookname): int {
global $DB;
$cm = $this->get_cm_by_activity_name('book', $bookname);
return $cm->instance;
}
}
+2 -2
View File
@@ -43,8 +43,8 @@ class behat_mod_chat extends behat_base {
* @throws Exception with a meaningful error message if the specified page cannot be found.
*/
protected function resolve_page_instance_url(string $type, string $name): moodle_url {
switch ($type) {
case 'View':
switch (strtolower($type)) {
case 'view':
$cm = $this->get_cm_by_chat_name($name);
return new moodle_url('/mod/chat/view.php', ['id' => $cm->id]);
default:
@@ -29,9 +29,7 @@ Feature: Automatic completion in the choice activity
| teacher1 | C1 | editingteacher |
Scenario: Viewing a choice activity with automatic completion as a student
Given I log in as "student1"
And I am on "Course 1" course homepage
When I follow "What to drink?"
When I am on the "What to drink?" "choice activity" page logged in as student1
Then the "View" completion condition of "What to drink?" is displayed as "done"
And the "Make a choice" completion condition of "What to drink?" is displayed as "todo"
And I set the field "Beer" to "1"
@@ -40,22 +38,17 @@ Feature: Automatic completion in the choice activity
And the "Make a choice" completion condition of "What to drink?" is displayed as "done"
Scenario: Viewing a choice activity with automatic completion as a teacher
Given I log in as "teacher1"
And I am on "Course 1" course homepage
When I follow "What to drink?"
When I am on the "What to drink?" "choice activity" page logged in as teacher1
Then "What to drink?" should have the "View" completion condition
And "What to drink?" should have the "Make a choice" completion condition
@javascript
Scenario: Overriding automatic choice completion for a user
Given I log in as "teacher1"
And I am on "Course 1" course homepage
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 click on "Student 1, What to drink?: Not completed" "link"
And I press "Save changes"
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
When I follow "What to drink?"
When I am on the "What to drink?" "choice activity" page logged in as student1
Then the "View" completion condition of "What to drink?" overridden by "Teacher 1" is displayed as "done"
And the "Make a choice" completion condition of "What to drink?" overridden by "Teacher 1" is displayed as "done"
@@ -28,9 +28,7 @@ Feature: Manual completion in the choice activity
@javascript
Scenario: Toggle manual completion as a student
Given I log in as "student1"
And I am on "Course 1" course homepage
And I follow "What to drink?"
Given I am on the "What to drink?" "choice activity" page logged in as student1
And the manual completion button of "What to drink?" is displayed as "Mark as done"
When I toggle the manual completion state of "What to drink?"
Then the manual completion button of "What to drink?" is displayed as "Done"
@@ -49,43 +47,33 @@ Feature: Manual completion in the choice activity
But "Done" "button" should not exist
Scenario: Viewing a choice activity with manual completion as a teacher
Given I log in as "teacher1"
And I am on "Course 1" course homepage
When I follow "What to drink?"
When I am on the "What to drink?" "choice activity" page logged in as teacher1
Then the manual completion button for "What to drink?" should be disabled
@javascript
Scenario: Overriding a manual choice completion for a user to done
Given I log in as "teacher1"
And I am on "Course 1" course homepage
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 click on "Student 1, What to drink?: Not completed" "link"
And I press "Save changes"
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
When I follow "What to drink?"
When I am on the "What to drink?" "choice activity" page logged in as student1
Then the manual completion button of "What to drink?" overridden by "Teacher 1" is displayed as "Done"
And I toggle the manual completion state of "What to drink?"
And the manual completion button of "What to drink?" is displayed as "Mark as done"
@javascript
Scenario: Overriding a manual choice completion for a user to not done
Given I log in as "student1"
And I am on "Course 1" course homepage
And I follow "What to drink?"
Given I am on the "What to drink?" "choice activity" page logged in as student1
And I press "Mark as done"
And I wait until the page is ready
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
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 click on "Student 1, What to drink?: Completed" "link"
And I press "Save changes"
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
When I follow "What to drink?"
Given I am on the "What to drink?" "choice activity" page logged in as student1
Then the manual completion button of "What to drink?" overridden by "Teacher 1" is displayed as "Mark as done"
And I toggle the manual completion state of "What to drink?"
And the manual completion button of "What to drink?" is displayed as "Done"
+2 -3
View File
@@ -46,8 +46,7 @@ class behat_mod_choice extends behat_base {
* @return array
*/
public function I_choose_option_from_activity($option, $choiceactivity) {
$this->execute("behat_general::click_link", $this->escape($choiceactivity));
$this->execute("behat_navigation::i_am_on_page_instance", [$this->escape($choiceactivity), 'choice activity']);
$this->execute('behat_forms::i_set_the_field_to', array( $this->escape($option), 1));
@@ -69,7 +68,7 @@ class behat_mod_choice extends behat_base {
$behatforms = behat_context_helper::get('behat_forms');
// Go to choice activity.
$behatgeneral->click_link($this->escape($choiceactivity));
$this->execute("behat_navigation::i_am_on_page_instance", [$this->escape($choiceactivity), 'choice activity']);
// Wait for page to be loaded.
$this->wait_for_pending_js();
+24 -20
View File
@@ -4,7 +4,7 @@ Feature: Teacher can choose whether to allow students to change their choice res
As a teacher
I need to enable the option to change the choice
Scenario: Add a choice activity and complete the activity as a student
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@example.com |
@@ -16,34 +16,38 @@ Feature: Teacher can choose whether to allow students to change their choice res
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And the following "activity" exists:
Scenario: Change a choice response as a student
Given the following "activity" exists:
| activity | choice |
| course | C1 |
| idnumber | choice1 |
| idnumber | Choice name |
| name | Choice name |
| intro | Choice Description |
| section | 1 |
| option | Option 1, Option 2 |
| allowupdate | 0 |
When I log in as "student1"
And I am on "Course 1" course homepage
When I am on the "Course 1" course page logged in as student1
And I choose "Option 1" from "Choice name" choice activity
Then I should see "Your selection: Option 1"
And I should see "Your choice has been saved"
And "Save my choice" "button" should not exist
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Choice name"
And I follow "Edit settings"
And I set the following fields to these values:
| Allow choice to be updated | Yes |
And I press "Save and display"
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Choice name"
And I should see "Your selection: Option 1"
And I should see "Your choice has been saved"
Then "Save my choice" "button" should not exist
Scenario: Change a choice response as a student
Given the following "activity" exists:
| activity | choice |
| course | C1 |
| idnumber | Choice name |
| name | Choice name |
| intro | Choice Description |
| section | 1 |
| option | Option 1, Option 2 |
| allowupdate | 1 |
When I am on the "Course 1" course page logged in as student1
And I choose "Option 1" from "Choice name" choice activity
And I should see "Your selection: Option 1"
And I should see "Your choice has been saved"
Then I should see "Your selection: Option 1"
And "Save my choice" "button" should exist
And "Remove my choice" "link" should exist
And I set the field "Option 2" to "1"
+11 -37
View File
@@ -26,10 +26,7 @@ Feature: Teacher can modify choices of the students
@javascript
Scenario: Delete students choice response as a teacher
When I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Choice name"
And I navigate to "Edit settings" in current page administration
Given I am on the "Choice name" "choice activity editing" page logged in as teacher1
And I expand all fieldsets
And I set the field "Show column for unanswered" to "Yes"
And I press "Save and return to course"
@@ -42,35 +39,27 @@ Feature: Teacher can modify choices of the students
And I log out
And I log in as "teacher1"
And I change window size to "large"
And I am on "Course 1" course homepage
And I follow "Choice name"
And I am on the "Choice name" "choice activity" page
And I navigate to "View 1 responses" in current page administration
And I click on "Student 1 Option 1" "checkbox"
And I select "Delete" from the "With selected" singleselect
And "Student 1 Option 1" "checkbox" should not exist
And "Student 1 Not answered yet" "checkbox" should exist
And I log out
@javascript
Scenario: Teacher set answers of students who did not respond or change existing answers
When I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Choice name"
And I navigate to "Edit settings" in current page administration
Given I am on the "Choice name" "choice activity editing" page logged in as teacher1
And I expand all fieldsets
And I set the field "Show column for unanswered" to "Yes"
And I press "Save and return to course"
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I am on the "Course 1" course page logged in as student1
And I choose "Option 1" from "Choice name" choice activity
Then I should see "Your selection: Option 1"
And I should see "Your choice has been saved"
And I log out
And I log in as "teacher1"
And I change window size to "large"
And I am on "Course 1" course homepage
And I follow "Choice name"
And I am on the "Choice name" "choice activity" page logged in as teacher1
And I navigate to "View 1 responses" in current page administration
And I click on "Student 1 Option 1" "checkbox"
And I click on "Student 2 Not answered yet" "checkbox"
@@ -82,52 +71,38 @@ Feature: Teacher can modify choices of the students
And "Student 1 Option 2" "checkbox" should exist
And "Student 2 Option 2" "checkbox" should exist
And "Student 3 Option 2" "checkbox" should exist
And I log out
@javascript
Scenario: Teacher can delete answers in the multiple answer choice
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Choice name"
And I navigate to "Edit settings" in current page administration
Given I am on the "Choice name" "choice activity editing" page logged in as teacher1
And I set the field "Allow more than one choice to be selected" to "Yes"
And I press "Save and return to course"
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I am on the "Course 1" course page logged in as student1
And I choose options "Option 1","Option 2" from "Choice name" choice activity
And I should see "Your selection: Option 1; Option 2"
And I should see "Your choice has been saved"
And I log out
And I log in as "teacher1"
And I change window size to "large"
And I am on "Course 1" course homepage
And I follow "Choice name"
And I am on the "Choice name" "choice activity" page logged in as teacher1
And I navigate to "View 1 responses" in current page administration
And I click on "Student 1 Option 2" "checkbox"
And I select "Delete" from the "With selected" singleselect
And I click on "Student 1 Option 1" "checkbox"
And I select "Choose: Option 3" from the "With selected" singleselect
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Choice name"
And I am on the "Choice name" "choice activity" page logged in as student1
And I should see "Your selection: Option 1; Option 3"
And I log out
@javascript
Scenario: Teacher can manage answers on view page if the names are displayed
When I log in as "student1"
And I am on "Course 1" course homepage
Given I am on the "Course 1" course page logged in as student1
And I choose "Option 1" from "Choice name" choice activity
Then I should see "Your selection: Option 1"
And I should see "Your choice has been saved"
And I log out
And I log in as "teacher1"
And I change window size to "large"
And I am on "Course 1" course homepage
And I follow "Choice name"
And I navigate to "Edit settings" in current page administration
And I am on the "Choice name" "choice activity editing" page logged in as teacher1
And I set the following fields to these values:
| Publish results | Always show results to students |
| Privacy of results | Publish full results, showing names and their choices |
@@ -144,4 +119,3 @@ Feature: Teacher can modify choices of the students
And I select "Delete" from the "With selected" singleselect
And "Student 1 Option 3" "checkbox" should not exist
And "Student 1 Not answered yet" "checkbox" should exist
And I log out
+4 -9
View File
@@ -22,8 +22,7 @@ Feature: Users can add entries to database activities
@javascript
Scenario: Students can add entries to a database
Given I log in as "teacher1"
And I am on "Course 1" course homepage
Given I am on the "Course 1" course page logged in as teacher1
And I add a "Text input" field to "Test database name" database and I fill the form with:
| Field name | Test field name |
| Field description | Test field description |
@@ -34,8 +33,7 @@ Feature: Users can add entries to database activities
And I follow "Templates"
And I wait until the page is ready
And I log out
When I log in as "student1"
And I am on "Course 1" course homepage
When I am on the "Course 1" course page logged in as student1
And I add an entry to "Test database name" database with:
| Test field name | Student original entry |
| Test field 2 name | Student original entry 2 |
@@ -71,9 +69,7 @@ Feature: Users can add entries to database activities
And I should see "Student third entry"
# Now I will bulk delete the rest of the entries.
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Test database name"
And I am on the "Test database name" "data activity" page logged in as teacher1
And I press "Select all"
And I press "Delete selected"
And I press "Delete"
@@ -81,8 +77,7 @@ Feature: Users can add entries to database activities
@javascript @editor @editor_atto @atto @atto_h5p
Scenario: If a new text area entry is added, the filepicker is displayed in the H5P Atto button
Given I log in as "teacher1"
And I am on "Course 1" course homepage
Given I am on the "Course 1" course page logged in as teacher1
And I add a "Text area" field to "Test database name" database and I fill the form with:
| Field name | Textarea field name |
When I add an entry to "Test database name" database with:
+28 -7
View File
@@ -48,8 +48,7 @@ class behat_mod_data extends behat_base {
* @param TableNode $fielddata
*/
public function i_add_a_field_to_database_and_i_fill_the_form_with($fieldtype, $activityname, TableNode $fielddata) {
$this->execute("behat_general::click_link", $this->escape($activityname));
$this->execute('behat_navigation::i_am_on_page_instance', [$this->escape($activityname), 'data activity']);
// Open "Fields" tab if it is not already open.
$fieldsstr = get_string('fields', 'mod_data');
@@ -80,11 +79,33 @@ class behat_mod_data extends behat_base {
* @param TableNode $entrydata
*/
public function i_add_an_entry_to_database_with($activityname, TableNode $entrydata) {
$this->execute("behat_general::click_link", $this->escape($activityname));
$this->execute("behat_navigation::i_navigate_to_in_current_page_administration",
get_string('add', 'mod_data'));
$this->execute('behat_navigation::i_am_on_page_instance', [$this->escape($activityname), 'mod_data > add entry']);
$this->execute("behat_forms::i_set_the_following_fields_to_these_values", $entrydata);
}
/**
* Convert page names to URLs for steps like 'When I am on the "[identifier]" "[page type]" page'.
*
* Recognised page names are:
* | pagetype | name meaning | description |
* | Add entry | Database name | Add an entry page (view.php) |
*
* @param string $type identifies which type of page this is, e.g. 'Add entry'.
* @param string $identifier identifies the particular page, e.g. 'My database name'.
* @return moodle_url the corresponding URL.
* @throws Exception with a meaningful error message if the specified page cannot be found.
*/
protected function resolve_page_instance_url(string $type, string $identifier): moodle_url {
global $DB;
switch (strtolower($type)) {
case 'add entry':
return new moodle_url('/mod/data/edit.php', [
'd' => $this->get_cm_by_activity_name('data', $identifier)->instance,
]);
default:
throw new Exception("Unrecognised page type '{$type}'");
}
}
}
@@ -10,29 +10,21 @@ Feature: View activity completion in the database activity
| student1 | Vinnie | Student1 | student1@example.com |
| teacher1 | Darrell | Teacher1 | teacher1@example.com |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
| fullname | shortname | enablecompletion | showcompletionconditions |
| Course 1 | C1 | 1 | 1 |
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
| teacher1 | C1 | editingteacher |
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I navigate to "Edit settings" in current page administration
And I expand all fieldsets
And I set the following fields to these values:
| Enable completion tracking | Yes |
| Show activity completion conditions | Yes |
And I press "Save and display"
And the following "activity" exists:
| activity | data |
| course | C1 |
| idnumber | mh1 |
| name | Music history |
| section | 1 |
And I am on "Course 1" course homepage
And I follow "Music history"
And I navigate to "Edit settings" in current page administration
| activity | data |
| course | C1 |
| idnumber | mh1 |
| name | Music history |
| section | 1 |
| completionentriesenabled | 1 |
| completionentries | 2 |
Given I am on the "Music history" "data activity editing" page logged in as teacher1
And I expand all fieldsets
And I set the following fields to these values:
| Aggregate type | Average of ratings |
@@ -41,8 +33,6 @@ Feature: View activity completion in the database activity
| Completion tracking | Show activity as complete when conditions are met |
| Require view | 1 |
| Require grade | 1 |
| completionentriesenabled | 1 |
| completionentries | 2 |
And I press "Save and display"
And I add a "Text input" field to "Music history" database and I fill the form with:
| Field name | Instrument types |
@@ -51,9 +41,7 @@ Feature: View activity completion in the database activity
And I log out
Scenario: View automatic completion items as a teacher and confirm all tabs display conditions
Given I log in as "teacher1"
And I am on "Course 1" course homepage
When I follow "Music history"
Given I am on the "Music history" "data activity" page logged in as teacher1
Then "Music history" should have the "View" completion condition
And "Music history" should have the "Make entries: 2" completion condition
And "Music history" should have the "Receive a grade" completion condition
@@ -87,9 +75,7 @@ Feature: View activity completion in the database activity
And "Music history" should have the "Receive a grade" completion condition
Scenario: View automatic completion items as a student
Given I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Music history"
Given I am on the "Music history" "data activity" page logged in as student1
And the "View" completion condition of "Music history" is displayed as "done"
And the "Make entries: 2" completion condition of "Music history" is displayed as "todo"
And the "Receive a grade" completion condition of "Music history" is displayed as "todo"
@@ -109,30 +95,24 @@ Feature: View activity completion in the database activity
And the "Make entries: 2" completion condition of "Music history" is displayed as "done"
And the "Receive a grade" completion condition of "Music history" is displayed as "todo"
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Music history"
And I am on the "Music history" "data activity" page logged in as teacher1
And I follow "View single"
And I set the field "rating" to "3"
And I press "Rate"
And I log out
When I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Music history"
When I am on the "Music history" "data activity" page logged in as student1
Then the "View" completion condition of "Music history" is displayed as "done"
And the "Make entries: 2" completion condition of "Music history" is displayed as "done"
And the "Receive a grade" completion condition of "Music history" is displayed as "done"
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
When I am on the "Course 1" course page logged in as teacher1
And "Vinnie Student1" user has completed "Music history" activity
@javascript
Scenario: Use manual completion
Given I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Music history"
And I navigate to "Edit settings" in current page administration
Given I am on the "Music history" "data activity editing" page logged in as teacher1
And I expand all fieldsets
And I set the field "Completion tracking" to "Students can manually mark the activity as completed"
And I press "Save and display"
@@ -140,9 +120,7 @@ Feature: View activity completion in the database activity
And the manual completion button for "Music history" should be disabled
And I log out
# Student view.
When I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Music history"
When I am on the "Music history" "data activity" page logged in as student1
Then the manual completion button of "Music history" is displayed as "Mark as done"
And I toggle the manual completion state of "Music history"
And the manual completion button of "Music history" is displayed as "Done"
+25 -34
View File
@@ -16,18 +16,17 @@ Feature: Users can edit approved entries in database activities
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
@javascript
Scenario: Students can manage their approved entries to a database
# Create database activity and allow editing of
# approved entries.
And I add a "Database" to section "1" and I fill the form with:
| Name | Test database name |
| Description | Test |
| id_approval | Yes |
| id_manageapproved | Yes |
Given the following "activity" exists:
| activity | data |
| course | C1 |
| idnumber | Test database name |
| name | Test database name |
| approval | 1 |
| manageapproved | 1 |
And I am on the "Test database name" "data activity" page logged in as teacher1
And I add a "Text input" field to "Test database name" database and I fill the form with:
| Field name | Test field name |
| Field description | Test field description |
@@ -35,34 +34,31 @@ Feature: Users can edit approved entries in database activities
And I follow "Templates"
And I log out
# Add an entry as a student.
And I log in as "student1"
And I am on "Course 1" course homepage
And I am on the "Test database name" "data activity" page logged in as student1
And I add an entry to "Test database name" database with:
| Test field name | Student entry |
And I press "Save and view"
And I log out
# Approve the student's entry as a teacher.
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Test database name"
And I am on the "Test database name" "data activity" page logged in as teacher1
And I follow "Approve"
And I log out
# Make sure the student can still edit their entry after it's approved.
When I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test database name"
When I am on the "Test database name" "data activity" page logged in as student1
Then I should see "Student entry"
And "Edit" "link" should exist
@javascript
Scenario: Students can not manage their approved entries to a database
# Create database activity and don't allow editing of
# approved entries.
And I add a "Database" to section "1" and I fill the form with:
| Name | Test database name |
| Description | Test |
| id_approval | Yes |
| id_manageapproved | No |
# Create database activity and don't allow editing of approved entries.
Given the following "activity" exists:
| activity | data |
| course | C1 |
| idnumber | Test database name |
| name | Test database name |
| approval | 1 |
| manageapproved | 0 |
And I am on the "Test database name" "data activity" page logged in as teacher1
And I add a "Text input" field to "Test database name" database and I fill the form with:
| Field name | Test field name |
| Field description | Test field description |
@@ -70,21 +66,16 @@ Feature: Users can edit approved entries in database activities
And I follow "Templates"
And I log out
# Add an entry as a student.
And I log in as "student1"
And I am on "Course 1" course homepage
And I am on the "Test database name" "data activity" page logged in as student1
And I add an entry to "Test database name" database with:
| Test field name | Student entry |
And I press "Save and view"
And I log out
# Approve the student's entry as a teacher.
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Test database name"
And I am on the "Test database name" "data activity" page logged in as teacher1
And I follow "Approve"
And I log out
# Make sure the student isn't able to edit their entry after it's approved.
When I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test database name"
Then I should see "Student entry"
And "Edit" "link" should not exist
When I am on the "Test database name" "data activity" page logged in as student1
Then "Edit" "link" should not exist
And I should see "Student entry"
+10 -29
View File
@@ -175,9 +175,7 @@ Feature: Anonymous feedback
@javascript
Scenario: Anonymous feedback in a course
# Teacher can not
When I log in as "teacher"
And I am on "Course 1" course homepage
And I follow "Course feedback"
When I am on the "Course feedback" "feedback activity" page logged in as teacher
And I click on "Edit questions" "link" in the "[role=main]" "css_element"
And I add a "Multiple choice" question to the feedback with:
| Question | Do you like this course? |
@@ -186,9 +184,8 @@ Feature: Anonymous feedback
| Hide the "Not selected" option | Yes |
| Multiple choice values | Yes\nNo\nI don't know |
And I log out
And I log in as "user1"
And I am on "Course 1" course homepage
And I follow "Course feedback"
And I am on the "Course feedback" "feedback activity" page logged in as user1
And I follow "Preview"
Then I should see "Do you like this course?"
And I press "Continue"
@@ -198,9 +195,7 @@ Feature: Anonymous feedback
| Yes | 1 |
And I press "Submit your answers"
And I log out
And I log in as "user2"
And I am on "Course 1" course homepage
And I follow "Course feedback"
And I am on the "Course feedback" "feedback activity" page logged in as user2
And I follow "Preview"
And I should see "Do you like this course?"
And I press "Continue"
@@ -218,9 +213,7 @@ Feature: Anonymous feedback
And I should see "1 (50.00 %)" in the "Yes" "table_row"
And I should see "1 (50.00 %)" in the "No" "table_row"
And I log out
And I log in as "teacher"
And I am on "Course 1" course homepage
And I follow "Course feedback"
And I am on the "Course feedback" "feedback activity" page logged in as teacher
And I follow "Preview"
And I should see "Do you like this course?"
And I press "Continue"
@@ -243,12 +236,9 @@ Feature: Anonymous feedback
And I should see "Anonymous entries (1)"
And I should not see "Response number: 1"
And I should see "Response number: 2"
And I log out
Scenario: Collecting new non-anonymous feedback from a previously anonymous feedback activity
When I log in as "teacher"
And I am on "Course 1" course homepage
And I follow "Course feedback"
When I am on the "Course feedback" "feedback activity" page logged in as teacher
And I navigate to "Edit settings" in current page administration
And I set the following fields to these values:
| Allow multiple submissions | Yes |
@@ -259,36 +249,27 @@ Feature: Anonymous feedback
| Label | shorttext |
| Maximum characters accepted | 200 |
And I log out
When I log in as "user1"
And I am on "Course 1" course homepage
And I follow "Course feedback"
When I am on the "Course feedback" "feedback activity" page logged in as user1
And I follow "Answer the questions"
And I set the following fields to these values:
| this is a short text answer | anontext |
And I press "Submit your answers"
And I log out
# Switch to non-anon responses.
And I log in as "teacher"
And I am on "Course 1" course homepage
And I follow "Course feedback"
And I navigate to "Edit settings" in current page administration
And I am on the "Course feedback" "feedback activity editing" page logged in as teacher
And I set the following fields to these values:
| Record user names | User's name will be logged and shown with answers |
And I press "Save and display"
And I log out
# Now leave a non-anon feedback as user1
When I log in as "user1"
And I am on "Course 1" course homepage
And I follow "Course feedback"
And I am on the "Course feedback" "feedback activity" page logged in as user1
And I follow "Answer the questions"
And I set the following fields to these values:
| this is a short text answer | usertext |
And I press "Submit your answers"
And I log out
# Now check the responses are correct.
When I log in as "teacher"
And I am on "Course 1" course homepage
And I follow "Course feedback"
And I am on the "Course feedback" "feedback activity" page logged in as teacher
And I follow "Show responses"
And I should see "Anonymous entries (1)"
And I should see "Non anonymous entries (1)"
@@ -108,8 +108,7 @@ class behat_mod_feedback extends behat_base {
$this->execute('behat_auth::i_log_in_as', $username);
// Navigate to feedback complete form.
$this->execute('behat_navigation::i_am_on_course_homepage', $coursename);
$this->execute('behat_general::click_link', $feedbackname);
$this->execute('behat_navigation::i_am_on_page_instance', [$feedbackname, 'feedback activity']);
$this->execute('behat_general::click_link', $completeform);
// Fill form and submit.
+3 -11
View File
@@ -21,9 +21,7 @@ Feature: Exporting and importing feedbacks
| feedback | Learning experience | C1 | feedback0 |
Scenario: Export sample feedback and compare with the fixture
When I log in as "teacher"
And I am on "Course 1" course homepage
And I follow "Learning experience"
When I am on the "Learning experience" "feedback activity" page logged in as teacher
And I click on "Edit questions" "link" in the "[role=main]" "css_element"
And I add a "Information" question to the feedback with:
| Question | this is an information question |
@@ -73,9 +71,7 @@ Feature: Exporting and importing feedbacks
@javascript @_file_upload
Scenario: Import feedback deleting old items
When I log in as "teacher"
And I am on "Course 1" course homepage
And I follow "Learning experience"
When I am on the "Learning experience" "feedback activity" page logged in as teacher
And I click on "Edit questions" "link" in the "[role=main]" "css_element"
And I add a "Numeric answer" question to the feedback with:
| Question | Existing question |
@@ -96,13 +92,10 @@ Feature: Exporting and importing feedbacks
And I should see "this is a multiple choice rated"
And I should see "this is a numeric answer"
And I should see "this is a short text answer"
And I log out
@javascript @_file_upload
Scenario: Import feedback appending new items
When I log in as "teacher"
And I am on "Course 1" course homepage
And I follow "Learning experience"
When I am on the "Learning experience" "feedback activity" page logged in as teacher
And I click on "Edit questions" "link" in the "[role=main]" "css_element"
And I add a "Numeric answer" question to the feedback with:
| Question | Existing question |
@@ -125,4 +118,3 @@ Feature: Exporting and importing feedbacks
And I should see "this is a multiple choice rated"
And I should see "this is a numeric answer"
And I should see "this is a short text answer"
And I log out
@@ -10,20 +10,12 @@ Feature: View activity completion in the feedback activity
| student1 | Vinnie | Student1 | student1@example.com |
| teacher1 | Darrell | Teacher1 | teacher1@example.com |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
| fullname | shortname | enablecompletion | showcompletionconditions |
| Course 1 | C1 | 1 | 1 |
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
| teacher1 | C1 | editingteacher |
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I navigate to "Edit settings" in current page administration
And I expand all fieldsets
And I set the following fields to these values:
| Enable completion tracking | Yes |
| Show activity completion conditions | Yes |
And I press "Save and display"
And the following "activity" exists:
| activity | feedback |
| course | C1 |
@@ -33,8 +25,7 @@ Feature: View activity completion in the feedback activity
| completion | 2 |
| completionview | 1 |
| completionsubmit | 1 |
And I am on "Course 1" course homepage
And I follow "Music history"
And I am on the "Music history" "feedback activity" page logged in as teacher1
And I click on "Edit questions" "link" in the "[role=main]" "css_element"
And I add a "Multiple choice" question to the feedback with:
| Question | What is your favourite instrument |
@@ -44,32 +35,25 @@ Feature: View activity completion in the feedback activity
And I log out
Scenario: View automatic completion items as a teacher
Given I log in as "teacher1"
And I am on "Course 1" course homepage
When I follow "Music history"
When I am on the "Music history" "feedback activity" page logged in as teacher1
Then "Music history" should have the "View" completion condition
And "Music history" should have the "Submit feedback" completion condition
Scenario: View automatic completion items as a student
Given I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Music history"
Given I am on the "Music history" "feedback activity" page logged in as student1
And the "View" completion condition of "Music history" is displayed as "todo"
And the "Submit feedback" completion condition of "Music history" is displayed as "todo"
When I follow "Answer the questions"
And I set the field "drums" to "1"
And I press "Submit your answers"
And I press "Continue"
And I follow "Music history"
And I am on the "Music history" "feedback activity" page
Then the "View" completion condition of "Music history" is displayed as "done"
And the "Submit feedback" completion condition of "Music history" is displayed as "done"
@javascript
Scenario: Use manual completion
Given I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Music history"
And I navigate to "Edit settings" in current page administration
Given I am on the "Music history" "feedback activity editing" page logged in as teacher1
And I expand all fieldsets
And I set the field "Completion tracking" to "Students can manually mark the activity as completed"
And I press "Save and display"
@@ -77,9 +61,7 @@ Feature: View activity completion in the feedback activity
And the manual completion button for "Music history" should be disabled
And I log out
# Student view.
When I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Music history"
When I am on the "Music history" "feedback activity" page logged in as student1
Then the manual completion button of "Music history" is displayed as "Mark as done"
And I toggle the manual completion state of "Music history"
And the manual completion button of "Music history" is displayed as "Done"
+14 -44
View File
@@ -50,9 +50,7 @@ Feature: Feedbacks in courses with groups
| feedback | Site feedback | Acceptance test site | feedback0 | 2 | 1 | 1 | 1 |
| feedback | Course feedback | C1 | feedback1 | 2 | 1 | 1 | 0 |
| feedback | Course anon feedback | C1 | feedback2 | 1 | 1 | 1 | 0 |
When I log in as "manager"
And I am on site homepage
And I follow "Site feedback"
And I am on the "Site feedback" "feedback activity" page logged in as manager
And I click on "Edit questions" "link" in the "[role=main]" "css_element"
And I add a "Multiple choice" question to the feedback with:
| Question | Do you like our site? |
@@ -64,9 +62,7 @@ Feature: Feedbacks in courses with groups
@javascript
Scenario: Non anonymous feedback with groups in a course
When I log in as "teacher"
And I am on "Course 1" course homepage
And I follow "Course feedback"
Given I am on the "Course feedback" "feedback activity" page logged in as teacher
And I click on "Edit questions" "link" in the "[role=main]" "css_element"
And I add a "Multiple choice" question to the feedback with:
| Question | Do you like this course? |
@@ -90,9 +86,7 @@ Feature: Feedbacks in courses with groups
And I log in as "user7" and complete feedback "Course feedback" in course "Course 1" with:
| I don't know | 1 |
# View analysis, user1 should only see one group - group 1
And I log in as "user1"
And I am on "Course 1" course homepage
And I follow "Course feedback"
And I am on the "Course feedback" "feedback activity" page logged in as user1
And I follow "Submitted answers"
And I should see "Separate groups: Group 1"
And I show chart data for the "multichoice1" feedback
@@ -100,9 +94,7 @@ Feature: Feedbacks in courses with groups
And I should see "1 (25.00 %)" in the "Not at all" "table_row"
And I log out
# View analysis, user3 should only see one group - group 2
And I log in as "user3"
And I am on "Course 1" course homepage
And I follow "Course feedback"
And I am on the "Course feedback" "feedback activity" page logged in as user3
And I follow "Submitted answers"
And I should see "Separate groups: Group 2"
And I show chart data for the "multichoice1" feedback
@@ -110,9 +102,7 @@ Feature: Feedbacks in courses with groups
And I should see "2 (66.67 %)" in the "Not at all" "table_row"
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 log in as "user2"
And I am on "Course 1" course homepage
And I follow "Course feedback"
And I am on the "Course feedback" "feedback activity" page logged in as user2
And I follow "Submitted answers"
And the field "Separate groups" matches value "Group 1"
And I show chart data for the "multichoice1" feedback
@@ -125,9 +115,7 @@ Feature: Feedbacks in courses with groups
And the "Separate groups" select box should not contain "All participants"
And I log out
# User without group can see all participants only
And I log in as "user7"
And I am on "Course 1" course homepage
And I follow "Course feedback"
And I am on the "Course feedback" "feedback activity" page logged in as user7
And I follow "Submitted answers"
And I should see "Separate groups: All participants"
And I show chart data for the "multichoice1" feedback
@@ -136,9 +124,7 @@ Feature: Feedbacks in courses with groups
And I should see "2 (28.57 %)" in the "I don't know" "table_row"
And I log out
# Teacher can browse everybody
And I log in as "teacher"
And I am on "Course 1" course homepage
And I follow "Course feedback"
And I am on the "Course feedback" "feedback activity" page logged in as teacher
And I navigate to "Analysis" in current page administration
And the field "Separate groups" matches value "All participants"
And I show chart data for the "multichoice1" feedback
@@ -163,13 +149,10 @@ Feature: Feedbacks in courses with groups
And I select "All participants" from the "Separate groups" singleselect
And I should see "Username 1"
And I should see "Username 3"
And I log out
@javascript
Scenario: Anonymous feedback with groups in a course
When I log in as "teacher"
And I am on "Course 1" course homepage
And I follow "Course anon feedback"
Given I am on the "Course anon feedback" "feedback activity" page logged in as teacher
And I click on "Edit questions" "link" in the "[role=main]" "css_element"
And I add a "Multiple choice" question to the feedback with:
| Question | Do you like this course? |
@@ -180,9 +163,7 @@ Feature: Feedbacks in courses with groups
And I log out
And I log in as "user1" and complete feedback "Course anon feedback" in course "Course 1" with:
| Not at all | 1 |
And I log in as "user1"
And I am on "Course 1" course homepage
And I follow "Course anon feedback"
And I am on the "Course anon feedback" "feedback activity" page logged in as user1
And I follow "Submitted answers"
And I should see "There are insufficient responses for this group"
And I should not see "Yes of course"
@@ -200,9 +181,7 @@ Feature: Feedbacks in courses with groups
And I log in as "user7" and complete feedback "Course anon feedback" in course "Course 1" with:
| I don't know | 1 |
# View analysis, user1 should only see one group - group 1
And I log in as "user1"
And I am on "Course 1" course homepage
And I follow "Course anon feedback"
And I am on the "Course anon feedback" "feedback activity" page logged in as user1
And I follow "Submitted answers"
And I should see "Separate groups: Group 1"
And I show chart data for the "multichoice1" feedback
@@ -210,9 +189,7 @@ Feature: Feedbacks in courses with groups
And I should see "1 (25.00 %)" in the "Not at all" "table_row"
And I log out
# View analysis, user3 should only see one group - group 2
And I log in as "user3"
And I am on "Course 1" course homepage
And I follow "Course anon feedback"
And I am on the "Course anon feedback" "feedback activity" page logged in as user3
And I follow "Submitted answers"
And I should see "Separate groups: Group 2"
And I show chart data for the "multichoice1" feedback
@@ -220,9 +197,7 @@ Feature: Feedbacks in courses with groups
And I should see "2 (66.67 %)" in the "Not at all" "table_row"
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 log in as "user2"
And I am on "Course 1" course homepage
And I follow "Course anon feedback"
And I am on the "Course anon feedback" "feedback activity" page logged in as user2
And I follow "Submitted answers"
And the field "Separate groups" matches value "Group 1"
And I show chart data for the "multichoice1" feedback
@@ -235,9 +210,7 @@ Feature: Feedbacks in courses with groups
And the "Separate groups" select box should not contain "All participants"
And I log out
# User without group can see all participants only
And I log in as "user7"
And I am on "Course 1" course homepage
And I follow "Course anon feedback"
And I am on the "Course anon feedback" "feedback activity" page logged in as user7
And I follow "Submitted answers"
And I should see "Separate groups: All participants"
And I show chart data for the "multichoice1" feedback
@@ -246,9 +219,7 @@ Feature: Feedbacks in courses with groups
And I should see "2 (28.57 %)" in the "I don't know" "table_row"
And I log out
# Teacher can browse everybody
And I log in as "teacher"
And I am on "Course 1" course homepage
And I follow "Course anon feedback"
And I am on the "Course anon feedback" "feedback activity" page logged in as teacher
And I navigate to "Analysis" in current page administration
And the field "Separate groups" matches value "All participants"
And I show chart data for the "multichoice1" feedback
@@ -274,4 +245,3 @@ Feature: Feedbacks in courses with groups
And I select "All participants" from the "Separate groups" singleselect
And "//tr[contains(@id,'_r6') and contains(.,'Response number')]" "xpath_element" should exist
And "//tr[contains(@id,'_r7') and contains(@class,'emptyrow')]" "xpath_element" should exist
And I log out
+10 -31
View File
@@ -21,9 +21,7 @@ Feature: Testing multichoice questions in feedback
And the following "activities" exist:
| activity | name | course | idnumber |
| feedback | Learning experience | C1 | feedback0 |
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Learning experience"
And I am on the "Learning experience" "feedback activity" page logged in as teacher1
And I click on "Edit questions" "link" in the "[role=main]" "css_element"
@javascript
@@ -56,9 +54,7 @@ Feature: Testing multichoice questions in feedback
And I add a "Label" question to the feedback with:
| Contents | this is the third page of the feedback |
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Learning experience"
And I am on the "Learning experience" "feedback activity" page logged in as student1
And I follow "Answer the questions"
# Examine the first page, select nothing, go to the next page
Then the following fields match these values:
@@ -123,9 +119,7 @@ Feature: Testing multichoice questions in feedback
And I log out
# Student 2 tries to trick - he answers the third question and then
# goes back and changes dependency question. Analysis should not show this answer!
And I log in as "student2"
And I am on "Course 1" course homepage
And I follow "Learning experience"
And I am on the "Learning experience" "feedback activity" page logged in as student2
And I follow "Answer the questions"
And I set the field "option a" to "1"
And I press "Next page"
@@ -138,9 +132,7 @@ Feature: Testing multichoice questions in feedback
And I press "Submit your answers"
And I log out
# Login as teacher and check analysis
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Learning experience"
And I am on the "Learning experience" "feedback activity" page logged in as teacher1
And I navigate to "Analysis" in current page administration
And I should see "Submitted answers: 2"
And I should see "Questions: 3"
@@ -200,9 +192,7 @@ Feature: Testing multichoice questions in feedback
| Contents | this is the third page of the feedback |
And I log out
# Login as the first student.
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Learning experience"
And I am on the "Learning experience" "feedback activity" page logged in as student1
And I follow "Answer the questions"
# Examine the first page, select nothing, go to the next page
And I should not see "Not selected"
@@ -265,9 +255,7 @@ Feature: Testing multichoice questions in feedback
And I log out
# Student 2 tries to trick - he answers the third question and then
# goes back and changes dependency question. Analysis should not show this answer!
And I log in as "student2"
And I am on "Course 1" course homepage
And I follow "Learning experience"
And I am on the "Learning experience" "feedback activity" page logged in as student2
And I follow "Answer the questions"
And I set the field "option a" to "1"
And I set the field "option b" to "1"
@@ -282,9 +270,7 @@ Feature: Testing multichoice questions in feedback
And I press "Submit your answers"
And I log out
# Login as teacher and check analysis
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Learning experience"
And I am on the "Learning experience" "feedback activity" page logged in as teacher1
And I navigate to "Analysis" in current page administration
And I should see "Submitted answers: 2"
And I should see "Questions: 3"
@@ -342,9 +328,7 @@ Feature: Testing multichoice questions in feedback
And I add a "Label" question to the feedback with:
| Contents | this is the third page of the feedback |
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Learning experience"
And I am on the "Learning experience" "feedback activity" page logged in as student1
And I follow "Answer the questions"
# Examine the first page, select nothing, go to the next page
Then the following fields match these values:
@@ -390,9 +374,7 @@ Feature: Testing multichoice questions in feedback
And I log out
# Student 2 tries to trick - he answers the third question and then
# goes back and changes dependency question. Analysis should not show this answer!
And I log in as "student2"
And I am on "Course 1" course homepage
And I follow "Learning experience"
And I am on the "Learning experience" "feedback activity" page logged in as student2
And I follow "Answer the questions"
And I set the field "this is a multiple choice 1" to "option a"
And I press "Next page"
@@ -405,9 +387,7 @@ Feature: Testing multichoice questions in feedback
And I press "Submit your answers"
And I log out
# Login as teacher and check analysis
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Learning experience"
And I am on the "Learning experience" "feedback activity" page logged in as teacher1
And I navigate to "Analysis" in current page administration
And I should see "Submitted answers: 2"
And I should see "Questions: 3"
@@ -434,4 +414,3 @@ Feature: Testing multichoice questions in feedback
And I should see "1 (100.00 %)" in the "option a" "table_row"
And I should not see "%" in the "option b" "table_row"
And I should not see "%" in the "option c" "table_row"
And I log out
+4 -13
View File
@@ -108,9 +108,7 @@ Feature: Non anonymous feedback
@javascript
Scenario: Non anonymous feedback in a course
When I log in as "teacher"
And I am on "Course 1" course homepage
And I follow "Course feedback"
When I am on the "Course feedback" "feedback activity" page logged in as teacher
And I click on "Edit questions" "link" in the "[role=main]" "css_element"
And I add a "Multiple choice" question to the feedback with:
| Question | Do you like this course? |
@@ -119,18 +117,14 @@ Feature: Non anonymous feedback
| Hide the "Not selected" option | Yes |
| Multiple choice values | Yes of course\nNot at all\nI don't know |
And I log out
And I log in as "user1"
And I am on "Course 1" course homepage
And I follow "Course feedback"
When I am on the "Course feedback" "feedback activity" page logged in as user1
And I follow "Answer the questions"
And I should see "Do you like this course?"
And I set the following fields to these values:
| Yes of course | 1 |
And I press "Submit your answers"
And I log out
And I log in as "user2"
And I am on "Course 1" course homepage
And I follow "Course feedback"
When I am on the "Course feedback" "feedback activity" page logged in as user2
And I follow "Answer the questions"
And I should see "Do you like this course?"
And I set the following fields to these values:
@@ -145,9 +139,7 @@ Feature: Non anonymous feedback
And I should see "1 (50.00 %)" in the "Yes of course" "table_row"
And I should see "1 (50.00 %)" in the "Not at all" "table_row"
And I log out
And I log in as "teacher"
And I am on "Course 1" course homepage
And I follow "Course feedback"
When I am on the "Course feedback" "feedback activity" page logged in as teacher
And I follow "Preview"
And I should see "Do you like this course?"
And I press "Continue"
@@ -170,4 +162,3 @@ Feature: Non anonymous feedback
And I should see "Non anonymous entries (1)"
And I should not see "Username 1"
And I should see "Username 2"
And I log out
@@ -22,9 +22,7 @@ Feature: Test creating different types of feedback questions for anonymous feedb
And the following "activities" exist:
| activity | name | course | idnumber |
| feedback | Learning experience | C1 | feedback0 |
When I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Learning experience"
When I am on the "Learning experience" "feedback activity" page logged in as teacher1
And I click on "Edit questions" "link" in the "[role=main]" "css_element"
And I add a "Information" question to the feedback with:
| Question | this is an information question |
@@ -65,9 +63,7 @@ Feature: Test creating different types of feedback questions for anonymous feedb
| Label | shorttext |
| Maximum characters accepted | 200 |
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Learning experience"
And I am on the "Learning experience" "feedback activity" page logged in as student1
And I follow "Answer the questions"
And I set the following fields to these values:
| this is a longer text answer | my long answer |
@@ -80,9 +76,7 @@ Feature: Test creating different types of feedback questions for anonymous feedb
| this is a short text answer | hello |
And I press "Submit your answers"
And I log out
And I log in as "student2"
And I am on "Course 1" course homepage
And I follow "Learning experience"
And I am on the "Learning experience" "feedback activity" page logged in as student2
And I follow "Answer the questions"
And I set the following fields to these values:
| this is a longer text answer | lots of feedbacks |
@@ -95,16 +89,11 @@ Feature: Test creating different types of feedback questions for anonymous feedb
| this is a short text answer | no way |
And I press "Submit your answers"
And I log out
When I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Learning experience"
When I am on the "Learning experience" "feedback activity" page logged in as teacher1
And I navigate to "Analysis" in current page administration
And I should see "Submitted answers: 2"
And I should see "Questions: 8"
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Learning experience"
And I am on the "Learning experience" "feedback activity" page
And I navigate to "Analysis" in current page administration
And I should see "C1" in the "(info)" "table"
And I should see "my long answer" in the "(longertext)" "table"
@@ -22,9 +22,7 @@ Feature: Test creating different types of feedback questions for non-anonymous f
And the following "activities" exist:
| activity | name | course | idnumber | anonymous |
| feedback | Learning experience | C1 | feedback0 | 2 |
When I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Learning experience"
When I am on the "Learning experience" "feedback activity" page logged in as teacher1
And I click on "Edit questions" "link" in the "[role=main]" "css_element"
And I add a "Information" question to the feedback with:
| Question | this is an information question |
@@ -69,9 +67,7 @@ Feature: Test creating different types of feedback questions for non-anonymous f
| Label | shorttext |
| Maximum characters accepted | 200 |
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Learning experience"
When I am on the "Learning experience" "feedback activity" page logged in as student1
And I follow "Answer the questions"
And I set the following fields to these values:
| this is a longer text answer | my long answer |
@@ -84,9 +80,7 @@ Feature: Test creating different types of feedback questions for non-anonymous f
| this is a short text answer | hello |
And I press "Submit your answers"
And I log out
And I log in as "student2"
And I am on "Course 1" course homepage
And I follow "Learning experience"
When I am on the "Learning experience" "feedback activity" page logged in as student2
And I follow "Answer the questions"
And I set the following fields to these values:
| this is a longer text answer | lots of feedbacks |
@@ -99,16 +93,12 @@ Feature: Test creating different types of feedback questions for non-anonymous f
| this is a short text answer | no way |
And I press "Submit your answers"
And I log out
When I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Learning experience"
When I am on the "Learning experience" "feedback activity" page logged in as teacher1
And I navigate to "Analysis" in current page administration
And I should see "Submitted answers: 2"
And I should see "Questions: 9"
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Learning experience"
And I am on the "Learning experience" "feedback activity" page logged in as teacher1
And I navigate to "Analysis" in current page administration
And I should see "C1" in the "(info)" "table"
And I should see "my long answer" in the "(longertext)" "table"
@@ -44,7 +44,7 @@ Feature: Show users who have not responded to the feedback survey
| Description | x |
| Record user names | User's name will be logged and shown with answers |
| Access restrictions | Grouping: GX1 |
And I follow "Frogs"
And I am on the Frogs "feedback activity" page
And I click on "Edit questions" "link" in the "[role=main]" "css_element"
And I set the field "Add question" to "Short text answer"
And I set the following fields to these values:
@@ -53,18 +53,14 @@ Feature: Show users who have not responded to the feedback survey
And I log out
# Go in as student 1 and do the feedback.
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Frogs"
And I am on the Frogs "feedback activity" page logged in as student1
And I follow "Answer the questions"
And I set the field "Y/N?" to "Y"
And I press "Submit your answers"
And I log out
# Go in as teacher and check the users who haven't completed it.
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Frogs"
And I am on the Frogs "feedback activity" page logged in as teacher1
And I navigate to "Show non-respondents" in current page administration
# Should only show student 2; not student 1 (they did it) or 3 (not in grouping).
+14 -38
View File
@@ -25,9 +25,7 @@ Feature: Saving, using and deleting feedback templates
| feedback | Learning experience course 1 | C1 | feedback1 |
| feedback | Another feedback in course 1 | C1 | feedback2 |
| feedback | Learning experience course 2 | C2 | feedback3 |
And I log in as "teacher"
And I am on "Course 1" course homepage
And I follow "Learning experience course 1"
And I am on the "Learning experience course 1" "feedback activity" page logged in as teacher
And I click on "Edit questions" "link" in the "[role=main]" "css_element"
And I add a "Multiple choice" question to the feedback with:
| Question | this is a multiple choice 1 |
@@ -38,9 +36,7 @@ Feature: Saving, using and deleting feedback templates
Scenario: Teacher can save template and re-use it in the same course only
# Go to feedback templates and make sure none exist yet
When I log in as "teacher"
And I am on "Course 1" course homepage
And I follow "Learning experience course 1"
When I am on the "Learning experience course 1" "feedback activity" page logged in as teacher
And I follow "Templates"
Then I should see "No templates available yet"
And "Use a template" "field" should not exist
@@ -55,8 +51,7 @@ Feature: Saving, using and deleting feedback templates
And I should see "Template saved"
And the "Use a template" select box should contain "My first template"
# Create a feedback from this template in the same course
And I am on "Course 1" course homepage
And I follow "Another feedback in course 1"
And I am on the "Another feedback in course 1" "feedback activity" page
And I follow "Templates"
And I set the field "Use a template" to "My first template"
And I press "Use this template"
@@ -65,24 +60,19 @@ Feature: Saving, using and deleting feedback templates
And I follow "Edit questions"
And I should see "this is a multiple choice 1"
# Make sure this template is not available in another course
And I am on "Course 2" course homepage
And I follow "Learning experience course 2"
And I am on the "Learning experience course 2" "feedback activity" page
And I follow "Templates"
And I should see "No templates available yet"
And "Use a template" "field" should not exist
And I log out
And I should see "No templates available yet"
Scenario: Teacher can append template to existing questions or remove them
# Save feedback as a course template
When I log in as "teacher"
And I am on "Course 1" course homepage
And I follow "Learning experience course 1"
When I am on the "Learning experience course 1" "feedback activity" page logged in as teacher
And I follow "Templates"
And I set the field "Name" to "My first template"
And I press "Save as new template"
# Add questions to another feedback
And I am on "Course 1" course homepage
And I follow "Another feedback in course 1"
And I am on the "Another feedback in course 1" "feedback activity" page
And I click on "Edit questions" "link" in the "[role=main]" "css_element"
And I add a "Multiple choice" question to the feedback with:
| Question | What is your favourite subject |
@@ -104,22 +94,17 @@ Feature: Saving, using and deleting feedback templates
And I set the field "Delete old items" to "1"
And I press "Save changes"
And I follow "Edit questions"
And I should see "this is a multiple choice 1"
And I should not see "What is your favourite subject"
And I log out
And I should see "this is a multiple choice 1"
Scenario: Manager can save template as public and it will be available in any course
When I log in as "manager"
And I am on "Course 1" course homepage
And I follow "Learning experience course 1"
When I am on the "Learning experience course 1" "feedback activity" page logged in as manager
And I follow "Templates"
And I set the field "Name" to "My first template"
And I set the field "Public" to "1"
And I press "Save as new template"
And I log out
And I log in as "teacher"
And I am on "Course 2" course homepage
And I follow "Learning experience course 2"
And I am on the "Learning experience course 2" "feedback activity" page logged in as teacher
And I follow "Templates"
And I set the field "Use a template" to "My first template"
And I press "Use this template"
@@ -127,13 +112,10 @@ Feature: Saving, using and deleting feedback templates
And I press "Save changes"
And I follow "Edit questions"
And I should see "this is a multiple choice 1"
And I log out
Scenario: Teacher can delete course templates but can not delete public templates
# Save feedback as both public and course template
When I log in as "manager"
And I am on "Course 1" course homepage
And I follow "Learning experience course 1"
When I am on the "Learning experience course 1" "feedback activity" page logged in as manager
And I follow "Templates"
And I set the field "Name" to "My public template"
And I set the field "Public" to "1"
@@ -142,9 +124,7 @@ Feature: Saving, using and deleting feedback templates
And I press "Save as new template"
And I log out
# Login as teacher and try to delete templates
And I log in as "teacher"
And I am on "Course 1" course homepage
And I follow "Another feedback in course 1"
And I am on the "Another feedback in course 1" "feedback activity" page logged in as teacher
And I follow "Templates"
And I follow "Delete template..."
Then I should not see "My public template"
@@ -157,14 +137,11 @@ Feature: Saving, using and deleting feedback templates
And I press "Back"
And the "Use a template" select box should not contain "My course template"
And the "Use a template" select box should contain "My public template"
And I log out
@javascript
Scenario: Manager can delete both course and public templates
# Save feedback as both public and course template
When I log in as "manager"
And I am on "Course 1" course homepage
And I follow "Learning experience course 1"
When I am on the "Learning experience course 1" "feedback activity" page logged in as manager
And I click on "Templates" "link" in the "[role=main]" "css_element"
And I set the field "Name" to "My public template"
And I set the field "Public" to "1"
@@ -190,6 +167,5 @@ Feature: Saving, using and deleting feedback templates
And "My public template" "text" should not exist in the ".publictemplates" "css_element"
And "No templates available yet" "text" should exist in the ".publictemplates" "css_element"
And I press "Back"
And I should see "No templates available yet"
And "Use a template" "field" should not exist
And I log out
And I should see "No templates available yet"
@@ -10,25 +10,15 @@ Feature: View activity completion information in the folder activity
| student1 | Vinnie | Student1 | student1@example.com |
| teacher1 | Darrell | Teacher1 | teacher1@example.com |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
| fullname | shortname | enablecompletion | showcompletionconditions |
| Course 1 | C1 | 1 | 1 |
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
| teacher1 | C1 | editingteacher |
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I navigate to "Edit settings" in current page administration
And I expand all fieldsets
And I set the following fields to these values:
| Enable completion tracking | Yes |
| Show activity completion conditions | Yes |
And I press "Save and display"
And I log out
Scenario: View automatic completion items
Given I log in as "teacher1"
And the following "activity" exists:
Given the following "activity" exists:
| activity | folder |
| course | C1 |
| idnumber | mh1 |
@@ -36,36 +26,29 @@ Feature: View activity completion information in the folder activity
| section | 1 |
| completion | 2 |
| completionview | 1 |
And I am on "Course 1" course homepage
# Teacher view.
And I follow "Music history"
And I am on the "Music history" "folder activity" page logged in as teacher1
And "Music history" should have the "View" completion condition
And I log out
# Student view.
When I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Music history"
When I am on the "Music history" "folder activity" page logged in as student1
Then the "View" completion condition of "Music history" is displayed as "done"
@javascript
Scenario: Use manual completion
Given I log in as "teacher1"
And the following "activity" exists:
Given the following "activity" exists:
| activity | folder |
| course | C1 |
| idnumber | mh1 |
| name | Music history |
| section | 1 |
| completion | 1 |
And I am on "Course 1" course homepage
And I follow "Music history"
And I am on the "Music history" "folder activity" page logged in as teacher1
# Teacher view.
And the manual completion button for "Music history" should be disabled
And I log out
# Student view.
When I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Music history"
When I am on the "Music history" "folder activity" page logged in as student1
Then the manual completion button of "Music history" is displayed as "Mark as done"
And I toggle the manual completion state of "Music history"
And the manual completion button of "Music history" is displayed as "Done"
@@ -40,9 +40,7 @@ Feature: Message users in the summary report
And the following "course enrolments" exist:
| user | course | role |
| student3 | C1 | student |
When I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "forum1"
When I am on the forum1 "forum activity" page logged in as teacher1
And I navigate to "Forum summary report" in current page administration
And I click on "Select 'Student 1'" "checkbox"
And I click on "Select 'Student 3'" "checkbox"
@@ -62,9 +60,7 @@ Feature: Message users in the summary report
@javascript
Scenario: Message all users
When I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "forum1"
When I am on the forum1 "forum activity" page logged in as teacher1
And I navigate to "Forum summary report" in current page administration
And I click on "Select all" "checkbox"
And I set the field "With selected users..." to "Send a message"
@@ -72,13 +68,9 @@ Feature: Message users in the summary report
@javascript
Scenario: Ensure no message options when messaging is disabled
Given I log in as "admin"
And I set the following administration settings values:
Given the following config values are set as admin:
| messaging | 0 |
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "forum1"
When I am on the forum1 "forum activity" page logged in as teacher1
And I navigate to "Forum summary report" in current page administration
Then I should not see "With selected users..."
And I should not see "Select all"
@@ -33,9 +33,7 @@ Feature: Report relevant content availability
@javascript
Scenario: Teachers can access report data about other users by default
Given I log in as "teacher1"
When I am on "Course 1" course homepage
And I follow "forum1"
Given I am on the "forum1" "forum activity" page logged in as teacher1
And I navigate to "Forum summary report" in current page administration
Then the following should exist in the "forumreport_summary_table" table:
| -2- | -3- | -4- | -5- | -6- | -7- | -8- |
@@ -57,9 +55,7 @@ Feature: Report relevant content availability
And "Export posts" "link" should not exist
Scenario: Students cannot access the summary report by default
Given I log in as "student1"
When I am on "Course 1" course homepage
And I follow "forum1"
Given I am on the "forum1" "forum activity" page logged in as student1
Then "Forum summary report" "link" should not exist in current page administration
@javascript
@@ -67,9 +63,7 @@ Feature: Report relevant content availability
Given the following "permission overrides" exist:
| capability | permission | role | contextlevel | reference |
| forumreport/summary:view | Allow | student | Course | C1 |
When I log in as "student1"
And I am on "Course 1" course homepage
And I follow "forum1"
When I am on the "forum1" "forum activity" page logged in as student1
And I navigate to "Forum summary report" in current page administration
Then the following should exist in the "forumreport_summary_table" table:
| -1- | -2- | -3- | -4- | -5- | -6- | -7- |
@@ -35,9 +35,9 @@ Feature: Groups report filter is available if groups exist
| student1 | G3 |
And the following "activities" exist:
| activity | name | description | course | idnumber | groupmode |
| forum | forum1 | C1 first forum | C1 | forum1 | 1 |
| forum | forum2 | C1 second forum | C1 | forum2 | 2 |
| forum | forum1 | C2 first forum | C2 | forum1 | 0 |
| forum | forum1 | C1 first forum | C1 | c1forum1 | 1 |
| forum | forum2 | C1 second forum | C1 | c1forum2 | 2 |
| forum | forum1 | C2 first forum | C2 | c2forum1 | 0 |
And the following forum discussions exist in course "Course 1":
| user | forum | name | message | group | created |
| teacher1 | forum1 | discussion1 | D1 message | G1 | ## 1 month ago ## |
@@ -62,9 +62,7 @@ Feature: Groups report filter is available if groups exist
@javascript
Scenario: All groups can be selected or cleared together in the groups filter, and are unchecked by default
When I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "forum1"
When I am on the "c1forum1" "forum activity" page logged in as teacher1
And I navigate to "Forum summary report" in current page administration
Then "Groups" "button" should exist
And the following should exist in the "forumreport_summary_table" table:
@@ -112,9 +110,7 @@ Feature: Groups report filter is available if groups exist
@javascript
Scenario: The summary report can be filtered by a subset of groups, and re-ordering the results retains the filter
When I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "forum1"
When I am on the "c1forum1" "forum activity" page logged in as teacher1
And I navigate to "Forum summary report" in current page administration
Then "Groups" "button" should exist
And the following should exist in the "forumreport_summary_table" table:
@@ -148,9 +144,7 @@ Feature: Groups report filter is available if groups exist
@javascript
Scenario: The summary report can be filtered as a mixture of groups and no groups
When I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "forum2"
When I am on the "c1forum2" "forum activity" page logged in as teacher1
And I navigate to "Forum summary report" in current page administration
Then "Groups" "button" should exist
And the following should exist in the "forumreport_summary_table" table:
@@ -174,9 +168,7 @@ Feature: Groups report filter is available if groups exist
@javascript
Scenario: The summary report can be filtered by no groups only
When I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "forum2"
When I am on the "c1forum2" "forum activity" page logged in as teacher1
And I navigate to "Forum summary report" in current page administration
Then the following should exist in the "forumreport_summary_table" table:
# | | Discussions | Replies |
@@ -199,9 +191,7 @@ Feature: Groups report filter is available if groups exist
@javascript
Scenario: Filtering by a group containing no users still allows the page to render
# Log in as admin so Teacher 1 not existing on page can be confirmed.
When I log in as "admin"
And I am on "Course 1" course homepage
And I follow "forum1"
When I am on the "c1forum1" "forum activity" page logged in as admin
And I navigate to "Forum summary report" in current page administration
Then "Groups" "button" should exist
And the following should exist in the "forumreport_summary_table" table:
@@ -224,9 +214,7 @@ Feature: Groups report filter is available if groups exist
@javascript
Scenario: Course forum summary report can be filtered by group
When I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "forum2"
When I am on the "c1forum2" "forum activity" page logged in as teacher1
And I navigate to "Forum summary report" in current page administration
And I select "All forums in course" from the "Forum selected" singleselect
And I click on "Groups" "button"
+1 -1
View File
@@ -39,7 +39,7 @@ Feature: Add forum activities and discussions
| Attachment | lib/tests/fixtures/upload_users.csv |
Then I should see "Reply with attachment"
And I should see "upload_users.csv"
And I follow "Test forum name"
And I am on the "Test forum name" "forum activity" page
And I follow "Post with attachment"
And I should see "empty.txt"
And I follow "Edit"
+11 -31
View File
@@ -38,9 +38,7 @@ Feature: The forum search allows users to perform advanced searches for forum po
And I log out
Scenario: Perform an advanced search using any term
Given I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Announcements"
Given I am on the "Announcements" "forum activity" page logged in as student1
And I press "Search forums"
And I should see "Advanced search"
And I set the field "words" to "subject"
@@ -49,9 +47,7 @@ Feature: The forum search allows users to perform advanced searches for forum po
And I should see "Your subjective"
Scenario: Perform an advanced search avoiding words
Given I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Announcements"
Given I am on the "Announcements" "forum activity" page logged in as student1
And I press "Search forums"
And I should see "Advanced search"
And I set the field "words" to "My"
@@ -62,11 +58,9 @@ Feature: The forum search allows users to perform advanced searches for forum po
Scenario: Perform an advanced search using whole words
Given database family used is one of the following:
| mysql |
| mysql |
| postgres |
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Announcements"
And I am on the "Announcements" "forum activity" page logged in as student1
And I press "Search forums"
And I should see "Advanced search"
And I set the field "fullwords" to "subject"
@@ -75,9 +69,7 @@ Feature: The forum search allows users to perform advanced searches for forum po
And I should not see "Your subjective"
Scenario: Perform an advanced search matching the subject
Given I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Announcements"
Given I am on the "Announcements" "forum activity" page logged in as student1
And I press "Search forums"
And I should see "Advanced search"
And I set the field "subject" to "subjective"
@@ -92,9 +84,7 @@ Feature: The forum search allows users to perform advanced searches for forum po
| Subject | My Subjects |
| Message | My message |
And I log out
When I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Announcements"
When I am on the "Announcements" "forum activity" page logged in as student1
And I press "Search forums"
And I should see "Advanced search"
And I set the field "user" to "TWO"
@@ -103,9 +93,7 @@ Feature: The forum search allows users to perform advanced searches for forum po
And I should not see "Teacher ONE"
Scenario: Perform an advanced search with multiple words
Given I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Announcements"
Given I am on the "Announcements" "forum activity" page logged in as student1
And I press "Search forums"
And I should see "Advanced search"
And I set the field "subject" to "your subjective"
@@ -115,18 +103,14 @@ Feature: The forum search allows users to perform advanced searches for forum po
@javascript
Scenario: Perform an advanced search using tags
Given I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Announcements"
Given I am on the "Announcements" "forum activity" page logged in as teacher1
And I follow "My subject"
And I follow "Edit"
And I set the following fields to these values:
| Tags | SearchedTag |
And I press "Save changes"
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Announcements"
And I am on the "Announcements" "forum activity" page logged in as student1
And I press "Search forums"
And I should see "Advanced search"
And I set the field "Is tagged with" to "SearchedTag"
@@ -136,9 +120,7 @@ Feature: The forum search allows users to perform advanced searches for forum po
@javascript
Scenario: Perform an advanced search on starred discussions without text
Given I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Announcements"
Given I am on the "Announcements" "forum activity" page logged in as student1
And I click on "Your subjective" action menu
And I follow "Star this discussion"
And I press "Search forums"
@@ -150,9 +132,7 @@ Feature: The forum search allows users to perform advanced searches for forum po
@javascript
Scenario: Perform an advanced search on starred discussions with text
Given I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Announcements"
Given I am on the "Announcements" "forum activity" page logged in as student1
And I click on "Your subjective" action menu
And I follow "Star this discussion"
And I press "Search forums"
+4 -8
View File
@@ -112,9 +112,8 @@ class behat_mod_forum extends behat_base {
* @param TableNode $table
*/
public function i_reply_post_from_forum_using_an_inpage_reply_with($postsubject, $forumname, TableNode $table) {
// Navigate to forum.
$this->execute('behat_general::click_link', $this->escape($forumname));
$this->execute('behat_navigation::i_am_on_page_instance', [$this->escape($forumname), 'forum activity']);
$this->execute('behat_general::click_link', $this->escape($postsubject));
$this->execute('behat_general::click_link', get_string('reply', 'forum'));
@@ -132,9 +131,8 @@ class behat_mod_forum extends behat_base {
* @param string $forumname The forum name
*/
public function i_navigate_to_post_in_forum($postsubject, $forumname) {
// Navigate to forum discussion.
$this->execute('behat_general::click_link', $this->escape($forumname));
$this->execute('behat_navigation::i_am_on_page_instance', [$this->escape($forumname), 'forum activity']);
$this->execute('behat_general::click_link', $this->escape($postsubject));
}
@@ -475,9 +473,8 @@ class behat_mod_forum extends behat_base {
* @param string $buttonstr
*/
protected function add_new_discussion($forumname, TableNode $table, $buttonstr) {
// Navigate to forum.
$this->execute('behat_general::click_link', $this->escape($forumname));
$this->execute('behat_navigation::i_am_on_page_instance', [$this->escape($forumname), 'forum activity']);
$this->execute('behat_general::click_link', $buttonstr);
$this->execute('behat_forms::press_button', get_string('showadvancededitor'));
@@ -495,9 +492,8 @@ class behat_mod_forum extends behat_base {
* @param string $buttonstr
*/
protected function add_new_discussion_inline($forumname, TableNode $table, $buttonstr) {
// Navigate to forum.
$this->execute('behat_general::click_link', $this->escape($forumname));
$this->execute('behat_navigation::i_am_on_page_instance', [$this->escape($forumname), 'forum activity']);
$this->execute('behat_general::click_link', $buttonstr);
$this->fill_new_discussion_form($table);
}
@@ -14,17 +14,18 @@ Feature: Students can choose from 4 discussion display options and their choice
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
And I log in as "admin"
And I am on "Course 1" course homepage with editing mode on
And I add a "Forum" to section "1" and I fill the form with:
| Forum name | Test forum name |
| Description | Test forum description |
And the following "activity" exists:
| course | C1 |
| activity | forum |
| name | Test forum name |
And I am on the "Course 1" course page logged in as admin
And I add a new discussion to "Test forum name" forum with:
| Subject | Discussion 1 |
| Message | Discussion contents 1, first message |
And I reply "Discussion 1" post from "Test forum name" forum with:
| Subject | Reply 1 to discussion 1 |
| Message | Discussion contents 1, second message |
And I am on the "Course 1" course page
And I add a new discussion to "Test forum name" forum with:
| Subject | Discussion 2 |
| Message | Discussion contents 2, first message |
@@ -32,11 +33,10 @@ Feature: Students can choose from 4 discussion display options and their choice
| Subject | Reply 1 to discussion 2 |
| Message | Discussion contents 2, second message |
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
Scenario: Display replies flat, with oldest first
Given I reply "Discussion 1" post from "Test forum name" forum with:
Given I am on the "Course 1" course page logged in as student1
And I reply "Discussion 1" post from "Test forum name" forum with:
| Subject | Reply 2 to discussion 1 |
| Message | Discussion contents 1, third message |
When I select "Display replies flat, with oldest first" from the "mode" singleselect
@@ -50,7 +50,8 @@ Feature: Students can choose from 4 discussion display options and their choice
And I should see "Discussion contents 2, second message" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' forumpost ') and not(contains(@class, 'starter'))]" "xpath_element"
Scenario: Display replies flat, with newest first
Given I reply "Discussion 1" post from "Test forum name" forum with:
Given I am on the "Course 1" course page logged in as student1
And I reply "Discussion 1" post from "Test forum name" forum with:
| Subject | Reply 2 to discussion 1 |
| Message | Discussion contents 1, third message |
When I select "Display replies flat, with newest first" from the "mode" singleselect
@@ -64,24 +65,24 @@ Feature: Students can choose from 4 discussion display options and their choice
And I should see "Discussion contents 2, third message" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' forumpost ') and not(contains(@class, 'starter'))]" "xpath_element"
Scenario: Display replies in threaded form
Given I follow "Test forum name"
Given I am on the "Test forum name" "forum activity" page logged in as student1
And I follow "Discussion 1"
When I select "Display replies in threaded form" from the "mode" singleselect
Then I should see "Discussion contents 1, first message"
And I should see "Reply 1 to discussion 1" in the "div.forumthread" "css_element"
And I follow "Test forum name"
And I click on "Test forum name" "link" in the "page-header" "region"
And I follow "Discussion 2"
And the field "Display mode" matches value "Display replies in threaded form"
And I should see "Discussion contents 2, first message"
And I should see "Reply 1 to discussion 2" in the "div.forumthread" "css_element"
Scenario: Display replies in nested form
Given I follow "Test forum name"
Given I am on the "Test forum name" "forum activity" page logged in as student1
And I follow "Discussion 1"
When I select "Display replies in nested form" from the "mode" singleselect
Then I should see "Discussion contents 1, first message" in the "div.firstpost.starter" "css_element"
And I should see "Discussion contents 1, second message" in the "div.indent div.forumpost" "css_element"
And I follow "Test forum name"
And I click on "Test forum name" "link" in the "page-header" "region"
And I follow "Discussion 2"
And the field "Display mode" matches value "Display replies in nested form"
And I should see "Discussion contents 2, first message" in the "div.firstpost.starter" "css_element"
+8 -13
View File
@@ -11,11 +11,11 @@ Feature: As a teacher, you can manually lock individual discussions when viewing
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
And I log in as "admin"
And I am on "Course 1" course homepage with editing mode on
And I add a "Forum" to section "1" and I fill the form with:
| Forum name | Test forum name |
| Description | Test forum description |
And the following "activity" exists:
| course | C1 |
| activity | forum |
| name | Test forum name |
And I am on the "Course 1" course page logged in as admin
And I add a new discussion to "Test forum name" forum with:
| Subject | Discussion 1 |
| Message | Discussion contents 1, first message |
@@ -28,11 +28,9 @@ Feature: As a teacher, you can manually lock individual discussions when viewing
And I reply "Discussion 2" post from "Test forum name" forum with:
| Subject | Reply 1 to discussion 2 |
| Message | Discussion contents 2, second message |
And I log out
Scenario: Lock a discussion and view
Given I log in as "admin"
And I am on "Course 1" course homepage
Given I am on the "Course 1" course page
And I navigate to post "Discussion 1" in "Test forum name" forum
And I press "Settings"
Then "Lock this discussion" "link" should be visible
@@ -53,8 +51,7 @@ Feature: As a teacher, you can manually lock individual discussions when viewing
@accessibility
Scenario: A locked discussion must be accessible
Given I log in as "admin"
And I am on "Course 1" course homepage
Given I am on the "Course 1" course page
And I navigate to post "Discussion 1" in "Test forum name" forum
When I reply "Discussion 1" post from "Test forum name" forum with:
| Subject | Discussion 1: Hello world! |
@@ -66,9 +63,7 @@ Feature: As a teacher, you can manually lock individual discussions when viewing
# Check discussion view accessibility with info notification shown when discussion is locked.
And the page should meet accessibility standards with "wcag143" extra tests
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test forum name"
And I am on the "Test forum name" "forum activity" page logged in as student1
# Check discussion list accessibility with danger pill shown when discussion is locked.
And the page should meet accessibility standards with "wcag143" extra tests
And I follow "Preferences" in the user menu
@@ -34,9 +34,7 @@ Feature: A user can control their own subscription preferences for a discussion
| Subject | Test post subject two |
| Message | Test post message two |
And I log out
When I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test forum name"
When I am on the "Test forum name" "forum activity" page logged in as student1
Then I can subscribe to this forum
And "Subscribe to this discussion" "checkbox" should exist in the "Test post subject one" "table_row"
And "Subscribe to this discussion" "checkbox" should exist in the "Test post subject two" "table_row"
@@ -81,9 +79,7 @@ Feature: A user can control their own subscription preferences for a discussion
| Subject | Test post subject two |
| Message | Test post message two |
And I log out
When I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test forum name"
When I am on the "Test forum name" "forum activity" page logged in as student1
Then I can unsubscribe from this forum
And "Unsubscribe from this discussion" "checkbox" should exist in the "Test post subject one" "table_row"
And "Unsubscribe from this discussion" "checkbox" should exist in the "Test post subject two" "table_row"
@@ -128,9 +124,7 @@ Feature: A user can control their own subscription preferences for a discussion
| Subject | Test post subject two |
| Message | Test post message two |
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test forum name"
And I am on the "Test forum name" "forum activity" page logged in as student1
And I can subscribe to this forum
And "Subscribe to this discussion" "checkbox" should exist in the "Test post subject one" "table_row"
And "Subscribe to this discussion" "checkbox" should exist in the "Test post subject two" "table_row"
@@ -139,17 +133,13 @@ Feature: A user can control their own subscription preferences for a discussion
And "Unsubscribe from this discussion" "checkbox" should exist in the "Test post subject one" "table_row"
And "Subscribe to this discussion" "checkbox" should exist in the "Test post subject two" "table_row"
And I log out
And I log in as "admin"
And I am on "Course 1" course homepage
And I follow "Test forum name"
And I am on the "Test forum name" "forum activity" page logged in as admin
And I navigate to "Edit settings" in current page administration
And I set the following fields to these values:
| Subscription mode | Auto subscription |
And I press "Save and return to course"
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test forum name"
And I am on the "Test forum name" "forum activity" page logged in as student1
And I can unsubscribe from this forum
And "Unsubscribe from this discussion" "checkbox" should exist in the "Test post subject one" "table_row"
And "Unsubscribe from this discussion" "checkbox" should exist in the "Test post subject two" "table_row"
@@ -177,9 +167,7 @@ Feature: A user can control their own subscription preferences for a discussion
| Subject | Test post subject two |
| Message | Test post message two |
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test forum name"
And I am on the "Test forum name" "forum activity" page logged in as student1
And I can subscribe to this forum
And "Subscribe to this discussion" "checkbox" should exist in the "Test post subject one" "table_row"
And "Subscribe to this discussion" "checkbox" should exist in the "Test post subject two" "table_row"
@@ -189,16 +177,13 @@ Feature: A user can control their own subscription preferences for a discussion
And "Subscribe to this discussion" "checkbox" should exist in the "Test post subject two" "table_row"
And I log out
And I log in as "admin"
And I am on "Course 1" course homepage
And I follow "Test forum name"
And I am on the "Test forum name" "forum activity" page
And I navigate to "Edit settings" in current page administration
And I set the following fields to these values:
| Subscription mode | Auto subscription |
And I press "Save and return to course"
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test forum name"
And I am on the "Test forum name" "forum activity" page logged in as student1
And I can unsubscribe from this forum
And "Unsubscribe from this discussion" "checkbox" should exist in the "Test post subject one" "table_row"
And "Unsubscribe from this discussion" "checkbox" should exist in the "Test post subject two" "table_row"
@@ -225,9 +210,7 @@ Feature: A user can control their own subscription preferences for a discussion
| Subject | Test post subject two |
| Message | Test post message two |
And I log out
When I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test forum name"
When I am on the "Test forum name" "forum activity" page logged in as student1
And I should see "Subscribe to this forum"
And I reply "Test post subject one" post from "Test forum name" forum with:
| Subject | Reply 1 to discussion 1 |
@@ -237,7 +220,7 @@ Feature: A user can control their own subscription preferences for a discussion
| Subject | Reply 1 to discussion 1 |
| Message | Discussion contents 1, second message |
| Discussion subscription | 0 |
And I follow "Test forum name"
And I am on the "Test forum name" "forum activity" page
Then "Unsubscribe from this discussion" "checkbox" should exist in the "Test post subject one" "table_row"
And "Subscribe to this discussion" "checkbox" should exist in the "Test post subject two" "table_row"
And I follow "Test post subject one"
@@ -265,9 +248,7 @@ Feature: A user can control their own subscription preferences for a discussion
| Subject | Test post subject two |
| Message | Test post message two |
And I log out
When I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test forum name"
When I am on the "Test forum name" "forum activity" page logged in as student1
And I should see "Unsubscribe from this forum"
And I reply "Test post subject one" post from "Test forum name" forum with:
| Subject | Reply 1 to discussion 1 |
@@ -277,13 +258,13 @@ Feature: A user can control their own subscription preferences for a discussion
| Subject | Reply 1 to discussion 1 |
| Message | Discussion contents 1, second message |
| Discussion subscription | 0 |
And I follow "Test forum name"
And I am on the "Test forum name" "forum activity" page
Then "Unsubscribe from this discussion" "checkbox" should exist in the "Test post subject one" "table_row"
And "Subscribe to this discussion" "checkbox" should exist in the "Test post subject two" "table_row"
And I follow "Test post subject one"
And I follow "Reply"
And the field "Discussion subscription" matches value "Send me notifications of new posts in this discussion"
And I follow "Test forum name"
And I am on the "Test forum name" "forum activity" page
And I follow "Test post subject two"
And I follow "Reply"
And the field "Discussion subscription" matches value "I don't want to be notified of new posts in this discussion"
@@ -337,9 +318,7 @@ Feature: A user can control their own subscription preferences for a discussion
| Subject | Test post subject one |
| Message | Test post message one |
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
When I follow "Test forum name"
When I am on the "Test forum name" "forum activity" page logged in as student1
Then "Subscribe to this forum" "link" should exist in current page administration
And I follow "Test post subject one"
And "You are not subscribed to this discussion. Click to subscribe" "link" should exist
+7 -10
View File
@@ -16,11 +16,11 @@ Feature: Edited forum posts handle tags correctly
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add a "Forum" to section "1" and I fill the form with:
| Forum name | Test forum name |
| Description | Test forum description |
And the following "activity" exists:
| course | C1 |
| activity | forum |
| name | Test forum name |
And I am on the "Course 1" Course page logged in as teacher1
And I add a new discussion to "Test forum name" forum with:
| Subject | Teacher post subject |
| Message | Teacher post message |
@@ -28,8 +28,7 @@ Feature: Edited forum posts handle tags correctly
@javascript
Scenario: Forum post edition of custom tags works as expected
Given I log in as "student1"
And I am on "Course 1" course homepage
Given I am on the "Course 1" Course page logged in as student1
And I reply "Teacher post subject" post from "Test forum name" forum with:
| Subject | Student post subject |
| Message | Student post message |
@@ -47,9 +46,7 @@ Feature: Edited forum posts handle tags correctly
And I set the field "Enter comma-separated list of new tags" to "OT1, OT2, OT3"
And I press "Continue"
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Test forum"
And I am on the "Test forum name" "forum activity" page logged in as teacher1
And I click on "Add a new discussion topic" "link"
And I click on "Advanced" "button"
And I expand all fieldsets
@@ -9,13 +9,13 @@ Feature: A student can favourite a discussion via the forum settings menu
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
And I log in as "admin"
And I am on "Course 1" course homepage with editing mode on
And I add a "Forum" to section "1" and I fill the form with:
| Forum name | Test forum name |
| Description | Test forum description |
| user | course | role |
| student1 | C1 | student |
And the following "activity" exists:
| course | C1 |
| activity | forum |
| name | Test forum name |
And I am on the "Course 1" Course page logged in as admin
And I add a new discussion to "Test forum name" forum with:
| Subject | Discussion 1 |
| Message | Discussion contents 1, first message |
@@ -23,25 +23,25 @@ Feature: A student can favourite a discussion via the forum settings menu
| Subject | Reply 1 to discussion 1 |
| Message | Discussion contents 1, second message |
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
Scenario: Student can favourite a discussion from within an individual discussion
Given I reply "Discussion 1" post from "Test forum name" forum with:
Given I am on the "Course 1" Course page logged in as student1
And I reply "Discussion 1" post from "Test forum name" forum with:
| Subject | Reply 2 to discussion 1 |
| Message | Discussion contents 1, third message |
And I wait until the page is ready
And I open the action menu in "[data-container='discussion-tools']" "css_element"
When I open the action menu in "[data-container='discussion-tools']" "css_element"
And I click on "[title='Star this discussion']" "css_element"
And I wait "3" seconds
And I open the action menu in "[data-container='discussion-tools']" "css_element"
And I click on "[title='Unstar this discussion']" "css_element"
Scenario: Student can favourite a discussion from the discussion list
Given I reply "Discussion 1" post from "Test forum name" forum with:
Given I am on the "Course 1" Course page logged in as student1
And I reply "Discussion 1" post from "Test forum name" forum with:
| Subject | Reply 2 to discussion 1 |
| Message | Discussion contents 1, third message |
And I follow "Test forum name"
When I am on the "Test forum name" "forum activity" page
And I click on "Discussion 1" action menu
And I click on "[title='Star this discussion']" "css_element"
And I click on "Discussion 1" action menu
@@ -10,29 +10,19 @@ Feature: View activity completion in the forum activity
| student1 | Vinnie | Student1 | student1@example.com |
| teacher1 | Darrell | Teacher1 | teacher1@example.com |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
| fullname | shortname | enablecompletion | showcompletionconditions |
| Course 1 | C1 | 1 | 1 |
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
| teacher1 | C1 | editingteacher |
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I navigate to "Edit settings" in current page administration
And I expand all fieldsets
And I set the following fields to these values:
| Enable completion tracking | Yes |
| Show activity completion conditions | Yes |
And I press "Save and display"
And the following "activity" exists:
| activity | forum |
| course | C1 |
| idnumber | mh1 |
| name | Music history |
| section | 1 |
And I am on "Course 1" course homepage
And I follow "Music history"
And I navigate to "Edit settings" in current page administration
And I am on the "Music history" "forum activity editing" page logged in as teacher1
And I expand all fieldsets
And I set the following fields to these values:
| Whole forum grading > Type | Point |
@@ -49,9 +39,7 @@ Feature: View activity completion in the forum activity
And I log out
Scenario: View automatic completion items as a teacher
Given I log in as "teacher1"
And I am on "Course 1" course homepage
When I follow "Music history"
When I am on the "Music history" "forum activity" page logged in as teacher1
Then "Music history" should have the "View" completion condition
And "Music history" should have the "Start discussions: 1" completion condition
And "Music history" should have the "Make forum posts: 2" completion condition
@@ -60,9 +48,7 @@ Feature: View activity completion in the forum activity
@javascript
Scenario: View automatic completion items as a student
Given I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Music history"
Given I am on the "Music history" "forum activity" page logged in as student1
And the "View" completion condition of "Music history" is displayed as "done"
And the "Start discussions: 1" completion condition of "Music history" is displayed as "todo"
And the "Make forum posts: 2" completion condition of "Music history" is displayed as "todo"
@@ -71,8 +57,7 @@ Feature: View activity completion in the forum activity
And I add a new discussion to "Music history" forum with:
| Subject | Fun instruments |
| Message | I like drums |
And I am on "Course 1" course homepage
And I follow "Music history"
And I am on the "Music history" "forum activity" page
And the "View" completion condition of "Music history" is displayed as "done"
And the "Start discussions: 1" completion condition of "Music history" is displayed as "done"
And the "Make forum posts: 2" completion condition of "Music history" is displayed as "todo"
@@ -81,8 +66,7 @@ Feature: View activity completion in the forum activity
And I reply "Fun instruments" post from "Music history" forum with:
| Subject | Reply 1 to Fun instruments |
| Message | Guitar is also Fun |
And I am on "Course 1" course homepage
And I follow "Music history"
And I am on the "Music history" "forum activity" page
And the "View" completion condition of "Music history" is displayed as "done"
And the "Start discussions: 1" completion condition of "Music history" is displayed as "done"
And the "Make forum posts: 2" completion condition of "Music history" is displayed as "done"
@@ -90,18 +74,14 @@ Feature: View activity completion in the forum activity
And the "Receive a grade" completion condition of "Music history" is displayed as "todo"
And I log out
# Grade the student
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Music history"
And I am on the "Music history" "forum activity" page logged in as teacher1
And I press "Grade users"
And I set the field "grade" to "33"
And I press "Save"
And I press "Close grader"
And I log out
# All conditions should now be completed.
When I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Music history"
When I am on the "Music history" "forum activity" page logged in as student1
Then the "View" completion condition of "Music history" is displayed as "done"
And the "Start discussions: 1" completion condition of "Music history" is displayed as "done"
And the "Make forum posts: 2" completion condition of "Music history" is displayed as "done"
@@ -110,9 +90,7 @@ Feature: View activity completion in the forum activity
@javascript
Scenario: Use manual completion
Given I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Music history"
Given I am on the "Music history" "forum activity" page logged in as teacher1
And I navigate to "Edit settings" in current page administration
And I expand all fieldsets
And I set the field "Completion tracking" to "Students can manually mark the activity as completed"
@@ -121,9 +99,7 @@ Feature: View activity completion in the forum activity
And the manual completion button for "Music history" should be disabled
And I log out
# Student view.
When I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Music history"
When I am on the "Music history" "forum activity" page logged in as student1
Then the manual completion button of "Music history" is displayed as "Mark as done"
And I toggle the manual completion state of "Music history"
And the manual completion button of "Music history" is displayed as "Done"
+3 -9
View File
@@ -22,9 +22,7 @@ Feature: Export forum
| forum | Test forum 1 | Test forum 1 description | general | C1 | 123 |
Scenario: Teacher can export forum
Given I log in as "teacher1"
And I am on "Course 1" course homepage
When I follow "Test forum 1"
Given I am on the "Test forum 1" "forum activity" page logged in as teacher1
And I navigate to "Export" in current page administration
And I open the autocomplete suggestions list
And I should see "Student 1" in the ".form-autocomplete-suggestions" "css_element"
@@ -35,9 +33,7 @@ Feature: Export forum
And I log out
Scenario: Students cannot export forum by default
Given I log in as "student1"
And I am on "Course 1" course homepage
When I follow "Test forum 1"
Given I am on the "Test forum 1" "forum activity" page logged in as student1
Then "Export" "link" should not exist in current page administration
And I log out
@@ -45,9 +41,7 @@ Feature: Export forum
Given the following "permission overrides" exist:
| capability | permission | role | contextlevel | reference |
| mod/forum:exportforum | Allow | student | Course | C1 |
When I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test forum 1"
When I am on the "Test forum 1" "forum activity" page logged in as student1
And I navigate to "Export" in current page administration
And I open the autocomplete suggestions list
And I should see "Student 1" in the ".form-autocomplete-suggestions" "css_element"
@@ -44,14 +44,13 @@ Feature: As a teacher I need to see an accurate list of subscribed users
| Forum type | Standard forum for general use |
| Description | Test forum description |
| Subscription mode | Forced subscription |
And I follow "Forced Forum 1"
And I am on the "Forced Forum 1" "forum activity" page
And I navigate to "Show/edit current subscribers" in current page administration
Then I should see "Student 1"
And I should see "Teacher Teacher"
And I should see "Student 2"
And I should see "Student 3"
And I follow "Forced Forum 1"
And I navigate to "Edit settings" in current page administration
And I am on the "Forced Forum 1" "forum activity editing" page
And I expand all fieldsets
And I click on "Add restriction..." "button"
And I click on "Grouping" "button" in the "Add restriction..." "dialogue"
@@ -72,14 +71,13 @@ Feature: As a teacher I need to see an accurate list of subscribed users
| course | C1 |
| idnumber | 0001 |
| section | 1 |
And I am on "Course 1" course homepage
And I follow "Forced Forum 2"
And I am on the "Forced Forum 2" "forum activity" page
And I navigate to "Edit settings" in current page administration
And I set the following fields to these values:
| Subscription mode | Forced subscription |
| Availability | Show on course page |
And I press "Save and return to course"
And I follow "Forced Forum 2"
And I am on the "Forced Forum 2" "forum activity" page
And I navigate to "Show/edit current subscribers" in current page administration
Then I should see "Teacher Teacher"
And I should see "Student 1"
@@ -97,13 +95,12 @@ Feature: As a teacher I need to see an accurate list of subscribed users
| idnumber | 0001 |
| section | 1 |
And I am on "Course 1" course homepage
And I follow "Forced Forum 2"
And I navigate to "Edit settings" in current page administration
And I am on the "Forced Forum 2" "forum activity editing" page
And I set the following fields to these values:
| Subscription mode | Forced subscription |
| Availability | Hide from students |
And I press "Save and return to course"
And I follow "Forced Forum 2"
And I am on the "Forced Forum 2" "forum activity" page
And I navigate to "Show/edit current subscribers" in current page administration
Then I should see "Teacher Teacher"
And I should not see "Student 1"
@@ -117,14 +114,14 @@ Feature: As a teacher I need to see an accurate list of subscribed users
| Forum type | Standard forum for general use |
| Description | Test forum description |
| Subscription mode | Auto subscription |
And I follow "Forced Forum 1"
And I am on the "Forced Forum 1" "forum activity" page
And I navigate to "Show/edit current subscribers" in current page administration
Then I should see "Student 1"
And I should see "Teacher Teacher"
And I should see "Student 2"
And I should see "Student 3"
And I follow "Forced Forum 1"
And I navigate to "Edit settings" in current page administration
And I am on "Course 1" course homepage
And I am on the "Forced Forum 1" "forum activity editing" page
And I expand all fieldsets
And I click on "Add restriction..." "button"
And I click on "Grouping" "button" in the "Add restriction..." "dialogue"
@@ -19,75 +19,57 @@ Feature: A user can control their default discussion subscription settings
And the following "activities" exist:
| activity | name | intro | course | idnumber | type | section |
| forum | Test forum name | Test forum description | C1 | forump1 | general | 1 |
And I log in as "admin"
And I am on "Course 1" course homepage
And I follow "Test forum name"
And I navigate to "Edit settings" in current page administration
And I am on the "Test forum name" "forum activity editing" page logged in as admin
And I set the following fields to these values:
| Subscription mode | Optional subscription |
And I press "Save and return to course"
And I am on "Course 1" course homepage with editing mode on
And I log out
Scenario: Creating a new discussion in an optional forum follows user preferences
Given I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test forum name"
Given I am on the "Test forum name" "forum activity" page logged in as student1
When I click on "Add a new discussion topic" "link"
And I click on "Advanced" "button"
Then "input[name=discussionsubscribe][checked=checked]" "css_element" should exist
And I log out
And I log in as "student2"
And I am on "Course 1" course homepage
And I follow "Test forum name"
And I am on the "Test forum name" "forum activity" page logged in as student2
And I click on "Add a new discussion topic" "link"
And I click on "Advanced" "button"
And "input[name=discussionsubscribe]:not([checked=checked])" "css_element" should exist
Scenario: Replying to an existing discussion in an optional forum follows user preferences
Given I add a new discussion to "Test forum name" forum with:
Given I am on the "Test forum name" "forum activity" page logged in as admin
And I add a new discussion to "Test forum name" forum with:
| Subject | Test post subject |
| Message | Test post message |
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test forum name"
And I am on the "Test forum name" "forum activity" page logged in as student1
And I follow "Test post subject"
When I follow "Reply"
Then "input[name=discussionsubscribe][checked=checked]" "css_element" should exist
And I log out
And I log in as "student2"
And I am on "Course 1" course homepage
And I follow "Test forum name"
And I am on the "Test forum name" "forum activity" page logged in as student2
And I follow "Test post subject"
And I follow "Reply"
And "input[name=discussionsubscribe]:not([checked=checked])" "css_element" should exist
Scenario: Creating a new discussion in an automatic forum follows forum subscription
Given I follow "Test forum name"
And I navigate to "Edit settings" in current page administration
Given I am on the "Test forum name" "forum activity editing" page logged in as admin
And I set the following fields to these values:
| Subscription mode | Auto subscription |
And I press "Save and return to course"
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test forum name"
And I am on the "Test forum name" "forum activity" page logged in as student1
When I click on "Add a new discussion topic" "link"
And I click on "Advanced" "button"
Then "input[name=discussionsubscribe][checked=checked]" "css_element" should exist
And I log out
And I log in as "student2"
And I am on "Course 1" course homepage
And I follow "Test forum name"
And I am on the "Test forum name" "forum activity" page logged in as student2
And I click on "Add a new discussion topic" "link"
And I click on "Advanced" "button"
And "input[name=discussionsubscribe][checked=checked]" "css_element" should exist
Scenario: Replying to an existing discussion in an automatic forum follows forum subscription
Given I am on "Course 1" course homepage
And I follow "Test forum name"
And I navigate to "Edit settings" in current page administration
Given I am on the "Test forum name" "forum activity editing" page logged in as admin
And I set the following fields to these values:
| Subscription mode | Optional subscription |
And I press "Save and return to course"
@@ -95,24 +77,19 @@ Feature: A user can control their default discussion subscription settings
| Subject | Test post subject |
| Message | Test post message |
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test forum name"
And I am on the "Test forum name" "forum activity" page logged in as student1
And I follow "Test post subject"
When I follow "Reply"
Then "input[name=discussionsubscribe][checked=checked]" "css_element" should exist
And I log out
And I log in as "student2"
And I am on "Course 1" course homepage
And I follow "Test forum name"
And I am on the "Test forum name" "forum activity" page logged in as student2
And I follow "Test post subject"
And I follow "Reply"
And "input[name=discussionsubscribe]:not([checked=checked])" "css_element" should exist
@javascript
Scenario: Replying to an existing discussion in an automatic forum which has been unsubscribed from follows user preferences
Given I follow "Test forum name"
And I navigate to "Edit settings" in current page administration
Given I am on the "Test forum name" "forum activity editing" page logged in as admin
And I set the following fields to these values:
| Subscription mode | Auto subscription |
And I press "Save and return to course"
@@ -120,18 +97,14 @@ Feature: A user can control their default discussion subscription settings
| Subject | Test post subject |
| Message | Test post message |
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test forum name"
And I am on the "Test forum name" "forum activity" page logged in as student1
And I click on "input[id^=subscription-toggle]" "css_element" in the "Test post subject" "table_row"
And I follow "Test post subject"
When I follow "Reply"
And I click on "Advanced" "button"
And "input[name=discussionsubscribe][checked]" "css_element" should exist
And I log out
And I log in as "student2"
And I am on "Course 1" course homepage
And I follow "Test forum name"
And I am on the "Test forum name" "forum activity" page logged in as student2
And I click on "input[id^=subscription-toggle]" "css_element" in the "Test post subject" "table_row"
And I follow "Test post subject"
And I follow "Reply"
@@ -37,9 +37,7 @@ Feature: View discussion while grading in a forum
| Gradable forum | student2 | My topic | I disagree |
Scenario: Viewing a discussion
Given I log in as "teacher"
And I am on "Course 1" course homepage
And I follow "Gradable forum"
Given I am on the "Gradable forum" "forum activity" page logged in as teacher
And I press "Grade users"
When I press "View discussion"
Then I should see "I disagree" in the "My topic" "dialogue"
@@ -47,9 +45,7 @@ Feature: View discussion while grading in a forum
And I should not see "I disagree"
Scenario: Viewing a discussion while grading is fullscreen
Given I log in as "teacher"
And I am on "Course 1" course homepage
And I follow "Gradable forum"
Given I am on the "Gradable forum" "forum activity" page logged in as teacher
And I press "Grade users"
# Uses the aria-label for the menu in in the grading interface.
And I press "Actions for the grader interface"
@@ -16,13 +16,11 @@ Feature: Blog posts are always displayed in reverse chronological order
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add a "Forum" to section "1" and I fill the form with:
| Forum name | Course blog forum |
| Description | Single discussion forum description |
| Forum type | Standard forum displayed in a blog-like format |
And I log out
And the following "activity" exists:
| course | C1 |
| activity | forum |
| name | Course blog forum |
| type | blog |
#
# We need javascript/wait to prevent creation of the posts in the same second. The threads
@@ -31,9 +29,7 @@ Feature: Blog posts are always displayed in reverse chronological order
#
@javascript
Scenario: Replying to a blog post or editing it does not affect its display order
Given I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Course blog forum"
Given I am on the "Course blog forum" "forum activity" page logged in as student1
#
# Add three posts into the blog.
#
@@ -58,14 +54,11 @@ Feature: Blog posts are always displayed in reverse chronological order
#
# Reply to another blog post.
#
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Course blog forum"
And I am on the "Course blog forum" "forum activity" page logged in as teacher1
And I click on "Discuss this topic" "link" in the "//div[@aria-label='Blog post 1 by Student 1']" "xpath_element"
And I reply "Blog post 1" post from "Course blog forum" forum with:
| Message | Reply to the first post |
And I am on "Course 1" course homepage
And I follow "Course blog forum"
And I am on the "Course blog forum" "forum activity" page
#
# Make sure the order of the blog posts is still reverse chronological.
#
@@ -16,13 +16,10 @@ Feature: New discussions and discussions with recently added replies are display
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add a "Forum" to section "1" and I fill the form with:
| Forum name | Course general forum |
| Description | Single discussion forum description |
| Forum type | Standard forum for general use |
And I log out
And the following "activity" exists:
| course | C1 |
| activity | forum |
| name | Course general forum |
#
# We need javascript/wait to prevent creation of the posts in the same second. The threads
@@ -31,9 +28,7 @@ Feature: New discussions and discussions with recently added replies are display
#
@javascript
Scenario: Replying to a forum post or editing it puts the discussion to the front
Given I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Course general forum"
Given I am on the "Course general forum" "forum activity" page logged in as student1
#
# Add three posts into the forum.
#
@@ -59,14 +54,11 @@ Feature: New discussions and discussions with recently added replies are display
#
# Reply to another forum post.
#
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Course general forum"
And I am on the "Course general forum" "forum activity" page logged in as teacher1
And I follow "Forum post 1"
And I reply "Forum post 1" post from "Course general forum" forum with:
| Message | Reply to the first post |
And I am on "Course 1" course homepage
And I follow "Course general forum"
And I am on the "Course general forum" "forum activity" page
#
# Make sure the order of the forum posts is as expected, with most recent new participation first (ie excluding edits).
#
+4 -6
View File
@@ -25,13 +25,12 @@ Feature: Glossary entries can be organised in categories
| label | name | check autolinking of CategoryAutoLinks and CategoryNoLinks text | C1 | label1 |
And the "glossary" filter is "on"
# Log in as a teacher and make sure nothing is yet autolinked
And I log in as "teacher1"
When I am on "Course 1" course homepage
When I am on the "Course 1" course page logged in as teacher1
Then I should see "CategoryAutoLinks"
And I should see "CategoryNoLinks"
And "a.glossary.autolink" "css_element" should not exist
# Create, edit and delete categories
And I follow "MyGlossary"
And I am on the MyGlossary "glossary activity" page
And I follow "Browse by category"
And I press "Edit categories"
And I press "Add category"
@@ -97,8 +96,7 @@ Feature: Glossary entries can be organised in categories
And I should see "CategoryNoLinks"
And "//a[contains(.,'CategoryNoLinks')]" "xpath_element" should not exist
# Delete a category with entries
And I am on "Course 1" course homepage
And I follow "MyGlossary"
And I am on the MyGlossary "glossary activity" page
And I follow "Browse by category"
And I press "Edit categories"
And I should see "2 Entries" in the "CategoryNoLinks" "table_row"
@@ -106,7 +104,7 @@ Feature: Glossary entries can be organised in categories
And I click on "Delete" "link" in the "CategoryAutoLinks" "table_row"
And I press "Yes"
And I wait to be redirected
And I follow "MyGlossary"
And I am on the MyGlossary "glossary activity" page
And I follow "Browse by category"
And I should see "EntryCategoryNL"
And I should not see "EntryNoCategory"
+7 -12
View File
@@ -16,17 +16,14 @@ Feature: Edited glossary entries handle tags correctly
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add a "Glossary" to section "1" and I fill the form with:
| Name | Test glossary |
| Description | A glossary about dreams! |
And I log out
And the following "activity" exists:
| course | C1 |
| activity | glossary |
| name | Test glossary |
| intro | A glossary about dreams! |
Scenario: Glossary entry edition of custom tags works as expected
Given I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Test glossary"
Given I am on the "Test glossary" "glossary activity" page logged in as teacher1
And I press "Add a new entry"
And I set the following fields to these values:
| Concept | Dummy first entry |
@@ -50,9 +47,7 @@ Feature: Edited glossary entries handle tags correctly
And I set the field "Enter comma-separated list of new tags" to "OT1, OT2, OT3"
And I press "Continue"
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Test glossary"
Given I am on the "Test glossary" "glossary activity" page logged in as teacher1
And I press "Add a new entry"
And I expand all fieldsets
And I open the autocomplete suggestions list
@@ -28,53 +28,39 @@ Feature: A teacher can choose whether glossary entries require approval
| defaultapproval | 0 |
Scenario: Approve and undo approve glossary entries
Given I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test glossary name"
Given I am on the "Test glossary name" "glossary activity" page logged in as student1
When I add a glossary entry with the following data:
| Concept | Just a test concept |
| Definition | Concept definition |
| Keyword(s) | Black |
And I log out
# Test that students can not see the unapproved entry.
And I log in as "student2"
And I am on "Course 1" course homepage
And I follow "Test glossary name"
And I am on the "Test glossary name" "glossary activity" page logged in as student2
Then I should see "No entries found in this section"
And I log out
# Approve the entry.
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Test glossary name"
And I am on the "Test glossary name" "glossary activity" page logged in as teacher1
And I follow "Waiting approval"
Then I should see "(this entry is currently hidden)"
And I follow "Approve"
And I follow "Test glossary name"
And I click on "Test glossary name" "link" in the "page-header" "region"
Then I should see "Concept definition"
And I log out
# Check that the entry can now be viewed by students.
And I log in as "student2"
And I am on "Course 1" course homepage
And I follow "Test glossary name"
And I am on the "Test glossary name" "glossary activity" page logged in as student2
Then I should see "Concept definition"
And I log out
# Undo the approval of the previous entry.
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Test glossary name"
And I am on the "Test glossary name" "glossary activity" page logged in as teacher1
And I follow "Undo approval"
And I log out
# Check that the entry is no longer visible by students.
And I log in as "student2"
And I am on "Course 1" course homepage
And I follow "Test glossary name"
And I am on the "Test glossary name" "glossary activity" page logged in as student2
Then I should see "No entries found in this section"
@javascript
Scenario: View pending approval glossary items
Given I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test glossary name"
Given I am on the "Test glossary name" "glossary activity" page logged in as student1
When I add a glossary entry with the following data:
| Concept | Just a test concept |
| Definition | Concept definition |
@@ -10,29 +10,18 @@ Feature: View activity completion in the glossary activity
| student1 | Vinnie | Student1 | student1@example.com |
| teacher1 | Darrell | Teacher1 | teacher1@example.com |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
| fullname | shortname | enablecompletion | showcompletionconditions |
| Course 1 | C1 | 1 | 1 |
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
| teacher1 | C1 | editingteacher |
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I navigate to "Edit settings" in current page administration
And I expand all fieldsets
And I set the following fields to these values:
| Enable completion tracking | Yes |
| Show activity completion conditions | Yes |
And I press "Save and display"
And the following "activity" exists:
| activity | glossary |
| course | C1 |
| idnumber | mh1 |
| name | Music history |
| section | 1 |
And I am on "Course 1" course homepage
And I follow "Music history"
And I navigate to "Edit settings" in current page administration
And I am on the "Music history" "glossary activity editing" page logged in as teacher1
And I expand all fieldsets
And I set the following fields to these values:
| Aggregate type | Average of ratings |
@@ -47,22 +36,17 @@ Feature: View activity completion in the glossary activity
And I log out
Scenario: View automatic completion items as a teacher
Given I log in as "teacher1"
And I am on "Course 1" course homepage
When I follow "Music history"
Given I am on the "Music history" "glossary activity" page logged in as teacher1
Then "Music history" should have the "View" completion condition
And "Music history" should have the "Make entries: 1" completion condition
And "Music history" should have the "Receive a grade" completion condition
Scenario: View automatic completion items as a student
Given I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Music history"
Given I am on the "Music history" "glossary activity" page logged in as student1
And the "View" completion condition of "Music history" is displayed as "done"
And the "Make entries: 1" completion condition of "Music history" is displayed as "todo"
And the "Receive a grade" completion condition of "Music history" is displayed as "todo"
When I am on "Course 1" course homepage
And I follow "Music history"
And I am on the "Music history" "glossary activity" page
And I press "Add a new entry"
And I set the following fields to these values:
| Concept | Blast beats |
@@ -72,25 +56,18 @@ Feature: View activity completion in the glossary activity
And the "Make entries: 1" completion condition of "Music history" is displayed as "done"
And the "Receive a grade" completion condition of "Music history" is displayed as "todo"
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Music history"
And I am on the "Music history" "glossary activity" page logged in as teacher1
And I set the field "rating" to "3"
And I press "Rate"
And I log out
When I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Music history"
When I am on the "Music history" "glossary activity" page logged in as student1
Then the "View" completion condition of "Music history" is displayed as "done"
And the "Make entries: 1" completion condition of "Music history" is displayed as "done"
And the "Receive a grade" completion condition of "Music history" is displayed as "done"
@javascript
Scenario: Use manual completion
Given I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Music history"
And I navigate to "Edit settings" in current page administration
Given I am on the "Music history" "glossary activity editing" page logged in as teacher1
And I expand all fieldsets
And I set the field "Completion tracking" to "Students can manually mark the activity as completed"
And I press "Save and display"
@@ -98,9 +75,7 @@ Feature: View activity completion in the glossary activity
And the manual completion button for "Music history" should be disabled
And I log out
# Student view.
When I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Music history"
When I am on the "Music history" "glossary activity" page logged in as student1
Then the manual completion button of "Music history" is displayed as "Mark as done"
And I toggle the manual completion state of "Music history"
And the manual completion button of "Music history" is displayed as "Done"
@@ -23,7 +23,7 @@ Feature: Importing glossary entries
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add the "Recent activity" block
And I follow "Glossary 1"
And I am on the "Glossary 1" "glossary activity" page
And I navigate to "Import entries" in current page administration
And I upload "mod/glossary/tests/fixtures/texfilter_glossary_en.xml" file to "File to import" filemanager
When I press "Submit"
@@ -38,7 +38,7 @@ Feature: Importing glossary entries
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add the "Tags" block
And I follow "Glossary 1"
And I am on the "Glossary 1" "glossary activity" page
And I navigate to "Import entries" in current page administration
And I upload "mod/glossary/tests/fixtures/musicians.xml" file to "File to import" filemanager
When I press "Submit"
@@ -15,13 +15,13 @@ Feature: A teacher can choose whether to allow duplicate entries in a glossary
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I add a "Glossary" to section "1" and I fill the form with:
| Name | Test glossary name |
| Description | Test glossary description |
| Duplicate entries allowed | No |
And I follow "Test glossary name"
And the following "activity" exists:
| course | C1 |
| activity | glossary |
| name | Test glossary name |
| intro | Test glossary description |
| allowduplicatedentries | 0 |
And I am on the "Test glossary name" "glossary activity" page logged in as teacher1
And I add a glossary entry with the following data:
| Concept | Unique concept |
| Definition | I'm the definition of an unique concept |
@@ -16,19 +16,16 @@ Feature: A teacher can choose whether to provide a printer-friendly glossary ent
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
@javascript
Scenario: Printer-friendly glossary view enabled
Given I add a "Glossary" to section "1" and I fill the form with:
| Name | Test glossary name |
| Description | Test glossary description |
| Allow print view | Yes |
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test glossary name"
Given the following "activity" exists:
| course | C1 |
| activity | glossary |
| name | Test glossary name |
| intro | Test glossary description |
| allowprintview | 1 |
And I am on the "Test glossary name" "glossary activity" page logged in as student1
When I add a glossary entry with the following data:
| Concept | Just a test concept |
| Definition | Concept definition |
@@ -39,14 +36,13 @@ Feature: A teacher can choose whether to provide a printer-friendly glossary ent
@javascript
Scenario: Printer-friendly glossary view disabled
Given I add a "Glossary" to section "1" and I fill the form with:
| Name | Test glossary name |
| Description | Test glossary description |
| Allow print view | No |
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test glossary name"
Given the following "activity" exists:
| course | C1 |
| activity | glossary |
| name | Test glossary name |
| intro | Test glossary description |
| allowprintview | 0 |
And I am on the "Test glossary name" "glossary activity" page logged in as student1
When I add a glossary entry with the following data:
| Concept | Just a test concept |
| Definition | Concept definition |
@@ -19,9 +19,7 @@ Feature: Glossary entries can be searched or browsed by alphabet, category, date
And the following "activities" exist:
| activity | name | intro | displayformat | course | idnumber |
| glossary | Test glossary name | Test glossary description | fullwithauthor | C1 | g1 |
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Test glossary name"
And I am on the "Test glossary name" "glossary activity" page logged in as teacher1
And I add a glossary entries category named "The ones I like"
And I add a glossary entries category named "All for you"
And I add a glossary entry with the following data:
@@ -29,17 +27,13 @@ Feature: Glossary entries can be searched or browsed by alphabet, category, date
| Definition | Sour eggplants |
| Categories | All for you |
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test glossary name"
And I am on the "Test glossary name" "glossary activity" page logged in as student1
And I add a glossary entry with the following data:
| Concept | Cucumber |
| Definition | Sweet cucumber |
| Categories | The ones I like |
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Test glossary name"
And I am on the "Test glossary name" "glossary activity" page logged in as teacher1
@javascript
Scenario: Search by keyword and browse by alphabet

Some files were not shown because too many files have changed in this diff Show More