Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MDL-27522 SCORM tidy up commit

  • Loading branch information...
commit 2875714e4a35f6104781cc5bd84d5237ce5db9e7 1 parent b4baa7f
@danmarsden danmarsden authored
Showing with 30 additions and 14 deletions.
  1. +2 −2 mod/scorm/report.php
  2. +28 −12 mod/scorm/userreport.php
View
4 mod/scorm/report.php
@@ -427,7 +427,7 @@
$row[] = '-';
$row[] = '-';
} else {
- if (!$download) $row[] = '<a href="reportuser.php?a='.$scorm->id.'&amp;user='.$scouser->userid.'&amp;attempt='.$scouser->attempt.'">'.$scouser->attempt.'</a>';
+ if (!$download) $row[] = '<a href="userreport.php?a='.$scorm->id.'&amp;user='.$scouser->userid.'&amp;attempt='.$scouser->attempt.'">'.$scouser->attempt.'</a>';
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[] = '<img src="'.$OUTPUT->pix_url($trackdata->status, 'scorm').'" alt="'.$strstatus.'" title="'.$strstatus.'" /><br/>
- <a href="reportuser.php?b='.$sco->id.'&amp;user='.$scouser->userid.'&amp;attempt='.$scouser->attempt.
+ <a href="userreport.php?b='.$sco->id.'&amp;user='.$scouser->userid.'&amp;attempt='.$scouser->attempt.
'" title="'.get_string('details', 'scorm').'">'.$score.'</a>';
} else {
$row[] = $score;
View
40 mod/scorm/userreport.php
@@ -1,6 +1,28 @@
<?php
-// Includes and parameters from old scorm report file
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * 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 '</div>'."\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('<a href="'.$CFG->wwwroot.'/mod/scorm/player.php?a='.$scorm->id.'&amp;mode=browse&amp;scoid='.$sco->id.'" target="_new">'.format_string($sco->title).'</a>');
echo '<div class="mdl-align">'."\n";
$scoreview = '';
@@ -322,4 +338,4 @@
}
// Print footer
-echo $OUTPUT->footer();
+echo $OUTPUT->footer();

0 comments on commit 2875714

Please sign in to comment.
Something went wrong with that request. Please try again.