Merge branch 'MDL-70610-main' of https://github.com/kevpercy/moodle

This commit is contained in:
Huong Nguyen
2025-02-11 11:12:58 +07:00
9 changed files with 47 additions and 47 deletions
@@ -121,7 +121,7 @@ final class user_deleted_observer_test extends \advanced_testcase {
* Ensure that a delete data request is being created upon user deletion
* if a finished delete data request (excluding complete) for that user already exists.
*/
public function test_create_delete_data_request_canceled_delete_data_request_preexists(): void {
public function test_create_delete_data_request_cancelled_delete_data_request_preexists(): void {
$this->resetAfterTest();
$this->setAdminUser();
@@ -135,7 +135,7 @@ final class user_deleted_observer_test extends \advanced_testcase {
$requestid = $datarequest->get('id');
api::update_request_status($requestid, api::DATAREQUEST_STATUS_CANCELLED);
// Validate that delete data request has been created and the status has been updated to 'Canceled'.
// Validate that delete data request has been created and the status has been updated to 'Cancelled'.
$this->assertEquals(1, api::get_data_requests_count($user->id, [], [api::DATAREQUEST_TYPE_DELETE]));
$this->assertFalse(api::has_ongoing_request($user->id, api::DATAREQUEST_TYPE_DELETE));
+33 -33
View File
@@ -122,7 +122,7 @@ class api {
}
/**
* Validate if current user have acces to the course_module if hidden.
* Validate if current user has access to the course_module if hidden.
*
* @param mixed $cmmixed The cm_info class, course module record or its ID.
* @param bool $throwexception Throw an exception or not.
@@ -152,7 +152,7 @@ class api {
}
/**
* Validate if current user have acces to the course if hidden.
* Validate if current user has access to the course if hidden.
*
* @param mixed $courseorid The course or it ID.
* @param bool $throwexception Throw an exception or not.
@@ -454,7 +454,7 @@ class api {
}
/**
* Read a the details for a single competency and return a record.
* Read the details for a single competency and return a record.
*
* Requires moodle/competency:competencyview capability at the system context.
*
@@ -484,7 +484,7 @@ class api {
}
/**
* Perform a text search based and return all results and their parents.
* Perform a search based on a text and return all results and their parents.
*
* Requires moodle/competency:competencyview capability at the framework context.
*
@@ -615,7 +615,7 @@ class api {
$framework->set('id', 0);
$framework = $framework->create();
// Array that match the old competencies ids with the new one to use when copying related competencies.
// Array that matches the old competencies ids with the new one to use when copying related competencies.
$frameworkcompetency = competency::get_framework_tree($id);
$matchids = self::duplicate_competency_tree($framework->get('id'), $frameworkcompetency, 0, 0);
@@ -705,7 +705,7 @@ class api {
// Commit the transaction.
$transaction->allow_commit();
// If all operations are successfull then trigger the delete event.
// If all operations are successful then trigger the delete event.
$event->trigger();
// Trigger deleted event competencies.
@@ -744,7 +744,7 @@ class api {
}
/**
* Read a the details for a single competency framework and return a record.
* Read the details for a single competency framework and return a record.
*
* Requires moodle/competency:competencyview capability at the system context.
*
@@ -763,7 +763,7 @@ class api {
}
/**
* Logg the competency framework viewed event.
* Log the competency framework viewed event.
*
* @param competency_framework|int $frameworkorid The competency_framework object or competency framework id
* @return bool
@@ -784,7 +784,7 @@ class api {
}
/**
* Logg the competency viewed event.
* Log the competency viewed event.
*
* @param competency|int $competencyorid The competency object or competency id
* @return bool
@@ -1025,7 +1025,7 @@ class api {
$cm = get_coursemodule_from_id('', $cmorid, 0, true, MUST_EXIST);
}
// Check the user have access to the course module.
// Check the user has access to the course module.
self::validate_course_module($cm);
$context = context_module::instance($cm->id);
@@ -1084,7 +1084,7 @@ class api {
*/
public static function count_proficient_competencies_in_course_for_user($courseid, $userid) {
static::require_enabled();
// Check the user have access to the course.
// Check the user has access to the course.
self::validate_course($courseid);
// First we do a permissions check.
@@ -1107,7 +1107,7 @@ class api {
*/
public static function count_competencies_in_course($courseid) {
static::require_enabled();
// Check the user have access to the course.
// Check the user has access to the course.
self::validate_course($courseid);
// First we do a permissions check.
@@ -1138,7 +1138,7 @@ class api {
$course = get_course($courseorid);
}
// Check the user have access to the course.
// Check the user has access to the course.
self::validate_course($course);
$context = context_course::instance($course->id);
@@ -1217,7 +1217,7 @@ class api {
$cm = get_coursemodule_from_id('', $cmorid, 0, true, MUST_EXIST);
}
// Check the user have access to the course module.
// Check the user has access to the course module.
self::validate_course_module($cm);
$context = context_module::instance($cm->id);
@@ -1245,7 +1245,7 @@ class api {
$cm = get_coursemodule_from_id('', $cmorid, 0, true, MUST_EXIST);
}
// Check the user have access to the course module.
// Check the user has access to the course module.
self::validate_course_module($cm);
$context = context_module::instance($cm->id);
@@ -1457,7 +1457,7 @@ class api {
$cm = get_coursemodule_from_id('', $cmorid, 0, true, MUST_EXIST);
}
// Check the user have access to the course module.
// Check the user has access to the course module.
self::validate_course_module($cm);
// First we do a permissions check.
@@ -1499,7 +1499,7 @@ class api {
if (!is_object($cmorid)) {
$cm = get_coursemodule_from_id('', $cmorid, 0, true, MUST_EXIST);
}
// Check the user have access to the course module.
// Check the user has access to the course module.
self::validate_course_module($cm);
// First we do a permissions check.
@@ -1535,7 +1535,7 @@ class api {
if (!is_object($cmorid)) {
$cm = get_coursemodule_from_id('', $cmorid, 0, true, MUST_EXIST);
}
// Check the user have access to the course module.
// Check the user has access to the course module.
self::validate_course_module($cm);
// First we do a permissions check.
@@ -1616,7 +1616,7 @@ class api {
*/
public static function add_competency_to_course($courseid, $competencyid) {
static::require_enabled();
// Check the user have access to the course.
// Check the user has access to the course.
self::validate_course($courseid);
// First we do a permissions check.
@@ -1630,7 +1630,7 @@ class api {
$competency = new competency($competencyid);
// Can not add a competency that belong to a hidden framework.
// Can not add a competency that belongs to a hidden framework.
if ($competency->get_framework()->get('visible') == false) {
throw new coding_exception('A competency belonging to hidden framework can not be linked to course');
}
@@ -1655,7 +1655,7 @@ class api {
*/
public static function remove_competency_from_course($courseid, $competencyid) {
static::require_enabled();
// Check the user have access to the course.
// Check the user has access to the course.
self::validate_course($courseid);
// First we do a permissions check.
@@ -1692,7 +1692,7 @@ class api {
*/
public static function reorder_course_competency($courseid, $competencyidfrom, $competencyidto) {
static::require_enabled();
// Check the user have access to the course.
// Check the user has access to the course.
self::validate_course($courseid);
// First we do a permissions check.
@@ -1954,7 +1954,7 @@ class api {
}
/**
* Read a the details for a single learning plan template and return a record.
* Read the details for a single learning plan template and return a record.
*
* Requires moodle/competency:templateview capability at the system context.
*
@@ -2197,7 +2197,7 @@ class api {
$competency = new competency($competencyid);
// Can not add a competency that belong to a hidden framework.
// Can not add a competency that belongs to a hidden framework.
if ($competency->get_framework()->get('visible') == false) {
throw new coding_exception('A competency belonging to hidden framework can not be added');
}
@@ -2686,9 +2686,9 @@ class api {
throw new required_capability_exception($plan->get_context(), 'moodle/competency:planmanage', 'nopermissions', '');
}
// Only plan with status DRAFT or ACTIVE can be unliked..
// Only plan with status DRAFT or ACTIVE can be unlinked..
if ($plan->get('status') == plan::STATUS_COMPLETE) {
throw new coding_exception('Only draft or active plan can be unliked from a template');
throw new coding_exception('Only draft or active plan can be unlinked from a template');
}
// Early exit, it's already done...
@@ -3363,7 +3363,7 @@ class api {
}
if (!$plan->can_be_edited()) {
throw new coding_exception('A competency can not be added to a learning plan completed');
throw new coding_exception('A competency can not be added to a completed learning plan');
}
$competency = new competency($competencyid);
@@ -3406,7 +3406,7 @@ class api {
}
if (!$plan->can_be_edited()) {
throw new coding_exception('A competency can not be removed from a learning plan completed');
throw new coding_exception('A competency can not be removed from a completed learning plan');
}
$link = plan_competency::get_record(array('planid' => $planid, 'competencyid' => $competencyid));
@@ -3440,7 +3440,7 @@ class api {
}
if (!$plan->can_be_edited()) {
throw new coding_exception('A competency can not be reordered in a learning plan completed');
throw new coding_exception('A competency can not be reordered in a completed learning plan');
}
$down = true;
@@ -3492,7 +3492,7 @@ class api {
if (!$uc || !$uc->can_read()) {
throw new required_capability_exception($context, 'moodle/competency:usercompetencyview', 'nopermissions', '');
} else if ($uc->get('status') != user_competency::STATUS_WAITING_FOR_REVIEW) {
throw new coding_exception('The competency can not be cancel review request at this stage.');
throw new coding_exception('The competency review request can not be cancelled at this stage.');
} else if (!$uc->can_request_review()) {
throw new required_capability_exception($context, 'moodle/competency:usercompetencyrequestreview', 'nopermissions', '');
}
@@ -3637,7 +3637,7 @@ class api {
}
$plan = new plan($planid);
if ($plan->get('status') == plan::STATUS_COMPLETE) {
throw new coding_exception('To log the user competency in completed plan use user_competency_plan_viewed method.');
throw new coding_exception('To log the user competency in a completed plan use the user_competency_plan_viewed method.');
}
\core\event\competency_user_competency_viewed_in_plan::create_from_user_competency_viewed_in_plan($uc, $planid)->trigger();
@@ -3770,7 +3770,7 @@ class api {
static::require_enabled();
$competency = new competency($competencyid);
// This only check if we have the permission in either competency because both competencies
// This only checks if we have the permission in either competency because both competencies
// should belong to the same framework.
require_capability('moodle/competency:competencymanage', $competency->get_context());
@@ -4324,7 +4324,7 @@ class api {
// if rating outside a course
// - set the default grade and proficiency ONLY if there is no current grade
// else we are in a course
// - set the defautl grade and proficiency in the course ONLY if there is no current grade in the course
// - set the default grade and proficiency in the course ONLY if there is no current grade in the course
// - then check the course settings to see if we should push the rating outside the course
// - if we should push it
// --- push it only if the user_competency (outside the course) has no grade
+4 -4
View File
@@ -706,11 +706,11 @@ final class events_test extends \advanced_testcase {
try {
api::user_competency_viewed_in_plan($uc, $plan->get('id'));
$this->fail('To log the user competency in completed plan '
. 'use user_competency_plan_viewed method.');
$this->fail('To log the user competency in a completed plan '
. 'use the user_competency_plan_viewed method.');
} catch (\coding_exception $e) {
$this->assertMatchesRegularExpression('/To log the user competency in completed plan '
. 'use user_competency_plan_viewed method./', $e->getMessage());
$this->assertMatchesRegularExpression('/To log the user competency in a completed plan '
. 'use the user_competency_plan_viewed method./', $e->getMessage());
}
api::reopen_plan($plan);
+1 -1
View File
@@ -63,7 +63,7 @@ $string['privacy:metadata:enrol_paypal:enrol_paypal:instanceid'] = 'The ID of th
$string['privacy:metadata:enrol_paypal:enrol_paypal:item_name'] = 'The full name of the course that its enrolment has been sold.';
$string['privacy:metadata:enrol_paypal:enrol_paypal:memo'] = 'A note that was entered by the buyer in PayPal website payments note field.';
$string['privacy:metadata:enrol_paypal:enrol_paypal:option_selection1_x'] = 'Full name of the buyer.';
$string['privacy:metadata:enrol_paypal:enrol_paypal:parent_txn_id'] = 'In the case of a refund, reversal, or canceled reversal, this would be the transaction ID of the original transaction.';
$string['privacy:metadata:enrol_paypal:enrol_paypal:parent_txn_id'] = 'In the case of a refund, reversal, or cancelled reversal, this would be the transaction ID of the original transaction.';
$string['privacy:metadata:enrol_paypal:enrol_paypal:payment_status'] = 'The status of the payment.';
$string['privacy:metadata:enrol_paypal:enrol_paypal:payment_type'] = 'Holds whether the payment was funded with an eCheck (echeck), or was funded with PayPal balance, credit card, or instant transfer (instant).';
$string['privacy:metadata:enrol_paypal:enrol_paypal:pending_reason'] = 'The reason why payment status is pending (if that is).';
+3 -3
View File
@@ -1196,15 +1196,15 @@ class behat_core_generator extends behat_generator_base {
global $DB;
if (!isset($data['userid'])) {
throw new Exception('\'last acces times\' requires the field \'user\' to be specified');
throw new Exception('\'last access times\' requires the field \'user\' to be specified');
}
if (!isset($data['courseid'])) {
throw new Exception('\'last acces times\' requires the field \'course\' to be specified');
throw new Exception('\'last access times\' requires the field \'course\' to be specified');
}
if (!isset($data['lastaccess'])) {
throw new Exception('\'last acces times\' requires the field \'lastaccess\' to be specified');
throw new Exception('\'last access times\' requires the field \'lastaccess\' to be specified');
}
$userdata = [];
+1 -1
View File
@@ -1598,7 +1598,7 @@ the groupid field.
moodle/site:configview capability added.
* Admin setting "Show My courses expanded on Dashboard" has been removed.
* Some backwards and forwards compatibility has been added for different bootstrap versions.
This is to allow the same markup to work in "clean" and "boost" themes alot of the time. It is also to allow user text
This is to allow the same markup to work in "clean" and "boost" themes a lot of the time. It is also to allow user text
with bootstrap classes to keep working in the new theme. See MDL-56004 for the list of supported classes.
* MForms element 'submitlink' has been deprecated.
* Searchable selector form element is now a wrapper for autocomplete. A "No selection" option is automatically
+1 -1
View File
@@ -134,7 +134,7 @@ final class base_test extends \advanced_testcase {
}
/*
* For tests that make sense to use alot of data, create extra students/teachers.
* For tests that make sense to use a lot of data, create extra students/teachers.
*/
protected function create_extra_users() {
global $DB;
@@ -66,7 +66,7 @@ class backup_lesson_activity_structure_step extends backup_activity_structure_st
// The lesson table
// This table contains all of the goodness for the lesson module, quite
// alot goes into it but nothing relational other than course when will
// a lot goes into it but nothing relational other than course when will
// need to be corrected upon restore.
$lesson = new backup_nested_element('lesson', array('id'), array(
'course', 'name', 'intro', 'introformat', 'practice', 'modattempts',
+1 -1
View File
@@ -542,7 +542,7 @@ abstract class engine {
* Executes the query on the engine.
*
* Implementations of this function should check user context array to limit the results to contexts where the
* user have access. They should also limit the owneruserid field to manger::NO_OWNER_ID or the current user's id.
* user has access. They should also limit the owneruserid field to manger::NO_OWNER_ID or the current user's id.
* Engines must use area->check_access() to confirm user access.
*
* Engines should reasonably attempt to fill up to limit with valid results if they are available.