@@ -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; |
@@ -98,10 +98,10 @@ |
||
98 | 98 | }*/ |
99 | 99 | } |
100 | 100 | |
101 | - // This is a good answer, count + 1 for nmbr of clicks |
|
102 | - if ($answers['weighting'][$i] > 0) { |
|
103 | - $nmbrTries++; |
|
104 | - } |
|
101 | + // This is a good answer, count + 1 for nmbr of clicks |
|
102 | + if ($answers['weighting'][$i] > 0) { |
|
103 | + $nmbrTries++; |
|
104 | + } |
|
105 | 105 | |
106 | 106 | $hotSpot['coord'] = $answers['hotspot_coordinates'][$i]; |
107 | 107 | $data['hotspots'][] = $hotSpot; |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | api_protect_course_script(false); |
12 | 12 | |
13 | -$isAllowedToEdit = api_is_allowed_to_edit(null,true); |
|
13 | +$isAllowedToEdit = api_is_allowed_to_edit(null, true); |
|
14 | 14 | |
15 | 15 | if (!$isAllowedToEdit) { |
16 | 16 | api_not_allowed(true); |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | $objQuestion = Question::read($questionId); |
23 | 23 | $_course = api_get_course_info(); |
24 | 24 | |
25 | -$documentPath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document'; |
|
25 | +$documentPath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document'; |
|
26 | 26 | |
27 | 27 | $picturePath = $documentPath.'/images'; |
28 | 28 | $pictureName = $objQuestion->selectPicture(); |
@@ -65,13 +65,13 @@ discard block |
||
65 | 65 | $answers = $_SESSION['tmp_answers']; |
66 | 66 | $nbrAnswers = count($answers['answer']); |
67 | 67 | |
68 | -for ($i=1;$i <= $nbrAnswers; $i++) { |
|
68 | +for ($i = 1; $i <= $nbrAnswers; $i++) { |
|
69 | 69 | $hotSpot = []; |
70 | 70 | $hotSpot['id'] = null; |
71 | - $hotSpot['answer']= $answers['answer'][$i]; |
|
71 | + $hotSpot['answer'] = $answers['answer'][$i]; |
|
72 | 72 | |
73 | 73 | if ($answer_type == HOT_SPOT_DELINEATION) { |
74 | - if ($i==1) { |
|
74 | + if ($i == 1) { |
|
75 | 75 | $hotSpot['type'] = 'delineation'; |
76 | 76 | } else { |
77 | 77 | $hotSpot['type'] = 'oar'; |
@@ -16,7 +16,6 @@ |
||
16 | 16 | * @author Patrick Cool |
17 | 17 | * @author René Haentjens, added CSV file import (October 2004) |
18 | 18 | * @package chamilo.link |
19 | - |
|
20 | 19 | */ |
21 | 20 | |
22 | 21 | // Including libraries |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | .sortable({ |
137 | 137 | cursor: "move", // works? |
138 | 138 | update: function(event, ui) { |
139 | - var order = $(this).sortable("serialize") + "&a=update_question_order&exercise_id=<?php echo intval($_GET['exerciseId']);?>"; |
|
139 | + var order = $(this).sortable("serialize") + "&a=update_question_order&exercise_id=<?php echo intval($_GET['exerciseId']); ?>"; |
|
140 | 140 | $.post("<?php echo $ajax_url ?>", order, function(reponse){ |
141 | 141 | $("#message").html(reponse); |
142 | 142 | }); |
@@ -172,12 +172,12 @@ discard block |
||
172 | 172 | echo "<div class='table-responsive'>"; |
173 | 173 | echo "<table class='table table-condensed'>"; |
174 | 174 | echo "<tr>"; |
175 | - echo "<th style=\"width: 40%;\">" .get_lang('Questions'). "</th>"; |
|
176 | - echo "<th style=\"width: 10%;\">" .get_lang('Type'). "</th>"; |
|
177 | - echo "<th style=\"width: 20%;\">" .get_lang('Category'). "</th>"; |
|
178 | - echo "<th style=\"width: 10%;\">" .get_lang('Difficulty'). "</th>"; |
|
179 | - echo "<th style=\"width: 10%;\">" .get_lang('Score'). "</th>"; |
|
180 | - echo "<th style=\"width: 10%;\">" .get_lang('Actions'). "</th>"; |
|
175 | + echo "<th style=\"width: 40%;\">".get_lang('Questions')."</th>"; |
|
176 | + echo "<th style=\"width: 10%;\">".get_lang('Type')."</th>"; |
|
177 | + echo "<th style=\"width: 20%;\">".get_lang('Category')."</th>"; |
|
178 | + echo "<th style=\"width: 10%;\">".get_lang('Difficulty')."</th>"; |
|
179 | + echo "<th style=\"width: 10%;\">".get_lang('Score')."</th>"; |
|
180 | + echo "<th style=\"width: 10%;\">".get_lang('Actions')."</th>"; |
|
181 | 181 | echo "</tr>"; |
182 | 182 | echo "</table>"; |
183 | 183 | echo "</div>"; |
@@ -217,15 +217,14 @@ discard block |
||
217 | 217 | $question_class = get_class($objQuestionTmp); |
218 | 218 | |
219 | 219 | $clone_link = '<a href="'.api_get_self().'?'.api_get_cidreq().'&clone_question='.$id.'">'. |
220 | - Display::return_icon('cd.png',get_lang('Copy'), array(), ICON_SIZE_SMALL).'</a>'; |
|
220 | + Display::return_icon('cd.png', get_lang('Copy'), array(), ICON_SIZE_SMALL).'</a>'; |
|
221 | 221 | $edit_link = ($objQuestionTmp->type == CALCULATED_ANSWER && $objQuestionTmp->isAnswered()) ? |
222 | 222 | '<a>'.Display::return_icon( |
223 | 223 | 'edit_na.png', |
224 | 224 | get_lang('QuestionEditionNotAvailableBecauseItIsAlreadyAnsweredHoweverYouCanCopyItAndModifyTheCopy'), |
225 | 225 | array(), |
226 | 226 | ICON_SIZE_SMALL |
227 | - ).'</a>' : |
|
228 | - '<a href="'.api_get_self().'?'.api_get_cidreq().'&type='. |
|
227 | + ).'</a>' : '<a href="'.api_get_self().'?'.api_get_cidreq().'&type='. |
|
229 | 228 | $objQuestionTmp->selectType().'&myid=1&editQuestion='.$id.'">'. |
230 | 229 | Display::return_icon( |
231 | 230 | 'edit.png', |
@@ -235,17 +234,17 @@ discard block |
||
235 | 234 | ).'</a>'; |
236 | 235 | $delete_link = null; |
237 | 236 | if ($objExercise->edit_exercise_in_lp == true) { |
238 | - $delete_link = '<a id="delete_'.$id.'" class="opener" href="'.api_get_self().'?'.api_get_cidreq().'&exerciseId='.$exerciseId.'&deleteQuestion='.$id.'" >'.Display::return_icon('delete.png',get_lang('RemoveFromTest'), array(), ICON_SIZE_SMALL).'</a>'; |
|
237 | + $delete_link = '<a id="delete_'.$id.'" class="opener" href="'.api_get_self().'?'.api_get_cidreq().'&exerciseId='.$exerciseId.'&deleteQuestion='.$id.'" >'.Display::return_icon('delete.png', get_lang('RemoveFromTest'), array(), ICON_SIZE_SMALL).'</a>'; |
|
239 | 238 | } |
240 | 239 | |
241 | - $edit_link = Display::tag('span', $edit_link, array('class'=>'items')); |
|
242 | - $clone_link = Display::tag('span', $clone_link, array('class'=>'items')); |
|
240 | + $edit_link = Display::tag('span', $edit_link, array('class'=>'items')); |
|
241 | + $clone_link = Display::tag('span', $clone_link, array('class'=>'items')); |
|
243 | 242 | $delete_link = Display::tag('span', $delete_link, array('class'=>'items')); |
244 | - $btnActions = Display::tag('td',Display::tag( |
|
243 | + $btnActions = Display::tag('td', Display::tag( |
|
245 | 244 | 'div', |
246 | 245 | $edit_link.$clone_link.$delete_link, |
247 | 246 | array('class'=>'edition') |
248 | - ), array ('class'=>'btn-actions')); |
|
247 | + ), array('class'=>'btn-actions')); |
|
249 | 248 | |
250 | 249 | $title = Security::remove_XSS($objQuestionTmp->selectTitle()); |
251 | 250 | /* $move = Display::return_icon( |
@@ -285,7 +284,7 @@ discard block |
||
285 | 284 | $questionScore = Display::tag('td', $objQuestionTmp->selectWeighting(), array('class'=>$styleScore)); |
286 | 285 | |
287 | 286 | echo '<div id="question_id_list_'.$id.'" >'; |
288 | - echo '<div class="header_operations" data-exercise="' . $objExercise->selectId() . '" data-question="' . $id . '">'; |
|
287 | + echo '<div class="header_operations" data-exercise="'.$objExercise->selectId().'" data-question="'.$id.'">'; |
|
289 | 288 | echo "<div class='table-responsive'>"; |
290 | 289 | echo "<table class='table'>"; |
291 | 290 | echo "<tr>"; |
@@ -7,7 +7,7 @@ |
||
7 | 7 | get_lang('MultiplicationStar')."\n". |
8 | 8 | get_lang('DivisionSlash')."\n". |
9 | 9 | get_lang('ExponentiationCircumflex')."\n". |
10 | -get_lang('ModuloPercentage') . "\n" . |
|
10 | +get_lang('ModuloPercentage')."\n". |
|
11 | 11 | "\n". |
12 | 12 | get_lang('SquareRootSqrt')."\n". |
13 | 13 | get_lang('AbsoluteValueAbs')."\n". |
@@ -133,8 +133,8 @@ discard block |
||
133 | 133 | ), |
134 | 134 | array('ToolbarSet' => 'TestQuestionDescription', 'Width' => '100%', 'Height' => '350')); |
135 | 135 | |
136 | - $form->addRule('answer', get_lang('GiveText'),'required'); |
|
137 | - $form->addRule('answer', get_lang('DefineBlanks'),'regex','/\[.*\]/'); |
|
136 | + $form->addRule('answer', get_lang('GiveText'), 'required'); |
|
137 | + $form->addRule('answer', get_lang('DefineBlanks'), 'regex', '/\[.*\]/'); |
|
138 | 138 | |
139 | 139 | $form->addElement('label', null, get_lang('IfYouWantOnlyIntegerValuesWriteBothLimitsWithoutDecimals')); |
140 | 140 | $form->addElement('html', '<div id="blanks_weighting"></div>'); |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | $form->setDefaults(array('weighting' => '10')); |
162 | 162 | |
163 | 163 | $form->addElement('text', 'answerVariations', get_lang('AnswerVariations')); |
164 | - $form->addRule('answerVariations', get_lang('GiveAnswerVariations'),'required'); |
|
164 | + $form->addRule('answerVariations', get_lang('GiveAnswerVariations'), 'required'); |
|
165 | 165 | $form->setDefaults(array('answerVariations' => '1')); |
166 | 166 | |
167 | 167 | global $text; |
@@ -201,22 +201,21 @@ discard block |
||
201 | 201 | $answerVariations = $form->getSubmitValue('answerVariations'); |
202 | 202 | $this->weighting = $form->getSubmitValue('weighting'); |
203 | 203 | // Create as many answers as $answerVariations |
204 | - for ($j=0 ; $j < $answerVariations; $j++) { |
|
204 | + for ($j = 0; $j < $answerVariations; $j++) { |
|
205 | 205 | $auxAnswer = $answer; |
206 | 206 | $auxFormula = $formula; |
207 | 207 | $nb = preg_match_all('/\[[^\]]*\]/', $auxAnswer, $blanks); |
208 | 208 | if ($nb > 0) { |
209 | - for ($i=0 ; $i < $nb; ++$i) { |
|
209 | + for ($i = 0; $i < $nb; ++$i) { |
|
210 | 210 | $blankItem = $blanks[0][$i]; |
211 | 211 | $replace = array("[", "]"); |
212 | 212 | $newBlankItem = str_replace($replace, "", $blankItem); |
213 | 213 | $newBlankItem = "[".trim($newBlankItem)."]"; |
214 | 214 | // take random float values when one or both edge values have a decimal point |
215 | 215 | $randomValue = |
216 | - (strpos($lowestValues[$i],'.') !== false || |
|
217 | - strpos($highestValues[$i],'.') !== false) ? |
|
218 | - mt_rand($lowestValues[$i]*100,$highestValues[$i]*100)/100 : |
|
219 | - mt_rand($lowestValues[$i],$highestValues[$i]); |
|
216 | + (strpos($lowestValues[$i], '.') !== false || |
|
217 | + strpos($highestValues[$i], '.') !== false) ? |
|
218 | + mt_rand($lowestValues[$i] * 100, $highestValues[$i] * 100) / 100 : mt_rand($lowestValues[$i], $highestValues[$i]); |
|
220 | 219 | $auxAnswer = str_replace($blankItem, $randomValue, $auxAnswer); |
221 | 220 | $auxFormula = str_replace($blankItem, $randomValue, $auxFormula); |
222 | 221 | } |
@@ -250,7 +249,7 @@ discard block |
||
250 | 249 | function return_header($feedback_type = null, $counter = null, $score = null) |
251 | 250 | { |
252 | 251 | $header = parent::return_header($feedback_type, $counter, $score); |
253 | - $header .= '<table class="'.$this->question_table_class .'"> |
|
252 | + $header .= '<table class="'.$this->question_table_class.'"> |
|
254 | 253 | <tr> |
255 | 254 | <th>'.get_lang("Answer").'</th> |
256 | 255 | </tr>'; |
@@ -18,10 +18,10 @@ |
||
18 | 18 | $file = file(api_get_path(SYS_LANG_PATH).'english/hotspot.inc.php'); |
19 | 19 | |
20 | 20 | foreach ($file as &$value) { |
21 | - $variable = explode('=', $value , 2); |
|
22 | - if (count($variable) > 1) { |
|
23 | - $variable = substr(trim($variable[0]), 1); |
|
24 | - $variable = '&'.$variable.'='.api_utf8_encode(get_lang($variable)).' '; |
|
25 | - echo $variable; |
|
26 | - } |
|
21 | + $variable = explode('=', $value , 2); |
|
22 | + if (count($variable) > 1) { |
|
23 | + $variable = substr(trim($variable[0]), 1); |
|
24 | + $variable = '&'.$variable.'='.api_utf8_encode(get_lang($variable)).' '; |
|
25 | + echo $variable; |
|
26 | + } |
|
27 | 27 | } |
@@ -18,7 +18,7 @@ |
||
18 | 18 | $file = file(api_get_path(SYS_LANG_PATH).'english/hotspot.inc.php'); |
19 | 19 | |
20 | 20 | foreach ($file as &$value) { |
21 | - $variable = explode('=', $value , 2); |
|
21 | + $variable = explode('=', $value, 2); |
|
22 | 22 | if (count($variable) > 1) { |
23 | 23 | $variable = substr(trim($variable[0]), 1); |
24 | 24 | $variable = '&'.$variable.'='.api_utf8_encode(get_lang($variable)).' '; |
@@ -249,7 +249,7 @@ |
||
249 | 249 | break; |
250 | 250 | case RESULT_DISABLE_SHOW_SCORE_ONLY: |
251 | 251 | if ($objExercise->feedback_type != EXERCISE_FEEDBACK_TYPE_END) { |
252 | - $header_names = array(get_lang('Attempt'), get_lang('StartDate'), get_lang('IP'), get_lang('Score')); |
|
252 | + $header_names = array(get_lang('Attempt'), get_lang('StartDate'), get_lang('IP'), get_lang('Score')); |
|
253 | 253 | } |
254 | 254 | else { |
255 | 255 | $header_names = array(get_lang('Attempt'), get_lang('StartDate'), get_lang('IP'), get_lang('Score'), get_lang('Details')); |
@@ -250,8 +250,7 @@ |
||
250 | 250 | case RESULT_DISABLE_SHOW_SCORE_ONLY: |
251 | 251 | if ($objExercise->feedback_type != EXERCISE_FEEDBACK_TYPE_END) { |
252 | 252 | $header_names = array(get_lang('Attempt'), get_lang('StartDate'), get_lang('IP'), get_lang('Score')); |
253 | - } |
|
254 | - else { |
|
253 | + } else { |
|
255 | 254 | $header_names = array(get_lang('Attempt'), get_lang('StartDate'), get_lang('IP'), get_lang('Score'), get_lang('Details')); |
256 | 255 | } |
257 | 256 | break; |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | |
13 | 13 | require_once '../inc/global.inc.php'; |
14 | 14 | |
15 | -$current_course_tool = TOOL_QUIZ; |
|
15 | +$current_course_tool = TOOL_QUIZ; |
|
16 | 16 | |
17 | 17 | // Clear the exercise session just in case |
18 | 18 | Session::erase('objExercise'); |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | |
71 | 71 | $html = ''; |
72 | 72 | $message = ''; |
73 | -$html.= '<div class="exercise">'; |
|
73 | +$html .= '<div class="exercise">'; |
|
74 | 74 | $is_allowed_to_edit = api_is_allowed_to_edit(null, true); |
75 | 75 | $edit_link = ''; |
76 | 76 | if ($is_allowed_to_edit && $objExercise->sessionId == $sessionId) { |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | |
117 | 117 | // 2. Exercise button |
118 | 118 | // Notice we not add there the lp_item_view_id because is not already generated |
119 | -$exercise_url = api_get_path(WEB_CODE_PATH) . 'exercise/exercise_submit.php?'.api_get_cidreq().'&exerciseId='.$objExercise->id.'&origin='.$origin.'&learnpath_id='.$learnpath_id.'&learnpath_item_id='.$learnpath_item_id.'&learnpath_item_view_id='.$learnpathItemViewId.$extra_params; |
|
119 | +$exercise_url = api_get_path(WEB_CODE_PATH).'exercise/exercise_submit.php?'.api_get_cidreq().'&exerciseId='.$objExercise->id.'&origin='.$origin.'&learnpath_id='.$learnpath_id.'&learnpath_item_id='.$learnpath_item_id.'&learnpath_item_view_id='.$learnpathItemViewId.$extra_params; |
|
120 | 120 | $exercise_url_button = Display::url( |
121 | 121 | $label, |
122 | 122 | $exercise_url, |
@@ -181,8 +181,8 @@ discard block |
||
181 | 181 | $attempt_result['exe_result'], |
182 | 182 | $attempt_result['exe_weighting'] |
183 | 183 | ); |
184 | - $attempt_url = api_get_path(WEB_CODE_PATH) . 'exercise/result.php?'; |
|
185 | - $attempt_url .= api_get_cidreq() . '&show_headers=1&'; |
|
184 | + $attempt_url = api_get_path(WEB_CODE_PATH).'exercise/result.php?'; |
|
185 | + $attempt_url .= api_get_cidreq().'&show_headers=1&'; |
|
186 | 186 | $attempt_url .= http_build_query([ |
187 | 187 | 'id' => $attempt_result['exe_id'] |
188 | 188 | ]); |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | get_lang('Show'), |
193 | 193 | $attempt_url, |
194 | 194 | [ |
195 | - 'class' => $btn_class . 'btn btn-default', |
|
195 | + 'class' => $btn_class.'btn btn-default', |
|
196 | 196 | 'data-title' => get_lang('Show'), |
197 | 197 | 'data-size' => 'lg' |
198 | 198 | ] |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | ), |
211 | 211 | 'userIp' => $attempt_result['user_ip'] |
212 | 212 | ); |
213 | - $attempt_link .= " " . $teacher_revised; |
|
213 | + $attempt_link .= " ".$teacher_revised; |
|
214 | 214 | |
215 | 215 | if (in_array( |
216 | 216 | $objExercise->results_disabled, |
@@ -306,7 +306,7 @@ discard block |
||
306 | 306 | } |
307 | 307 | |
308 | 308 | if ($time_control) { |
309 | - $html.= $objExercise->return_time_left_div(); |
|
309 | + $html .= $objExercise->return_time_left_div(); |
|
310 | 310 | } |
311 | 311 | |
312 | 312 | $html .= $message; |
@@ -326,7 +326,7 @@ discard block |
||
326 | 326 | $table_content, |
327 | 327 | ['class' => 'table-responsive'] |
328 | 328 | ); |
329 | -$html.= '</div>'; |
|
329 | +$html .= '</div>'; |
|
330 | 330 | echo $html; |
331 | 331 | |
332 | 332 | Display::display_footer(); |
@@ -72,12 +72,12 @@ discard block |
||
72 | 72 | for ($i = 1; $i <= $answer->nbrAnswers; $i++) { |
73 | 73 | if ($answer->isCorrect($i)) { |
74 | 74 | $nb_matches++; |
75 | - $defaults['answer[' . $nb_matches . ']'] = $answer->selectAnswer($i); |
|
76 | - $defaults['weighting[' . $nb_matches . ']'] = float_format($answer->selectWeighting($i), 1); |
|
77 | - $defaults['matches[' . $nb_matches . ']'] = $answer->correct[$i]; |
|
75 | + $defaults['answer['.$nb_matches.']'] = $answer->selectAnswer($i); |
|
76 | + $defaults['weighting['.$nb_matches.']'] = float_format($answer->selectWeighting($i), 1); |
|
77 | + $defaults['matches['.$nb_matches.']'] = $answer->correct[$i]; |
|
78 | 78 | } else { |
79 | 79 | $nb_options++; |
80 | - $defaults['option[' . $nb_options . ']'] = $answer->selectAnswer($i); |
|
80 | + $defaults['option['.$nb_options.']'] = $answer->selectAnswer($i); |
|
81 | 81 | } |
82 | 82 | } |
83 | 83 | } |
@@ -108,10 +108,10 @@ discard block |
||
108 | 108 | $html = '<table class="table table-striped table-hover"> |
109 | 109 | <thead> |
110 | 110 | <tr> |
111 | - <th width="5%">' . get_lang('Number') . '</th> |
|
112 | - <th width="70%">' . get_lang('Answer') . '</th> |
|
113 | - <th width="15%">' . get_lang('MatchesTo') . '</th> |
|
114 | - <th width="10%">' . get_lang('Weighting') . '</th> |
|
111 | + <th width="5%">' . get_lang('Number').'</th> |
|
112 | + <th width="70%">' . get_lang('Answer').'</th> |
|
113 | + <th width="15%">' . get_lang('MatchesTo').'</th> |
|
114 | + <th width="10%">' . get_lang('Weighting').'</th> |
|
115 | 115 | </tr> |
116 | 116 | </thead> |
117 | 117 | <tbody>'; |
@@ -162,8 +162,8 @@ discard block |
||
162 | 162 | $html = '<table class="table table-striped table-hover"> |
163 | 163 | <thead> |
164 | 164 | <tr> |
165 | - <th width="15%">' . get_lang('Number') . '</th> |
|
166 | - <th width="85%">' . get_lang('Answer') . '</th> |
|
165 | + <th width="15%">' . get_lang('Number').'</th> |
|
166 | + <th width="85%">' . get_lang('Answer').'</th> |
|
167 | 167 | </tr> |
168 | 168 | </thead> |
169 | 169 | <tbody>'; |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | |
186 | 186 | $form->addHtml('<tr>'); |
187 | 187 | |
188 | - $form->addHtml('<td>' . chr(64 + $i) . '</td>'); |
|
188 | + $form->addHtml('<td>'.chr(64 + $i).'</td>'); |
|
189 | 189 | $form->addText("option[$i]", null); |
190 | 190 | |
191 | 191 | $form->addHtml('</tr>'); |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | public function return_header($feedback_type = null, $counter = null, $score = null) |
268 | 268 | { |
269 | 269 | $header = parent::return_header($feedback_type, $counter, $score); |
270 | - $header .= '<table class="'.$this->question_table_class .'">'; |
|
270 | + $header .= '<table class="'.$this->question_table_class.'">'; |
|
271 | 271 | $header .= '<tr> |
272 | 272 | <th>'.get_lang('ElementList').'</th> |
273 | 273 | <th>'.get_lang('CorrespondsTo').'</th> |
@@ -223,10 +223,10 @@ |
||
223 | 223 | |
224 | 224 | $counter++; |
225 | 225 | if ($objExercise->type == ONE_PER_PAGE) { |
226 | - $question_title = Display::url($counter.'. '.cut($objQuestionTmp->selectTitle(), 40), $url); |
|
227 | - $question_title = $counter.'. '.cut($objQuestionTmp->selectTitle(), 40); |
|
226 | + $question_title = Display::url($counter.'. '.cut($objQuestionTmp->selectTitle(), 40), $url); |
|
227 | + $question_title = $counter.'. '.cut($objQuestionTmp->selectTitle(), 40); |
|
228 | 228 | } else { |
229 | - $question_title = $counter.'. '.cut($objQuestionTmp->selectTitle(), 40); |
|
229 | + $question_title = $counter.'. '.cut($objQuestionTmp->selectTitle(), 40); |
|
230 | 230 | } |
231 | 231 | //Check if the question doesn't have an answer |
232 | 232 | if (!in_array($questionId, $exercise_result)) { |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | // notice for unauthorized people. |
18 | 18 | api_protect_course_script(true); |
19 | 19 | |
20 | -if ($debug>0) { |
|
20 | +if ($debug > 0) { |
|
21 | 21 | error_log('Entered exercise_result.php: '.print_r($_POST, 1)); |
22 | 22 | } |
23 | 23 | |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | if (isset($_SESSION['exe_id'])) { |
98 | 98 | $exe_id = intval($_SESSION['exe_id']); |
99 | 99 | } |
100 | -$exercise_stat_info = $objExercise->get_stat_track_exercise_info_by_exe_id($exe_id); |
|
100 | +$exercise_stat_info = $objExercise->get_stat_track_exercise_info_by_exe_id($exe_id); |
|
101 | 101 | if (!empty($exercise_stat_info['data_tracking'])) { |
102 | 102 | $question_list = explode(',', $exercise_stat_info['data_tracking']); |
103 | 103 | } |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | Display::url( |
250 | 250 | get_lang('ReviewQuestions'), |
251 | 251 | 'javascript://', |
252 | - array('onclick'=>'review_questions();','class'=>'btn btn-success') |
|
252 | + array('onclick'=>'review_questions();', 'class'=>'btn btn-success') |
|
253 | 253 | ); |
254 | 254 | |
255 | 255 | echo Display::div('', array('class'=>'clear')); |