From: dongsheng Date: Fri, 13 Jun 2008 09:10:05 +0000 (+0000) Subject: "MDL-14129, fix print_error" X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=a5047f155323d71c6a723781b645583c441fe08a;p=moodle.git "MDL-14129, fix print_error" --- diff --git a/lang/en_utf8/question.php b/lang/en_utf8/question.php index 526ce8450e..c79b486f4d 100644 --- a/lang/en_utf8/question.php +++ b/lang/en_utf8/question.php @@ -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 \"{$a->tocontext}\"?
We have detected {$a->urlcount} files 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 \"{$a->tocontext}\"?
There are no files 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.'; diff --git a/lang/en_utf8/quiz.php b/lang/en_utf8/quiz.php index 26a1cdcacd..172fc36cab 100644 --- a/lang/en_utf8/quiz.php +++ b/lang/en_utf8/quiz.php @@ -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'; diff --git a/mod/quiz/report/analysis/report.php b/mod/quiz/report/analysis/report.php index ce315064d8..13e8a91aaf 100644 --- a/mod/quiz/report/analysis/report.php +++ b/mod/quiz/report/analysis/report.php @@ -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(); diff --git a/mod/quiz/report/regrade/report.php b/mod/quiz/report/regrade/report.php index 6dc29b46ce..97daf5fd30 100644 --- a/mod/quiz/report/regrade/report.php +++ b/mod/quiz/report/regrade/report.php @@ -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); diff --git a/mod/quiz/report/reportlib.php b/mod/quiz/report/reportlib.php index 42304c9800..f87a885d70 100644 --- a/mod/quiz/report/reportlib.php +++ b/mod/quiz/report/reportlib.php @@ -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.