MDL-14730 mod_lesson: allow linking to pages inside a lesson

This commit is contained in:
Jean-Michel Vedrine 2014-12-31 13:23:09 +01:00
parent edbcfbd61f
commit 5ca2e765fa

View File

@ -1255,11 +1255,12 @@ class lesson extends lesson_base {
global $USER, $DB;
// clock code
// get time information for this user
if (!$timer = $DB->get_records('lesson_timer', array ("lessonid" => $this->properties->id, "userid" => $USER->id), 'starttime DESC', '*', 0, 1)) {
print_error('cannotfindtimer', 'lesson');
} else {
$timer = current($timer); // this will get the latest start time record
$params = array("lessonid" => $this->properties->id, "userid" => $USER->id);
if (!$timer = $DB->get_records('lesson_timer', $params, 'starttime DESC', '*', 0, 1)) {
$this->start_timer();
$timer = $DB->get_records('lesson_timer', $params, 'starttime DESC', '*', 0, 1);
}
$timer = current($timer); // This will get the latest start time record.
if ($restart) {
if ($continue) {