"MDL-14129, fix print_error"
This commit is contained in:
+4
-4
@@ -14,7 +14,7 @@
|
||||
if (isset($SESSION->scorm_scoid)) {
|
||||
$scoid = $SESSION->scorm_scoid;
|
||||
} else {
|
||||
print_error('Invalid script call');
|
||||
print_error('cannotcallscript');
|
||||
}
|
||||
$mode = 'normal';
|
||||
if (isset($SESSION->scorm_mode)) {
|
||||
@@ -32,10 +32,10 @@
|
||||
|
||||
if ($sco = scorm_get_sco($scoid, SCO_ONLY)) {
|
||||
if (!$scorm = $DB->get_record('scorm', array('id'=>$sco->scorm))) {
|
||||
print_error('Invalid script call');
|
||||
print_error('cannotcallscript');
|
||||
}
|
||||
} else {
|
||||
print_error('Invalid script call');
|
||||
print_error('cannotcallscript');
|
||||
}
|
||||
|
||||
if ($scorm = $DB->get_record('scorm', array('id'=>$sco->scorm))) {
|
||||
@@ -129,7 +129,7 @@
|
||||
echo 'Max_Time_Allowed = '.$userdata->maxtimeallowed."\n";
|
||||
echo 'Time_Limit_Action = '.$userdata->timelimitaction."\n";
|
||||
} else {
|
||||
print_error('Sco not found');
|
||||
print_error('cannotfindsco', 'scorm');
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
+8
-8
@@ -11,26 +11,26 @@
|
||||
|
||||
if (!empty($id)) {
|
||||
if (! $cm = get_coursemodule_from_id('scorm', $id)) {
|
||||
print_error("Course Module ID was incorrect");
|
||||
print_error('invalidcoursemodule');
|
||||
}
|
||||
if (! $course = $DB->get_record("course", array("id"=>$cm->course))) {
|
||||
print_error("Course is misconfigured");
|
||||
print_error('coursemisconf');
|
||||
}
|
||||
if (! $scorm = $DB->get_record("scorm", array("id"=>$cm->instance))) {
|
||||
print_error("Course module is incorrect");
|
||||
print_error('invalidcoursemodule');
|
||||
}
|
||||
} else if (!empty($a)) {
|
||||
if (! $scorm = $DB->get_record("scorm", array("id"=>$a))) {
|
||||
print_error("Course module is incorrect");
|
||||
print_error('invalidcoursemodule');
|
||||
}
|
||||
if (! $course = $DB->get_record("course", array("id"=>$scorm->course))) {
|
||||
print_error("Course is misconfigured");
|
||||
print_error('coursemisconf');
|
||||
}
|
||||
if (! $cm = get_coursemodule_from_instance("scorm", $scorm->id, $course->id)) {
|
||||
print_error("Course Module ID was incorrect");
|
||||
print_error('invalidcoursemodule');
|
||||
}
|
||||
} else {
|
||||
print_error('A required parameter is missing');
|
||||
print_error('missingparameter');
|
||||
}
|
||||
|
||||
require_login($course->id, false, $cm);
|
||||
@@ -62,7 +62,7 @@
|
||||
$userdata->$key = $value;
|
||||
}
|
||||
} else {
|
||||
print_error('Sco not found');
|
||||
print_error('cannotfindsco', 'scorm');
|
||||
}
|
||||
$scorm->version = strtolower(clean_param($scorm->version, PARAM_SAFEDIR)); // Just to be safe
|
||||
if (file_exists($CFG->dirroot.'/mod/scorm/datamodels/'.$scorm->version.'.js.php')) {
|
||||
|
||||
@@ -11,26 +11,26 @@
|
||||
|
||||
if (!empty($id)) {
|
||||
if (! $cm = $DB->get_record("course_modules", array("id"=>$id))) {
|
||||
print_error("Course Module ID was incorrect");
|
||||
print_error('invalidcoursemodule');
|
||||
}
|
||||
if (! $course = $DB->get_record("course", array("id"=>$cm->course))) {
|
||||
print_error("Course is misconfigured");
|
||||
print_error('coursemisconf');
|
||||
}
|
||||
if (! $scorm = $DB->get_record("scorm", array("id"=>$cm->instance))) {
|
||||
print_error("Course module is incorrect");
|
||||
print_error('invalidcoursemodule');
|
||||
}
|
||||
} else if (!empty($a)) {
|
||||
if (! $scorm = $DB->get_record("scorm", array("id"=>$a))) {
|
||||
print_error("Course module is incorrect");
|
||||
print_error('invalidcoursemodule');
|
||||
}
|
||||
if (! $course = $DB->get_record("course", array("id"=>$scorm->course))) {
|
||||
print_error("Course is misconfigured");
|
||||
print_error('coursemisconf');
|
||||
}
|
||||
if (! $cm = get_coursemodule_from_instance("scorm", $scorm->id, $course->id)) {
|
||||
print_error("Course Module ID was incorrect");
|
||||
print_error('invalidcoursemodule');
|
||||
}
|
||||
} else {
|
||||
print_error('A required parameter is missing');
|
||||
print_error('missingparameter');
|
||||
}
|
||||
|
||||
require_login($course->id, false, $cm);
|
||||
|
||||
+2
-2
@@ -7,10 +7,10 @@
|
||||
|
||||
if (!empty($id)) {
|
||||
if (!$course = $DB->get_record('course', array('id'=>$id))) {
|
||||
print_error("Course ID is incorrect");
|
||||
print_error('invalidcourseid');
|
||||
}
|
||||
} else {
|
||||
print_error('A required parameter is missing');
|
||||
print_error('missingparameter');
|
||||
}
|
||||
|
||||
require_course_login($course);
|
||||
|
||||
@@ -10,26 +10,26 @@
|
||||
|
||||
if (!empty($id)) {
|
||||
if (! $cm = get_coursemodule_from_id('scorm', $id)) {
|
||||
print_error('Course Module ID was incorrect');
|
||||
print_error('invalidcoursemodule');
|
||||
}
|
||||
if (! $course = $DB->get_record('course', array('id'=>$cm->course))) {
|
||||
print_error('Course is misconfigured');
|
||||
print_error('coursemisconf');
|
||||
}
|
||||
if (! $scorm = $DB->get_record('scorm', array('id'=>$cm->instance))) {
|
||||
print_error('Course module is incorrect');
|
||||
print_error('invalidcoursemodule');
|
||||
}
|
||||
} else if (!empty($a)) {
|
||||
if (! $scorm = $DB->get_record('scorm', array('id'=>$a))) {
|
||||
print_error('Course module is incorrect');
|
||||
print_error('coursemisconf');
|
||||
}
|
||||
if (! $course = $DB->get_record('course', array('id'=>$scorm->course))) {
|
||||
print_error('Course is misconfigured');
|
||||
print_error('coursemisconf');
|
||||
}
|
||||
if (! $cm = get_coursemodule_from_instance('scorm', $scorm->id, $course->id)) {
|
||||
print_error('Course Module ID was incorrect');
|
||||
print_error('invalidcoursemodule');
|
||||
}
|
||||
} else {
|
||||
print_error('A required parameter is missing');
|
||||
print_error('missingparameter');
|
||||
}
|
||||
|
||||
require_login($course->id, false, $cm);
|
||||
|
||||
@@ -457,7 +457,7 @@ function scorm_course_format_display($user,$course) {
|
||||
// The module SCORM activity with the least id is the course
|
||||
$scorm = current($scorms);
|
||||
if (! $cm = get_coursemodule_from_instance('scorm', $scorm->id, $course->id)) {
|
||||
print_error('Course Module ID was incorrect');
|
||||
print_error('invalidcoursemodule');
|
||||
}
|
||||
$colspan = '';
|
||||
$headertext = '<table width="100%"><tr><td class="title">'.get_string('name').': <b>'.format_string($scorm->name).'</b>';
|
||||
|
||||
@@ -16,26 +16,26 @@
|
||||
|
||||
if (!empty($id)) {
|
||||
if (! $cm = get_coursemodule_from_id('scorm', $id)) {
|
||||
print_error("Course Module ID was incorrect");
|
||||
print_error('invalidcoursemodule');
|
||||
}
|
||||
if (! $course = $DB->get_record("course", array("id"=>$cm->course))) {
|
||||
print_error("Course is misconfigured");
|
||||
print_error('coursemisconf');
|
||||
}
|
||||
if (! $scorm = $DB->get_record("scorm", array("id"=>$cm->instance))) {
|
||||
print_error("Course module is incorrect");
|
||||
print_error('invalidcoursemodule');
|
||||
}
|
||||
} else if (!empty($a)) {
|
||||
if (! $scorm = $DB->get_record("scorm", array("id"=>$a))) {
|
||||
print_error("Course module is incorrect");
|
||||
print_error('invalidcoursemodule');
|
||||
}
|
||||
if (! $course = $DB->get_record("course", array("id"=>$scorm->course))) {
|
||||
print_error("Course is misconfigured");
|
||||
print_error('coursemisconf');
|
||||
}
|
||||
if (! $cm = get_coursemodule_from_instance("scorm", $scorm->id, $course->id)) {
|
||||
print_error("Course Module ID was incorrect");
|
||||
print_error('invalidcoursemodule');
|
||||
}
|
||||
} else {
|
||||
print_error('A required parameter is missing');
|
||||
print_error('missingparameter');
|
||||
}
|
||||
|
||||
require_login($course->id, false, $cm);
|
||||
|
||||
@@ -13,30 +13,30 @@
|
||||
|
||||
if (!empty($id)) {
|
||||
if (! $cm = get_coursemodule_from_id('scorm', $id)) {
|
||||
print_error('Course Module ID was incorrect');
|
||||
print_error('invalidcoursemodule');
|
||||
}
|
||||
if (! $course = $DB->get_record('course', array('id'=>$cm->course))) {
|
||||
print_error('Course is misconfigured');
|
||||
print_error('coursemisconf');
|
||||
}
|
||||
if (! $scorm = $DB->get_record('scorm', array('id'=>$cm->instance))) {
|
||||
print_error('Course module is incorrect');
|
||||
print_error('invalidcoursemodule');
|
||||
}
|
||||
} else {
|
||||
if (!empty($b)) {
|
||||
if (! $sco = $DB->get_record('scorm_scoes', array('id'=>$b))) {
|
||||
print_error('Scorm activity is incorrect');
|
||||
print_error('invalidactivity', 'scorm');
|
||||
}
|
||||
$a = $sco->scorm;
|
||||
}
|
||||
if (!empty($a)) {
|
||||
if (! $scorm = $DB->get_record('scorm', array('id'=>$a))) {
|
||||
print_error('Course module is incorrect');
|
||||
print_error('invalidcoursemodule');
|
||||
}
|
||||
if (! $course = $DB->get_record('course', array('id'=>$scorm->course))) {
|
||||
print_error('Course is misconfigured');
|
||||
print_error('coursemisconf');
|
||||
}
|
||||
if (! $cm = get_coursemodule_from_instance('scorm', $scorm->id, $course->id)) {
|
||||
print_error('Course Module ID was incorrect');
|
||||
print_error('invalidcoursemodule');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -44,7 +44,7 @@
|
||||
require_login($course->id, false, $cm);
|
||||
|
||||
if (!has_capability('mod/scorm:viewreport', get_context_instance(CONTEXT_MODULE,$cm->id))) {
|
||||
print_error('You are not allowed to use this script');
|
||||
print_error('cannotcallscript');
|
||||
}
|
||||
|
||||
add_to_log($course->id, 'scorm', 'report', 'report.php?id='.$cm->id, $scorm->id);
|
||||
@@ -406,7 +406,7 @@
|
||||
}
|
||||
print_simple_box_end();
|
||||
} else {
|
||||
print_error('Missing script parameter');
|
||||
print_error('missingparameter');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+7
-7
@@ -9,26 +9,26 @@
|
||||
|
||||
if (!empty($id)) {
|
||||
if (! $cm = get_coursemodule_from_id('scorm', $id)) {
|
||||
print_error("Course Module ID was incorrect");
|
||||
print_error('invalidcoursemodule');
|
||||
}
|
||||
if (! $course = $DB->get_record("course", array("id"=>$cm->course))) {
|
||||
print_error("Course is misconfigured");
|
||||
print_error('coursemisconf');
|
||||
}
|
||||
if (! $scorm = $DB->get_record("scorm", array("id"=>$cm->instance))) {
|
||||
print_error("Course module is incorrect");
|
||||
print_error('invalidcoursemodule');
|
||||
}
|
||||
} else if (!empty($a)) {
|
||||
if (! $scorm = $DB->get_record("scorm", array("id"=>$a))) {
|
||||
print_error("Course module is incorrect");
|
||||
print_error('invalidcoursemodule');
|
||||
}
|
||||
if (! $course = $DB->get_record("course", array("id"=>$scorm->course))) {
|
||||
print_error("Course is misconfigured");
|
||||
print_error('coursemisconf');
|
||||
}
|
||||
if (! $cm = get_coursemodule_from_instance("scorm", $scorm->id, $course->id)) {
|
||||
print_error("Course Module ID was incorrect");
|
||||
print_error('invalidcoursemodule');
|
||||
}
|
||||
} else {
|
||||
print_error('A required parameter is missing');
|
||||
print_error('missingparameter');
|
||||
}
|
||||
|
||||
require_login($course->id, false, $cm);
|
||||
|
||||
Reference in New Issue
Block a user