diff --git a/mod/scorm/report.php b/mod/scorm/report.php
index 63c1582b83a..a4232483291 100755
--- a/mod/scorm/report.php
+++ b/mod/scorm/report.php
@@ -5,11 +5,11 @@
require_once("../../config.php");
require_once("lib.php");
- $id = optional_param('id', '', PARAM_INT); // Course Module ID, or
- $b = optional_param('b', '', PARAM_INT); // sco ID
- $user = optional_param('user', '', PARAM_INT); // user ID
+ optional_variable($id); // Course Module ID, or
+ optional_variable($b); // SCO ID
+ optional_variable($user); // User ID
- if (!empty($id)) {
+ if ($id) {
if (! $cm = get_record("course_modules", "id", $id)) {
error("Course Module ID was incorrect");
}
@@ -19,12 +19,12 @@
if (! $scorm = get_record("scorm", "id", $cm->instance)) {
error("Course module is incorrect");
}
- } else if (!empty($b)) {
+ } else if (isset($b)) {
if (! $sco = get_record("scorm_scoes", "id", $b)) {
- error("Course module is incorrect");
+ error("Scorm activity is incorrect");
}
if (! $scorm = get_record("scorm", "id", $sco->scorm)) {
- error("Scorm activity is incorrect");
+ error("Course module is incorrect");
}
if (! $course = get_record("course", "id", $scorm->course)) {
error("Course is misconfigured");
@@ -32,8 +32,6 @@
if (! $cm = get_coursemodule_from_instance("scorm", $scorm->id, $course->id)) {
error("Course Module ID was incorrect");
}
- } else {
- error('A required parameter is missing');
}
require_login($course->id, false, $cm);
@@ -73,6 +71,7 @@
if (!empty($id)) {
if ($scoes = get_records_select("scorm_scoes","scorm='$scorm->id' ORDER BY id")) {
if ($scousers=get_records_select("scorm_scoes_track", "scormid='$scorm->id' GROUP BY userid,scormid", "", "userid,scormid")) {
+ $table = new stdClass();
$table->head = array(' ', $strname);
$table->align = array('center', 'left');
$table->wrap = array('nowrap', 'nowrap');
@@ -80,7 +79,8 @@
$table->size = array(10, '*');
foreach ($scoes as $sco) {
if ($sco->launch!='') {
- $table->head[]=scorm_string_round($sco->title);
+ $table->head[]=scorm_string_wrap($sco->title);
+ //$table->head[]=$sco->title;
$table->align[] = 'center';
$table->wrap[] = 'nowrap';
$table->size[] = '*';
@@ -89,7 +89,7 @@
foreach ($scousers as $scouser) {
if ($userdata = scorm_get_user_data($scouser->userid)) {
- $row = '';
+ $row = array();
$row[] = print_user_picture($scouser->userid, $course->id, $userdata->picture, false, true);
$row[] = "wwwroot/user/view.php?id=$scouser->userid&course=$course->id\">".
"$userdata->firstname $userdata->lastname";
@@ -151,11 +151,154 @@
echo '
'.$trackdata->total_time.'
'.$scoreview.'
';
echo ''."\n";
- foreach($trackdata as $element => $value) {
- if (substr($element,0,3) == 'cmi') {
- echo $element.' => '.$value.'
';
+ echo '