diff --git a/backup/moodle2/restore_attendance_stepslib.php b/backup/moodle2/restore_attendance_stepslib.php index b177fb5..f8c0dae 100644 --- a/backup/moodle2/restore_attendance_stepslib.php +++ b/backup/moodle2/restore_attendance_stepslib.php @@ -75,7 +75,6 @@ class restore_attendance_activity_structure_step extends restore_activity_struct global $DB; $data = (object)$data; - $oldid = $data->id; $data->course = $this->get_courseid(); // Insert the attendance record. @@ -132,7 +131,6 @@ class restore_attendance_activity_structure_step extends restore_activity_struct global $DB; $data = (object)$data; - $oldid = $data->id; $data->sessionid = $this->get_mappingid('attendance_session', $data->sessionid); $data->studentid = $this->get_mappingid('user', $data->studentid); @@ -145,7 +143,7 @@ class restore_attendance_activity_structure_step extends restore_activity_struct $data->timetaken = $this->apply_date_offset($data->timetaken); $data->takenby = $this->get_mappingid('user', $data->takenby); - $newitemid = $DB->insert_record('attendance_log', $data); + $DB->insert_record('attendance_log', $data); } /** diff --git a/duration_form.php b/duration_form.php index 3e067d5..347c588 100644 --- a/duration_form.php +++ b/duration_form.php @@ -39,12 +39,9 @@ class mod_attendance_duration_form extends moodleform { */ public function definition() { - global $CFG; $mform =& $this->_form; - $course = $this->_customdata['course']; $cm = $this->_customdata['cm']; - $modcontext = $this->_customdata['modcontext']; $ids = $this->_customdata['ids']; $mform->addElement('header', 'general', get_string('changeduration', 'attendance')); diff --git a/lib.php b/lib.php index 3222181..432ae12 100644 --- a/lib.php +++ b/lib.php @@ -253,13 +253,6 @@ function attendance_user_complete($course, $user, $mod, $attendance) { echo construct_full_user_stat_html_table($attendance, $course, $user, $mod); } } -function attendance_print_recent_activity($course, $isteacher, $timestart) { - return false; -} - -function attendance_cron () { - return true; -} function attendance_update_grades($attendance, $userid=0, $nullifnone=true) { // We need this function to exist so that quick editing of module name is passed to gradebook. @@ -375,7 +368,7 @@ function attendance_scale_used_anywhere($scaleid) { * @return bool false if file not found, does not return if found - justsend the file */ function attendance_pluginfile($course, $cm, $context, $filearea, $args, $forcedownload) { - global $CFG, $DB; + global $DB; if ($context->contextlevel != CONTEXT_MODULE) { return false; @@ -383,7 +376,7 @@ function attendance_pluginfile($course, $cm, $context, $filearea, $args, $forced require_login($course, false, $cm); - if (!$att = $DB->get_record('attendance', array('id' => $cm->instance))) { + if (!$DB->record_exists('attendance', array('id' => $cm->instance))) { return false; } @@ -394,7 +387,7 @@ function attendance_pluginfile($course, $cm, $context, $filearea, $args, $forced } $sessid = (int)array_shift($args); - if (!$sess = $DB->get_record('attendance_sessions', array('id' => $sessid))) { + if (!$DB->record_exists('attendance_sessions', array('id' => $sessid))) { return false; }