first commit

This commit is contained in:
CHIEFSOFT\ameye
2024-09-30 18:11:26 -04:00
commit e592ca6823
27270 changed files with 5002257 additions and 0 deletions
@@ -0,0 +1,25 @@
@report @report_participation
Feature: In a course administration page, navigate through report page, test for course participation page
In order to navigate through report page
As an admin
Go to course administration -> Reports -> Course participation
Background:
Given the following "courses" exist:
| fullname | shortname | category | groupmode |
| Course 1 | C1 | 0 | 1 |
And the following "users" exist:
| username | firstname | lastname | email |
| student1 | Student | 1 | student1@example.com |
And the following "course enrolments" exist:
| user | course | role |
| admin | C1 | editingteacher |
| student1 | C1 | student |
Scenario: Selector should be available in the course participation page
Given I log in as "admin"
And I am on "Course 1" course homepage
When I navigate to "Reports" in current page administration
And I click on "Course participation" "link"
Then "Report" "field" should exist in the "tertiary-navigation" "region"
And I should see "Course participation" in the "tertiary-navigation" "region"
@@ -0,0 +1,81 @@
@report @report_participation
Feature: In a participation report, admin can filter student actions
In order to filter participation data
As a student
I need to log action and then log in as admin to view participation report
Background:
Given the following "courses" exist:
| fullname | shortname | category | groupmode |
| Course 1 | C1 | 0 | 1 |
And the following "users" exist:
| username | firstname | lastname | email |
| manager1 | Manager | 1 | manager1@example.com |
| teacher1 | Teacher | 1 | teacher1@example.com |
| student1 | Student | 1 | student1@example.com |
And the following "course enrolments" exist:
| user | course | role |
| manager1 | C1 | manager |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And the following "activity" exists:
| course | C1 |
| activity | forum |
| name | Test forum name |
| idnumber | forum1 |
Scenario: Filter participation report when standard log reader is enabled later
Given I log in as "admin"
And I navigate to "Plugins > Logging > Manage log stores" in site administration
And I click on "Disable" "link" in the "Standard log" "table_row"
And I log out
And I am on the "Test forum name" "forum activity" page logged in as student1
And I log out
And I log in as "admin"
And I navigate to "Plugins > Logging > Manage log stores" in site administration
And I click on "Enable" "link" in the "Standard log" "table_row"
And I am on the "Test forum name" "forum activity" page logged in as student1
And I am on the "Course 1" course page logged in as admin
When I navigate to "Reports" in current page administration
And I click on "Course participation" "link"
And I set the following fields to these values:
| Activity module | Test forum name |
| Show only | Student |
And I press "Go"
Then the following should exist in the "reporttable" table:
| -1- | All actions |
| Student 1 | Yes (1) |
Scenario: Filter participation report when only standard log reader is enabled by default
Given I am on the "Test forum name" "forum activity" page logged in as student1
When I am on the "Course 1" course page logged in as admin
And I navigate to "Reports" in current page administration
And I click on "Course participation" "link"
And I set the following fields to these values:
| Activity module | Test forum name |
| Show only | Student |
And I press "Go"
Then the following should exist in the "reporttable" table:
| -1- | All actions |
| Student 1 | Yes (1) |
Scenario Outline: Filter participation report by viewable roles
Given I am on the "Course 1" course page logged in as "teacher1"
When I navigate to "Reports" in current page administration
And I click on "Course participation" "link"
# Teacher role cannot see Manager by default.
Then "Manager" "option" should not exist in the "Show only" "select"
And I set the following fields to these values:
| Activity module | Test forum name |
| Show only | <role> |
And I press "Go"
And I should see "<uservisible>" in the "reporttable" "table"
And I should not see "<usernonvisible>" in the "reporttable" "table"
Examples:
| role | uservisible | usernonvisible |
| Student | Student 1 | Teacher 1 |
| Teacher | Teacher 1 | Student 1 |
@@ -0,0 +1,74 @@
@report @report_participation
Feature: Use the participation report to message groups of students
In order to engage with students based on participation
As a teacher
I need to be able to message students who have not participated in an activity
Background:
Given the following "courses" exist:
| fullname | shortname | category | groupmode |
| Course 1 | C1 | 0 | 1 |
And the following "users" exist:
| username | firstname | lastname |
| teacher1 | Teacher | 1 |
| student1 | Student | 1 |
| student2 | Student | 2 |
| student3 | Student | 3 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
| student2 | C1 | student |
| student3 | C1 | student |
And the following "activity" exists:
| course | C1 |
| activity | book |
| name | Test book name |
| idnumber | Test book name |
| idnumber | book1 |
And I am on the "Test book name" "book activity" page logged in as student1
@javascript
Scenario: Message all students from the participation report
Given I am on the "Course 1" course page logged in as teacher1
And I navigate to "Reports" in current page administration
And I click on "Course participation" "link"
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"
@javascript
Scenario: Message students who have not participated in book
Given I am on the "Course 1" course page logged in as teacher1
And I navigate to "Reports" in current page administration
And I click on "Course participation" "link"
And I set the field "instanceid" to "Test book name"
And I set the field "roleid" to "Student"
And I press "Go"
And I should see "Yes (1)" in the "Student 1" "table_row"
And I should see "No" in the "Student 2" "table_row"
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 "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: When messaging is disabled no message options should be displayed
Given the following config values are set as admin:
| messaging | 0 |
And I am on the "Course 1" course page logged in as teacher1
And I navigate to "Reports" in current page administration
And I click on "Course participation" "link"
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 "select-all-participants" "checkbox" should not exist
+56
View File
@@ -0,0 +1,56 @@
<?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/>.
/**
* Tests for report library functions.
*
* @package report_participation
* @copyright 2014 onwards Ankit agarwal <ankit.agrr@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later.
*/
namespace report_participation;
defined('MOODLE_INTERNAL') || die();
/**
* Class report_participation_lib_testcase
*
* @package report_participation
* @copyright 2014 onwards Ankit agarwal <ankit.agrr@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later.
*/
class lib_test extends \advanced_testcase {
/**
* Test report_log_supports_logstore.
*/
public function test_report_participation_supports_logstore(): void {
$logmanager = get_log_manager();
$allstores = \core_component::get_plugin_list_with_class('logstore', 'log\store');
$supportedstores = array(
'logstore_standard' => '\logstore_standard\log\store'
);
// Make sure all supported stores are installed.
$expectedstores = array_keys(array_intersect($allstores, $supportedstores));
$stores = $logmanager->get_supported_logstores('report_participation');
$stores = array_keys($stores);
foreach ($expectedstores as $expectedstore) {
$this->assertContains($expectedstore, $stores);
}
}
}