]> git.mjollnir.org Git - moodle.git/commitdiff
"MDL-14129, fix print_error"
authordongsheng <dongsheng>
Sun, 15 Jun 2008 11:25:45 +0000 (11:25 +0000)
committerdongsheng <dongsheng>
Sun, 15 Jun 2008 11:25:45 +0000 (11:25 +0000)
admin/xmldb/index.php
lang/en_utf8/error.php
mod/hotpot/lib.php
mod/quiz/attempt.php

index f2f7adb9fbfc5793e429efb5c361a334147244a7..c95f77b11424cb45e1dbecbccff4400d960f9d1d 100644 (file)
                         break;
                 }
             } else {
-                print_error($xmldb_action->getError());
+                //TODO: need more detailed error info
+                print_error('xmldberror');
             }
         } else {
             error ("Error: cannot instantiate class (actions/$action/$actionclass)");
index 72540a968ab9e29a2b99a62de0605d95877520c1..da406c67177ca5493e858946720c8457a04fe0a8 100644 (file)
@@ -417,5 +417,6 @@ $string['wrongdestpath'] = 'Wrong destination path.';
 $string['wrongroleid'] = 'Incorrect role ID!';
 $string['wrongsourcebase'] = 'Wrong source URL base.';
 $string['wrongzipfilename'] = 'Wrong ZIP filename.';
+$string['xmldberror'] = 'XMLDB Error!';
 
 ?>
index cb9d7756985565fd8bb949eab2e69467415d2d4b..437c31593f1430c01bfa36f338a1d6079edb6b18 100644 (file)
@@ -1616,9 +1616,8 @@ class hotpot_xml_quiz extends hotpot_xml_tree {
 
         // can't continue if there is no course or reference
         if (empty($this->course) || empty($this->reference)) {
-            $this->error = get_string('error_nocourseorfilename', 'hotpot');
             if ($this->report_errors) {
-                print_error($this->error);
+                print_error('error_nocourseorfilename', 'hotpot');
             }
             return;
         }
@@ -1652,9 +1651,8 @@ class hotpot_xml_quiz extends hotpot_xml_tree {
         if ($this->read_file) {
 
             if (!file_exists($this->filepath) || !is_readable($this->filepath)) {
-                $this->error = get_string('error_couldnotopensourcefile', 'hotpot', $this->filepath);
                 if ($this->report_errors) {
-                    print_error($this->error, '', $this->course_homeurl);
+                    print_error('error_couldnotopensourcefile', 'hotpot');
                 }
                 return;
             }
@@ -1759,9 +1757,8 @@ class hotpot_xml_quiz extends hotpot_xml_tree {
 
                     // check template class exists
                     if (!file_exists($this->template_filepath) || !is_readable($this->template_filepath)) {
-                        $this->error = get_string('error_couldnotopentemplate', 'hotpot', $this->template_dir);
                         if ($this->report_errors) {
-                            print_error($this->error, '', $this->course_homeurl);
+                            print_error('error_couldnotopentemplate', 'hotpot', $this->course_homeurl);
                         }
                         return;
                     }
index defa90655c1d7c4f892b5d1240eef502f91e9883..e8735525cf31478fb60b24115bbe90e8252183be 100644 (file)
         $messages = $accessmanager->prevent_access() +
                 $accessmanager->prevent_new_attempt($attemptnumber - 1, $lastattempt);
         if (!$canpreview && $messages) {
-            print_error($accessmanager->print_messages($messages, true), '',
-                    $CFG->wwwroot . '/mod/quiz/view.php?q=' . $quiz->id);
+            //TODO: need more detailed error info
+            print_error('attempterror', 'quiz', $CFG->wwwroot . '/mod/quiz/view.php?q=' . $quiz->id);
         }
         $accessmanager->do_password_check($canpreview);
 
     if (!$newattempt) {
         $messages = $accessmanager->prevent_access();
         if (!$canpreview && $messages) {
-            print_error($accessmanager->print_messages($messages, true), '',
-                    $CFG->wwwroot . '/mod/quiz/view.php?q=' . $quiz->id);
+            //TODO: need more detailed error info
+            print_error('attempterror', 'quiz', $CFG->wwwroot . '/mod/quiz/view.php?q=' . $quiz->id);
         }
         $accessmanager->do_password_check($canpreview);
     }