// relative path must start with '/', because of backup/restore!!!
if (!$relativepath) {
- print_error('No valid arguments supplied or incorrect server configuration');
+ print_error('invalidarguments');
} else if ($relativepath{0} != '/') {
- print_error('No valid arguments supplied, path does not start with slash!');
+ print_error('pathdoesnotstartslash');
}
$pathname = $CFG->dataroot.'/questionattempt'.$relativepath;
// check for the right number of directories in the path
if (count($args) != 3) {
- print_error('Invalid arguments supplied');
+ print_error('invalidarguments');
}
// security: require login
$parsableanswerdef .= 'NUMERICAL:';
break;
default:
- print_error("questiontype $wrapped->qtype not recognized");
+ print_error('unknownquestiontype', 'question', '', $wrapped->qtype);
}
$separator= '';
foreach ($wrapped->options->answers as $subanswer) {
return 'multianswer';
}
}
-?>
\ No newline at end of file
+?>
echo $feedbackimg;
break;
default:
- print_error("Unable to recognize questiontype of question part #$positionkey.");
+ print_error('unknownquestiontype', 'question');
break;
}
echo "</label>"; // MDL-7497
$answer = $exploded[1];
// $sequence is an ordered array of the question ids.
if (!$sequence = get_field('question_multianswer', 'sequence', 'question', $state->question)) {
- print_error("The cloze question $state->question is missing its options");
+ print_error('missingoption', 'question', '', $state->question);
}
$sequence = explode(',', $sequence);
// The id of the current question.
$wrapped->partiallycorrectfeedback = '';
$wrapped->incorrectfeedback = '';
} else {
- print_error("Cannot identify qtype $answerregs[2]");
+ print_error('unknownquestiontype', 'question', '', $answerregs[2]);
return false;
}
$form->name = '';
$question = parent::save_question($question, $form, $course);
if (!$category = get_record('question_categories', 'id', $question->category)) {
- print_error('Could retrieve question category');
+ print_error('cannotretrieveqcat', 'question');
}
$question->name = $this->question_name($category);
if (!set_field('question', 'name', $question->name, 'id', $question->id)) {
- print_error('Could not update random question name');
+ print_error('cannotupdaterandomqname', 'question');
}
return $question;
}