"MDL-14129, fix print_error call"
authordongsheng <dongsheng>
Fri, 23 May 2008 07:03:17 +0000 (07:03 +0000)
committerdongsheng <dongsheng>
Fri, 23 May 2008 07:03:17 +0000 (07:03 +0000)
mod/choice/index.php
mod/choice/lib.php
mod/choice/report.php
mod/choice/view.php

index b12652907b85e244749543412636885ccafbd07c..3d6d89cd38aa0803e197b9f3236e4b29fe697568 100644 (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);
index 3ebd07616d1a3ad936d8231572b43dd09da17459..cf767aab8ad926f5e8404bd523de0cef5e19c0c0 100644 (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');
         }
     }
 }
index 3bee4b3e6aa554de6d1fd10bd5dd727e669fb30c..22ef4e7bbf463ff5085643c7896ef231372e0ab1 100644 (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");
index 0db511b476d98f0d835350aa22fbed46e56f368c..681af14d6ddae09ae943b50b20a7fbff5202a563 100644 (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');