Fix create multiple answer true false question

pull/4037/head
Angel Fernando Quiroz Campos 4 years ago
parent 6bfc2ee909
commit e4303f0da7
  1. 8
      public/main/exercise/MultipleAnswerTrueFalseDegreeCertainty.php
  2. 4
      public/main/exercise/multiple_answer_true_false.class.php

@ -155,7 +155,7 @@ class MultipleAnswerTrueFalseDegreeCertainty extends Question
$form->addElement('radio', 'correct['.$i.']', null, null, 2);
}
$txtAnswer = $form->addHtmlEditor(
$form->addHtmlEditor(
'answer['.$i.']',
null,
true,
@ -166,11 +166,11 @@ class MultipleAnswerTrueFalseDegreeCertainty extends Question
$form->addRule('answer['.$i.']', get_lang('Required field'), 'required');
if (isset($_POST['answer']) && isset($_POST['answer'][$i])) {
$txtAnswer->setValue(Security::remove_XSS($_POST['answer'][$i]));
$form->getElement("answer[$i]")->setValue(Security::remove_XSS($_POST['answer'][$i]));
}
// show comment when feedback is enable
if (EXERCISE_FEEDBACK_TYPE_EXAM != $objEx->getFeedbackType()) {
$txtComment = $form->addHtmlEditor(
$form->addHtmlEditor(
'comment['.$i.']',
null,
false,
@ -179,7 +179,7 @@ class MultipleAnswerTrueFalseDegreeCertainty extends Question
['style' => 'vertical-align:middle;'],
);
if (isset($_POST['comment']) && isset($_POST['comment'][$i])) {
$txtComment->setValue(Security::remove_XSS($_POST['comment'][$i]));
$form->getElement("comment[$i]")->setValue(Security::remove_XSS($_POST['comment'][$i]));
}
}
$form->addElement('html', '</tr>');

@ -149,7 +149,7 @@ class MultipleAnswerTrueFalse extends Question
}
// show comment when feedback is enable
if (EXERCISE_FEEDBACK_TYPE_EXAM != $obj_ex->getFeedbackType()) {
$txtComment = $form->addHtmlEditor(
$form->addHtmlEditor(
'comment['.$i.']',
null,
true,
@ -161,7 +161,7 @@ class MultipleAnswerTrueFalse extends Question
]
);
if (isset($_POST['comment']) && isset($_POST['comment'][$i])) {
$txtComment->setValue(Security::remove_XSS($_POST['comment'][$i]));
$form->getElement("comment[$i]")->setValue(Security::remove_XSS($_POST['comment'][$i]));
}
}

Loading…
Cancel
Save