@@ -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; |
@@ -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 |
@@ -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 | } |
@@ -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')); |
@@ -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)) { |
@@ -344,7 +344,7 @@ |
||
344 | 344 | if (is_dir($full_name)) { |
345 | 345 | $filelist[] = $file; |
346 | 346 | } |
347 | - } |
|
347 | + } |
|
348 | 348 | } |
349 | 349 | } |
350 | 350 | } |
@@ -241,13 +241,13 @@ discard block |
||
241 | 241 | } |
242 | 242 | |
243 | 243 | /** |
244 | - * abstract function which creates the form to create / edit the answers of the question |
|
245 | - * @param FormValidator $form |
|
246 | - */ |
|
244 | + * abstract function which creates the form to create / edit the answers of the question |
|
245 | + * @param FormValidator $form |
|
246 | + */ |
|
247 | 247 | public function processAnswersCreation($form) |
248 | 248 | { |
249 | - $questionWeighting = $nbrGoodAnswers = 0; |
|
250 | - $objAnswer = new Answer($this->id); |
|
249 | + $questionWeighting = $nbrGoodAnswers = 0; |
|
250 | + $objAnswer = new Answer($this->id); |
|
251 | 251 | $nb_answers = $form->getSubmitValue('nb_answers'); |
252 | 252 | //$options_count = $form->getSubmitValue('options_count'); |
253 | 253 | $course_id = api_get_course_int_id(); |
@@ -269,7 +269,7 @@ discard block |
||
269 | 269 | $course_id, |
270 | 270 | $i |
271 | 271 | ); |
272 | - $correct[$i] = $last_id; |
|
272 | + $correct[$i] = $last_id; |
|
273 | 273 | } |
274 | 274 | } |
275 | 275 | |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | |
281 | 281 | $sorted_by_position = array(); |
282 | 282 | foreach ($new_options as $item) { |
283 | - $sorted_by_position[$item['position']] = $item; |
|
283 | + $sorted_by_position[$item['position']] = $item; |
|
284 | 284 | } |
285 | 285 | |
286 | 286 | /* Saving quiz_question.extra values that has the correct scores of |
@@ -293,7 +293,7 @@ discard block |
||
293 | 293 | } |
294 | 294 | $this->setExtra(implode(':', $extra_values)); |
295 | 295 | |
296 | - for ($i = 1; $i <= $nb_answers; $i++) { |
|
296 | + for ($i = 1; $i <= $nb_answers; $i++) { |
|
297 | 297 | $answer = trim($form->getSubmitValue('answer['.$i.']')); |
298 | 298 | $comment = trim($form->getSubmitValue('comment['.$i.']')); |
299 | 299 | $goodAnswer = trim($form->getSubmitValue('correct['.$i.']')); |
@@ -302,18 +302,18 @@ discard block |
||
302 | 302 | // change the default values from the form 1 and 2 by the correct "option id" registered |
303 | 303 | $goodAnswer = $sorted_by_position[$goodAnswer]['id']; |
304 | 304 | } |
305 | - $questionWeighting += $extra_values[0]; //By default 0 has the correct answers |
|
305 | + $questionWeighting += $extra_values[0]; //By default 0 has the correct answers |
|
306 | 306 | |
307 | - $objAnswer->createAnswer($answer, $goodAnswer, $comment,'',$i); |
|
307 | + $objAnswer->createAnswer($answer, $goodAnswer, $comment,'',$i); |
|
308 | 308 | } |
309 | 309 | |
310 | - // saves the answers into the data base |
|
310 | + // saves the answers into the data base |
|
311 | 311 | $objAnswer->save(); |
312 | 312 | |
313 | 313 | // sets the total weighting of the question |
314 | 314 | $this->updateWeighting($questionWeighting); |
315 | 315 | $this->save(); |
316 | - } |
|
316 | + } |
|
317 | 317 | |
318 | 318 | /** |
319 | 319 | * @param int $feedback_type |
@@ -324,17 +324,17 @@ discard block |
||
324 | 324 | function return_header($feedback_type = null, $counter = null, $score = null) |
325 | 325 | { |
326 | 326 | $header = parent::return_header($feedback_type, $counter, $score); |
327 | - $header .= '<table class="'.$this->question_table_class .'"> |
|
327 | + $header .= '<table class="'.$this->question_table_class .'"> |
|
328 | 328 | <tr> |
329 | 329 | <th>'.get_lang("Choice").'</th> |
330 | 330 | <th>'. get_lang("ExpectedChoice").'</th> |
331 | 331 | <th>'. get_lang("Answer").'</th>'; |
332 | - if ($feedback_type != EXERCISE_FEEDBACK_TYPE_EXAM) { |
|
333 | - $header .= '<th>'.get_lang("Comment").'</th>'; |
|
334 | - } else { |
|
335 | - $header .= '<th> </th>'; |
|
336 | - } |
|
332 | + if ($feedback_type != EXERCISE_FEEDBACK_TYPE_EXAM) { |
|
333 | + $header .= '<th>'.get_lang("Comment").'</th>'; |
|
334 | + } else { |
|
335 | + $header .= '<th> </th>'; |
|
336 | + } |
|
337 | 337 | $header .= '</tr>'; |
338 | 338 | return $header; |
339 | - } |
|
339 | + } |
|
340 | 340 | } |
@@ -15,24 +15,24 @@ |
||
15 | 15 | $answerId = intval($_GET['answerId']); |
16 | 16 | |
17 | 17 | if ($_GET['type'] == "square" || $_GET['type'] == "circle") { |
18 | - $hotspot_type = $_GET['type']; |
|
19 | - $hotspot_coordinates = $_GET['x'].";".$_GET['y']."|".$_GET['width']."|".$_GET['height']; |
|
18 | + $hotspot_type = $_GET['type']; |
|
19 | + $hotspot_coordinates = $_GET['x'].";".$_GET['y']."|".$_GET['width']."|".$_GET['height']; |
|
20 | 20 | } |
21 | 21 | if ($_GET['type'] == "poly" || $_GET['type'] == "delineation" || $_GET['type'] == "oar") { |
22 | - $hotspot_type = $_GET['type']; |
|
23 | - $tmp_coord = explode(",",$_GET['co']); |
|
24 | - $i = 0; |
|
25 | - $hotspot_coordinates = ""; |
|
26 | - foreach ($tmp_coord as $coord) { |
|
27 | - if ($i%2 == 0) { |
|
28 | - $delimiter = ";"; |
|
29 | - } else { |
|
30 | - $delimiter = "|"; |
|
31 | - } |
|
32 | - $hotspot_coordinates .= $coord.$delimiter; |
|
33 | - $i++; |
|
34 | - } |
|
35 | - $hotspot_coordinates = api_substr($hotspot_coordinates,0,-2); |
|
22 | + $hotspot_type = $_GET['type']; |
|
23 | + $tmp_coord = explode(",",$_GET['co']); |
|
24 | + $i = 0; |
|
25 | + $hotspot_coordinates = ""; |
|
26 | + foreach ($tmp_coord as $coord) { |
|
27 | + if ($i%2 == 0) { |
|
28 | + $delimiter = ";"; |
|
29 | + } else { |
|
30 | + $delimiter = "|"; |
|
31 | + } |
|
32 | + $hotspot_coordinates .= $coord.$delimiter; |
|
33 | + $i++; |
|
34 | + } |
|
35 | + $hotspot_coordinates = api_substr($hotspot_coordinates,0,-2); |
|
36 | 36 | } |
37 | 37 | $course_id = api_get_course_int_id(); |
38 | 38 | $sql = "UPDATE $TBL_ANSWER SET |
@@ -907,10 +907,10 @@ |
||
907 | 907 | <?php } else { ?> |
908 | 908 | <input class="form-control" type="text" name="weighting[<?php echo $i; ?>]" value="<?php echo (isset($weighting[$i]) ? $weighting[$i] : 10); ?>" /> |
909 | 909 | <?php |
910 | - } |
|
911 | - } |
|
912 | - if ($answerType == HOT_SPOT) { |
|
913 | - ?> |
|
910 | + } |
|
911 | + } |
|
912 | + if ($answerType == HOT_SPOT) { |
|
913 | + ?> |
|
914 | 914 | <input class="form-control" type="text" name="weighting[<?php echo $i; ?>]" value="<?php echo (isset($weighting[$i]) ? $weighting[$i] : 10); ?>" /> |
915 | 915 | <input type="hidden" name="hotspot_coordinates[<?php echo $i; ?>]" value="<?php echo (empty($hotspot_coordinates[$i]) ? '0;0|0|0' : $hotspot_coordinates[$i]); ?>" /> |
916 | 916 | <input type="hidden" name="hotspot_type[<?php echo $i; ?>]" value="<?php echo (empty($hotspot_type[$i]) ? 'square' : $hotspot_type[$i]); ?>" /> |