Skip to content

Commit

Permalink
MDL-79756 mod_scorm: Deprecate SCORM report generate_master_checkbox()
Browse files Browse the repository at this point in the history
  • Loading branch information
junpataleta committed Jan 10, 2025
1 parent e628f1b commit c777d11
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 5 deletions.
9 changes: 9 additions & 0 deletions .upgradenotes/MDL-79756-2024111812030302.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
issueNumber: MDL-79756
notes:
mod_scorm:
- message: >
The method `\mod_scorm\report::generate_master_checkbox()` has been
deprecated and should no longer be used. SCORM report plugins calling
this method should use `\mod_scorm\report::generate_toggler_checkbox()`
instead.
type: deprecated
17 changes: 15 additions & 2 deletions mod/scorm/classes/report.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ public function canview($contextmodule) {
}

/**
* Generates a checkbox that can be added to header tables to select/deselect all quiz attempts.
* Generates a checkbox that can be added to header tables to select/deselect all entries in the SCORM report.
*
* @return string
*/
protected function generate_master_checkbox(): string {
protected function generate_toggler_checkbox(): string {
global $OUTPUT;

// Build the select/deselect all control.
Expand All @@ -78,6 +78,19 @@ protected function generate_master_checkbox(): string {
return $OUTPUT->render($togglercheckbox);
}

/**
* Generates a checkbox that can be added to header tables to select/deselect all entries in the SCORM report.
*
* @deprecated since Moodle 5.0
* @todo MDL-83748 Remove this method in Moodle 6.0.
* @return string
*/
#[\core\attribute\deprecated(replacement: '\mod_scorm\report::generate_toggler_checkbox()', since: '5.0', mdl: 'MDL-79756')]
protected function generate_master_checkbox(): string {
\core\deprecation::emit_deprecation_if_present([self::class, __FUNCTION__]);
return $this->generate_toggler_checkbox();
}

/**
* Generates a checkbox for a row in the attempts table.
*
Expand Down
2 changes: 1 addition & 1 deletion mod/scorm/report/basic/classes/report.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public function display($scorm, $cm, $course, $download) {
$headers = array();
if (!$download && $candelete) {
$columns[] = 'checkbox';
$headers[] = $this->generate_master_checkbox();
$headers[] = $this->generate_toggler_checkbox();
}
if (!$download && $CFG->grade_report_showuserimage) {
$columns[] = 'picture';
Expand Down
2 changes: 1 addition & 1 deletion mod/scorm/report/interactions/classes/report.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public function display($scorm, $cm, $course, $download) {
$headers = array();
if (!$download && $candelete) {
$columns[] = 'checkbox';
$headers[] = $this->generate_master_checkbox();
$headers[] = $this->generate_toggler_checkbox();
}
if (!$download && $CFG->grade_report_showuserimage) {
$columns[] = 'picture';
Expand Down
2 changes: 1 addition & 1 deletion mod/scorm/report/objectives/classes/report.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public function display($scorm, $cm, $course, $download) {
$headers = array();
if (!$download && $candelete) {
$columns[] = 'checkbox';
$headers[] = $this->generate_master_checkbox();
$headers[] = $this->generate_toggler_checkbox();
}
if (!$download && $CFG->grade_report_showuserimage) {
$columns[] = 'picture';
Expand Down

0 comments on commit c777d11

Please sign in to comment.