Skip to content

Commit

Permalink
MDL-33822 SCORM Interactions report - fix formatting of empty cells.
Browse files Browse the repository at this point in the history
  • Loading branch information
leblangi authored and Sam Hemelryk committed Jul 9, 2012
1 parent f5fe536 commit 751f5b0
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions mod/scorm/report/interactions/report.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ function display($scorm, $cm, $course, $download) {
$countsql .= $from.$where;
$attempts = $DB->get_records_sql($select.$from.$where, $params);
$questioncount = get_scorm_question_count($scorm->id);
$nbmaincolumns = count($columns);
for($id = 0; $id < $questioncount; $id++) {
if ($displayoptions['qtext']) {
$columns[] = 'question' . $id;
Expand Down Expand Up @@ -476,9 +477,7 @@ function display($scorm, $cm, $course, $download) {
$row[] = $score;
}
// interaction data
$i=0;
$element='cmi.interactions_'.$i.'.id';
while(isset($trackdata->$element)) {
for ($i=0; $i < $questioncount; $i++) {
if ($displayoptions['qtext']) {
$element='cmi.interactions_'.$i.'.id';
if (isset($trackdata->$element)) {
Expand Down Expand Up @@ -513,8 +512,6 @@ function display($scorm, $cm, $course, $download) {
$row[] = '&nbsp;';
}
}
$i++;
$element = 'cmi.interactions_'.$i.'.id';
}
//---end of interaction data*/
} else {
Expand All @@ -525,6 +522,10 @@ function display($scorm, $cm, $course, $download) {
} else {
$row[] = $strstatus;
}
// complete the empty cells
for ($i=0; $i < count($columns) - $nbmaincolumns; $i++) {
$row[] = '&nbsp;';
}
}
}
}
Expand Down

0 comments on commit 751f5b0

Please sign in to comment.