Fixed the empty grades for attendance.

Added log_display database records
This commit is contained in:
jungwirr 2004-05-04 17:18:02 +00:00
parent 8fc1384b78
commit 018e87bedb
4 changed files with 11 additions and 4 deletions

View File

@ -14,6 +14,14 @@ function attendance_upgrade($oldversion) {
execute_sql("ALTER TABLE `{$CFG->prefix}attendance` ADD `autoattend` TINYINT( 1 ) DEFAULT '0' NOT NULL;");
}
if ($oldversion < 2004050301) {
modify_database("", "INSERT INTO {$CFG->prefix}log_display VALUES ('attendance', 'view', 'attendance', 'name');");
modify_database("", "INSERT INTO {$CFG->prefix}log_display VALUES ('attendance', 'viewall', 'attendance', 'name');");
modify_database("", "INSERT INTO {$CFG->prefix}log_display VALUES ('attendance', 'viewweek', 'attendance', 'name');");
}
return true;
}

View File

@ -15,7 +15,7 @@
require_login($course->id);
add_to_log($course->id, "attendance", "view all", "index.php?id=$course->id", "");
add_to_log($course->id, "attendance", "viewall", "index.php?id=$course->id", "");
/// Get all required strings

View File

@ -330,8 +330,7 @@ function attendance_grades($attendanceid) {
} // if students
$return->maxgrade = $attendance->maxgrade;
} else { // if attendance->grade == "1"
$return->grades = NULL;
$return->maxgrade = NULL;
$return = NULL;
}// else for if attendance->grade == "1"
return $return;
}

View File

@ -5,7 +5,7 @@
/// This fragment is called by moodle_needs_upgrading() and /admin/index.php
/////////////////////////////////////////////////////////////////////////////////
$module->version = 2004013101; // The current module version (Date: YYYYMMDDXX)
$module->version = 2004050301; // The current module version (Date: YYYYMMDDXX)
$module->requires = 2004013101; // Requires this Moodle version
$module->cron = 3600; // Period for cron to check this module (secs)