diff --git a/attrem.php b/attrem.php index 9f600b7e..939cfe6b 100755 --- a/attrem.php +++ b/attrem.php @@ -40,9 +40,9 @@ $gradeid = optional_param('g', 0, PARAM_INT); $mtmode = optional_param('mtmode', 0, PARAM_INT); -$mootyper = $DB->get_record('mootyper', array('id' => $mid), '*', MUST_EXIST); -$course = $mootyper->course; -$cm = get_coursemodule_from_instance('mootyper', $mootyper->id, $course->id, false, MUST_EXIST); +$mootyper = $DB->get_record('mootyper', array('id' => $mid), '*', MUST_EXIST); +$course = $mootyper->course; +$cm = get_coursemodule_from_instance('mootyper', $mootyper->id, $course->id, false, MUST_EXIST); $context = context_module::instance($cm->id); require_login($course, true, $cm); diff --git a/classes/privacy/provider.php b/classes/privacy/provider.php index 8765e482..9150b706 100644 --- a/classes/privacy/provider.php +++ b/classes/privacy/provider.php @@ -168,7 +168,7 @@ public static function get_users_in_context(userlist $userlist) { $params = [ 'modid' => $modid, 'contextlevel' => CONTEXT_MODULE, - 'contextid' => $context->id, + 'contextid' => $context->id, ]; // Fetch all mootyper user grades. $sql = " diff --git a/db/install.php b/db/install.php index 7116cae0..9a344e6e 100755 --- a/db/install.php +++ b/db/install.php @@ -65,7 +65,7 @@ function add_keyboard_layout($dafile) { $periodpos = strrpos($dafile, '.'); $layoutname = substr($dafile, 0, $periodpos); $record = (object) [ - 'name' => $layoutname, + 'name' => $layoutname, ]; $DB->insert_record('mootyper_layouts', $record, true); } diff --git a/gview.php b/gview.php index a944718c..f0a8eaee 100755 --- a/gview.php +++ b/gview.php @@ -38,7 +38,7 @@ global $USER; $id = optional_param('id', 0, PARAM_INT); // Course_module ID, or. -$n = optional_param('n', 0, PARAM_INT); // Mootyper instance ID - it should be named as the first character of the module. +$n = optional_param('n', 0, PARAM_INT); // Mootyper instance ID - it should be named as the first character of the module. $se = optional_param('exercise', 0, PARAM_INT); $md = optional_param('jmode', 0, PARAM_INT); $us = optional_param('juser', 0, PARAM_INT); @@ -50,14 +50,14 @@ $se = 0; } if ($id) { - $cm = get_coursemodule_from_id('mootyper', $id, 0, false, MUST_EXIST); - $course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST); - $mootyper = $DB->get_record('mootyper', array('id' => $cm->instance), '*', MUST_EXIST); + $cm = get_coursemodule_from_id('mootyper', $id, 0, false, MUST_EXIST); + $course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST); + $mootyper = $DB->get_record('mootyper', array('id' => $cm->instance), '*', MUST_EXIST); } else if ($n) { - $mootyper = $DB->get_record('mootyper', array('id' => $n), '*', MUST_EXIST); - $course = $DB->get_record('course', array('id' => $mootyper->course), '*', MUST_EXIST); - $cm = get_coursemodule_from_instance('mootyper', $mootyper->id, $course->id, false, MUST_EXIST); - $id = $cm->id; // Since we had ID of 0, we really need Course module ID for cvsexport, so set it. + $mootyper = $DB->get_record('mootyper', array('id' => $n), '*', MUST_EXIST); + $course = $DB->get_record('course', array('id' => $mootyper->course), '*', MUST_EXIST); + $cm = get_coursemodule_from_instance('mootyper', $mootyper->id, $course->id, false, MUST_EXIST); + $id = $cm->id; // Since we had ID of 0, we really need Course module ID for cvsexport, so set it. } else { throw new moodle_exception(get_string('mootypererror', 'mootyper')); } diff --git a/index.php b/index.php index 6916cf25..cbdeaba7 100755 --- a/index.php +++ b/index.php @@ -55,13 +55,13 @@ $table = new html_table(); if ($course->format == 'weeks') { - $table->head = array(get_string('week'), get_string('name')); + $table->head = array(get_string('week'), get_string('name')); $table->align = array('center', 'left'); } else if ($course->format == 'topics') { - $table->head = array(get_string('topic'), get_string('name')); + $table->head = array(get_string('topic'), get_string('name')); $table->align = array('center', 'left', 'left', 'left'); } else { - $table->head = array(get_string('name')); + $table->head = array(get_string('name')); $table->align = array('left', 'left', 'left'); } diff --git a/lib.php b/lib.php index 5017be0c..278d0a75 100755 --- a/lib.php +++ b/lib.php @@ -296,7 +296,7 @@ function mootyper_add_instance($mootyper, $mform = null) { } if (empty($mootyper->ratingtime) || empty($mootyper->assessed)) { - $mootyper->assesstimestart = 0; + $mootyper->assesstimestart = 0; $mootyper->assesstimefinish = 0; } @@ -410,7 +410,7 @@ function mootyper_update_instance($mootyper, $mform) { } if (empty($mootyper->assessed)) { - $mootyper->assesstimestart = 0; + $mootyper->assesstimestart = 0; $mootyper->assesstimefinish = 0; } @@ -421,9 +421,9 @@ function mootyper_update_instance($mootyper, $mform) { $mootyper->timeclose = 0; } - $cmid = $mootyper->coursemodule; + $cmid = $mootyper->coursemodule; $cmidnumber = $mootyper->cmidnumber; - $courseid = $mootyper->course; + $courseid = $mootyper->course; $mootyper->id = $mootyper->instance; $context = context_module::instance($cmid); $mootyper->timemodified = time(); @@ -600,8 +600,8 @@ function mootyper_print_recent_activity($course, $viewfullnames, $timestart) { $newentries = $DB->get_records_sql($sql, $dbparams); $modinfo = get_fast_modinfo($course); - $show = array(); - $grader = array(); + $show = array(); + $grader = array(); $showrecententries = get_config('mod_mootyper', 'showrecentactivity'); foreach ($newentries as $anentry) { @@ -808,11 +808,11 @@ function mootyper_grade_item_update($mootyper, $ratings = null, $mootypergrades $item['gradetype'] = GRADE_TYPE_NONE; } else if ($mootyper->scale > 0) { $item['gradetype'] = GRADE_TYPE_VALUE; - $item['grademax'] = $mootyper->scale; - $item['grademin'] = 0; + $item['grademax'] = $mootyper->scale; + $item['grademin'] = 0; } else if ($mootyper->scale < 0) { $item['gradetype'] = GRADE_TYPE_SCALE; - $item['scaleid'] = -$mootyper->scale; + $item['scaleid'] = -$mootyper->scale; } if ($ratings === 'reset') { $item['reset'] = true; diff --git a/lsnimport.php b/lsnimport.php index b0343d13..91562098 100644 --- a/lsnimport.php +++ b/lsnimport.php @@ -121,7 +121,7 @@ function add_keyboard_layout($dafile) { $periodpos = strrpos($dafile, '.'); $layoutname = substr($dafile, 0, $periodpos); $record = (object) [ - 'name' => $layoutname, + 'name' => $layoutname, ]; $DB->insert_record('mootyper_layouts', $record, true); } diff --git a/mod_setup.php b/mod_setup.php index fcebd31c..aa8fa7af 100755 --- a/mod_setup.php +++ b/mod_setup.php @@ -38,16 +38,16 @@ global $USER; $id = optional_param('id', 0, PARAM_INT); // Course_module ID, or. -$n = optional_param('n', 0, PARAM_INT); // Mootyper instance ID - it should be named as the first character of the module. +$n = optional_param('n', 0, PARAM_INT); // Mootyper instance ID - it should be named as the first character of the module. if ($id) { - $cm = get_coursemodule_from_id('mootyper', $id, 0, false, MUST_EXIST); - $course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST); - $mootyper = $DB->get_record('mootyper', array('id' => $cm->instance), '*', MUST_EXIST); + $cm = get_coursemodule_from_id('mootyper', $id, 0, false, MUST_EXIST); + $course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST); + $mootyper = $DB->get_record('mootyper', array('id' => $cm->instance), '*', MUST_EXIST); } else if ($n) { - $mootyper = $DB->get_record('mootyper', array('id' => $n), '*', MUST_EXIST); - $course = $DB->get_record('course', array('id' => $mootyper->course), '*', MUST_EXIST); - $cm = get_coursemodule_from_instance('mootyper', $mootyper->id, $course->id, false, MUST_EXIST); + $mootyper = $DB->get_record('mootyper', array('id' => $n), '*', MUST_EXIST); + $course = $DB->get_record('course', array('id' => $mootyper->course), '*', MUST_EXIST); + $cm = get_coursemodule_from_instance('mootyper', $mootyper->id, $course->id, false, MUST_EXIST); } else { throw new moodle_exception(get_string('mootypererror', 'mootyper')); } @@ -286,7 +286,7 @@ global $DB, $CFG; // Update all the settings for this MooTyper instance when Confirm is clicked. - $mootyper = $DB->get_record('mootyper', array('id' => $n), '*', MUST_EXIST); + $mootyper = $DB->get_record('mootyper', array('id' => $n), '*', MUST_EXIST); $mootyper->lesson = $lessonpo; $mootyper->isexam = $modepo; if ($modepo == 1) { diff --git a/owngrades.php b/owngrades.php index 863c9bc5..2e04d538 100755 --- a/owngrades.php +++ b/owngrades.php @@ -36,7 +36,7 @@ global $USER; $id = optional_param('id', 0, PARAM_INT); // Course_module ID. -$n = optional_param('n', 0, PARAM_INT); // Mootyper instance ID. +$n = optional_param('n', 0, PARAM_INT); // Mootyper instance ID. $se = optional_param('exercise', 0, PARAM_INT); $md = optional_param('jmode', 0, PARAM_INT); $us = optional_param('juser', 0, PARAM_INT); @@ -50,18 +50,18 @@ $se = 0; } if ($id) { - $cm = get_coursemodule_from_id('mootyper', $id, 0, false, MUST_EXIST); - $course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST); - $mootyper = $DB->get_record('mootyper', array('id' => $cm->instance), '*', MUST_EXIST); + $cm = get_coursemodule_from_id('mootyper', $id, 0, false, MUST_EXIST); + $course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST); + $mootyper = $DB->get_record('mootyper', array('id' => $cm->instance), '*', MUST_EXIST); } else if ($n) { - $mootyper = $DB->get_record('mootyper', array('id' => $n), '*', MUST_EXIST); - $course = $DB->get_record('course', array('id' => $mootyper->course), '*', MUST_EXIST); - $cm = get_coursemodule_from_instance('mootyper', $mootyper->id, $course->id, false, MUST_EXIST); + $mootyper = $DB->get_record('mootyper', array('id' => $n), '*', MUST_EXIST); + $course = $DB->get_record('course', array('id' => $mootyper->course), '*', MUST_EXIST); + $cm = get_coursemodule_from_instance('mootyper', $mootyper->id, $course->id, false, MUST_EXIST); } else { throw new moodle_exception(get_string('mootypererror', 'mootyper')); } -$lsnname = $DB->get_record('mootyper_lessons', array('id' => $mootyper->lesson), '*', MUST_EXIST); +$lsnname = $DB->get_record('mootyper_lessons', array('id' => $mootyper->lesson), '*', MUST_EXIST); $mtmode = $mootyper->isexam; require_login($course, true, $cm); $context = context_module::instance($cm->id); diff --git a/renderer.php b/renderer.php index 81ff49c9..13bcbeab 100644 --- a/renderer.php +++ b/renderer.php @@ -96,7 +96,7 @@ public function footer() { */ public function mootyper_inaccessible($message) { global $CFG; - $output = $this->output->box_start('generalbox boxaligncenter'); + $output = $this->output->box_start('generalbox boxaligncenter'); $output .= $this->output->box_start('center'); $output .= (get_string('notavailable', 'mootyper')); $output .= $message; @@ -117,7 +117,7 @@ public function mootyper_inaccessible($message) { */ public function login_prompt($mootyper, $failedattempt = false) { global $CFG; - $output = $this->output->box_start('password-form'); + $output = $this->output->box_start('password-form'); $output .= $this->output->box_start('generalbox boxaligncenter'); $output .= '