Skip to content
Permalink
Browse files

Disable radio button to avoid select Don't Know question option on qu…

…estion type 10 - refs #8408
  • Loading branch information...
AngelFQC committed Oct 4, 2016
1 parent cbb5dff commit 299b3387b408fa0a7a9efe6211e2d5899720d68d
Showing with 9 additions and 5 deletions.
  1. +9 −5 main/exercise/unique_answer_no_option.class.php
@@ -209,8 +209,9 @@ public function createAnswersForm($form)
$i = 666;
$form->addHtml('<tr>');
$defaults["counter[$i]"] = '-';
$defaults['answer[' . $i . ']'] = get_lang('DontKnow');
$defaults['weighting[' . $i . ']'] = 0;
$defaults['weighting[' . $i . ']'] = '0';
$defaults['scenario'] = $temp_scenario;
$renderer = & $form->defaultRenderer();
@@ -235,20 +236,23 @@ public function createAnswersForm($form)
'weighting[' . $i . ']'
);
$answer_number = $form->addElement('text', 'counter[' . $i . ']', null, 'value="-"');
$answer_number->freeze();
$form
->addElement('text', 'counter[' . $i . ']', null)
->freeze();
$form->addElement('hidden', 'position[' . $i . ']', '666');
$form->addElement('radio', 'correct', null, null, $i, 'class="checkbox" style="margin-left: 0em;"');
$form->addElement('radio', 'correct', null, null, $i, ['class' => 'checkbox', 'disabled' => true]);
$form->addElement('html_editor', 'answer[' . $i . ']', null, array(), $editor_config);
$form->addRule('answer[' . $i . ']', get_lang('ThisFieldIsRequired'), 'required');
$form->addElement('html_editor', 'comment[' . $i . ']', null, array(), $editor_config);
//$form->addElement('select', 'destination'.$i, get_lang('SelectQuestion').' : ',$select_question,'multiple');
$form->addText("weighting[$i]", null, false, ['style' => 'width: 60px;', 'value' => 0, 'readonly' => 'readonly']);
$form
->addElement('text', "weighting[$i]", null)
->freeze();
$form->addHTml('</tr>');
$form->addHtml('</tbody></table>');

0 comments on commit 299b338

Please sign in to comment.
You can’t perform that action at this time.