]> git.mjollnir.org Git - moodle.git/commitdiff
"MDL-14129, fixed hardcoded print_error"
authordongsheng <dongsheng>
Thu, 25 Sep 2008 08:03:54 +0000 (08:03 +0000)
committerdongsheng <dongsheng>
Thu, 25 Sep 2008 08:03:54 +0000 (08:03 +0000)
lang/en_utf8/error.php
lang/en_utf8/moodle.php
lang/en_utf8/question.php
question/format/blackboard_six/format.php
question/format/qti_two/format.php

index 6ea7557bf3af57e4d5a6ab6bfb9879de6a883462..67c2e2b80838dc99ff84b8a2d0d23976e7a7a514 100644 (file)
@@ -139,7 +139,7 @@ $string['cannotupdaterole'] = 'Cannot update role!';
 $string['cannotupdatemod'] = 'Could not update $a';
 $string['cannotupdatemodcap'] = 'Could not update $a capabilities!';
 $string['cannotupdateuser'] = 'Updating user failed';
-$string['cannotupdateusermsgpref'] = 'Updating user failed';
+$string['cannotupdateusermsgpref'] = 'Cannot update user message preferences';
 $string['cannotupdateuseronexauth'] = 'Failed to update user data on external auth: $a. See the server logs for more details.';
 $string['cannotupdatepasswordonextauth'] = 'Failed to update password on external auth: $a. See the server logs for more details.';
 $string['cannotupdateplugincap'] = 'Could not update $a capabilities!';
@@ -169,6 +169,7 @@ $string['confirmsesskeybad'] = 'Sorry, but your session key could not be confirm
 $string['couldnotassignrole'] = 'A serious but unspecified error occurred while trying to assign a role to you';
 $string['coursegroupunknown'] = 'Course corresponding to group $a not specified';
 $string['coursemisconf'] = 'Course is misconfigured';
+$string['courserequestdisabled'] = 'Sorry, but requesting courses has been disabled by the administrator';
 $string['csvemptyfile'] = 'The CSV file is empty';
 $string['csvcolumnduplicates'] = 'Duplicate columns detected';
 $string['csvfewcolumns'] = 'Not enough columns, please verify the delimiter setting';
@@ -207,6 +208,7 @@ $string['expiredkey'] = 'Expired key';
 $string['failtoloadblocks'] = 'One or more blocks are registered in the database, but they all failed to load!';
 $string['fieldrequired'] = '\"$a\" is a required field';
 $string['filenotfound'] = 'Sorry, the requested file could not be found';
+$string['filenotreadable'] = 'File is not readable';
 $string['filemismatch'] = 'Non-core file name mismatch. The file \"$a->current\" should be $a->file';
 $string['filternotinstalled'] = 'Filter $a is not currently installed';
 $string['filternotactive'] = 'Filter $a is not currently active';
@@ -391,7 +393,7 @@ $string['tagnotfound'] = 'The specified tag was not found in the database';
 $string['tagdisabled'] = 'Tags are disabled!';
 $string['themenotinstall'] = 'This theme is not installed!';
 $string['transactionvoid'] = 'Transaction cannot be voided because it has already been voided';
-$string['typenotimplement'] = 'TODO: type not implemented';
+$string['importformatnotimplement'] = 'Sorry, importing this format is not yet implemented!';
 $string['unicodeupgradeerror'] = 'Sorry, but your database is not already in Unicode, and this version of Moodle is not able to migrate your database to Unicode.  Please upgrade to Moodle 1.7.x first and perform the Unicode migration from the Admin page.  After that is done you should be able to migrate to Moodle $a';
 $string['unspecifycourseid'] = 'Must specify course id, short name or idnumber';
 $string['statsdisable'] = 'Stats is not enabled';
index 060eb8733c03cd944991409c82a136fcf846259a..95558b41a38ff6fa21f722d39bdfe5744144ee95 100644 (file)
@@ -292,7 +292,6 @@ $a';
 $string['courserejectreason'] = 'Outline your reasons for rejecting this course<br />(this will be emailed to the requester)';
 $string['courserejectsubject'] = 'Your course has been rejected';
 $string['courserequest'] = 'Course request';
-$string['courserequestdisabled'] = 'Sorry, but requesting courses has been disabled by the administrator';
 $string['courserequestfailed'] = 'For some reason, your course request could not be saved';
 $string['courserequestintro'] = 'Use this form to request a course to be created for you.<br />Try and fill in as much information as you can to allow<br />the administrators to understand your reasons for wanting this course.';
 $string['courserequestreason'] = 'Reasons for wanting this course';
index cd3223736535fdbbca3e162c15f92507e2afc12d..2faedc712a28186373e2918f9c60adf0d049edd5 100644 (file)
@@ -9,6 +9,7 @@ $string['cannotinsert'] = 'Could not insert entry in question_sessions';
 $string['cannotcreate'] = 'Could not create new entry in question_attempts table';
 $string['cannotcreatedataset'] = 'Unable to create dataset $a';
 $string['cannotcreaterelation'] = 'Unable to create relation to dataset $a[0] $a[1]';
+$string['cannotcreatepath'] = 'Cannot create path: $a';
 $string['cannotcopybackup'] = 'Could not copy backup file';
 $string['cannotdeletecate'] = 'You can\'t delete that category it is the default category for this context.';
 $string['cannotfindcate'] = 'Could not find category record';
@@ -30,6 +31,7 @@ $string['cannotupdatecate'] = 'Could not update the category $a';
 $string['cannotmovecate'] = 'Cannot move the category $a. It is the last in this context.';
 $string['cannotmovefromto'] = 'Could not move the category $a[0] to $a[1]';
 $string['cannotmovequestion'] = 'You can\'t use this script to move questions that have files associated with them from different areas.';
+$string['cannotopenforwriting'] = 'Cannot open for writing: $a';
 $string['cannotunhidequestion'] = 'Failed to unhide the question.';
 $string['cannotunzip'] = 'Could not unzip file.';
 $string['cannotupdatesubcate'] = 'Could not update a child category!';
@@ -81,6 +83,9 @@ $string['errorfileschanged'] = 'Error files linked to from questions have change
 $string['errormanualgradeoutofrange'] = 'The grade $a->grade is not between 0 and $a->maxgrade for question $a->name. The score and comment have not been saved.';
 $string['errormovingquestions'] = 'Error while moving questions with ids $a.';
 $string['errorprocessingresponses'] = 'An error occurred while processing your responses.';
+$string['errorpreprocess'] = 'Error occurred during pre-processing!';
+$string['errorpostprocess'] = 'Error occurred during post-processing!';
+$string['errorprocess'] = 'Error occurred during processing!';
 $string['errorsavingcomment'] = 'Error saving the comment for question $a->name in the database.';
 $string['errorupdatingattempt'] = 'Error updating attempt $a->id in the database.';
 $string['emptyxml'] = 'Unkown error - empty imsmanifest.xml';
index 0ae5c5b02e23d84e31d2a84c53641c0ebcbdbf32..d5b640f866c30e15a2ff9c5e8654b274f1196152 100644 (file)
@@ -158,7 +158,7 @@ class qformat_blackboard_six extends qformat_default {
         $ext = substr($this->realfilename, strpos($this->realfilename,'.'), strlen($this->realfilename)-1);      
         if ($ext=='.dat') {
             if (!is_readable($filename)) {
-                error("File is not readable"); 
+                print_error('filenotreadable', 'error');       
             }          
             return file($filename);
         }        
index 66dea840c4f5d8f1aaed12e6164938808ff8e180..c7f4d42609cbfde3f1935ab832267c998c3f4b20 100644 (file)
@@ -110,8 +110,7 @@ class qformat_qti_two extends qformat_default {
     function importpreprocess() {
         global $CFG;
 
-        error("Sorry, importing this format is not yet implemented!",
-            "$CFG->wwwroot/mod/quiz/import.php?category=$category->id");
+        print_error('cannotimportformat', 'question', "$CFG->wwwroot/mod/quiz/import.php?category=$category->id");
     }
 
     function exportpreprocess() {
@@ -241,7 +240,7 @@ function handle_questions_media(&$questions, $path, $courseid) {
 
         // create a directory for the exports (if not already existing)
         if (!$export_dir = make_upload_directory($this->question_get_export_dir().'/'.$this->filename)) {
-              error( get_string('cannotcreatepath','quiz',$export_dir) );
+              print_error('cannotcreatepath', 'quiz', '', $export_dir);
         }
         $path = $CFG->dataroot.'/'.$this->question_get_export_dir().'/'.$this->filename;
 
@@ -273,13 +272,13 @@ function handle_questions_media(&$questions, $path, $courseid) {
         $expout = $smarty->fetch('imsmanifest.tpl');
         $filepath = $path.'/imsmanifest.xml';
         if (empty($expout)) {
-            error("Unkown error - empty imsmanifest.xml");
+            print_error('emptyxml', 'question');
         }
         if (!$fh=fopen($filepath,"w")) {
-            error("Cannot open for writing: $filepath");
+            print_error('cannotopenforwriting', 'question', '', $filepath);
         }
         if (!fwrite($fh, $expout)) {
-            error("Cannot write exported questions to $filepath");
+            print_error('cannotwriteto', 'question', '', $filepath);
         }
         fclose($fh);
 
@@ -294,10 +293,10 @@ function handle_questions_media(&$questions, $path, $courseid) {
 
             $filepath = $path.'/'.$this->get_assesment_item_id($question) . ".xml";
             if (!$fh=fopen($filepath,"w")) {
-                error("Cannot open for writing: $filepath");
+                print_error('cannotopenforwriting', 'question', '', $filepath);
             }
             if (!fwrite($fh, $expout)) {
-                error("Cannot write exported questions to $filepath");
+                print_error('cannotwriteto', 'question', '', $filepath);
             }
             fclose($fh);
 
@@ -331,13 +330,13 @@ function handle_questions_media(&$questions, $path, $courseid) {
         $this->xml_entitize($result);
         $this->xml_entitize($submiturl);
         if (! $this->exportpreprocess(0, $course)) {   // Do anything before that we need to
-            error("Error occurred during pre-processing!", $redirect);
+            print_error('errorpreprocess', 'question', $redirect);
         }
         if (! $this->exportprocess_quiz($quiz, $questions, $result, $submiturl, $course)) {         // Process the export data
-            error("Error occurred during processing!", $redirect);
+            print_error('errorprocess','question', $redirect);
         }
         if (! $this->exportpostprocess()) {                    // In case anything needs to be done after
-            error("Error occurred during post-processing!", $redirect);
+            print_error('errorpostprocess', 'question', $redirect);
         }
 
     }
@@ -676,7 +675,7 @@ function xml_entitize(&$collection) {
         $path = $CFG->dataroot."/smarty_c";
         if (!is_dir($path)) {
             if (!mkdir($path, $CFG->directorypermissions)) {
-              error("Cannot create path: $path");
+              print_error('cannotcreatepath', 'question', '', $path);
             }
         }
         $smarty = new Smarty;
@@ -919,4 +918,4 @@ function xml_entitize(&$collection) {
 
 }
 
-?>
\ No newline at end of file
+?>