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,79 @@
<?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/>.
/**
* Behat competency report definitions.
*
* @package report_competency
* @category test
* @copyright 2022 Noel De Martin
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once(__DIR__ . '/../../../../lib/behat/behat_base.php');
/**
* Competency report definitions.
*
* @package report_competency
* @category test
* @copyright 2022 Noel De Martin
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class behat_report_competency extends behat_base {
/**
* Convert page names to URLs for steps like 'When I am on the "[identifier]" "[page type]" page'.
*
* Recognised page names are:
* | pagetype | name meaning | description |
* | Breakdown | Course name | The course competencies breakdown page |
*
* @param string $page identifies which type of page this is, e.g. 'Breakdown'.
* @param string $identifier identifies the particular page, e.g. 'C1'.
* @return moodle_url the corresponding URL.
* @throws Exception with a meaningful error message if the specified page cannot be found.
*/
protected function resolve_page_instance_url(string $page, string $identifier): moodle_url {
switch (strtolower($page)) {
case 'breakdown':
$courseid = $this->get_course_id($identifier);
return new moodle_url('/report/competency/index.php', [
'id' => $courseid,
]);
default:
throw new Exception("Unrecognised page type '{$page}'");
}
}
/**
* Return a list of the exact named selectors for the component.
*
* @return behat_component_named_selector[]
*/
public static function get_exact_named_selectors(): array {
return [
new behat_component_named_selector('breakdown', [
"//*[@data-region='competency-breakdown-report']//table".
"//tr[contains(., //a[@data-action='competency-dialogue'][contains(., %locator%)])]",
]),
new behat_component_named_selector('breakdown rating', [
"//td[position()=2][contains(., //a[@title='User competency summary'][contains(., %locator%)])]",
]),
];
}
}
@@ -0,0 +1,74 @@
@report @javascript @report_competency
Feature: See the competencies for an activity
As a competency grader
In order to perform mark all competencies for an activity
I need to see the competencies linked to one activity in the breakdown report.
Background:
Given the following lp "frameworks" exist:
| shortname | idnumber |
| Test-Framework | ID-FW1 |
And the following lp "competencies" exist:
| shortname | framework |
| Test-Comp1 | ID-FW1 |
| Test-Comp2 | ID-FW1 |
Given the following "courses" exist:
| shortname | fullname |
| C1 | Course 1 |
And the following "users" exist:
| username | firstname | lastname | email | idnumber | middlename | alternatename | firstnamephonetic | lastnamephonetic |
| student1 | Grainne | Beauchamp | student1@example.com | s1 | Ann | Jill | Gronya | Beecham |
| student2 | Niamh | Cholmondely | student2@example.com | s2 | Jane | Nina | Nee | Chumlee |
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
| student2 | C1 | student |
And the following "activities" exist:
| activity | name | intro | course | idnumber |
| page | PageName1 | PageDesc1 | C1 | PAGE1 |
And the following config values are set as admin:
| fullnamedisplay | firstname |
| alternativefullnameformat | middlename, alternatename, firstname, lastname |
And I log in as "admin"
And I am on site homepage
And I follow "Course 1"
And I navigate to "Competencies" in current page administration
And I press "Add competencies to course"
And "Competency picker" "dialogue" should be visible
And I select "Test-Comp1" of the competency tree
And I click on "Add" "button" in the "Competency picker" "dialogue"
And I press "Add competencies to course"
And "Competency picker" "dialogue" should be visible
And I select "Test-Comp2" of the competency tree
And I click on "Add" "button" in the "Competency picker" "dialogue"
And I am on the PageName1 "page activity editing" page
And I click on "Expand all" "link" in the "region-main" "region"
And I set the field "Course competencies" to "Test-Comp1"
And I press "Save and return to course"
@javascript
Scenario: Go to the competency breakdown report
When I navigate to "Reports" in current page administration
And I click on "Competency breakdown" "link"
And I set the field "Filter competencies by resource or activity" to "PageName1"
Then I should see "Test-Comp1"
And I should not see "Test-Comp2"
And I should see "Ann, Jill, Grainne, Beauchamp"
And I should see "Ann, Jill, Grainne, Beauchamp" in the ".form-autocomplete-selection" "css_element"
And I open the autocomplete suggestions list
And I should see "Jane, Nina, Niamh, Cholmondely" in the ".form-autocomplete-suggestions" "css_element"
And I click on "Not rated" "link"
And I click on "Rate" "button"
And I set the field "Rating" to "A"
And I click on "Rate" "button" in the ".competency-grader" "css_element"
And I click on "Close" "button" in the "User competency summary" "dialogue"
And I click on "PageName1" "autocomplete_selection"
And I should see "Test-Comp1"
And I should see "Test-Comp2"
@accessibility
Scenario: Evaluate the accessibility of the user competency summary dialogue
Given I navigate to "Reports" in current page administration
When I click on "Competency breakdown" "link"
And I click on "Not rated" "link"
And the page should meet accessibility standards
@@ -0,0 +1,26 @@
@report @report_competency
Feature: In a course administration page, navigate through report page, test for course competency page
In order to navigate through report page
As an admin
Go to course administration -> reports -> competency breackdown
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 |
@javascript
Scenario: Selector should be available in the course competency 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 "Competency breakdown" "link"
Then "Report" "field" should exist in the "tertiary-navigation" "region"
And I should see "Competency breakdown" in the "tertiary-navigation" "region"