Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'MDL-36855-m23' of git://github.com/ankitagarwal/moodle …

…into MOODLE_23_STABLE
  • Loading branch information...
commit a68bc19fa6031a6a697f508baa21d4d04275f272 2 parents c1fcc89 + 7f7e18c
@samhemelryk samhemelryk authored
Showing with 8 additions and 6 deletions.
  1. +8 −6 mod/scorm/report/reportlib.php
View
14 mod/scorm/report/reportlib.php
@@ -68,14 +68,16 @@ function get_scorm_question_count($scormid) {
$params[] = "cmi.interactions_%.id";
$rs = $DB->get_recordset_select("scorm_scoes_track", $select, $params, 'element');
$keywords = array("cmi.interactions_", ".id");
- foreach ($rs as $record) {
- $num = trim(str_ireplace($keywords, '', $record->element));
- if (is_numeric($num) && $num > $count) {
- $count = $num;
+ 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
- $count++;
$rs->close(); // closing recordset
return $count;
}
Please sign in to comment.
Something went wrong with that request. Please try again.