In a Quiz if we use the question type match, and we put as answer "<", the result does not work well, we can't save the question and we can't see it.
To fix the problem we try to:
- Modified /question/type/match/edit_match_form.php code:
protected function get_per_answer_fields($mform, $label, $gradeoptions, |
&$repeatedoptions, &$answersoption) { |
$mform->addElement('static', 'answersinstruct',get_string('availablechoices', 'qtype_match'), |
get_string('filloutthreeqsandtwoas', 'qtype_match')); |
$repeated = array(); |
$repeated[] = $mform->createElement('editor', 'subquestions',$label,array('rows'=>3), $this->editoroptions); |
$repeated[] = $mform->createElement('text', 'subanswers',get_string('answer', 'question'), array('size' => 50, 'maxlength' => 255)); |
$repeatedoptions['subquestions']['type'] = PARAM_RAW; |
//------------------------------ |
//BUG FIXED "<" |
//ORIGINAL CODE |
//$repeatedoptions['subanswers']['type'] = PARAM_TEXT; |
//FIXED CODE: |
$repeatedoptions['subanswers']['type'] = PARAM_RAW; |
//END |
$answersoption = 'subquestions'; |
return $repeated; |
}
|
- And must be $CFG->formatstringstriptags = false.