mirror of
https://github.com/moodle/moodle.git
synced 2025-02-19 23:55:54 +01:00
Merge branch 'MDL-83844-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE
This commit is contained in:
commit
6cc0eabc7e
@ -704,7 +704,7 @@ function scorm_get_sco_runtime($scormid, $scoid, $userid, $attempt=1) {
|
|||||||
global $DB;
|
global $DB;
|
||||||
|
|
||||||
$params = array('userid' => $userid, 'scormid' => $scormid, 'attempt' => $attempt);
|
$params = array('userid' => $userid, 'scormid' => $scormid, 'attempt' => $attempt);
|
||||||
$sql = "SELECT min(timemodified) as start, max(timemodified) as finish
|
$sql = "SELECT MIN(timemodified) AS timemin, MAX(timemodified) AS timemax
|
||||||
FROM {scorm_scoes_value} v
|
FROM {scorm_scoes_value} v
|
||||||
JOIN {scorm_attempt} a on a.id = v.attemptid
|
JOIN {scorm_attempt} a on a.id = v.attemptid
|
||||||
WHERE a.userid = :userid AND a.scormid = :scormid AND a.attempt = :attempt";
|
WHERE a.userid = :userid AND a.scormid = :scormid AND a.attempt = :attempt";
|
||||||
@ -712,9 +712,12 @@ function scorm_get_sco_runtime($scormid, $scoid, $userid, $attempt=1) {
|
|||||||
$params['scoid'] = $scoid;
|
$params['scoid'] = $scoid;
|
||||||
$sql .= " AND v.scoid = :scoid";
|
$sql .= " AND v.scoid = :scoid";
|
||||||
}
|
}
|
||||||
$timedata = $DB->get_record_sql($sql, $params);
|
|
||||||
if (!empty($timedata)) {
|
if ($timedata = $DB->get_record_sql($sql, $params)) {
|
||||||
return $timedata;
|
return (object) [
|
||||||
|
'start' => $timedata->timemin,
|
||||||
|
'finish' => $timedata->timemax,
|
||||||
|
];
|
||||||
} else {
|
} else {
|
||||||
$timedata = new stdClass();
|
$timedata = new stdClass();
|
||||||
$timedata->start = false;
|
$timedata->start = false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user