Merge branch 'MDL-73021-39' of git://github.com/andelacruz/moodle into MOODLE_39_STABLE

This commit is contained in:
Jun Pataleta
2022-01-21 11:18:15 +08:00
11 changed files with 303 additions and 384 deletions
@@ -14,6 +14,10 @@ Feature: Basic recycle bin functionality
| fullname | shortname |
| Course 1 | C1 |
| Course 2 | C2 |
And the following "activities" exist:
| activity | course | section | name | intro |
| assign | C1 | 1 | Test assign 1 | Test 1 |
| assign | C1 | 1 | Test assign 2 | Test 2 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
@@ -44,18 +48,15 @@ Feature: Basic recycle bin functionality
Scenario: Restore a deleted assignment
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 assign |
| Description | Test |
And I delete "Test assign" activity
And I delete "Test assign 1" activity
When I navigate to "Recycle bin" in current page administration
Then I should see "Test assign"
Then I should see "Test assign 1"
And I should see "Contents will be permanently deleted after 7 days"
And I click on "Restore" "link" in the "region-main" "region"
And I should see "'Test assign' has been restored"
And I should see "'Test assign 1' has been restored"
And I wait to be redirected
And I am on "Course 1" course homepage
And I should see "Test assign" in the "Topic 1" "section"
And I should see "Test assign 1" in the "Topic 1" "section"
Scenario: Restore a deleted course
Given I log in as "admin"
@@ -87,31 +88,22 @@ Feature: Basic recycle bin functionality
Scenario: Deleting a single item from the recycle bin
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 assign |
| Description | Test |
And I delete "Test assign" activity
And I delete "Test assign 1" activity
And I run all adhoc tasks
And I navigate to "Recycle bin" in current page administration
When I click on "Delete" "link"
Then I should see "Are you sure you want to delete the selected item from the recycle bin?"
And I click on "Cancel" "button" in the "Confirmation" "dialogue"
And I should see "Test assign"
And I should see "Test assign 1"
And I click on "Delete" "link"
And I press "Yes"
And I should see "'Test assign' has been deleted"
And I should see "'Test assign 1' has been deleted"
And I should see "There are no items in the recycle bin."
@javascript
Scenario: Deleting all the items from the recycle bin
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 assign 1 |
| Description | Test 1 |
And I add a "Assignment" to section "1" and I fill the form with:
| Assignment name | Test assign 2 |
| Description | Test 2 |
And I delete "Test assign 1" activity
And I delete "Test assign 2" activity
And I run all adhoc tasks
@@ -16,6 +16,14 @@ Feature: availability_grade
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
# Add an assignment.
And the following "activity" exists:
| activity | assign |
| course | C1 |
| section | 1 |
| name | A1 |
| intro | x |
| assignsubmission_onlinetext_enabled | 1 |
@javascript
Scenario: Test condition
@@ -23,12 +31,6 @@ Feature: availability_grade
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
# Add an assignment.
And I add a "Assignment" to section "1" and I fill the form with:
| Assignment name | A1 |
| Description | x |
| Online text | 1 |
# Add a Page with a grade condition for 'any grade'.
And I add a "Page" to section "2"
And I set the following fields to these values:
+34 -106
View File
@@ -4,20 +4,32 @@ Feature: Award badges
As an admin
I need to add criteria to badges in the system
Background:
Given the following "courses" exist:
| fullname | shortname | format | enablecompletion |
| Course 1 | C1 | topics | 1 |
And the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@example.com |
| student1 | Student | 1 | student1@example.com |
| student2 | Student | 2 | student2@example.com |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
| student2 | C1 | student |
And the following "activity" exists:
| activity | assign |
| course | C1 |
| section | 1 |
| name | Test assignment name |
| intro | Submit your online text |
| completion | 1 |
| assignsubmission_onlinetext_enabled | 1 |
@javascript
Scenario: Award badge on other badges as criteria
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@example.com |
| student1 | Student | 1 | student1@example.com |
And the following "courses" exist:
| fullname | shortname | category | groupmode |
| Course 1 | C1 | 0 | 1 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And I log in as "teacher1"
Given I log in as "teacher1"
And I am on "Course 1" course homepage
# Create course badge 1.
And I navigate to "Badges > Add a new badge" in current page administration
@@ -127,11 +139,7 @@ Feature: Award badges
@javascript
Scenario: Award site badge
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher | teacher | 1 | teacher1@example.com |
| student | student | 1 | student1@example.com |
And I log in as "admin"
Given I log in as "admin"
And I navigate to "Badges > Add a new badge" in site administration
And I set the following fields to these values:
| Name | Site Badge |
@@ -145,33 +153,21 @@ Feature: Award badges
And I press "Continue"
And I follow "Recipients (0)"
And I press "Award badge"
And I set the field "potentialrecipients[]" to "teacher 1 (teacher1@example.com)"
And I set the field "potentialrecipients[]" to "Teacher 1 (teacher1@example.com)"
And I press "Award badge"
And I set the field "potentialrecipients[]" to "student 1 (student1@example.com)"
And I set the field "potentialrecipients[]" to "Student 1 (student1@example.com)"
And I press "Award badge"
And I navigate to "Badges > Manage badges" in site administration
When I follow "Site Badge"
Then I should see "Recipients (2)"
And I log out
And I log in as "student"
And I log in as "student1"
And I follow "Profile" in the user menu
Then I should see "Site Badge"
@javascript
Scenario: Award course badge
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@example.com |
| student1 | Student | 1 | student1@example.com |
| student2 | Student | 2 | student2@example.com |
And the following "courses" exist:
| fullname | shortname | category | groupmode |
| Course 1 | C1 | 0 | 1 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
| student2 | C1 | student |
And I log in as "teacher1"
Given I log in as "teacher1"
And I am on "Course 1" course homepage
And I navigate to "Badges > Add a new badge" in current page administration
And I follow "Add a new badge"
@@ -201,28 +197,7 @@ Feature: Award badges
@javascript
Scenario: Award badge on activity completion
Given the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | Frist | teacher1@example.com |
| student1 | Student | First | student1@example.com |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
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 set the following fields to these values:
| Enable completion tracking | Yes |
And I press "Save and display"
And I turn 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 |
| id_completion | 1 |
Given I log in as "teacher1"
And I am on "Course 1" course homepage
And I navigate to "Badges > Add a new badge" in current page administration
And I follow "Add a new badge"
@@ -249,29 +224,8 @@ Feature: Award badges
@javascript
Scenario: Award badge on course completion
Given the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | Frist | teacher1@example.com |
| student1 | Student | First | student1@example.com |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And I log in as "teacher1"
Given 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 set the following fields to these values:
| Enable completion tracking | Yes |
And I press "Save and display"
And I turn 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 |
| id_completion | 1 |
And I navigate to "Course completion" in current page administration
And I set the field "id_overall_aggregation" to "2"
And I click on "Condition: Activity completion" "link"
@@ -311,20 +265,7 @@ Feature: Award badges
@javascript
Scenario: All of the selected roles can award badges
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@example.com |
| student1 | Student | 1 | student1@example.com |
| student2 | Student | 2 | student2@example.com |
And the following "courses" exist:
| fullname | shortname | category | groupmode |
| Course 1 | C1 | 0 | 1 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
| student2 | C1 | student |
And I log in as "teacher1"
Given I log in as "teacher1"
And I am on "Course 1" course homepage
# Create course badge 1.
And I navigate to "Badges > Add a new badge" in current page administration
@@ -393,20 +334,7 @@ Feature: Award badges
@javascript
Scenario: Revoke badge
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@example.com |
| student1 | Student | 1 | student1@example.com |
| student2 | Student | 2 | student2@example.com |
And the following "courses" exist:
| fullname | shortname | category | groupmode |
| Course 1 | C1 | 0 | 1 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
| student2 | C1 | student |
And I log in as "teacher1"
Given I log in as "teacher1"
And I am on "Course 1" course homepage
And I navigate to "Badges > Add a new badge" in current page administration
And I follow "Add a new badge"
@@ -7,19 +7,25 @@ Feature: Restrict activity availability through date conditions
Background:
Given the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
| Course 1 | C1 | 0 |
And the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | Frist | teacher1@example.com |
| student1 | Student | First | student1@example.com |
| username | firstname | lastname | email |
| teacher1 | Teacher | Frist | teacher1@example.com |
| student1 | Student | First | student1@example.com |
And the following "course enrolments" exist:
| 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
# Adding the page like this because id_available*_enabled needs to be clicked to trigger the action.
And I add a "Assignment" to section "1"
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And the following "activity" exists:
| activity | assign |
| course | C1 |
| section | 1 |
| name | Test assignment 1 |
| intro | This assignment is restricted by date |
| assignsubmission_onlinetext_enabled | 1 |
| assignsubmission_file_enabled | 0 |
And I am on the "Test assignment 1" "assign activity" page logged in as "teacher1"
And I navigate to "Edit settings" in current page administration
And I expand all fieldsets
@javascript
@@ -27,10 +33,6 @@ Feature: Restrict activity availability through date conditions
Given I click on "Add restriction..." "button"
And I click on "Date" "button" in the "Add restriction..." "dialogue"
And I set the following fields to these values:
| Assignment name | Test assignment 1 |
| Description | This assignment is restricted by date |
| assignsubmission_onlinetext_enabled | 1 |
| assignsubmission_file_enabled | 0 |
| x[day] | 31 |
| x[month] | 12 |
| x[year] | 2037 |
@@ -46,10 +48,6 @@ Feature: Restrict activity availability through date conditions
Given I click on "Add restriction..." "button"
And I click on "Date" "button" in the "Add restriction..." "dialogue"
And I set the following fields to these values:
| Assignment name | Test assignment 2 |
| Description | This assignment is restricted by date |
| assignsubmission_onlinetext_enabled | 1 |
| assignsubmission_file_enabled | 0 |
| x[day] | 1 |
| x[month] | 2 |
| x[year] | 2013 |
@@ -59,4 +57,4 @@ Feature: Restrict activity availability through date conditions
And I press "Save and return to course"
And I log out
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"
Then I should not see "Test assignment 1" in the "page" "region"
@@ -7,15 +7,24 @@ Feature: Restrict sections availability through completion or grade conditions
Background:
Given the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
| Course 1 | C1 | 0 |
And the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | Frist | teacher1@example.com |
| student1 | Student | First | student1@example.com |
| username | firstname | lastname | email |
| teacher1 | Teacher | Frist | teacher1@example.com |
| student1 | Student | First | student1@example.com |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And the following "activity" exists:
| activity | assign |
| course | C1 |
| section | 1 |
| name | Grade assignment |
| intro | Grade this assignment to revoke restriction on restricted assignment |
| assignsubmission_onlinetext_enabled | 1 |
| assignsubmission_file_enabled | 0 |
| submissiondrafts | 0 |
@javascript
Scenario: Show section greyed-out to student when completion condition is not satisfied
@@ -53,11 +62,6 @@ Feature: Restrict sections availability through completion or grade conditions
Scenario: Show section greyed-out to student when grade condition is not satisfied
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 | Grade assignment |
| Description | Grade this assignment to revoke restriction on restricted assignment |
| assignsubmission_onlinetext_enabled | 1 |
| assignsubmission_file_enabled | 0 |
And I add a "Page" to section "2" and I fill the form with:
| Name | Test page name |
| Description | Restricted section page resource, till grades in Grade assignment is at least 20% |
@@ -4,25 +4,33 @@ Feature: Toggle activities visibility from the course page
As a teacher
I need to quickly change the visibility of an activity
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@example.com |
| student1 | Student | 1 | student1@example.com |
And the following "courses" exist:
| fullname | shortname | format | numsections |
| Course 1 | C1 | topics | 2 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And the following "activities" exist:
| activity | course | section | idnumber | name | intro | id_visible |
| assign | C1 | 1 | 1 | Test assignment name | Test assignment description | 1 |
@javascript
Scenario: Hide/Show toggle with javascript enabled
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@example.com |
| student1 | Student | 1 | student1@example.com |
And the following "courses" exist:
| fullname | shortname | format |
| Course 1 | C1 | topics |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
Given the following "activity" exists:
| activity | forum |
| course | C1 |
| idnumber | C1F1 |
| name | Test forum name |
| intro | Test forum description |
| visible | 1 |
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 |
| Availability | Show on course page |
When I open "Test forum name" actions menu
Then "Test forum name" actions menu should not have "Show" item
And "Test forum name" actions menu should not have "Make available" item
@@ -60,28 +68,20 @@ Feature: Toggle activities visibility from the course page
And I log in as "student1"
And I am on "Course 1" course homepage
And I should not see "Test forum name"
And I log out
@javascript
Scenario: Activities can be made available and unavailable inside a hidden section
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@example.com |
| student1 | Student | 1 | student1@example.com |
And the following "courses" exist:
| fullname | shortname | format | numsections |
| Course 1 | C1 | topics | 2 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
Given the following "activity" exists:
| activity | forum |
| course | C1 |
| idnumber | C1F1 |
| section | 2 |
| name | Test forum name |
| intro | Test forum description |
| visible | 1 |
And 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 add a "Forum" to section "2" and I fill the form with:
| Forum name | Test forum name |
| Description | Test forum description |
| Availability | Show on course page |
When I hide section "2"
Then "Test forum name" activity should be hidden
And I open "Test forum name" actions menu
@@ -116,30 +116,14 @@ Feature: Toggle activities visibility from the course page
And I click on "Test forum name" "link" in the "Recent activity" "block"
And I should see "Test forum name"
And I should see "(There are no discussion topics yet in this forum)"
And I log out
@javascript
Scenario: Activities can be made available but not visible on a course page
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@example.com |
| student1 | Student | 1 | student1@example.com |
And the following "courses" exist:
| fullname | shortname | format | numsections |
| Course 1 | C1 | topics | 2 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And the following config values are set as admin:
Given the following config values are set as admin:
| allowstealth | 1 |
And 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 add a "Assignment" to section "2" and I fill the form with:
| Assignment name | Test assignment name |
| Description | Test assignment description |
| Availability | Show on course page |
When I open "Test assignment name" actions menu
Then "Test assignment name" actions menu should not have "Show" item
And "Test assignment name" actions menu should have "Hide" item
@@ -162,7 +146,6 @@ Feature: Toggle activities visibility from the course page
And the field "Availability" matches value "Make available but not shown on course page"
And I press "Save and return to course"
And "Test assignment name" activity should be available but hidden from course page
And I change window size to "large"
And I turn editing mode off
And "Test assignment name" activity should be available but hidden from course page
And I log out
@@ -17,12 +17,17 @@ Feature: Rubrics can be created and edited
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And the following "activity" exists:
| activity | assign |
| course | C1 |
| section | 1 |
| name | Test assignment 1 name |
| intro | Test assignment description |
| assignfeedback_comments_enabled | 1 |
| assignfeedback_editpdf_enabled | 1 |
| advancedgradingmethod_submissions | rubric |
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 1 name |
| Description | Test assignment description |
| Grading method | Rubric |
When I go to "Test assignment 1 name" advanced grading definition page
# Defining a rubric.
And I set the following fields to these values:
@@ -7,38 +7,28 @@ Feature: We can change what we are viewing on the grader report
Background:
Given the following "courses" exist:
| fullname | shortname | format |
| Course 1 | C1 | topics |
| Course 1 | C1 | topics |
And the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@example.com |
| student1 | Student | 1 | student1@example.com |
| student2 | Student | 1 | student2@example.com |
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@example.com |
| student1 | Student | 1 | student1@example.com |
| student2 | Student | 1 | student2@example.com |
And the following "course enrolments" exist:
| 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 1 |
| Description | Submit your online text |
| assignsubmission_onlinetext_enabled | 1 |
And I add a "Assignment" to section "1" and I fill the form with:
| Assignment name | Test assignment name 2 |
| Description | Submit your online text |
| assignsubmission_onlinetext_enabled | 1 |
And I log out
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
| student2 | C1 | student |
And the following "activities" exist:
| activity | course | section | name | intro | assignsubmission_onlinetext_enabled | submissiondrafts |
| assign | C1 | 1 | Test assignment name 1 | Submit your online text | 1 | 0 |
| assign | C1 | 1 | Test assignment name 2 | submit your online text | 1 | 0 |
And the following "mod_assign > submissions" exist:
| assign | user | onlinetext |
| Test assignment name 1 | student1 | This is a submission for assignment 1 |
| Test assignment name 2 | student1 | This is a submission for assignment 2 |
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 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 |
And I press "Save changes"
Then I should see "Submitted for grading"
And I log out
And I log in as "teacher1"
@@ -89,9 +79,6 @@ Feature: We can change what we are viewing on the grader report
| capability | permission |
| moodle/grade:viewhidden | Prevent |
And I log out
And the following "course enrolments" exist:
| user | course | role |
| student2 | C1 | student |
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I navigate to "View > Grader report" in the course gradebook
@@ -8,27 +8,25 @@ Feature: A teacher checks the grade history report in a course
Scenario: Check the history report displays results correctly
Given the following "courses" exist:
| fullname | shortname | category | groupmode |
| Course 1 | C1 | 0 | 1 |
| Course 1 | C1 | 0 | 1 |
And the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@example.com |
| teacher2 | Teacher | 2 | teacher2@example.com |
| student1 | Student | 1 | student1@example.com |
| student2 | Student | 2 | student2@example.com |
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@example.com |
| teacher2 | Teacher | 2 | teacher2@example.com |
| student1 | Student | 1 | student1@example.com |
| student2 | Student | 2 | student2@example.com |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| teacher2 | C1 | editingteacher |
| student1 | C1 | student |
| student2 | C1 | student |
| user | course | role |
| teacher1 | C1 | editingteacher |
| teacher2 | C1 | editingteacher |
| student1 | C1 | student |
| student2 | C1 | student |
And the following "activities" exist:
| activity | course | section | name | intro |
| assign | C1 | 1 | The greatest assignment ever | Write a behat test for Moodle - it's amazing |
| assign | C1 | 1 | Rewarding assignment | After writing your behat test go grab a beer! |
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 | The greatest assignment ever |
| Description | Write a behat test for Moodle - it's amazing! |
And I add a "Assignment" to section "1" and I fill the form with:
| Assignment name | Rewarding assignment |
| Description | After writing your behat test go grab a beer! |
And I navigate to "View > Grader report" in the course gradebook
And I turn editing mode on
And I give the grade "50.00" to the user "Student 1" for the grade item "The greatest assignment ever"
+121 -66
View File
@@ -7,24 +7,33 @@ Feature: We can set the grade to pass value
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@example.com |
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@example.com |
And the following "courses" exist:
| fullname | shortname | format | numsections |
| Course 1 | C1 | weeks | 5 |
| Course 1 | C1 | weeks | 5 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| user | course | role |
| teacher1 | C1 | editingteacher |
And the following "scales" exist:
| name | scale |
| name | scale |
| Test Scale 1 | Disappointing, Good, Very good, Excellent |
And the following "activity" exists:
| activity | assign |
| course | C1 |
| section | 1 |
| idnumber | assign1 |
| name | Test Assignment 1 |
| intro | Submit your online text |
| assignsubmission_onlinetext_enabled | 1 |
And I log in as "teacher1"
And I am on "Course 1" course homepage
@javascript
Scenario: Validate that switching the type of grading used correctly disables grade to pass
When I turn editing mode on
And I add a "Assignment" to section "1"
Given I turn editing mode on
And I am on the "Test Assignment 1" "assign activity" page
And I navigate to "Edit settings" in current page administration
And I expand all fieldsets
And I set the field "grade[modgrade_type]" to "Point"
Then the "Grade to pass" "field" should be enabled
@@ -35,32 +44,34 @@ Feature: We can set the grade to pass value
@javascript
Scenario: Create an activity with a Grade to pass value greater than the maximum grade
When I turn editing mode on
And I add a "Assignment" to section "1" and I fill the form with:
| Assignment name | Test Assignment 1 |
| Description | Submit your online text |
| assignsubmission_onlinetext_enabled | 1 |
| grade[modgrade_type] | Point |
| grade[modgrade_point] | 50 |
| Grade to pass | 100 |
And I am on the "Test Assignment 1" "assign activity" page
And I navigate to "Edit settings" in current page administration
And I expand all fieldsets
And I set the field "grade[modgrade_type]" to "Point"
And I set the field "grade[modgrade_point]" to "50"
And I set the field "Grade to pass" to "100"
And I press "Save and return to course"
Then I should see "The grade to pass can not be greater than the maximum possible grade 50"
And I press "Cancel"
@javascript
Scenario: Set a valid grade to pass for an assignment activity using points
When I turn editing mode on
And I add a "Assignment" to section "1" and I fill the form with:
| Assignment name | Test Assignment 1 |
| Description | Submit your online text |
And I am on the "Test Assignment 1" "assign activity" page
And I navigate to "Edit settings" in current page administration
And I set the following fields to these values:
| assignsubmission_onlinetext_enabled | 1 |
| grade[modgrade_type] | Point |
| grade[modgrade_point] | 50 |
| Grade to pass | 25 |
And I press "Save and return to course"
And I navigate to "View > Grader report" in the course gradebook
And I turn editing mode on
And I click on "Edit assign Test Assignment 1" "link"
Then the field "Grade to pass" matches value "25"
And I am on "Course 1" course homepage
And I follow "Test Assignment 1"
And I follow "Edit settings"
And I am on the "Test Assignment 1" "assign activity" page
And I navigate to "Edit settings" in current page administration
And I expand all fieldsets
And I set the field "Grade to pass" to "30"
And I press "Save and return to course"
@@ -68,14 +79,16 @@ Feature: We can set the grade to pass value
And I click on "Edit assign Test Assignment 1" "link"
And the field "Grade to pass" matches value "30"
@javascript
Scenario: Set a valid grade to pass for an assignment activity using scales
When I turn editing mode on
And I add a "Assignment" to section "1" and I fill the form with:
| Assignment name | Test Assignment 1 |
| Description | Submit your online text |
And I am on the "Test Assignment 1" "assign activity" page
And I navigate to "Edit settings" in current page administration
And I set the following fields to these values:
| grade[modgrade_type] | Scale |
| grade[modgrade_scale] | Test Scale 1 |
| Grade to pass | 3 |
And I press "Save and return to course"
And I navigate to "View > Grader report" in the course gradebook
And I turn editing mode on
And I click on "Edit assign Test Assignment 1" "link"
@@ -84,29 +97,35 @@ Feature: We can set the grade to pass value
And I set the field "Grade to pass" to "4"
And I press "Save changes"
And I am on "Course 1" course homepage
And I follow "Test Assignment 1"
And I follow "Edit settings"
And I am on the "Test Assignment 1" "assign activity" page
And I navigate to "Edit settings" in current page administration
And the field "Grade to pass" matches value "4"
@javascript
Scenario: Set a invalid grade to pass for an assignment activity using scales
When I turn editing mode on
And I add a "Assignment" to section "1" and I fill the form with:
| Assignment name | Test Assignment 1 |
| Description | Submit your online text |
And I am on the "Test Assignment 1" "assign activity" page
And I navigate to "Edit settings" in current page administration
And I set the following fields to these values:
| grade[modgrade_type] | Scale |
| grade[modgrade_scale] | Test Scale 1 |
| Grade to pass | 10 |
And I press "Save and return to course"
Then I should see "The grade to pass can not be greater than the maximum possible grade 4"
Scenario: Set a valid grade to pass for workshop activity
When I turn editing mode on
And I add a "Workshop" to section "1" and I fill the form with:
| Workshop name | Test Workshop 1 |
| Description | Test workshop |
Given the following "activities" exist:
| activity | name | intro | course | section | idnumber |
| workshop | Test Workshop 1 | Test workshop | C1 | 1 | workshop1 |
And I am on "Course 1" course homepage with editing mode on
And I follow "Test Workshop 1"
And I navigate to "Edit settings" in current page administration
And I set the following fields to these values:
| grade | 80 |
| Submission grade to pass | 40 |
| gradinggrade | 20 |
| Assessment grade to pass | 10 |
And I press "Save and return to course"
And I navigate to "View > Grader report" in the course gradebook
And I turn editing mode on
And I click on "Edit workshop Test Workshop 1 (submission)" "link"
@@ -126,22 +145,31 @@ Feature: We can set the grade to pass value
And the field "Assessment grade to pass" matches value "15"
Scenario: Set an invalid grade to pass for workshop activity
When I turn editing mode on
And I add a "Workshop" to section "1" and I fill the form with:
| Workshop name | Test Workshop 1 |
| Description | Test workshop |
Given the following "activities" exist:
| activity | name | intro | course | section | idnumber |
| workshop | Test Workshop 1 | Test workshop | C1 | 1 | workshop1 |
And I am on "Course 1" course homepage with editing mode on
And I follow "Test Workshop 1"
And I navigate to "Edit settings" in current page administration
And I set the following fields to these values:
| grade | 80 |
| Submission grade to pass | 90 |
| gradinggrade | 20 |
| Assessment grade to pass | 30 |
And I press "Save and return to course"
Then "The grade to pass can not be greater than the maximum possible grade 80" "text" should exist in the "Submission grade to pass" "form_row"
Then "The grade to pass can not be greater than the maximum possible grade 20" "text" should exist in the "Assessment grade to pass" "form_row"
Scenario: Set a valid grade to pass for quiz activity
When I turn editing mode on
And I add a "Quiz" to section "1" and I fill the form with:
| Name | Test Quiz 1 |
Given the following "activities" exist:
| activity | name | course | section | idnumber |
| quiz | Test Quiz 1 | C1 | 1 | quiz1 |
And I am on "Course 1" course homepage with editing mode on
And I follow "Test Quiz 1"
And I navigate to "Edit settings" in current page administration
And I set the following fields to these values:
| Grade to pass | 9.5 |
And I press "Save and return to course"
And I navigate to "View > Grader report" in the course gradebook
And I turn editing mode on
And I click on "Edit quiz Test Quiz 1" "link"
@@ -155,11 +183,15 @@ Feature: We can set the grade to pass value
And the field "Grade to pass" matches value "8.00"
Scenario: Set a valid grade to pass for lesson activity
When I turn editing mode on
And I add a "Lesson" to section "1" and I fill the form with:
| Name | Test Lesson 1 |
| Description | Test |
Given the following "activities" exist:
| activity | name | intro | course | section | idnumber |
| lesson | Test Lesson 1 | Test | C1 | 1 | lesson1 |
And I am on "Course 1" course homepage with editing mode on
And I follow "Test Lesson 1"
And I navigate to "Edit settings" in current page administration
And I set the following fields to these values:
| Grade to pass | 90 |
And I press "Save and return to course"
And I navigate to "View > Grader report" in the course gradebook
And I turn editing mode on
And I click on "Edit lesson Test Lesson 1" "link"
@@ -173,12 +205,18 @@ Feature: We can set the grade to pass value
And the field "Grade to pass" matches value "80"
Scenario: Set a valid grade to pass for database activity
When I turn editing mode on
And I add a "Database" to section "1" and I fill the form with:
| Name | Test Database 1 |
| Description | Test |
| Aggregate type | Average of ratings |
| Grade to pass | 90 |
Given the following "activities" exist:
| activity | name | intro | course | section | idnumber |
| data | Test Database 1 | Test | C1 | 1 | data1 |
And I am on "Course 1" course homepage with editing mode on
And I follow "Test Database 1"
And I navigate to "Edit settings" in current page administration
And I expand all fieldsets
And I set the following fields to these values:
| Ratings > Aggregate type | Average of ratings |
| id_scale_modgrade_type | Point |
| Ratings > Grade to pass | 90 |
And I press "Save and return to course"
And I navigate to "View > Grader report" in the course gradebook
And I turn editing mode on
And I click on "Edit data Test Database 1" "link"
@@ -191,22 +229,34 @@ Feature: We can set the grade to pass value
And the field "Grade to pass" matches value "80"
Scenario: Set an invalid grade to pass for forum activity
When I turn editing mode on
And I add a "Forum" to section "1" and I fill the form with:
| Forum name | Test Forum 1 |
| Description | Test |
| Ratings > Aggregate type | Average of ratings |
| Ratings > Grade to pass | 90 |
| Ratings > scale[modgrade_point] | 60 |
Given the following "activities" exist:
| activity | name | intro | course | section | idnumber |
| forum | Test Forum 1 | Test | C1 | 1 | forum1 |
And I am on "Course 1" course homepage with editing mode on
And I follow "Test Forum 1"
And I navigate to "Edit settings" in current page administration
And I expand all fieldsets
And I set the following fields to these values:
| Ratings > Aggregate type | Average of ratings |
| id_scale_modgrade_type | Point |
| Ratings > Grade to pass | 90 |
| Ratings > scale[modgrade_point] | 60 |
And I press "Save and return to course"
Then I should see "The grade to pass can not be greater than the maximum possible grade 60"
Scenario: Set a valid grade to pass for forum activity
When I turn editing mode on
And I add a "Forum" to section "1" and I fill the form with:
| Forum name | Test Forum 1 |
| Description | Test |
Given the following "activities" exist:
| activity | name | intro | course | section | idnumber |
| forum | Test Forum 1 | Test | C1 | 1 | forum1 |
And I am on "Course 1" course homepage with editing mode on
And I follow "Test Forum 1"
And I navigate to "Edit settings" in current page administration
And I expand all fieldsets
And I set the following fields to these values:
| Ratings > Aggregate type | Average of ratings |
| id_scale_modgrade_type | Point |
| Ratings > Grade to pass | 90 |
And I press "Save and return to course"
And I navigate to "View > Grader report" in the course gradebook
And I turn editing mode on
And I click on "Edit forum Test Forum 1 rating" "link"
@@ -220,12 +270,17 @@ Feature: We can set the grade to pass value
And the field "Ratings > Grade to pass" matches value "80"
Scenario: Set a valid grade to pass for glossary activity
When I turn editing mode on
And I add a "Glossary" to section "1" and I fill the form with:
| Name | Test Glossary 1 |
| Description | Test |
| Aggregate type | Average of ratings |
| Grade to pass | 90 |
Given the following "activities" exist:
| activity | name | intro | course | section | idnumber |
| glossary | Test Glossary 1 | Test | C1 | 1 | glossary1 |
And I am on "Course 1" course homepage with editing mode on
And I follow "Test Glossary 1"
And I navigate to "Edit settings" in current page administration
And I set the following fields to these values:
| Ratings > Aggregate type | Average of ratings |
| id_scale_modgrade_type | Point |
| Ratings > Grade to pass | 90 |
And I press "Save and return to course"
And I navigate to "View > Grader report" in the course gradebook
And I turn editing mode on
And I click on "Edit glossary Test Glossary 1" "link"
@@ -6,31 +6,29 @@ Feature: Using the activity grade form element
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| student1 | Student | 1 | student1@example.com |
| teacher1 | Teacher | 1 | teacher1@example.com |
| username | firstname | lastname | email |
| student1 | Student | 1 | student1@example.com |
| teacher1 | Teacher | 1 | teacher1@example.com |
And the following "courses" exist:
| fullname | shortname | category | groupmode |
| Course 1 | C1 | 0 | 1 |
| Course 1 | C1 | 0 | 1 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And the following "scales" exist:
| name | scale |
| ABCDEF | F,E,D,C,B,A |
| Letter scale | Disappointing, Good, Very good, Excellent |
And the following "activity" exists:
| activity | assign |
| course | C1 |
| section | 1 |
| name | Test assignment name |
| intro | Test assignment description |
Scenario: Being able to change the grade type, scale and maximum grade when there are no grades
Given I log in as "admin"
And I navigate to "Grades > Scales" in site administration
And I press "Add a new scale"
And I set the following fields to these values:
| Name | ABCDEF |
| Scale | F,E,D,C,B,A |
And I press "Save changes"
And I press "Add a new scale"
And I set the following fields to these values:
| Name | Letter scale |
| Scale | Disappointing, Good, Very good, Excellent |
And I press "Save changes"
And I log out
And the following "activities" exist:
| activity | name | intro | course | idnumber |
| forum | Test forum name | Test forum description | C1 | forum1 |
@@ -66,20 +64,7 @@ Feature: Using the activity grade form element
@javascript
Scenario: Attempting to change the scale when grades already exist in rating activity
Given I log in as "admin"
And I navigate to "Grades > Scales" in site administration
And I press "Add a new scale"
And I set the following fields to these values:
| Name | ABCDEF |
| Scale | F,E,D,C,B,A |
And I press "Save changes"
And I press "Add a new scale"
And I set the following fields to these values:
| Name | Letter scale |
| Scale | Disappointing, Good, Very good, Excellent |
And I press "Save changes"
And I log out
And I log in as "teacher1"
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 | Test forum name |
@@ -115,26 +100,12 @@ Feature: Using the activity grade form element
@javascript
Scenario: Attempting to change the scale when grades already exist in non-rating activity
Given I log in as "admin"
And I navigate to "Grades > Scales" in site administration
And I press "Add a new scale"
Given I am on the "Test assignment name" "assign 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:
| Name | ABCDEF |
| Scale | F,E,D,C,B,A |
And I press "Save changes"
And I press "Add a new scale"
And I set the following fields to these values:
| Name | Letter scale |
| Scale | Disappointing, Good, Very good, Excellent |
And I press "Save changes"
And I log out
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 |
| grade[modgrade_type] | Scale |
| grade[modgrade_scale] | ABCDEF |
And I press "Save and display"
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"
@@ -185,11 +156,7 @@ Feature: Using the activity grade form element
@javascript
Scenario: Attempting to change the maximum grade when no rescaling option has been chosen
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
Given 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 1" "table_row"
And I set the field "Grade out of 100" to "50"