From d9ea44e5a3001e2bef8f05a507cf47b36cbddbb1 Mon Sep 17 00:00:00 2001 From: Ankit Agarwal Date: Mon, 29 Apr 2013 13:21:43 +0800 Subject: [PATCH] MDL-39365 scorm reports: Return correct track count --- mod/scorm/report/reportlib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mod/scorm/report/reportlib.php b/mod/scorm/report/reportlib.php index 21aa8515cec..d6d50c6fd8b 100644 --- a/mod/scorm/report/reportlib.php +++ b/mod/scorm/report/reportlib.php @@ -69,14 +69,14 @@ function get_scorm_question_count($scormid) { $rs = $DB->get_recordset_select("scorm_scoes_track", $select, $params, 'element'); $keywords = array("cmi.interactions_", ".id"); if ($rs->valid()) { - // Done as interactions start at 0 (do only if we have something to report). - $count++; foreach ($rs as $record) { $num = trim(str_ireplace($keywords, '', $record->element)); if (is_numeric($num) && $num > $count) { $count = $num; } } + // Done as interactions start at 0 (do only if we have something to report). + $count++; } $rs->close(); // closing recordset return $count;