Skip to content

Commit

Permalink
DEF-3544: Disable setting with global config
Browse files Browse the repository at this point in the history
  • Loading branch information
ojnadjarm committed Feb 14, 2025
1 parent 80bd4ae commit 5bd3236
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,11 @@ function local_quizanon_before_standard_top_of_body_html() {
* @param moodleform $mform
*/
function local_quizanon_coursemodule_standard_elements($formwrapper, $mform) {
global $COURSE, $DB;
global $COURSE, $DB, $PAGE;
$pluginenabled = get_config('local_quizanon', 'enablequizanon');
if ($PAGE->pagetype !== 'mod-quiz-edit' || empty($pluginenabled)) {
return;
}
if ($formwrapper instanceof mod_quiz_mod_form) {
$cm = $formwrapper->get_coursemodule();
if (!empty($cm->id)) {
Expand Down Expand Up @@ -132,7 +136,8 @@ function local_quizanon_coursemodule_standard_elements($formwrapper, $mform) {
* @return stdClass
*/
function local_quizanon_coursemodule_edit_post_actions($data) {
global $DB, $USER;
global $DB, $USER, $PAGE;

$quizid = $data->coursemodule;

$arraydata = [
Expand Down

0 comments on commit 5bd3236

Please sign in to comment.