diff --git a/mod/scorm/report.php b/mod/scorm/report.php
index 361984a479c89..92ed305694be3 100644
--- a/mod/scorm/report.php
+++ b/mod/scorm/report.php
@@ -427,7 +427,7 @@
$row[] = '-';
$row[] = '-';
} else {
- if (!$download) $row[] = ''.$scouser->attempt.'';
+ if (!$download) $row[] = ''.$scouser->attempt.'';
else $row[] = $scouser->attempt;
if ($download =='ODS' || $download =='Excel' ) $row[] = userdate($timetracks->start, get_string("strftimedatetime", "langconfig"));
else $row[] = userdate($timetracks->start);
@@ -463,7 +463,7 @@
}
if (!$download) {
$row[] = '
- id.'&user='.$scouser->userid.'&attempt='.$scouser->attempt.
'" title="'.get_string('details', 'scorm').'">'.$score.'';
} else {
$row[] = $score;
diff --git a/mod/scorm/userreport.php b/mod/scorm/userreport.php
index 96b975f49c8b5..63115bc5a7bb2 100644
--- a/mod/scorm/userreport.php
+++ b/mod/scorm/userreport.php
@@ -1,6 +1,28 @@
.
+
+/**
+ * This page displays the user data from a single attempt
+ *
+ * @package mod
+ * @subpackage scorm
+ * @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
require_once("../../config.php");
require_once($CFG->dirroot.'/mod/scorm/locallib.php');
@@ -12,7 +34,6 @@
$b = optional_param('b', '', PARAM_INT); // SCO ID
$attempt = optional_param('attempt', '1', PARAM_INT); // attempt number
-
// Building the url to use for links.+ data details buildup
$url = new moodle_url('/mod/scorm/userreport.php');
$url->param('user', $user);
@@ -21,7 +42,6 @@
$url->param('attempt', $attempt);
}
-
if (!empty($id)) {
$url->param('id', $id);
$cm = get_coursemodule_from_id('scorm', $id, 0, false, MUST_EXIST);
@@ -45,16 +65,16 @@
// checking login +logging +getting context
require_login($course->id, false, $cm);
-$contextmodule= get_context_instance(CONTEXT_MODULE, $cm->id);
+$contextmodule = get_context_instance(CONTEXT_MODULE, $cm->id);
+require_capability('mod/scorm:viewreport', $contextmodule);
+
add_to_log($course->id, 'scorm', 'userreport', 'userreport.php?id='.$cm->id, $scorm->id, $cm->id);
$userdata = scorm_get_user_data($user);
-// END of checking login +logging +getting context
// Print the page header
$strreport = get_string('report', 'scorm');
$strattempt = get_string('attempt', 'scorm');
-
$PAGE->set_title("$course->shortname: ".format_string($scorm->name));
$PAGE->set_heading($course->fullname);
$PAGE->navbar->add($strreport, new moodle_url('/mod/scorm/report.php', array('id'=>$cm->id)));
@@ -71,11 +91,10 @@
echo $OUTPUT->heading(format_string($scorm->name));
// End of Print the page header
-//Parameter Checking +Capabality Check
+//Parameter Checking
if (empty ($userdata)) {
print_error('missingparameter');
}
-require_capability('mod/scorm:viewreport', $contextmodule);
//printing user details
echo $OUTPUT->box_start('generalbox boxaligncenter');
@@ -87,8 +106,6 @@
echo ''."\n";
echo $OUTPUT->box_end();
-// User SCORM report
-
if ($scoes = $DB->get_records_select('scorm_scoes', "scorm=? ORDER BY id", array($scorm->id))) {
// Print general score data
$table = new html_table();
@@ -137,7 +154,6 @@
if (!empty($b)) {
echo $OUTPUT->box_start('generalbox boxaligncenter');
- //print_heading(format_string($sco->title));
echo $OUTPUT->heading(''.format_string($sco->title).'');
echo '