]> git.mjollnir.org Git - moodle.git/commitdiff
Revert bogus error -> print_error changes that were stopping my patch from merging.
authortjhunt <tjhunt>
Wed, 23 Apr 2008 14:45:45 +0000 (14:45 +0000)
committertjhunt <tjhunt>
Wed, 23 Apr 2008 14:45:45 +0000 (14:45 +0000)
mod/quiz/edit.php

index 924804a4169fe1fa703bdc2a2d8fb8dc9cf44bf2..e639c06b1295728cbe28e842f2ca74f28fea838b 100644 (file)
 
     // 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.
             // 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');
             }
         }
     }
             // 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');
             }
         }
     }
         $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);
                 $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);
             }
         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
                 $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');
             }
         }
     }
 
         $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();
 
     $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();