mirrored from git://git.moodle.org/moodle.git
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'MDL-68915-master' of https://github.com/sharidas/moodle
- Loading branch information
Showing
5 changed files
with
217 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
lib/form/tests/behat/graderescale_for_database_pointscale.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
@mod @mod_data @core_grades @core_form | ||
Feature: Using the database activities which support point scale | ||
validate if we can change the maximum grade when users are graded | ||
As a teacher | ||
I need to know whether I can not edit value of Maximum grade input field | ||
|
||
Background: | ||
Given the following "users" exist: | ||
| 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 | | ||
And the following "course enrolments" exist: | ||
| user | course | role | | ||
| teacher1 | C1 | editingteacher | | ||
| student1 | C1 | student | | ||
And the following "activities" exist: | ||
| activity | name | intro | course | idnumber | | ||
| data | Test database name | n | C1 | data1 | | ||
|
||
@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 | ||
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 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 log out | ||
Given I log in as "student1" | ||
And I am on "Course 1" course homepage | ||
And I add an entry to "Test database name" database with: | ||
| Test field name | Student original entry | | ||
| 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 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 expand all fieldsets | ||
Then the "Maximum grade" "field" should be disabled |
49 changes: 49 additions & 0 deletions
49
lib/form/tests/behat/graderescale_for_forum_pointscale.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
@mod @mod_forum @core_grades @core_form | ||
Feature: Using the forum activities which support point scale | ||
validate if we can change the maximum grade when users are graded | ||
As a teacher | ||
I need to know whether I can not edit value of Maximum grade input field | ||
|
||
Background: | ||
Given the following "users" exist: | ||
| 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 | | ||
And the following "course enrolments" exist: | ||
| user | course | role | | ||
| teacher1 | C1 | editingteacher | | ||
| student1 | C1 | student | | ||
And the following "activity" exists: | ||
| course | C1 | | ||
| activity | forum | | ||
| name | Test forum name | | ||
| description | Test forum description | | ||
| idnumber | forum1 | | ||
|
||
@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 | ||
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 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 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 | ||
And I expand all fieldsets | ||
Then the "Maximum grade" "field" should be disabled |
51 changes: 51 additions & 0 deletions
51
lib/form/tests/behat/graderescale_for_glossary_pointscale.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
@mod @mod_glossary @core_grades @core_form | ||
Feature: Using the glossary activities which support point scale | ||
validate if we can change the maximum grade when users are graded | ||
As a teacher | ||
I need to know whether I can not edit value of Maximum grade input field | ||
|
||
Background: | ||
Given the following "users" exist: | ||
| 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 | | ||
And the following "course enrolments" exist: | ||
| user | course | role | | ||
| teacher1 | C1 | editingteacher | | ||
| student1 | C1 | student | | ||
And the following "activity" exists: | ||
| course | C1 | | ||
| activity | glossary | | ||
| name | Test glossary name | | ||
| description | Test glossary description | | ||
| idnumber | glossary1 | | ||
|
||
@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" | ||
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 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 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 | ||
And I expand all fieldsets | ||
Then the "Maximum grade" "field" should be disabled |
54 changes: 54 additions & 0 deletions
54
lib/form/tests/behat/graderescale_for_lesson_pointscale.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
@mod @mod_lesson @core_grades @core_form | ||
Feature: Using the lesson activities which support point scale | ||
validate if we can change the maximum grade when users are graded | ||
As a teacher | ||
I need to know whether I can not edit value of Maximum grade input field | ||
|
||
Background: | ||
Given the following "users" exist: | ||
| 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 | | ||
And the following "course enrolments" exist: | ||
| user | course | role | | ||
| teacher1 | C1 | editingteacher | | ||
| student1 | C1 | student | | ||
And the following "activity" exists: | ||
| course | C1 | | ||
| activity | lesson | | ||
| name | Test lesson name | | ||
| intro | Test forum description | | ||
| idnumber | lesson1 | | ||
|
||
@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" | ||
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" | ||
And I set the following fields to these values: | ||
| Page title | Numerical question | | ||
| Page contents | What is 1 + 2? | | ||
| id_answer_editor_0 | 3 | | ||
| id_jumpto_0 | End of lesson | | ||
| id_enableotheranswers | 1 | | ||
| 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 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 expand all fieldsets | ||
Then the "Maximum grade" "field" should be disabled |