diff --git a/classes/condition/studentquiz_condition.php b/classes/condition/studentquiz_condition.php index 5cfcb62d..8f5f78eb 100755 --- a/classes/condition/studentquiz_condition.php +++ b/classes/condition/studentquiz_condition.php @@ -25,7 +25,7 @@ namespace mod_studentquiz\condition; defined('MOODLE_INTERNAL') || die(); -if (class_exists('\core_question\bank\search\condition')) { +if (!class_exists('\core_question\local\bank\condition')) { class_alias('\core_question\bank\search\condition', '\core_question\local\bank\condition'); } diff --git a/classes/question/bank/anonym_creator_name_column.php b/classes/question/bank/anonym_creator_name_column.php index 8940f552..900979d3 100644 --- a/classes/question/bank/anonym_creator_name_column.php +++ b/classes/question/bank/anonym_creator_name_column.php @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . -namespace mod_studentquiz\bank; +namespace mod_studentquiz\question\bank; /** * A column type for the name of the question creator. diff --git a/classes/question/bank/attempts_column.php b/classes/question/bank/attempts_column.php index 58c573c2..724919a8 100644 --- a/classes/question/bank/attempts_column.php +++ b/classes/question/bank/attempts_column.php @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . -namespace mod_studentquiz\bank; +namespace mod_studentquiz\question\bank; /** * Represent performances column in studentquiz_bank_view diff --git a/classes/question/bank/comments_column.php b/classes/question/bank/comment_column.php similarity index 99% rename from classes/question/bank/comments_column.php rename to classes/question/bank/comment_column.php index f8fe11a1..c043688e 100644 --- a/classes/question/bank/comments_column.php +++ b/classes/question/bank/comment_column.php @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . -namespace mod_studentquiz\bank; +namespace mod_studentquiz\question\bank; use mod_studentquiz\utils; diff --git a/classes/question/bank/difficulty_level_column.php b/classes/question/bank/difficulty_level_column.php index 25bfe4e6..4a93a8ab 100644 --- a/classes/question/bank/difficulty_level_column.php +++ b/classes/question/bank/difficulty_level_column.php @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . -namespace mod_studentquiz\bank; +namespace mod_studentquiz\question\bank; /** * Representing difficulty level column in studentquiz_bank_view diff --git a/classes/question/bank/legacy/studentquiz_bank_view_pre_43.php b/classes/question/bank/legacy/studentquiz_bank_view_pre_43.php index b925ad17..c36a8579 100644 --- a/classes/question/bank/legacy/studentquiz_bank_view_pre_43.php +++ b/classes/question/bank/legacy/studentquiz_bank_view_pre_43.php @@ -29,12 +29,6 @@ use mod_studentquiz\utils; use stdClass; use core_question\local\bank\question_version_status; -use mod_studentquiz\bank\mod_studentquiz_question_bank_filter_form; -use mod_studentquiz\bank\studentquiz_user_filter_date; -use mod_studentquiz\bank\user_filter_number; -use mod_studentquiz\bank\studentquiz_user_filter_text; -use mod_studentquiz\bank\toggle_filter_checkbox; -use mod_studentquiz\bank\user_filter_percent; defined('MOODLE_INTERNAL') || die(); @@ -211,8 +205,8 @@ public function get_questions() { */ protected function default_sort(): array { return [ - 'mod_studentquiz\bank\anonym_creator_name_column-timecreated' => -1, - 'mod_studentquiz\bank\question_name_column' => 1, + 'mod_studentquiz\question\bank\anonym_creator_name_column-timecreated' => -1, + 'mod_studentquiz\question\bank\question_name_column' => 1, ]; } diff --git a/classes/question/bank/question_bank_filter.php b/classes/question/bank/question_bank_filter.php index fcd3848e..eb7b5460 100644 --- a/classes/question/bank/question_bank_filter.php +++ b/classes/question/bank/question_bank_filter.php @@ -21,7 +21,6 @@ * @copyright 2017 HSR (http://www.hsr.ch) * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -namespace mod_studentquiz\bank; defined('MOODLE_INTERNAL') || die(); require_once($CFG->dirroot . '/lib/formslib.php'); @@ -35,7 +34,7 @@ * @copyright 2017 HSR (http://www.hsr.ch) * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -class mod_studentquiz_question_bank_filter_form extends moodleform { +class mod_studentquiz_question_bank_filter_form extends \moodleform { /** * Filter fields of question bank @@ -115,7 +114,7 @@ public function definition() { * @author Huong Nguyen * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -class studentquiz_user_filter_text extends user_filter_text { +class studentquiz_user_filter_text extends \user_filter_text { /** * Adds controls specific to this filter in the form. @@ -144,7 +143,7 @@ public function setupForm(&$mform) { // @codingStandardsIgnoreLine * @author Huong Nguyen * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -class studentquiz_user_filter_date extends user_filter_date { +class studentquiz_user_filter_date extends \user_filter_date { /** * Adds controls specific to this filter in the form. @@ -294,7 +293,7 @@ private function generate_creation_label($creationtext, $rowtext, $inputtext, $i * * They have no own value but refer a the target field which is set to a defined value once toggled. */ -class toggle_filter_checkbox extends user_filter_checkbox { +class toggle_filter_checkbox extends \user_filter_checkbox { /** * Operator is a short form to express if the value diff --git a/classes/question/bank/question_name_column.php b/classes/question/bank/question_name_column.php index 5df50bda..3b5c5581 100644 --- a/classes/question/bank/question_name_column.php +++ b/classes/question/bank/question_name_column.php @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . -namespace mod_studentquiz\bank; +namespace mod_studentquiz\question\bank; /** * A column type for the name of the question name. diff --git a/classes/question/bank/question_text_row.php b/classes/question/bank/question_text_row.php index a7d0eb4d..3ada6e43 100644 --- a/classes/question/bank/question_text_row.php +++ b/classes/question/bank/question_text_row.php @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . -namespace mod_studentquiz\bank; +namespace mod_studentquiz\question\bank; /** * A column type for the name of the question name. diff --git a/classes/question/bank/rate_column.php b/classes/question/bank/rate_column.php index a1df9e0d..3b28f0c6 100644 --- a/classes/question/bank/rate_column.php +++ b/classes/question/bank/rate_column.php @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . -namespace mod_studentquiz\bank; +namespace mod_studentquiz\question\bank; /** * Represent rate column in studentquiz_bank_view diff --git a/classes/question/bank/sq_delete_action.php b/classes/question/bank/sq_delete_action.php index 9624e840..d4cde8b4 100644 --- a/classes/question/bank/sq_delete_action.php +++ b/classes/question/bank/sq_delete_action.php @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . -namespace mod_studentquiz\bank; +namespace mod_studentquiz\question\bank; use mod_studentquiz\local\studentquiz_helper; diff --git a/classes/question/bank/sq_edit_action.php b/classes/question/bank/sq_edit_action.php index 4a51c371..ec833483 100644 --- a/classes/question/bank/sq_edit_action.php +++ b/classes/question/bank/sq_edit_action.php @@ -14,11 +14,11 @@ // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . -namespace mod_studentquiz\bank; +namespace mod_studentquiz\question\bank; use mod_studentquiz\local\studentquiz_helper; -if (class_exists('\qbank_editquestion\edit_action_column')) { +if (!class_exists('\qbank_editquestion\edit_action')) { class_alias('\qbank_editquestion\edit_action_column', '\qbank_editquestion\edit_action'); } /** diff --git a/classes/question/bank/sq_edit_menu_column.php b/classes/question/bank/sq_edit_menu_column.php index 5e9b8237..c5b49f9f 100644 --- a/classes/question/bank/sq_edit_menu_column.php +++ b/classes/question/bank/sq_edit_menu_column.php @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . -namespace mod_studentquiz\bank; +namespace mod_studentquiz\question\bank; use core_question\local\bank\edit_menu_column; diff --git a/classes/question/bank/sq_hidden_action.php b/classes/question/bank/sq_hidden_action.php index 126e2581..f0558a32 100644 --- a/classes/question/bank/sq_hidden_action.php +++ b/classes/question/bank/sq_hidden_action.php @@ -14,9 +14,9 @@ // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . -namespace mod_studentquiz\bank; +namespace mod_studentquiz\question\bank; -if (class_exists('\qbank_previewquestion\preview_action_column')) { +if (!class_exists('\core_question\local\bank\question_action_base')) { class_alias('\core_question\local\bank\menu_action_column_base', '\core_question\local\bank\question_action_base'); } /** diff --git a/classes/question/bank/sq_pin_action.php b/classes/question/bank/sq_pin_action.php index 1cfdf922..73e95000 100644 --- a/classes/question/bank/sq_pin_action.php +++ b/classes/question/bank/sq_pin_action.php @@ -15,9 +15,9 @@ // along with Moodle. If not, see . -namespace mod_studentquiz\bank; +namespace mod_studentquiz\question\bank; -if (class_exists('\core_question\local\bank\menu_action_column_base')) { +if (!class_exists('\core_question\local\bank\question_action_base')) { class_alias('\core_question\local\bank\menu_action_column_base', '\core_question\local\bank\question_action_base'); } diff --git a/classes/question/bank/sq_preview_action.php b/classes/question/bank/sq_preview_action.php index e8031a93..bffaeb8e 100644 --- a/classes/question/bank/sq_preview_action.php +++ b/classes/question/bank/sq_preview_action.php @@ -14,9 +14,9 @@ // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . -namespace mod_studentquiz\bank; +namespace mod_studentquiz\question\bank; -if (class_exists('\qbank_previewquestion\preview_action_column')) { +if (!class_exists('\qbank_previewquestion\preview_action')) { class_alias('\qbank_previewquestion\preview_action_column', '\qbank_previewquestion\preview_action'); } diff --git a/classes/question/bank/state_column.php b/classes/question/bank/state_column.php index d88f9252..b6cfa8f8 100644 --- a/classes/question/bank/state_column.php +++ b/classes/question/bank/state_column.php @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . -namespace mod_studentquiz\bank; +namespace mod_studentquiz\question\bank; /** * Represent state column in studentquiz_bank_view diff --git a/classes/question/bank/state_pin_column.php b/classes/question/bank/state_pin_column.php index 4b889eef..c76abb52 100644 --- a/classes/question/bank/state_pin_column.php +++ b/classes/question/bank/state_pin_column.php @@ -15,7 +15,7 @@ // along with Moodle. If not, see . -namespace mod_studentquiz\bank; +namespace mod_studentquiz\question\bank; /** * Represent question is pinned or not in studentquiz_bank_view diff --git a/classes/question/bank/studentquiz_bank_view.php b/classes/question/bank/studentquiz_bank_view.php index 4c122cdc..b2eb4327 100755 --- a/classes/question/bank/studentquiz_bank_view.php +++ b/classes/question/bank/studentquiz_bank_view.php @@ -31,13 +31,8 @@ use core_question\local\bank\question_version_status; use qbank_managecategories\category_condition; use core_question\local\bank\column_manager_base; -use mod_studentquiz\bank\mod_studentquiz_question_bank_filter_form; -use mod_studentquiz\bank\studentquiz_user_filter_date; -use mod_studentquiz\bank\user_filter_number; -use mod_studentquiz\bank\studentquiz_user_filter_text; -use mod_studentquiz\bank\toggle_filter_checkbox; -use mod_studentquiz\bank\user_filter_percent; - +require_once(__DIR__ . '/question_bank_filter.php'); +require_once(__DIR__ . '/question_text_row.php'); defined('MOODLE_INTERNAL') || die(); /** @@ -186,8 +181,8 @@ public function get_questions() { */ protected function default_sort(): array { return [ - 'mod_studentquiz__bank__anonym_creator_name_column-timecreated' => SORT_DESC, - 'mod_studentquiz__bank__question_name_column' => SORT_ASC, + 'mod_studentquiz__question__bank__anonym_creator_name_column-timecreated' => SORT_DESC, + 'mod_studentquiz__question__bank__question_name_column' => SORT_ASC, ]; } @@ -423,49 +418,49 @@ private function set_filter_form_fields($anonymize = true) { $this->fields = array(); // Fast filters. - $this->fields[] = new toggle_filter_checkbox('onlynew', + $this->fields[] = new \toggle_filter_checkbox('onlynew', get_string('filter_label_onlynew', 'studentquiz'), false, 'myattempts', array('myattempts', 'myattempts_op'), 0, 0, get_string('filter_label_onlynew_help', 'studentquiz')); - $this->fields[] = new toggle_filter_checkbox('only_new_state', + $this->fields[] = new \toggle_filter_checkbox('only_new_state', get_string('state_newplural', 'studentquiz'), false, 'sqq.state', ['approved'], 2, studentquiz_helper::STATE_NEW); - $this->fields[] = new toggle_filter_checkbox('only_approved_state', + $this->fields[] = new \toggle_filter_checkbox('only_approved_state', get_string('state_approvedplural', 'studentquiz'), false, 'sqq.state', ['approved'], 2, studentquiz_helper::STATE_APPROVED); - $this->fields[] = new toggle_filter_checkbox('only_disapproved_state', + $this->fields[] = new \toggle_filter_checkbox('only_disapproved_state', get_string('state_disapprovedplural', 'studentquiz'), false, 'sqq.state', ['approved'], 2, studentquiz_helper::STATE_DISAPPROVED); - $this->fields[] = new toggle_filter_checkbox('only_changed_state', + $this->fields[] = new \toggle_filter_checkbox('only_changed_state', get_string('state_changedplural', 'studentquiz'), false, 'sqq.state', ['approved'], 2, studentquiz_helper::STATE_CHANGED); - $this->fields[] = new toggle_filter_checkbox('only_reviewable_state', + $this->fields[] = new \toggle_filter_checkbox('only_reviewable_state', get_string('state_reviewableplural', 'studentquiz'), false, 'sqq.state', ['approved'], 2, studentquiz_helper::STATE_REVIEWABLE); - $this->fields[] = new toggle_filter_checkbox('onlygood', + $this->fields[] = new \toggle_filter_checkbox('onlygood', get_string('filter_label_onlygood', 'studentquiz'), false, 'vo.rate', array('rate', 'rate_op'), 1, 4, get_string('filter_label_onlygood_help', 'studentquiz', '4')); - $this->fields[] = new toggle_filter_checkbox('onlymine', + $this->fields[] = new \toggle_filter_checkbox('onlymine', get_string('filter_label_onlymine', 'studentquiz'), false, 'q.createdby', array('createdby'), 2, $this->userid, get_string('filter_label_onlymine_help', 'studentquiz')); - $this->fields[] = new toggle_filter_checkbox('onlydifficultforme', + $this->fields[] = new \toggle_filter_checkbox('onlydifficultforme', get_string('filter_label_onlydifficultforme', 'studentquiz'), false, 'mydifficulty', array('mydifficulty', 'mydifficulty_op'), 1, 0.60, get_string('filter_label_onlydifficultforme_help', 'studentquiz', '60')); - $this->fields[] = new toggle_filter_checkbox('onlydifficult', + $this->fields[] = new \toggle_filter_checkbox('onlydifficult', get_string('filter_label_onlydifficult', 'studentquiz'), false, 'dl.difficultylevel', array('difficultylevel', 'difficultylevel_op'), 1, 0.60, get_string('filter_label_onlydifficult_help', 'studentquiz', '60')); // Advanced filters. - $this->fields[] = new studentquiz_user_filter_text('tagarray', get_string('filter_label_tags', 'studentquiz'), + $this->fields[] = new \studentquiz_user_filter_text('tagarray', get_string('filter_label_tags', 'studentquiz'), true, 'tagarray'); $states = array(); @@ -478,27 +473,27 @@ private function set_filter_form_fields($anonymize = true) { $this->fields[] = new \user_filter_simpleselect('state', get_string('state_column_name', 'studentquiz'), true, 'state', $states); - $this->fields[] = new user_filter_number('rate', get_string('filter_label_rates', 'studentquiz'), + $this->fields[] = new \user_filter_number('rate', get_string('filter_label_rates', 'studentquiz'), true, 'rate'); - $this->fields[] = new user_filter_percent('difficultylevel', get_string('filter_label_difficulty_level', 'studentquiz'), + $this->fields[] = new \user_filter_percent('difficultylevel', get_string('filter_label_difficulty_level', 'studentquiz'), true, 'difficultylevel'); - $this->fields[] = new user_filter_number('publiccomment', get_string('filter_label_comment', 'studentquiz'), + $this->fields[] = new \user_filter_number('publiccomment', get_string('filter_label_comment', 'studentquiz'), true, 'publiccomment'); - $this->fields[] = new studentquiz_user_filter_text('name', get_string('filter_label_question', 'studentquiz'), + $this->fields[] = new \studentquiz_user_filter_text('name', get_string('filter_label_question', 'studentquiz'), true, 'name'); - $this->fields[] = new studentquiz_user_filter_text('questiontext', get_string('filter_label_questiontext', 'studentquiz'), + $this->fields[] = new \studentquiz_user_filter_text('questiontext', get_string('filter_label_questiontext', 'studentquiz'), true, 'questiontext'); if ($anonymize) { $this->fields[] = new \user_filter_checkbox('createdby', get_string('filter_label_show_mine', 'studentquiz'), true, 'createdby'); } else { - $this->fields[] = new studentquiz_user_filter_text('firstname', get_string('firstname'), true, 'firstname'); - $this->fields[] = new studentquiz_user_filter_text('lastname', get_string('lastname'), true, 'lastname'); + $this->fields[] = new \studentquiz_user_filter_text('firstname', get_string('firstname'), true, 'firstname'); + $this->fields[] = new \studentquiz_user_filter_text('lastname', get_string('lastname'), true, 'lastname'); } - $this->fields[] = new studentquiz_user_filter_date('timecreated', get_string('filter_label_createdate', 'studentquiz'), + $this->fields[] = new \studentquiz_user_filter_date('timecreated', get_string('filter_label_createdate', 'studentquiz'), true, 'timecreated'); $this->fields[] = new \user_filter_simpleselect('lastanswercorrect', @@ -508,13 +503,13 @@ private function set_filter_form_fields($anonymize = true) { '0' => get_string('lastattempt_wrong', 'studentquiz') )); - $this->fields[] = new user_filter_number('myattempts', get_string('filter_label_myattempts', 'studentquiz'), + $this->fields[] = new \user_filter_number('myattempts', get_string('filter_label_myattempts', 'studentquiz'), true, 'myattempts'); - $this->fields[] = new user_filter_number('mydifficulty', get_string('filter_label_mydifficulty', 'studentquiz'), + $this->fields[] = new \user_filter_number('mydifficulty', get_string('filter_label_mydifficulty', 'studentquiz'), true, 'mydifficulty'); - $this->fields[] = new user_filter_number('myrate', get_string('filter_label_myrate', 'studentquiz'), + $this->fields[] = new \user_filter_number('myrate', get_string('filter_label_myrate', 'studentquiz'), true, 'myrate'); } @@ -542,7 +537,7 @@ private function initialize_filter_form($pageurl) { $pageurl->params(['id' => $this->cm->id]); redirect($pageurl->out()); } - $this->filterform = new mod_studentquiz_question_bank_filter_form( + $this->filterform = new \mod_studentquiz_question_bank_filter_form( $this->fields, $pageurl->out(false), array_merge(['cmid' => $this->cm->id], $this->pagevars) @@ -635,9 +630,9 @@ protected function parse_subsort($sort): array { // When we sort by public/private comments and turn off the setting studentquiz | privatecomment, // the parse_subsort function will throw exception. We should redirect to the base_url after cleaning all sort params. $showprivatecomment = $this->studentquiz->privatecommenting; - if ($showprivatecomment && $sort == 'mod_studentquiz\bank\comment_column' || - !$showprivatecomment && ($sort == 'mod_studentquiz\bank\comment_column-privatecomment' || - $sort == 'mod_studentquiz\bank\comment_column-publiccomment')) { + if ($showprivatecomment && $sort == 'mod_studentquiz\bank\question\comment_column' || + !$showprivatecomment && ($sort == 'mod_studentquiz\bank\question\comment_column-privatecomment' || + $sort == 'mod_studentquiz\bank\question\comment_column-publiccomment')) { for ($i = 1; $i <= self::MAX_SORTS; $i++) { $this->baseurl->remove_params('qbs' . $i); } @@ -677,11 +672,11 @@ protected function init_column_manager(): void { */ protected function init_question_actions(): void { $this->questionactions = [ - new \mod_studentquiz\bank\sq_edit_action($this), - new \mod_studentquiz\bank\sq_preview_action($this), - new \mod_studentquiz\bank\sq_delete_action($this), - new \mod_studentquiz\bank\sq_hidden_action($this), - new \mod_studentquiz\bank\sq_pin_action($this), + new sq_edit_action($this), + new sq_preview_action($this), + new sq_delete_action($this), + new sq_hidden_action($this), + new sq_pin_action($this), ]; } diff --git a/classes/question/bank/studentquiz_column_base.php b/classes/question/bank/studentquiz_column_base.php index a7028e95..8bb43dbb 100644 --- a/classes/question/bank/studentquiz_column_base.php +++ b/classes/question/bank/studentquiz_column_base.php @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . -namespace mod_studentquiz\bank; +namespace mod_studentquiz\question\bank; /** * Represent studentquiz column base in studentquiz_bank_view diff --git a/classes/question/bank/tag_column.php b/classes/question/bank/tag_column.php index 636257f6..793d9c5f 100644 --- a/classes/question/bank/tag_column.php +++ b/classes/question/bank/tag_column.php @@ -22,7 +22,7 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -namespace mod_studentquiz\bank; +namespace mod_studentquiz\question\bank; defined('MOODLE_INTERNAL') || die(); diff --git a/renderer.php b/renderer.php old mode 100755 new mode 100644 index 9967bb8c..0a69f47c --- a/renderer.php +++ b/renderer.php @@ -923,17 +923,17 @@ public function get_columns_for_question_bank_view(mod_studentquiz\question\bank return [ new core_question\local\bank\checkbox_column($view), new qbank_viewquestiontype\question_type_column($view), - new \mod_studentquiz\bank\state_column($view), - new \mod_studentquiz\bank\state_pin_column($view), - new \mod_studentquiz\bank\question_name_column($view), - new \mod_studentquiz\bank\sq_edit_menu_column($view), + new \mod_studentquiz\question\bank\state_column($view), + new \mod_studentquiz\question\bank\state_pin_column($view), + new \mod_studentquiz\question\bank\question_name_column($view), + new \mod_studentquiz\question\bank\sq_edit_menu_column($view), new qbank_history\version_number_column($view), - new \mod_studentquiz\bank\anonym_creator_name_column($view), - new \mod_studentquiz\bank\tag_column($view), - new \mod_studentquiz\bank\attempts_column($view), - new \mod_studentquiz\bank\difficulty_level_column($view), - new \mod_studentquiz\bank\rate_column($view), - new \mod_studentquiz\bank\comment_column($view), + new \mod_studentquiz\question\bank\anonym_creator_name_column($view), + new \mod_studentquiz\question\bank\tag_column($view), + new \mod_studentquiz\question\bank\attempts_column($view), + new \mod_studentquiz\question\bank\difficulty_level_column($view), + new \mod_studentquiz\question\bank\rate_column($view), + new \mod_studentquiz\question\bank\comment_column($view), ]; } @@ -947,22 +947,22 @@ public function get_columns_for_question_bank_view_pre_43(mod_studentquiz\questi return [ new core_question\local\bank\checkbox_column($view), new qbank_viewquestiontype\question_type_column($view), - new \mod_studentquiz\bank\state_column($view), - new \mod_studentquiz\bank\state_pin_column($view), - new \mod_studentquiz\bank\question_name_column($view), - new \mod_studentquiz\bank\sq_edit_action($view), - new \mod_studentquiz\bank\sq_preview_action($view), - new \mod_studentquiz\bank\sq_delete_action($view), - new \mod_studentquiz\bank\sq_hidden_action($view), - new \mod_studentquiz\bank\sq_pin_action($view), - new \mod_studentquiz\bank\sq_edit_menu_column($view), + new \mod_studentquiz\question\bank\state_column($view), + new \mod_studentquiz\question\bank\state_pin_column($view), + new \mod_studentquiz\question\bank\question_name_column($view), + new \mod_studentquiz\question\bank\sq_edit_action($view), + new \mod_studentquiz\question\bank\sq_preview_action($view), + new \mod_studentquiz\question\bank\sq_delete_action($view), + new \mod_studentquiz\question\bank\sq_hidden_action($view), + new \mod_studentquiz\question\bank\sq_pin_action($view), + new \mod_studentquiz\question\bank\sq_edit_menu_column($view), new qbank_history\version_number_column($view), - new \mod_studentquiz\bank\anonym_creator_name_column($view), - new \mod_studentquiz\bank\tag_column($view), - new \mod_studentquiz\bank\attempts_column($view), - new \mod_studentquiz\bank\difficulty_level_column($view), - new \mod_studentquiz\bank\rate_column($view), - new \mod_studentquiz\bank\comment_column($view), + new \mod_studentquiz\question\bank\anonym_creator_name_column($view), + new \mod_studentquiz\question\bank\tag_column($view), + new \mod_studentquiz\question\bank\attempts_column($view), + new \mod_studentquiz\question\bank\difficulty_level_column($view), + new \mod_studentquiz\question\bank\rate_column($view), + new \mod_studentquiz\question\bank\comment_column($view), ]; } diff --git a/viewlib.php b/viewlib.php index 54da39d7..1641e484 100755 --- a/viewlib.php +++ b/viewlib.php @@ -169,7 +169,6 @@ private function load_questionbank() { } $this->qbpagevar = array_merge($pagevars, $params); if (utils::moodle_version_is("<=", "42")) { - require_once($CFG->dirroot . '/mod/studentquiz/classes/question/bank/legacy/studentquiz_bank_view_pre_43.php'); $this->questionbank = new \mod_studentquiz\question\bank\studentquiz_bank_view_pre_43( $contexts, $thispageurl, $this->course, $this->cm, $this->studentquiz, $pagevars, $this->report); } else {