Revert bogus error -> print_error changes that were stopping my patch from merging.
This commit is contained in:
+11
-11
@@ -107,7 +107,7 @@
|
||||
|
||||
// Get the course object and related bits.
|
||||
if (! $course = get_record("course", "id", $quiz->course)) {
|
||||
print_error("This course doesn't exist");
|
||||
error("This course doesn't exist");
|
||||
}
|
||||
|
||||
// Log this visit.
|
||||
@@ -139,7 +139,7 @@
|
||||
// Avoid duplicate page breaks
|
||||
$quiz->questions = str_replace(',0,0', ',0', $quiz->questions);
|
||||
if (!set_field('quiz', 'questions', $quiz->questions, 'id', $quiz->instance)) {
|
||||
print_error('Could not save question list');
|
||||
error('Could not save question list');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -156,7 +156,7 @@
|
||||
// Avoid duplicate page breaks
|
||||
$quiz->questions = str_replace(',0,0', ',0', $quiz->questions);
|
||||
if (!set_field('quiz', 'questions', $quiz->questions, 'id', $quiz->instance)) {
|
||||
print_error('Could not save question list');
|
||||
error('Could not save question list');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -180,7 +180,7 @@
|
||||
$randomcount = required_param('randomcount', PARAM_INT);
|
||||
// load category
|
||||
if (! $category = get_record('question_categories', 'id', $categoryid)) {
|
||||
print_error('Category ID is incorrect');
|
||||
error('Category ID is incorrect');
|
||||
}
|
||||
$catcontext = get_context_instance_by_id($category->contextid);
|
||||
require_capability('moodle/question:useall', $catcontext);
|
||||
@@ -215,7 +215,7 @@
|
||||
$question->qtype = RANDOM;
|
||||
$question = $QTYPES[RANDOM]->save_question($question, $form, $course);
|
||||
if(!isset($question->id)) {
|
||||
print_error('Could not insert new random question!');
|
||||
error('Could not insert new random question!');
|
||||
}
|
||||
quiz_add_quiz_question($question->id, $quiz);
|
||||
}
|
||||
@@ -226,12 +226,12 @@
|
||||
if (isset($_REQUEST['questionsperpage'])) {
|
||||
$quiz->questionsperpage = required_param('questionsperpage', PARAM_INT);
|
||||
if (!set_field('quiz', 'questionsperpage', $quiz->questionsperpage, 'id', $quiz->id)) {
|
||||
print_error('Could not save number of questions per page');
|
||||
error('Could not save number of questions per page');
|
||||
}
|
||||
}
|
||||
$quiz->questions = quiz_repaginate($quiz->questions, $quiz->questionsperpage);
|
||||
if (!set_field('quiz', 'questions', $quiz->questions, 'id', $quiz->id)) {
|
||||
print_error('Could not save layout');
|
||||
error('Could not save layout');
|
||||
}
|
||||
}
|
||||
if (isset($_REQUEST['delete']) and confirm_sesskey()) { /// Remove a question from the quiz
|
||||
@@ -278,14 +278,14 @@
|
||||
$quiz->questions = str_replace(',0,0', ',0', $quiz->questions);
|
||||
}
|
||||
if (!set_field('quiz', 'questions', $quiz->questions, 'id', $quiz->instance)) {
|
||||
print_error('Could not save question list');
|
||||
error('Could not save question list');
|
||||
}
|
||||
}
|
||||
|
||||
// If rescaling is required save the new maximum
|
||||
if (isset($_REQUEST['maxgrade'])) {
|
||||
if (!quiz_set_grade(optional_param('maxgrade', 0), $quiz)) {
|
||||
print_error('Could not set a new maximum grade for the quiz');
|
||||
error('Could not set a new maximum grade for the quiz');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -325,7 +325,7 @@
|
||||
|
||||
$sumgrades = quiz_print_question_list($quiz, $thispageurl, false, $quiz_showbreaks, $quiz_reordertool);
|
||||
if (!set_field('quiz', 'sumgrades', $sumgrades, 'id', $quiz->instance)) {
|
||||
print_error('Failed to set sumgrades');
|
||||
error('Failed to set sumgrades');
|
||||
}
|
||||
|
||||
print_box_end();
|
||||
@@ -352,7 +352,7 @@
|
||||
|
||||
$sumgrades = quiz_print_question_list($quiz, $thispageurl, true, $quiz_showbreaks, $quiz_reordertool);
|
||||
if (!set_field('quiz', 'sumgrades', $sumgrades, 'id', $quiz->instance)) {
|
||||
print_error('Failed to set sumgrades');
|
||||
error('Failed to set sumgrades');
|
||||
}
|
||||
|
||||
print_box_end();
|
||||
|
||||
Reference in New Issue
Block a user