FYI,
I just updated the certif mod. All is working fine. (I have debug OFF) This is what I had to do:
1. For the date, I had to switch the two commented lines David mentions above to get it right.
2. I also got the headers sent error when clicking on a locked certif as a student. I added Don's locking fix above (thanks for that) and it is fixed.
Here's my server setup:
|
Linux |
Apache Version: |
1.3.33 (Unix) |
PHP Version: |
4.3.11 |
|
4.0.22-standard |
Also, I got the certificate views to show in the user activity reports. Replace the function_user_certificate_outline and function_user_certificate_complete code in certificate/lib.php with this:
function certificate_user_outline($course, $user, $mod, $certificate) {
if ($logs = get_records_select("log", "userid='$user->id' AND module='certificate'
AND action='view' AND info='$certificate->id'", "time ASC")) {
$numviews = count($logs);
$lastlog = array_pop($logs);
$result->info = get_string("numviews", "", $numviews);
$result->time = $lastlog->time;
return $result;
}
return NULL;
}
function certificate_user_complete($course, $user, $mod, $certificate) {
global $CFG;
if ($logs = get_records_select("log", "userid='$user->id' AND module='certificate'
AND action='view' AND info='$certificate->id'", "time ASC")) {
$numviews = count($logs);
$lastlog = array_pop($logs);
$strmostrecently = get_string("mostrecently");
$strnumviews = get_string("numviews", "", $numviews);
echo "$strnumviews - $strmostrecently ".userdate($lastlog->time);
} else {
print_string("neverseen", "resource");
}
}