Skip to content

Commit

Permalink
Merge branch 'MDL-75960-400' of https://github.com/andelacruz/moodle
Browse files Browse the repository at this point in the history
…into MOODLE_400_STABLE
  • Loading branch information
andrewnicols committed Nov 29, 2022
2 parents 1735591 + aeebd7a commit 382f91c
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 64 deletions.
17 changes: 5 additions & 12 deletions blocks/tests/behat/manage_blocks.feature
Expand Up @@ -15,25 +15,18 @@ Feature: Block appearances
| user | course | role |
| teacher1 | C1 | editingteacher |
And the following "activities" exist:
| activity | name | description | course | idnumber | section |
| survey | Test survey name | Test survey description | C1 | survey1 | 1 |
| book | Test book name | Test book description | C1 | book1 | 1 |
| activity | name | description | course | idnumber | section | template |
| survey | Test survey name | | C1 | survey1 | 1 | 4 |
| book | Test book name | Test book description | C1 | book1 | 1 | |
And I log in as "admin"
And I am on "Course 1" course homepage
And I click on "Test survey name" "link" in the "region-main" "region"
And I navigate to "Settings" in current page administration
And I set the following fields to these values:
| Survey type | ATTLS (20 item version) |
And I press "Save and return to course"
And I am on "Course 1" course homepage with editing mode on
And I click on "Test book name" "link" in the "region-main" "region"
And I set the following fields to these values:
| Chapter title | Book title |
| Content | Book content test test |
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 am on the "Course 1" course page logged in as teacher1
And I turn editing mode on
And I add the "Comments" block
And I configure the "Comments" block
And I set the following fields to these values:
Expand Down
7 changes: 3 additions & 4 deletions blocks/tests/behat/move_blocks.feature
Expand Up @@ -14,12 +14,11 @@ Feature: Block region moving
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
And the following "activities" exist:
| activity | course | name | template |
| survey | C1 | Test survey name | 4 |
And I log in as "admin"
And I am on "Course 1" course homepage with editing mode on
And I add a "Survey" to section "1" and I fill the form with:
| Name | Test survey name |
| Survey type | ATTLS (20 item version) |
| Description | Test survey description |
And I add a "Book" to section "1" and I fill the form with:
| Name | Test book name |
| Description | Test book description |
Expand Down
37 changes: 9 additions & 28 deletions mod/survey/tests/behat/survey_completion.feature
Expand Up @@ -20,45 +20,27 @@ Feature: A teacher can use activity completion to track a student progress

Scenario: Require survey view
Given the following "activities" exist:
| activity | name | intro | course | idnumber |
| survey | Test survey name | Test survey description | C1 | survey1 |
And I am on the "Test survey name" "survey activity editing" page
And I set the following fields to these values:
| Survey type | Critical incidents |
| Completion tracking | Show activity as complete when conditions are met |
| completionview | 1 |
| completionsubmit | 0 |
And I press "Save and return to course"
And I follow "Test survey name"
| activity | name | course | idnumber | template | completion | completionview | completionsubmit |
| survey | Test survey name | C1 | survey1 | 5 | 2 | 1 | 0 |
And I am on the "Test survey name" "survey activity" page
# Teacher view.
And "Test survey name" 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
When I am on the "Course 1" course page logged in as student1
And the "View" completion condition of "Test survey name" is displayed as "todo"
And I follow "Test survey name"
And I am on "Course 1" course homepage
Then the "View" completion condition of "Test survey name" is displayed as "done"

Scenario: Require survey submission
Given the following "activities" exist:
| activity | name | intro | course | idnumber |
| survey | Test survey name | Test survey description | C1 | survey1 |
And I am on the "Test survey name" "survey activity editing" page
And I set the following fields to these values:
| Survey type | Critical incidents |
| Completion tracking | Show activity as complete when conditions are met |
| completionview | 1 |
| completionsubmit | 1 |
And I press "Save and return to course"
| activity | name | course | idnumber | template | completion | completionview | completionsubmit |
| survey | Test survey name | C1 | survey1 | 5 | 2 | 1 | 1 |
And I am on the "Test survey name" "survey activity" page
# Teacher view.
And "Test survey name" should have the "Submit answers" completion condition
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
And the "Submit answers" completion condition of "Test survey name" is displayed as "todo"
And I follow "Test survey name"
And the "Submit answers" completion condition of "Test survey name" is displayed as "todo"
Expand All @@ -71,12 +53,11 @@ Feature: A teacher can use activity completion to track a student progress
@javascript
Scenario: Use manual completion
Given the following "activities" exist:
| activity | name | intro | course | idnumber | completion |
| survey | Test survey name | Test survey description | C1 | survey1 | 1 |
| activity | name | course | idnumber | completion |
| survey | Test survey name | C1 | survey1 | 1 |
And I am on "Course 1" course homepage
# Teacher view.
And the manual completion button for "Test survey name" should be disabled
And I log out
# Student view.
When I am on the "survey1" Activity page logged in as student1
Then the manual completion button of "Test survey name" is displayed as "Mark as done"
Expand Down
14 changes: 3 additions & 11 deletions mod/survey/tests/behat/survey_critical_incidents.feature
Expand Up @@ -18,25 +18,18 @@ Feature: A teacher navigates to response reports of students
| student1 | C1 | student |
| student2 | C1 | student |
And the following "activities" exist:
| activity | name | intro | course | idnumber | section |
| survey | Test survey name | Test survey description | C1 | survey1 | 1 |
| activity | name | course | idnumber | template |
| survey | Test survey name | C1 | survey1 | 5 |

Scenario: Only questions and participants page should be available under response reports as teacher
Given I am on the "Test survey name" "survey activity" page logged in as teacher1
And I navigate to "Settings" in current page administration
And I set the following fields to these values:
| Survey type | Critical incidents |
And I press "Save and return to course"
And I log out
And I am on the "Test survey name" "survey activity" page logged in as student1
Given I am on the "Test survey name" "survey activity" page logged in as student1
And I set the field "At what moment in class were you most engaged as a learner?" to "most engaged as student1"
And I set the field "At what moment in class were you most distanced as a learner?" to "most distanced as student1"
And I set the field "What action from anyone in the forums did you find most affirming or helpful?" to "most helpful student1"
And I set the field "What action from anyone in the forums did you find most puzzling or confusing?" to "most confusing student1"
And I set the field "What event surprised you most?" to "most surprised student1"
And I press "Submit"
And I press "Continue"
And I log out
And I am on the "Test survey name" "survey activity" page logged in as student2
And I set the field "At what moment in class were you most engaged as a learner?" to "most engaged as student2"
And I set the field "At what moment in class were you most distanced as a learner?" to "most distanced as student2"
Expand All @@ -45,7 +38,6 @@ Feature: A teacher navigates to response reports of students
And I set the field "What event surprised you most?" to "most surprised student1"
And I press "Submit"
And I press "Continue"
And I log out
When I am on the "Test survey name" "survey activity" page logged in as teacher1
And I navigate to "Response reports" in current page administration
Then I should not see "Summary"
Expand Down
29 changes: 20 additions & 9 deletions mod/survey/tests/behat/survey_types.feature
Expand Up @@ -4,7 +4,7 @@ Feature: A teacher can set three types of survey activity
As a teacher
I need to set survey activities and select which survey type suits my needs

Scenario: Switching between the three survey types
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@example.com |
Expand All @@ -14,17 +14,16 @@ Feature: A teacher can set three types of survey activity
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
And the following "activities" exist:
| activity | name | intro | course | idnumber | section |
| survey | Test survey name | Test survey description | C1 | survey1 | 1 |
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Test survey name"
And I navigate to "Settings" in current page administration

Scenario: Switching between the three survey types
Given the following "activities" exist:
| activity | name | course | idnumber |
| survey | Test survey name | C1 | survey1 |
And I am on the "Test survey name" "survey activity editing" page
And I set the following fields to these values:
| Survey type | ATTLS (20 item version) |
And I press "Save and return to course"
And I follow "Test survey name"
And I press "Save and display"
Then I should see "Attitudes Towards Thinking and Learning"
And I navigate to "Settings" in current page administration
And I set the following fields to these values:
Expand All @@ -37,3 +36,15 @@ Feature: A teacher can set three types of survey activity
And I press "Save and display"
And I should see "In this online unit..."
And I should see "my learning focuses on issues that interest me."

@javascript
Scenario: Survey activity is created via UI
Given I am on the "Course 1" course page
And I turn editing mode on
And I add a "Survey" to section "1"
And I set the following fields to these values:
| Name | Test survey name |
| Description | Test survey description |
| Survey type | ATTLS (20 item version) |
When I press "Save and return to course"
Then I should see "Test survey name"

0 comments on commit 382f91c

Please sign in to comment.