Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
hieuvu committed Jan 16, 2024
1 parent d795052 commit bea8e25
Show file tree
Hide file tree
Showing 23 changed files with 88 additions and 101 deletions.
2 changes: 1 addition & 1 deletion classes/condition/studentquiz_condition.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}

Expand Down
2 changes: 1 addition & 1 deletion classes/question/bank/anonym_creator_name_column.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

namespace mod_studentquiz\bank;
namespace mod_studentquiz\question\bank;

/**
* A column type for the name of the question creator.
Expand Down
2 changes: 1 addition & 1 deletion classes/question/bank/attempts_column.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

namespace mod_studentquiz\bank;
namespace mod_studentquiz\question\bank;

/**
* Represent performances column in studentquiz_bank_view
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

namespace mod_studentquiz\bank;
namespace mod_studentquiz\question\bank;

use mod_studentquiz\utils;

Expand Down
2 changes: 1 addition & 1 deletion classes/question/bank/difficulty_level_column.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

namespace mod_studentquiz\bank;
namespace mod_studentquiz\question\bank;

/**
* Representing difficulty level column in studentquiz_bank_view
Expand Down
10 changes: 2 additions & 8 deletions classes/question/bank/legacy/studentquiz_bank_view_pre_43.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -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,
];
}

Expand Down
9 changes: 4 additions & 5 deletions classes/question/bank/question_bank_filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -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
Expand Down Expand Up @@ -115,7 +114,7 @@ public function definition() {
* @author Huong Nguyen <[email protected]>
* @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.
Expand Down Expand Up @@ -144,7 +143,7 @@ public function setupForm(&$mform) { // @codingStandardsIgnoreLine
* @author Huong Nguyen <[email protected]>
* @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.
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion classes/question/bank/question_name_column.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

namespace mod_studentquiz\bank;
namespace mod_studentquiz\question\bank;

/**
* A column type for the name of the question name.
Expand Down
2 changes: 1 addition & 1 deletion classes/question/bank/question_text_row.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

namespace mod_studentquiz\bank;
namespace mod_studentquiz\question\bank;

/**
* A column type for the name of the question name.
Expand Down
2 changes: 1 addition & 1 deletion classes/question/bank/rate_column.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

namespace mod_studentquiz\bank;
namespace mod_studentquiz\question\bank;

/**
* Represent rate column in studentquiz_bank_view
Expand Down
2 changes: 1 addition & 1 deletion classes/question/bank/sq_delete_action.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

namespace mod_studentquiz\bank;
namespace mod_studentquiz\question\bank;

use mod_studentquiz\local\studentquiz_helper;

Expand Down
4 changes: 2 additions & 2 deletions classes/question/bank/sq_edit_action.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

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');
}
/**
Expand Down
2 changes: 1 addition & 1 deletion classes/question/bank/sq_edit_menu_column.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

namespace mod_studentquiz\bank;
namespace mod_studentquiz\question\bank;

use core_question\local\bank\edit_menu_column;

Expand Down
4 changes: 2 additions & 2 deletions classes/question/bank/sq_hidden_action.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

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');
}
/**
Expand Down
4 changes: 2 additions & 2 deletions classes/question/bank/sq_pin_action.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.


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');
}

Expand Down
4 changes: 2 additions & 2 deletions classes/question/bank/sq_preview_action.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

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');
}

Expand Down
2 changes: 1 addition & 1 deletion classes/question/bank/state_column.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

namespace mod_studentquiz\bank;
namespace mod_studentquiz\question\bank;

/**
* Represent state column in studentquiz_bank_view
Expand Down
2 changes: 1 addition & 1 deletion classes/question/bank/state_pin_column.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.


namespace mod_studentquiz\bank;
namespace mod_studentquiz\question\bank;

/**
* Represent question is pinned or not in studentquiz_bank_view
Expand Down
Loading

0 comments on commit bea8e25

Please sign in to comment.