mirror of
https://github.com/moodle/moodle.git
synced 2025-04-24 09:55:33 +02:00
"MDL-14129, fixed hardcoded print_header in quiz module"
This commit is contained in:
parent
2aa98ea846
commit
a6344df49a
@ -88,13 +88,18 @@ $string['cannoteditafterattempts'] = 'You cannot add or remove questions because
|
||||
$string['cannotfindprevattempt'] = 'Cannot find previous attempt to build on.';
|
||||
$string['cannotfindquestionregard'] = 'Failed to get questions for regrading!';
|
||||
$string['cannotinsert'] = 'Cannot insert question';
|
||||
$string['cannotinsertrandomquestion'] = 'Could not insert new random 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';
|
||||
$string['cannotreviewopen'] = 'You cannot review this attempt, it is still open.';
|
||||
$string['cannotsavelayout'] = 'Could not save layout';
|
||||
$string['cannotsavequestion'] = 'Cannot save question list';
|
||||
$string['cannotsavenumberofquestion'] = 'Could not save number of questions per page';
|
||||
$string['cannotsetgrade'] = 'Could not set a new maximum grade for the quiz';
|
||||
$string['cannotsetsumgrades'] = 'Failed to set sumgrades';
|
||||
$string['cannotwrite'] = 'Cannot write to export file ($a)';
|
||||
$string['caseno'] = 'No, case is unimportant';
|
||||
$string['casesensitive'] = 'Case sensitivity';
|
||||
|
@ -2,7 +2,10 @@
|
||||
// quiz_grading.php - created with Moodle 1.7 beta + (2006101003)
|
||||
|
||||
|
||||
$string['cannotloadquestioninfo'] = 'Unable to load questiontype specific question information';
|
||||
$string['essayonly'] = 'The following questions need to be graded manually';
|
||||
$string['invalidquestionid'] = 'Gradeable question with id $a not found';
|
||||
$string['invalidattemptid'] = 'No such attempt ID exists';
|
||||
$string['grading'] = 'Manual grading';
|
||||
$string['gradingreport'] = 'Manual grading report';
|
||||
$string['gradeall'] = 'Grade all $a attempts';
|
||||
|
@ -107,7 +107,7 @@
|
||||
|
||||
// Get the course object and related bits.
|
||||
if (! $course = $DB->get_record('course', array('id' => $quiz->course))) {
|
||||
error("This course doesn't exist");
|
||||
print_error('invalidcourseid', 'error');
|
||||
}
|
||||
|
||||
// Log this visit.
|
||||
@ -141,7 +141,7 @@
|
||||
// Avoid duplicate page breaks
|
||||
$quiz->questions = str_replace(',0,0', ',0', $quiz->questions);
|
||||
if (!$DB->set_field('quiz', 'questions', $quiz->questions, array('id' => $quiz->instance))) {
|
||||
error('Could not save question list');
|
||||
print_error('cannotsavequestion', 'quiz');
|
||||
}
|
||||
$significantchangemade = true;
|
||||
}
|
||||
@ -158,7 +158,7 @@
|
||||
// Avoid duplicate page breaks
|
||||
$quiz->questions = str_replace(',0,0', ',0', $quiz->questions);
|
||||
if (!$DB->set_field('quiz', 'questions', $quiz->questions, array('id' => $quiz->instance))) {
|
||||
error('Could not save question list');
|
||||
print_error('cannotsavequestion', 'quiz');
|
||||
}
|
||||
$significantchangemade = true;
|
||||
}
|
||||
@ -186,7 +186,7 @@
|
||||
$randomcount = required_param('randomcount', PARAM_INT);
|
||||
// load category
|
||||
if (! $category = $DB->get_record('question_categories', array('id' => $categoryid))) {
|
||||
error('Category ID is incorrect');
|
||||
print_error('invalidcategoryid', 'error');
|
||||
}
|
||||
$catcontext = get_context_instance_by_id($category->contextid);
|
||||
require_capability('moodle/question:useall', $catcontext);
|
||||
@ -221,7 +221,7 @@
|
||||
$question->qtype = RANDOM;
|
||||
$question = $QTYPES[RANDOM]->save_question($question, $form, $course);
|
||||
if(!isset($question->id)) {
|
||||
error('Could not insert new random question!');
|
||||
print_error('cannotinsertrandomquestion', 'quiz');
|
||||
}
|
||||
quiz_add_quiz_question($question->id, $quiz);
|
||||
}
|
||||
@ -234,12 +234,12 @@
|
||||
if ($questionsperpage != $quiz->questionsperpage) {
|
||||
$quiz->questionsperpage = $questionsperpage;
|
||||
if (!$DB->set_field('quiz', 'questionsperpage', $quiz->questionsperpage, array('id' => $quiz->id))) {
|
||||
error('Could not save number of questions per page');
|
||||
print_error('cannotsavenumberofquestion', 'quiz');
|
||||
}
|
||||
}
|
||||
$quiz->questions = quiz_repaginate($quiz->questions, $quiz->questionsperpage);
|
||||
if (!$DB->set_field('quiz', 'questions', $quiz->questions, array('id' => $quiz->id))) {
|
||||
error('Could not save layout');
|
||||
print_error('cannotsavelayout', 'quiz');
|
||||
}
|
||||
$significantchangemade = true;
|
||||
}
|
||||
@ -288,7 +288,7 @@
|
||||
$quiz->questions = str_replace(',0,0', ',0', $quiz->questions);
|
||||
}
|
||||
if (!$DB->set_field('quiz', 'questions', $quiz->questions, array('id' => $quiz->instance))) {
|
||||
error('Could not save question list');
|
||||
print_error('cannotsavequestion', 'quiz');
|
||||
}
|
||||
}
|
||||
|
||||
@ -296,7 +296,7 @@
|
||||
$maxgrade = optional_param('maxgrade', -1, PARAM_NUMBER);
|
||||
if ($maxgrade >= 0) {
|
||||
if (!quiz_set_grade($maxgrade, $quiz)) {
|
||||
error('Could not set a new maximum grade for the quiz');
|
||||
print_error('cannotsetgrade', 'quiz');
|
||||
}
|
||||
}
|
||||
$significantchangemade = true;
|
||||
@ -342,7 +342,7 @@
|
||||
|
||||
$sumgrades = quiz_print_question_list($quiz, $thispageurl, false, $quiz_showbreaks, $quiz_reordertool);
|
||||
if (!$DB->set_field('quiz', 'sumgrades', $sumgrades, array('id' => $quiz->instance))) {
|
||||
error('Failed to set sumgrades');
|
||||
print_error('cannotsetsumgrades', 'quiz');
|
||||
}
|
||||
|
||||
print_box_end();
|
||||
@ -369,7 +369,7 @@
|
||||
|
||||
$sumgrades = quiz_print_question_list($quiz, $thispageurl, true, $quiz_showbreaks, $quiz_reordertool);
|
||||
if (!$DB->set_field('quiz', 'sumgrades', $sumgrades, array('id' => $quiz->instance))) {
|
||||
error('Failed to set sumgrades');
|
||||
print_error('cannotsetsumgrades', 'quiz');
|
||||
}
|
||||
|
||||
print_box_end();
|
||||
|
@ -87,7 +87,7 @@ class quiz_grading_report extends quiz_default_report {
|
||||
|
||||
if (!empty($questionid)) {
|
||||
if (!isset($gradeableqs[$questionid])){
|
||||
error("Gradeable question with id $questionid not found");
|
||||
print_error('invalidquestionid', 'quiz_grading', '', $questionid);
|
||||
} else {
|
||||
$question =& $gradeableqs[$questionid];
|
||||
}
|
||||
@ -101,7 +101,7 @@ class quiz_grading_report extends quiz_default_report {
|
||||
// We need to add additional questiontype specific information to
|
||||
// the question objects.
|
||||
if (!get_question_options($questions)) {
|
||||
error("Unable to load questiontype specific question information");
|
||||
print_error('cannotloadquestioninfo', 'quiz_grading');
|
||||
}
|
||||
// This will have extended the question object so that it now holds
|
||||
// all the information about the questions that may be needed later.
|
||||
@ -125,7 +125,7 @@ class quiz_grading_report extends quiz_default_report {
|
||||
"WHERE uniqueid = ? AND " .
|
||||
"userid $usql AND " .
|
||||
"quiz=?", array_merge(array($uniqueid), $params, array($quiz->id)))){
|
||||
error('No such attempt ID exists');
|
||||
print_error('invalidattemptid', 'quiz_grading');
|
||||
}
|
||||
|
||||
// Load the state for this attempt (The questions array was created earlier)
|
||||
|
Loading…
x
Reference in New Issue
Block a user