@@ -34,20 +34,20 @@ discard block |
||
| 34 | 34 | $html = '<table class="data_table"> |
| 35 | 35 | <tr> |
| 36 | 36 | <th width="10px"> |
| 37 | - ' . get_lang('Number') . '
|
|
| 37 | + ' . get_lang('Number').'
|
|
| 38 | 38 | </th> |
| 39 | 39 | <th width="10px"> |
| 40 | - ' . get_lang('True') . '
|
|
| 40 | + ' . get_lang('True').'
|
|
| 41 | 41 | </th> |
| 42 | 42 | <th width="50%"> |
| 43 | - ' . get_lang('Answer') . '
|
|
| 43 | + ' . get_lang('Answer').'
|
|
| 44 | 44 | </th>'; |
| 45 | 45 | |
| 46 | - $html .='<th>' . get_lang('Comment') . '</th>';
|
|
| 47 | - $html .='</tr>'; |
|
| 46 | + $html .= '<th>'.get_lang('Comment').'</th>';
|
|
| 47 | + $html .= '</tr>'; |
|
| 48 | 48 | $form->addElement( |
| 49 | 49 | 'label', |
| 50 | - get_lang('Answers') .
|
|
| 50 | + get_lang('Answers').
|
|
| 51 | 51 | '<br /> '.Display::return_icon('fill_field.png'),
|
| 52 | 52 | $html |
| 53 | 53 | ); |
@@ -82,9 +82,9 @@ discard block |
||
| 82 | 82 | for ($i = 1; $i <= $nb_answers; ++$i) {
|
| 83 | 83 | /* si la reponse est de type objet */ |
| 84 | 84 | if (is_object($answer)) {
|
| 85 | - $defaults['answer[' . $i . ']'] = $answer->answer[$i]; |
|
| 86 | - $defaults['comment[' . $i . ']'] = $answer->comment[$i]; |
|
| 87 | - $defaults['correct[' . $i . ']'] = $answer->correct[$i]; |
|
| 85 | + $defaults['answer['.$i.']'] = $answer->answer[$i]; |
|
| 86 | + $defaults['comment['.$i.']'] = $answer->comment[$i]; |
|
| 87 | + $defaults['correct['.$i.']'] = $answer->correct[$i]; |
|
| 88 | 88 | |
| 89 | 89 | // start |
| 90 | 90 | $scoreA = $answer->weighting[$i]; |
@@ -106,16 +106,16 @@ discard block |
||
| 106 | 106 | $renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', 'comment['.$i.']');
|
| 107 | 107 | //$renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', 'weighting['.$i.']');
|
| 108 | 108 | |
| 109 | - $answer_number = $form->addElement('text', 'counter[' . $i . ']', null, 'value="' . $i . '"');
|
|
| 109 | + $answer_number = $form->addElement('text', 'counter['.$i.']', null, 'value="'.$i.'"');
|
|
| 110 | 110 | $answer_number->freeze(); |
| 111 | 111 | |
| 112 | - $form->addElement('checkbox', 'correct[' . $i . ']', null, null, 'class="checkbox"');
|
|
| 113 | - $boxes_names[] = 'correct[' . $i . ']'; |
|
| 112 | + $form->addElement('checkbox', 'correct['.$i.']', null, null, 'class="checkbox"');
|
|
| 113 | + $boxes_names[] = 'correct['.$i.']'; |
|
| 114 | 114 | |
| 115 | - $form->addElement('html_editor', 'answer[' . $i . ']', null, array(), array('ToolbarSet' => 'TestProposedAnswer', 'Width' => '100%', 'Height' => '100'));
|
|
| 116 | - $form->addRule('answer[' . $i . ']', get_lang('ThisFieldIsRequired'), 'required');
|
|
| 115 | + $form->addElement('html_editor', 'answer['.$i.']', null, array(), array('ToolbarSet' => 'TestProposedAnswer', 'Width' => '100%', 'Height' => '100'));
|
|
| 116 | + $form->addRule('answer['.$i.']', get_lang('ThisFieldIsRequired'), 'required');
|
|
| 117 | 117 | |
| 118 | - $form->addElement('html_editor', 'comment[' . $i . ']', null, array(), array('ToolbarSet' => 'TestProposedAnswer', 'Width' => '100%', 'Height' => '100'));
|
|
| 118 | + $form->addElement('html_editor', 'comment['.$i.']', null, array(), array('ToolbarSet' => 'TestProposedAnswer', 'Width' => '100%', 'Height' => '100'));
|
|
| 119 | 119 | |
| 120 | 120 | $form->addElement('html', '</tr>');
|
| 121 | 121 | } |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | // Reponses correctes |
| 182 | 182 | $nbr_corrects = 0; |
| 183 | 183 | for ($i = 1; $i <= $nb_answers; $i++) {
|
| 184 | - $goodAnswer = trim($form->getSubmitValue('correct[' . $i . ']'));
|
|
| 184 | + $goodAnswer = trim($form->getSubmitValue('correct['.$i.']'));
|
|
| 185 | 185 | if ($goodAnswer) {
|
| 186 | 186 | $nbr_corrects++; |
| 187 | 187 | } |
@@ -200,9 +200,9 @@ discard block |
||
| 200 | 200 | $test = $form->getSubmitValue('pts');
|
| 201 | 201 | |
| 202 | 202 | for ($i = 1; $i <= $nb_answers; $i++) {
|
| 203 | - $answer = trim($form->getSubmitValue('answer[' . $i . ']'));
|
|
| 204 | - $comment = trim($form->getSubmitValue('comment[' . $i . ']'));
|
|
| 205 | - $goodAnswer = trim($form->getSubmitValue('correct[' . $i . ']'));
|
|
| 203 | + $answer = trim($form->getSubmitValue('answer['.$i.']'));
|
|
| 204 | + $comment = trim($form->getSubmitValue('comment['.$i.']'));
|
|
| 205 | + $goodAnswer = trim($form->getSubmitValue('correct['.$i.']'));
|
|
| 206 | 206 | |
| 207 | 207 | if ($goodAnswer) {
|
| 208 | 208 | $weighting = abs($answer_score); |
@@ -230,12 +230,12 @@ discard block |
||
| 230 | 230 | $score = null |
| 231 | 231 | ) {
|
| 232 | 232 | $header = parent::return_header($feedback_type, $counter, $score); |
| 233 | - $header .= '<table class="'.$this->question_table_class .'"> |
|
| 233 | + $header .= '<table class="'.$this->question_table_class.'"> |
|
| 234 | 234 | <tr> |
| 235 | - <th>' . get_lang("Choice") . '</th>
|
|
| 236 | - <th>' . get_lang("ExpectedChoice") . '</th>
|
|
| 237 | - <th>' . get_lang("Answer") . '</th>';
|
|
| 238 | - $header .= '<th>' . get_lang("Comment") . '</th>';
|
|
| 235 | + <th>' . get_lang("Choice").'</th>
|
|
| 236 | + <th>' . get_lang("ExpectedChoice").'</th>
|
|
| 237 | + <th>' . get_lang("Answer").'</th>';
|
|
| 238 | + $header .= '<th>'.get_lang("Comment").'</th>';
|
|
| 239 | 239 | $header .= '</tr>'; |
| 240 | 240 | |
| 241 | 241 | return $header; |