@@ -17,7 +17,7 @@ |
||
17 | 17 | $result = $objExercise->read($exercise_id); |
18 | 18 | |
19 | 19 | if (!$result) { |
20 | - api_not_allowed(true); |
|
20 | + api_not_allowed(true); |
|
21 | 21 | } |
22 | 22 | |
23 | 23 | $interbreadcrumb[] = array( |
@@ -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; |
@@ -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 | } |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | * Searches for a node in the given array. |
262 | 262 | * @param array $array Reference to the array to search |
263 | 263 | * @param string $node Node we are looking for in the array |
264 | - * @return mixed Node name or false if not found |
|
264 | + * @return false|string Node name or false if not found |
|
265 | 265 | */ |
266 | 266 | function myarraysearch(&$array, $node) |
267 | 267 | { |
@@ -282,7 +282,7 @@ discard block |
||
282 | 282 | * Searches an image name into an array. |
283 | 283 | * @param array $imgparams Reference to an array to search |
284 | 284 | * @param string $string String to look for |
285 | - * @return mixed String given if found, false otherwise |
|
285 | + * @return false|string String given if found, false otherwise |
|
286 | 286 | * @uses myarraysearch This function is just an additional layer on the myarraysearch() function |
287 | 287 | */ |
288 | 288 | function CheckImageName(&$imgparams, $string) |
@@ -103,7 +103,7 @@ |
||
103 | 103 | $path = Database::escape_string($path); |
104 | 104 | $comment = Database::escape_string($comment); |
105 | 105 | $course_id = api_get_course_int_id(); |
106 | - $query = "UPDATE $dbTable SET comment = '$comment' |
|
106 | + $query = "update $dbTable SET comment = '$comment' |
|
107 | 107 | WHERE $course_id AND path = '$path'"; |
108 | 108 | $result = Database::query($query); |
109 | 109 |
@@ -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]); ?>" /> |
@@ -678,12 +678,15 @@ discard block |
||
678 | 678 | $option1 = $option2 = $option3 = ''; |
679 | 679 | for ($k = 1; $k <= 100; $k++) { |
680 | 680 | $selected1 = $selected2 = $selected3 = ''; |
681 | - if ($k == $threadhold1[$i]) |
|
682 | - $selected1 = 'selected="selected"'; |
|
683 | - if ($k == $threadhold2[$i]) |
|
684 | - $selected2 = 'selected="selected"'; |
|
685 | - if ($k == $threadhold3[$i]) |
|
686 | - $selected3 = 'selected="selected"'; |
|
681 | + if ($k == $threadhold1[$i]) { |
|
682 | + $selected1 = 'selected="selected"'; |
|
683 | + } |
|
684 | + if ($k == $threadhold2[$i]) { |
|
685 | + $selected2 = 'selected="selected"'; |
|
686 | + } |
|
687 | + if ($k == $threadhold3[$i]) { |
|
688 | + $selected3 = 'selected="selected"'; |
|
689 | + } |
|
687 | 690 | $option1 .= '<option '.$selected1.' >'.$k.' % </option>'; |
688 | 691 | $option2 .= '<option '.$selected2.' >'.$k.' % </option>'; |
689 | 692 | $option3 .= '<option '.$selected3.'>'.$k.' %</option>'; |
@@ -730,7 +733,10 @@ discard block |
||
730 | 733 | <div class="checkbox"> |
731 | 734 | <p> |
732 | 735 | <label> |
733 | - <input type="checkbox" class="checkbox" name="<?php echo 'try['.$i; ?>]" <?php if ($try[$i] == 1) echo'checked'; ?> /> |
|
736 | + <input type="checkbox" class="checkbox" name="<?php echo 'try['.$i; ?>]" <?php if ($try[$i] == 1) { |
|
737 | + echo'checked'; |
|
738 | +} |
|
739 | +?> /> |
|
734 | 740 | <?php echo get_lang('TryAgain'); ?> |
735 | 741 | </label> |
736 | 742 | </p> |
@@ -783,7 +789,10 @@ discard block |
||
783 | 789 | <div class="checkbox"> |
784 | 790 | <p> |
785 | 791 | <label> |
786 | - <input type="checkbox" class="checkbox" name="<?php echo 'try['.$i; ?>]" <?php if ($try[$i] == 1) echo'checked'; ?> /> |
|
792 | + <input type="checkbox" class="checkbox" name="<?php echo 'try['.$i; ?>]" <?php if ($try[$i] == 1) { |
|
793 | + echo'checked'; |
|
794 | +} |
|
795 | +?> /> |
|
787 | 796 | <?php echo get_lang('TryAgain'); ?> |
788 | 797 | </label> |
789 | 798 | </p> |
@@ -822,7 +831,10 @@ discard block |
||
822 | 831 | <th ><?php echo get_lang('OAR'); ?>*</th> |
823 | 832 | <?php if ($objExercise->selectFeedbackType() == EXERCISE_FEEDBACK_TYPE_DIRECT) { ?> |
824 | 833 | <th colspan="2" ><?php echo get_lang('Comment'); ?></th> |
825 | - <th ><?php if ($answerType == HOT_SPOT_DELINEATION) echo get_lang('Scenario'); ?></th> |
|
834 | + <th ><?php if ($answerType == HOT_SPOT_DELINEATION) { |
|
835 | + echo get_lang('Scenario'); |
|
836 | +} |
|
837 | +?></th> |
|
826 | 838 | <?php } else { ?> |
827 | 839 | <th colspan="3" ><?php echo get_lang('Comment'); ?></th> |
828 | 840 | <?php } ?> |
@@ -848,7 +860,10 @@ discard block |
||
848 | 860 | <div class="checkbox"> |
849 | 861 | <p> |
850 | 862 | <label> |
851 | - <input type="checkbox" class="checkbox" name="<?php echo 'try['.$i; ?>]" <?php if (isset($try[$i]) && $try[$i] == 1) echo'checked'; ?> /> |
|
863 | + <input type="checkbox" class="checkbox" name="<?php echo 'try['.$i; ?>]" <?php if (isset($try[$i]) && $try[$i] == 1) { |
|
864 | + echo'checked'; |
|
865 | +} |
|
866 | +?> /> |
|
852 | 867 | <?php echo get_lang('TryAgain'); ?> |
853 | 868 | </label> |
854 | 869 | </p> |
@@ -994,7 +1009,10 @@ discard block |
||
994 | 1009 | <div class="checkbox"> |
995 | 1010 | <p> |
996 | 1011 | <label> |
997 | - <input type="checkbox" class="checkbox" name="try_noerror" <?php if ($try_noerror == 1) echo'checked'; ?> /> |
|
1012 | + <input type="checkbox" class="checkbox" name="try_noerror" <?php if ($try_noerror == 1) { |
|
1013 | + echo'checked'; |
|
1014 | +} |
|
1015 | +?> /> |
|
998 | 1016 | <?php echo get_lang('TryAgain'); ?> |
999 | 1017 | </label> |
1000 | 1018 | </p> |
@@ -51,17 +51,17 @@ |
||
51 | 51 | $result = Database::query($sql); |
52 | 52 | $exercises['-'] = '-'.get_lang('SelectExercise').'-'; |
53 | 53 | while ($row = Database :: fetch_array($result)) { |
54 | - $exercises[$row['id']] = cut($row['title'], EXERCISE_MAX_NAME_SIZE); |
|
54 | + $exercises[$row['id']] = cut($row['title'], EXERCISE_MAX_NAME_SIZE); |
|
55 | 55 | } |
56 | 56 | $form->addElement('select', 'exercise', get_lang('Exercise'), $exercises); |
57 | 57 | |
58 | 58 | // generate default content |
59 | 59 | $form->addElement( |
60 | - 'checkbox', |
|
61 | - 'is_content', |
|
62 | - null, |
|
63 | - get_lang('GenerateDefaultContent'), |
|
64 | - array('checked' => true) |
|
60 | + 'checkbox', |
|
61 | + 'is_content', |
|
62 | + null, |
|
63 | + get_lang('GenerateDefaultContent'), |
|
64 | + array('checked' => true) |
|
65 | 65 | ); |
66 | 66 | |
67 | 67 | // the submit button |
@@ -108,7 +108,8 @@ |
||
108 | 108 | Display::display_footer(); |
109 | 109 | } |
110 | 110 | |
111 | -function check_question_type($parameter) { |
|
111 | +function check_question_type($parameter) |
|
112 | +{ |
|
112 | 113 | $question_list = Question::get_question_type_list(); |
113 | 114 | foreach ($question_list as $key => $value) { |
114 | 115 | $valid_question_types[] = $key; |
@@ -28,10 +28,10 @@ |
||
28 | 28 | $content = ReadFileCont($full_file_path.$user_id.'.t.html'); |
29 | 29 | |
30 | 30 | if ($content == '') { |
31 | - $content = ReadFileCont($full_file_path); |
|
31 | + $content = ReadFileCont($full_file_path); |
|
32 | 32 | // Do not move this like: |
33 | - $mit = "function Finish(){"; |
|
34 | - $js_content = " |
|
33 | + $mit = "function Finish(){"; |
|
34 | + $js_content = " |
|
35 | 35 | // Code added - start |
36 | 36 | var SaveScoreVariable = 0; |
37 | 37 | function mySaveScore() { |
@@ -85,7 +85,7 @@ |
||
85 | 85 | }; |
86 | 86 | }); |
87 | 87 | </script> |
88 | -HTML; |
|
88 | +html; |
|
89 | 89 | |
90 | 90 | $interbreadcrumb[] = array("url"=>"./exercise.php", "name"=> get_lang('Exercises')); |
91 | 91 | if ($origin == 'learnpath') { |
@@ -281,7 +281,7 @@ |
||
281 | 281 | $correct_answer_index = array_search($matches[1], $answers_array); |
282 | 282 | $exercise_info['question'][$question_index]['title'] = $matches[1]; |
283 | 283 | } elseif (preg_match('/^TAGS:\s?([A-Z])\s?/', $info, $matches)) { |
284 | - //TAGS for chamilo >= 1.10 |
|
284 | + //TAGS for chamilo >= 1.10 |
|
285 | 285 | $exercise_info['question'][$question_index]['answer_tags'] = explode(',', $matches[1]); |
286 | 286 | } elseif (preg_match('/^ETIQUETAS:\s?([A-Z])\s?/', $info, $matches)) { |
287 | 287 | //TAGS for chamilo >= 1.10 (Spanish e-ducativa format) |
@@ -20,9 +20,9 @@ |
||
20 | 20 | * @param int $user_id User ID |
21 | 21 | * @param int $view_id View ID |
22 | 22 | * @param int $item_id Item ID |
23 | - * @param float $score Current score |
|
24 | - * @param float $max Maximum score |
|
25 | - * @param float $min Minimum score |
|
23 | + * @param integer $score Current score |
|
24 | + * @param integer $max Maximum score |
|
25 | + * @param integer $min Minimum score |
|
26 | 26 | * @param string $status Lesson status |
27 | 27 | * @param int $time Session time |
28 | 28 | * @param string $suspend Suspend data |
@@ -458,7 +458,7 @@ |
||
458 | 458 | } |
459 | 459 | |
460 | 460 | if ($myLP->get_type() == 2) { |
461 | - $return .= "update_stats();"; |
|
461 | + $return .= "update_stats();"; |
|
462 | 462 | } |
463 | 463 | |
464 | 464 | // To be sure progress is updated. |
@@ -55,7 +55,8 @@ discard block |
||
55 | 55 | $lmsFinish = 0, |
56 | 56 | $userNavigatesAway = 0, |
57 | 57 | $statusSignalReceived = 0 |
58 | -) { |
|
58 | +) |
|
59 | +{ |
|
59 | 60 | //global $debug; |
60 | 61 | $debug = 0; |
61 | 62 | $return = null; |
@@ -477,7 +478,8 @@ discard block |
||
477 | 478 | if (is_array($_REQUEST['interact'])) { |
478 | 479 | foreach ($_REQUEST['interact'] as $idx => $interac) { |
479 | 480 | $interactions[$idx] = preg_split('/,/', substr($interac, 1, -1)); |
480 | - if (!isset($interactions[$idx][7])) { // Make sure there are 7 elements. |
|
481 | + if (!isset($interactions[$idx][7])) { |
|
482 | +// Make sure there are 7 elements. |
|
481 | 483 | $interactions[$idx][7] = ''; |
482 | 484 | } |
483 | 485 | } |
@@ -450,7 +450,7 @@ |
||
450 | 450 | $current_time = api_get_utc_datetime(); |
451 | 451 | $row = Database::fetch_array($q_last_connection); |
452 | 452 | $i_id_last_connection = $row['login_id']; |
453 | - $sql = "UPDATE $tbl_track_login |
|
453 | + $sql = "update $tbl_track_login |
|
454 | 454 | SET logout_date='".$current_time."' |
455 | 455 | WHERE login_id = $i_id_last_connection"; |
456 | 456 | Database::query($sql); |
@@ -458,8 +458,8 @@ |
||
458 | 458 | } else if(param == 'cmi.core.student_name'){ |
459 | 459 | // ---- cmi.core.student_name |
460 | 460 | <?php |
461 | - $who = addslashes($user['complete_name']); |
|
462 | - echo "result='$who';"; |
|
461 | + $who = addslashes($user['complete_name']); |
|
462 | + echo "result='$who';"; |
|
463 | 463 | ?> |
464 | 464 | } else if(param == 'cmi.core.lesson_location'){ |
465 | 465 | // ---- cmi.core.lesson_location |