"MDL-14129, fix print_error call"

This commit is contained in:
dongsheng
2008-05-23 07:03:17 +00:00
parent ab50023681
commit c72813552a
4 changed files with 10 additions and 10 deletions
+1 -1
View File
@@ -6,7 +6,7 @@
$id = required_param('id',PARAM_INT); // course
if (! $course = get_record("course", "id", $id)) {
print_error("Course ID is incorrect");
print_error('invalidcourseid');
}
require_course_login($course);
+3 -3
View File
@@ -264,7 +264,7 @@ function choice_user_submit_response($formanswer, $choice, $userid, $courseid, $
$newanswer->optionid = $formanswer;
$newanswer->timemodified = time();
if (! update_record("choice_answers", $newanswer)) {
print_error("Could not update your choice because of a database error");
print_error('cannotupdatechoice', 'choice');
}
add_to_log($courseid, "choice", "choose again", "view.php?id=$cm->id", $choice->id, $cm->id);
} else {
@@ -274,13 +274,13 @@ function choice_user_submit_response($formanswer, $choice, $userid, $courseid, $
$newanswer->optionid = $formanswer;
$newanswer->timemodified = time();
if (! insert_record("choice_answers", $newanswer)) {
print_error("Could not save your choice");
print_error('cannotsavechoice', 'choice');
}
add_to_log($courseid, "choice", "choose", "view.php?id=$cm->id", $choice->id, $cm->id);
}
} else {
if (!($current->optionid==$formanswer)) { //check to see if current choice already selected - if not display error
print_error("this choice is full!");
print_error('choicefull', 'choice');
}
}
}
+3 -3
View File
@@ -9,11 +9,11 @@
$action = optional_param('action', '', PARAM_ALPHA);
if (! $cm = get_coursemodule_from_id('choice', $id)) {
print_error("Course Module ID was incorrect");
print_error("invalidcoursemodule");
}
if (! $course = get_record("course", "id", $cm->course)) {
print_error("Course module is misconfigured");
print_error("coursemisconf");
}
require_login($course->id, false, $cm);
@@ -23,7 +23,7 @@
require_capability('mod/choice:readresponses', $context);
if (!$choice = choice_get_choice($cm->instance)) {
print_error("Course module is incorrect");
print_error('invalidcoursemodule');
}
$strchoice = get_string("modulename", "choice");
+3 -3
View File
@@ -8,17 +8,17 @@
$attemptids = optional_param('attemptid', array(), PARAM_INT); // array of attempt ids for delete action
if (! $cm = get_coursemodule_from_id('choice', $id)) {
print_error("Course Module ID was incorrect");
print_error('invalidcoursemodule');
}
if (! $course = get_record("course", "id", $cm->course)) {
print_error("Course is misconfigured");
print_error('coursemisconf');
}
require_course_login($course, false, $cm);
if (!$choice = choice_get_choice($cm->instance)) {
print_error("Course module is incorrect");
print_error('invalidcoursemodule');
}
$strchoice = get_string('modulename', 'choice');