MDL-39342 stop users entering too long matching answers.

Since they lead to an ugly DB error.
This commit is contained in:
Tim Hunt 2013-04-25 11:18:12 +01:00
parent cf5a3296c4
commit cbe0a1f60a

View file

@ -44,7 +44,7 @@ class qtype_match_edit_form extends question_edit_form {
$repeated[] = $mform->createElement('editor', 'subquestions', $repeated[] = $mform->createElement('editor', 'subquestions',
$label, array('rows'=>3), $this->editoroptions); $label, array('rows'=>3), $this->editoroptions);
$repeated[] = $mform->createElement('text', 'subanswers', $repeated[] = $mform->createElement('text', 'subanswers',
get_string('answer', 'question'), array('size'=>50)); get_string('answer', 'question'), array('size' => 50, 'maxlength' => 255));
$repeatedoptions['subquestions']['type'] = PARAM_RAW; $repeatedoptions['subquestions']['type'] = PARAM_RAW;
$repeatedoptions['subanswers']['type'] = PARAM_TEXT; $repeatedoptions['subanswers']['type'] = PARAM_TEXT;
$answersoption = 'subquestions'; $answersoption = 'subquestions';