]> git.mjollnir.org Git - moodle.git/commitdiff
"MDL-14129, fix print_error"
authordongsheng <dongsheng>
Fri, 13 Jun 2008 09:10:05 +0000 (09:10 +0000)
committerdongsheng <dongsheng>
Fri, 13 Jun 2008 09:10:05 +0000 (09:10 +0000)
lang/en_utf8/question.php
lang/en_utf8/quiz.php
mod/quiz/report/analysis/report.php
mod/quiz/report/regrade/report.php
mod/quiz/report/reportlib.php

index 526ce8450eba8010635cb5e0eeccdb9f1c607823..c79b486f4d0d86bceacaa5945d02cf24724ebb3e 100644 (file)
@@ -106,8 +106,8 @@ $string['movingcategorynofiles']= 'Are you sure you want to move category \"{$a-
 $string['movingquestions'] = 'Moving Questions and Any Files';
 $string['movingquestionsandfiles']= 'Are you sure you want to move question(s) {$a->questions} to context for <strong>\"{$a->tocontext}\"</strong>?<br /> We have detected <strong>{$a->urlcount} files</strong> linked from these question(s) in {$a->fromareaname}, would you like to copy or move these to {$a->toareaname}?';
 $string['movingquestionsnofiles']=  'Are you sure you want to move question(s) {$a->questions} to context for <strong>\"{$a->tocontext}\"</strong>?<br /> There are <strong>no files</strong> linked from these question(s) in {$a->fromareaname}.';
-$string['nocate'] = 'No such category $a!';
 $string['needtochoosecat'] = 'You need to choose a category to move this question to or press \'cancel\'.';
+$string['nocate'] = 'No such category $a!';
 $string['nopermissionadd'] = 'You don\'t have permission to add questions here.';
 $string['noprobs'] = 'No problems found in your question database.';
 $string['notenoughdatatoeditaquestion'] = 'Neither a question id, nor a category id and question type, was specified.';
index 26a1cdcacda13fef927ebf0812176d33e82e5f12..172fc36cabb9aad0df32fd7cb1e4a7c870d516d0 100644 (file)
@@ -81,8 +81,10 @@ $string['calculatedquestion'] = 'Calculated Question not supported at line $a. T
 $string['cannotcreatepath'] = 'Path cannot be created ($a)';
 $string['cannoteditafterattempts'] = 'You cannot add or remove questions because there are attempts.';
 $string['cannotfindprevattempt'] = 'Cannot find previous attempt to build on.';
+$string['cannotfindquestionregard'] = 'Failed to get questions for regrading!';
 $string['cannotinsert'] = 'Cannot insert question';
 $string['cannotloadtypeinfo'] = 'Unable to load questiontype specific question information';
+$string['cannotloadquestion'] = 'Could not load question options';
 $string['cannotopen'] = 'Cannot open export file ($a)';
 $string['cannotread'] = 'Cannot read import file (or file is empty)';
 $string['cannotrestore'] = 'Could not restore question sessions';
index ce315064d8d1d50eef6511fd171628d53ffbb28b..13e8a91aafaff91e2c4a67669510866a107a1741 100644 (file)
@@ -147,17 +147,17 @@ class quiz_report extends quiz_default_report {
                    "   AND q.id IN ($questionlist)";
 
             if (!$quizquestions = $DB->get_records_sql($sql)) {
-                print_error('No questions found');
+                print_error('noquestion', 'quiz');
             }
 
             // Load the question type specific information
             if (!get_question_options($quizquestions)) {
-                print_error('Could not load question options');
+                print_error('cannotloadquestion', 'quiz');
             }
             // Restore the question sessions to their most recent states
             // creating new sessions where required
             if (!$states = get_question_states($quizquestions, $quiz, $attempt)) {
-                print_error('Could not restore question sessions');
+                print_error('cannotrestore', 'quiz');
             }
             $numbers = explode(',', $questionlist);
             $statsrow = array();
@@ -492,17 +492,17 @@ class quiz_report extends quiz_default_report {
                    "   AND q.id $usql";
 
             if (!$quizquestions = $DB->get_records_sql($sql, $params)) {
-                print_error('No questions found');
+                print_error('noquestion', 'quiz');
             }
 
             // Load the question type specific information
             if (!get_question_options($quizquestions)) {
-                print_error('Could not load question options');
+                print_error('cannotloadquestion', 'quiz');
             }
             // Restore the question sessions to their most recent states
             // creating new sessions where required
             if (!$states = get_question_states($quizquestions, $quiz, $attempt)) {
-                print_error('Could not restore question sessions');
+                print_error('cannotrestore', 'quiz');
             }
             $numbers = explode(',', $questionlist);
             $statsrow = array();
index 6dc29b46ce14d15959dcb3fca1f80baada3ed9e7..97daf5fd301c1ce46c637cf5d7e328ec5f9eb11c 100644 (file)
@@ -31,7 +31,7 @@ class quiz_report extends quiz_default_report {
                 AND i.question = q.id";
 
         if (! $questions = $DB->get_records_sql($sql, array($quiz->id))) {
-            print_error("Failed to get questions for regrading!");
+            print_error('cannotfindquestionregard', 'quiz');
         }
         get_question_options($questions);
 
index 42304c980029ccd0bbe8054a28713db32c5e693d..f87a885d705751718384abb58036eff2f1cf18a0 100644 (file)
@@ -120,7 +120,7 @@ function quiz_report_load_questions($quiz){
             WHERE q.id $usql AND
             qqi.question = q.id AND
             qqi.quiz = ?", $params)) {
-        print_error('No questions found');
+        print_error('noquestionsfound', 'quiz');
     }
     //Now we have an array of questions from a quiz we work out there question nos and remove
     //questions with zero length ie. description questions etc.