"MDL-14129, fix print_error call"
This commit is contained in:
@@ -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
@@ -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');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user