From 7c016b34516fa0809296ea6808231d5df532d009 Mon Sep 17 00:00:00 2001 From: Marc-Alexandre Ghaly Date: Tue, 16 Nov 2021 08:55:34 -0500 Subject: [PATCH] MDL-71636 core_question : API changes for column_base This commit implements methods visibility changes to column_base class and its child classes. --- mod/quiz/classes/question/bank/question_name_column.php | 2 +- question/bank/comment/classes/comment_count_column.php | 2 +- question/bank/customfields/classes/custom_field_column.php | 2 +- question/bank/editquestion/classes/question_status_column.php | 2 +- .../bank/statistics/classes/columns/discrimination_index.php | 2 +- .../statistics/classes/columns/discriminative_efficiency.php | 2 +- question/bank/statistics/classes/columns/facility_index.php | 2 +- question/bank/usage/classes/question_usage_column.php | 2 +- question/bank/viewcreator/classes/creator_name_column.php | 2 +- .../classes/viewquestionname_column_helper.php | 2 +- question/bank/viewquestiontext/classes/question_text_row.php | 2 +- .../bank/viewquestiontype/classes/question_type_column.php | 4 ++-- question/classes/local/bank/action_column_base.php | 2 +- question/classes/local/bank/checkbox_column.php | 4 ++-- question/classes/local/bank/column_base.php | 4 ++-- question/classes/local/bank/edit_menu_column.php | 2 +- question/tests/fixtures/testable_core_question_column.php | 2 +- 17 files changed, 20 insertions(+), 20 deletions(-) diff --git a/mod/quiz/classes/question/bank/question_name_column.php b/mod/quiz/classes/question/bank/question_name_column.php index 4f1462cf816..22119a7aadf 100644 --- a/mod/quiz/classes/question/bank/question_name_column.php +++ b/mod/quiz/classes/question/bank/question_name_column.php @@ -36,7 +36,7 @@ class question_name_column extends \core_question\local\bank\column_base { return 'questionname'; } - protected function get_title(): string { + public function get_title(): string { return get_string('question'); } diff --git a/question/bank/comment/classes/comment_count_column.php b/question/bank/comment/classes/comment_count_column.php index 966c8a9f8d9..03dd56d9f92 100644 --- a/question/bank/comment/classes/comment_count_column.php +++ b/question/bank/comment/classes/comment_count_column.php @@ -43,7 +43,7 @@ class comment_count_column extends column_base { * * @return string */ - protected function get_title(): string { + public function get_title(): string { return get_string('commentplural', 'qbank_comment'); } diff --git a/question/bank/customfields/classes/custom_field_column.php b/question/bank/customfields/classes/custom_field_column.php index 75ffb403090..fdefab9dca3 100644 --- a/question/bank/customfields/classes/custom_field_column.php +++ b/question/bank/customfields/classes/custom_field_column.php @@ -68,7 +68,7 @@ class custom_field_column extends column_base { * * @return string */ - protected function get_title(): string { + public function get_title(): string { return $this->field->get_formatted_name(); } diff --git a/question/bank/editquestion/classes/question_status_column.php b/question/bank/editquestion/classes/question_status_column.php index a505c9af337..060f5a679aa 100644 --- a/question/bank/editquestion/classes/question_status_column.php +++ b/question/bank/editquestion/classes/question_status_column.php @@ -33,7 +33,7 @@ class question_status_column extends column_base { return 'questionstatus'; } - protected function get_title(): string { + public function get_title(): string { return get_string('questionstatus', 'qbank_editquestion'); } diff --git a/question/bank/statistics/classes/columns/discrimination_index.php b/question/bank/statistics/classes/columns/discrimination_index.php index a0255390607..a7cbabc7264 100644 --- a/question/bank/statistics/classes/columns/discrimination_index.php +++ b/question/bank/statistics/classes/columns/discrimination_index.php @@ -33,7 +33,7 @@ class discrimination_index extends column_base { * * @return string column title */ - protected function get_title(): string { + public function get_title(): string { return get_string('discrimination_index', 'qbank_statistics'); } diff --git a/question/bank/statistics/classes/columns/discriminative_efficiency.php b/question/bank/statistics/classes/columns/discriminative_efficiency.php index 75eeadc9486..45a201b8a63 100644 --- a/question/bank/statistics/classes/columns/discriminative_efficiency.php +++ b/question/bank/statistics/classes/columns/discriminative_efficiency.php @@ -33,7 +33,7 @@ class discriminative_efficiency extends column_base { * * @return string column title */ - protected function get_title(): string { + public function get_title(): string { return get_string('discriminative_efficiency', 'qbank_statistics'); } diff --git a/question/bank/statistics/classes/columns/facility_index.php b/question/bank/statistics/classes/columns/facility_index.php index b862ed03ce9..efbf5425129 100644 --- a/question/bank/statistics/classes/columns/facility_index.php +++ b/question/bank/statistics/classes/columns/facility_index.php @@ -33,7 +33,7 @@ class facility_index extends column_base { * * @return string column title */ - protected function get_title(): string { + public function get_title(): string { return get_string('facility_index', 'qbank_statistics'); } diff --git a/question/bank/usage/classes/question_usage_column.php b/question/bank/usage/classes/question_usage_column.php index cae0d56741c..72af6117eec 100644 --- a/question/bank/usage/classes/question_usage_column.php +++ b/question/bank/usage/classes/question_usage_column.php @@ -32,7 +32,7 @@ class question_usage_column extends column_base { return 'questionusage'; } - protected function get_title(): string { + public function get_title(): string { return get_string('questionusage', 'qbank_usage'); } diff --git a/question/bank/viewcreator/classes/creator_name_column.php b/question/bank/viewcreator/classes/creator_name_column.php index bf655de8a65..f00f41395c1 100644 --- a/question/bank/viewcreator/classes/creator_name_column.php +++ b/question/bank/viewcreator/classes/creator_name_column.php @@ -32,7 +32,7 @@ class creator_name_column extends column_base { return 'creatorname'; } - protected function get_title(): string { + public function get_title(): string { return get_string('createdby', 'question'); } diff --git a/question/bank/viewquestionname/classes/viewquestionname_column_helper.php b/question/bank/viewquestionname/classes/viewquestionname_column_helper.php index 22d02421207..6e3027aa4bb 100644 --- a/question/bank/viewquestionname/classes/viewquestionname_column_helper.php +++ b/question/bank/viewquestionname/classes/viewquestionname_column_helper.php @@ -38,7 +38,7 @@ class viewquestionname_column_helper extends column_base { return 'questionname'; } - protected function get_title(): string { + public function get_title(): string { return get_string('question'); } diff --git a/question/bank/viewquestiontext/classes/question_text_row.php b/question/bank/viewquestiontext/classes/question_text_row.php index 1279e9ca183..60783123167 100644 --- a/question/bank/viewquestiontext/classes/question_text_row.php +++ b/question/bank/viewquestiontext/classes/question_text_row.php @@ -44,7 +44,7 @@ class question_text_row extends row_base { return 'questiontext'; } - protected function get_title(): string { + public function get_title(): string { return get_string('questiontext', 'question'); } diff --git a/question/bank/viewquestiontype/classes/question_type_column.php b/question/bank/viewquestiontype/classes/question_type_column.php index 13cd141d8b2..bffc58f2b19 100644 --- a/question/bank/viewquestiontype/classes/question_type_column.php +++ b/question/bank/viewquestiontype/classes/question_type_column.php @@ -32,11 +32,11 @@ class question_type_column extends column_base { return 'qtype'; } - protected function get_title(): string { + public function get_title(): string { return get_string('qtypeveryshort', 'question'); } - protected function get_title_tip(): string { + public function get_title_tip(): string { return get_string('questiontype', 'question'); } diff --git a/question/classes/local/bank/action_column_base.php b/question/classes/local/bank/action_column_base.php index 84b93744f2c..efdbc50e0fd 100644 --- a/question/classes/local/bank/action_column_base.php +++ b/question/classes/local/bank/action_column_base.php @@ -33,7 +33,7 @@ namespace core_question\local\bank; */ abstract class action_column_base extends column_base { - protected function get_title(): string { + public function get_title(): string { return ' '; } diff --git a/question/classes/local/bank/checkbox_column.php b/question/classes/local/bank/checkbox_column.php index babd720c828..938d8864cc4 100644 --- a/question/classes/local/bank/checkbox_column.php +++ b/question/classes/local/bank/checkbox_column.php @@ -39,7 +39,7 @@ class checkbox_column extends column_base { return 'checkbox'; } - protected function get_title() { + public function get_title() { global $OUTPUT; $mastercheckbox = new checkbox_toggleall('qbank', true, [ @@ -53,7 +53,7 @@ class checkbox_column extends column_base { return $OUTPUT->render($mastercheckbox); } - protected function get_title_tip() { + public function get_title_tip() { return get_string('selectquestionsforbulk', 'question'); } diff --git a/question/classes/local/bank/column_base.php b/question/classes/local/bank/column_base.php index faaa2a5c76a..57e3994d820 100644 --- a/question/classes/local/bank/column_base.php +++ b/question/classes/local/bank/column_base.php @@ -133,7 +133,7 @@ abstract class column_base { /** * Title for this column. Not used if is_sortable returns an array. */ - abstract protected function get_title(); + abstract public function get_title(); /** * Use this when get_title() returns @@ -141,7 +141,7 @@ abstract class column_base { * * @return string a fuller version of the name. */ - protected function get_title_tip() { + public function get_title_tip() { return ''; } diff --git a/question/classes/local/bank/edit_menu_column.php b/question/classes/local/bank/edit_menu_column.php index ad30be24fed..91ac0214f65 100644 --- a/question/classes/local/bank/edit_menu_column.php +++ b/question/classes/local/bank/edit_menu_column.php @@ -64,7 +64,7 @@ class edit_menu_column extends column_base { return $remainingcolumns; } - protected function get_title() { + public function get_title() { return get_string('actions'); } diff --git a/question/tests/fixtures/testable_core_question_column.php b/question/tests/fixtures/testable_core_question_column.php index 02dfadb873a..3e41e84b1f7 100644 --- a/question/tests/fixtures/testable_core_question_column.php +++ b/question/tests/fixtures/testable_core_question_column.php @@ -60,7 +60,7 @@ class testable_core_question_column extends \core_question\local\bank\column_bas return 'test_column'; } - protected function get_title() { + public function get_title() { return 'Test Column'; } }