Skip to content

Commit

Permalink
Merge branch 'MDL-71168' of git://github.com/paulholden/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewnicols committed Apr 28, 2021
2 parents 1b8bd12 + fd9a393 commit 679fcbf
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 18 deletions.
2 changes: 1 addition & 1 deletion report/participation/amd/build/participants.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion report/participation/amd/build/participants.min.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion report/participation/amd/src/participants.js
Expand Up @@ -31,7 +31,7 @@ import {showSendMessage} from 'core_user/local/participants/bulkactions';

const Selectors = {
bulkActionSelect: "#formactionid",
bulkUserSelectedCheckBoxes: "input[data-togglegroup^='participants-table']:checked",
bulkUserSelectedCheckBoxes: "input[data-togglegroup^='participants-table'][data-toggle='slave']:checked",
participantsForm: '#participantsform',
};

Expand Down
41 changes: 26 additions & 15 deletions report/participation/tests/behat/message_participants.feature
Expand Up @@ -20,21 +20,31 @@ Feature: Use the particiaption report to message groups of students
| student1 | C1 | student |
| student2 | C1 | student |
| student3 | 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 name |
| Description | Test book |
And I follow "Test book name"
And I set the following fields to these values:
| Chapter title | Test chapter |
| Content | Test chapter content |
And I log out
And the following "activity" exists:
| course | C1 |
| activity | book |
| name | Test book name |
| description | Test book |
| idnumber | book1 |
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test book name"
And I log out

Scenario: Message all students from the participation report
Given I log in as "teacher1"
And I am on "Course 1" course homepage
And I navigate to "Reports > Course participation" in current page administration
And I set the field "instanceid" to "Test book name"
And I set the field "roleid" to "Student"
And I press "Go"
When I click on "select-all-participants" "checkbox"
And I choose "Send a message" from the participants page bulk action menu
Then "Send message to 3 people" "dialogue" should exist
And I set the field "Message" to "Hi there"
And I press "Send message to 3 people"
And I should see "Message sent to 3 people"

Scenario: Message students who have not participated in book
Given I log in as "teacher1"
And I am on "Course 1" course homepage
Expand All @@ -47,18 +57,19 @@ Feature: Use the particiaption report to message groups of students
And I should see "No" in the "Student 3" "table_row"
When I press "Select all 'No'"
And I choose "Send a message" from the participants page bulk action menu
Then I should see "Send message to 2 people"
Then "Send message to 2 people" "dialogue" should exist
And I set the field "Message" to "Hi there"
And I press "Send message to 2 people"
And I should see "Message sent to 2 people"

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 navigate to "Reports > Course participation" in current page administration
When I set the field "instanceid" to "Test book name"
And I set the field "roleid" to "Student"
And I press "Go"
Then I should not see "With selected users..."
And I should not see "Select all"
And "select-all-participants" "checkbox" should not exist

0 comments on commit 679fcbf

Please sign in to comment.