@@ -362,9 +362,10 @@ |
||
362 | 362 | |
363 | 363 | if ($inATest) { |
364 | 364 | echo '<div class="actions">'; |
365 | - if (isset($_GET['hotspotadmin']) || isset($_GET['newQuestion']) || isset($_GET['myid'])) |
|
366 | - echo '<a href="'.api_get_path(WEB_CODE_PATH).'exercise/admin.php?exerciseId='.$exerciseId.'&'.api_get_cidreq().'">'. |
|
365 | + if (isset($_GET['hotspotadmin']) || isset($_GET['newQuestion']) || isset($_GET['myid'])) { |
|
366 | + echo '<a href="'.api_get_path(WEB_CODE_PATH).'exercise/admin.php?exerciseId='.$exerciseId.'&'.api_get_cidreq().'">'. |
|
367 | 367 | Display::return_icon('back.png', get_lang('GoBackToQuestionList'),'',ICON_SIZE_MEDIUM).'</a>'; |
368 | + } |
|
368 | 369 | |
369 | 370 | if (!isset($_GET['hotspotadmin']) && !isset($_GET['newQuestion']) && !isset($_GET['myid']) && !isset($_GET['editQuestion'])) { |
370 | 371 | echo '<a href="'.api_get_path(WEB_CODE_PATH).'exercise/exercise.php?'.api_get_cidreq().'">'. |
@@ -15,12 +15,13 @@ |
||
15 | 15 | $exerciseId = $objExcercise->selectId(); |
16 | 16 | // Save clicking order |
17 | 17 | $answerOrderId = count($_SESSION['exerciseResult'][$questionId]['ids'])+1; |
18 | -if ($_GET['answerId'] == "0") // click is NOT on a hotspot |
|
18 | +if ($_GET['answerId'] == "0") { |
|
19 | + // click is NOT on a hotspot |
|
19 | 20 | { |
20 | 21 | $hit = 0; |
21 | - $answerId = NULL; |
|
22 | 22 | } |
23 | -else // user clicked ON a hotspot |
|
23 | + $answerId = NULL; |
|
24 | +} else // user clicked ON a hotspot |
|
24 | 25 | { |
25 | 26 | $hit = 1; |
26 | 27 | $answerId = api_substr($_GET['answerId'],22,2); |
@@ -607,10 +607,11 @@ |
||
607 | 607 | $current_width = $current_image_size['width']; |
608 | 608 | $current_height = $current_image_size['height']; |
609 | 609 | |
610 | - if ($current_width < $Max && $current_height < $Max) |
|
611 | - return true; |
|
612 | - elseif ($current_height == "") |
|
613 | - return false; |
|
610 | + if ($current_width < $Max && $current_height < $Max) { |
|
611 | + return true; |
|
612 | + } elseif ($current_height == "") { |
|
613 | + return false; |
|
614 | + } |
|
614 | 615 | |
615 | 616 | // Resize according to height. |
616 | 617 | if ($Dimension == "height") { |
@@ -146,15 +146,17 @@ discard block |
||
146 | 146 | $list_dest = $item_list[2]; |
147 | 147 | $url = $item_list[3]; |
148 | 148 | |
149 | - if ($try == 0) |
|
150 | - $try_result = 0; |
|
151 | - else |
|
152 | - $try_result = 1; |
|
149 | + if ($try == 0) { |
|
150 | + $try_result = 0; |
|
151 | + } else { |
|
152 | + $try_result = 1; |
|
153 | + } |
|
153 | 154 | |
154 | - if ($url == 0) |
|
155 | - $url_result = ''; |
|
156 | - else |
|
157 | - $url_result = $url; |
|
155 | + if ($url == 0) { |
|
156 | + $url_result = ''; |
|
157 | + } else { |
|
158 | + $url_result = $url; |
|
159 | + } |
|
158 | 160 | |
159 | 161 | $temp_scenario['url' . $i] = $url_result; |
160 | 162 | $temp_scenario['try' . $i] = $try_result; |
@@ -343,8 +345,9 @@ discard block |
||
343 | 345 | } |
344 | 346 | } |
345 | 347 | |
346 | - if (empty($try)) |
|
347 | - $try=0; |
|
348 | + if (empty($try)) { |
|
349 | + $try=0; |
|
350 | + } |
|
348 | 351 | |
349 | 352 | if (empty($lp)) { |
350 | 353 | $lp=0; |
@@ -366,8 +366,9 @@ discard block |
||
366 | 366 | if ($answerType == HOT_SPOT_DELINEATION) { |
367 | 367 | // the magic happens here ... |
368 | 368 | // we do this to not count the if no error section |
369 | - if ($nbrAnswers >= 2) |
|
370 | - $nbrAnswers--; |
|
369 | + if ($nbrAnswers >= 2) { |
|
370 | + $nbrAnswers--; |
|
371 | + } |
|
371 | 372 | } |
372 | 373 | |
373 | 374 | $reponse = array(); |
@@ -679,12 +680,15 @@ discard block |
||
679 | 680 | |
680 | 681 | for ($k = 1; $k <= 100; $k++) { |
681 | 682 | $selected1 = $selected2 = $selected3 = ''; |
682 | - if ($k == $threadhold1[$i]) |
|
683 | - $selected1 = 'selected="selected"'; |
|
684 | - if ($k == $threadhold2[$i]) |
|
685 | - $selected2 = 'selected="selected"'; |
|
686 | - if ($k == $threadhold3[$i]) |
|
687 | - $selected3 = 'selected="selected"'; |
|
683 | + if ($k == $threadhold1[$i]) { |
|
684 | + $selected1 = 'selected="selected"'; |
|
685 | + } |
|
686 | + if ($k == $threadhold2[$i]) { |
|
687 | + $selected2 = 'selected="selected"'; |
|
688 | + } |
|
689 | + if ($k == $threadhold3[$i]) { |
|
690 | + $selected3 = 'selected="selected"'; |
|
691 | + } |
|
688 | 692 | $option1.='<option ' . $selected1 . ' >' . $k . ' % </option>'; |
689 | 693 | $option2.='<option ' . $selected2 . ' >' . $k . ' % </option>'; |
690 | 694 | $option3.='<option ' . $selected3 . '>' . $k . ' %</option>'; |
@@ -731,7 +735,10 @@ discard block |
||
731 | 735 | <div class="checkbox"> |
732 | 736 | <p> |
733 | 737 | <label> |
734 | - <input type="checkbox" class="checkbox" name="<?php echo 'try[' . $i; ?>]" <?php if ($try[$i] == 1) echo'checked'; ?> /> |
|
738 | + <input type="checkbox" class="checkbox" name="<?php echo 'try[' . $i; ?>]" <?php if ($try[$i] == 1) { |
|
739 | + echo'checked'; |
|
740 | +} |
|
741 | +?> /> |
|
735 | 742 | <?php echo get_lang('TryAgain'); ?> |
736 | 743 | </label> |
737 | 744 | </p> |
@@ -784,7 +791,10 @@ discard block |
||
784 | 791 | <div class="checkbox"> |
785 | 792 | <p> |
786 | 793 | <label> |
787 | - <input type="checkbox" class="checkbox" name="<?php echo 'try[' . $i; ?>]" <?php if ($try[$i] == 1) echo'checked'; ?> /> |
|
794 | + <input type="checkbox" class="checkbox" name="<?php echo 'try[' . $i; ?>]" <?php if ($try[$i] == 1) { |
|
795 | + echo'checked'; |
|
796 | +} |
|
797 | +?> /> |
|
788 | 798 | <?php echo get_lang('TryAgain'); ?> |
789 | 799 | </label> |
790 | 800 | </p> |
@@ -823,7 +833,10 @@ discard block |
||
823 | 833 | <th ><?php echo get_lang('OAR'); ?>*</th> |
824 | 834 | <?php if ($objExercise->selectFeedbackType() == EXERCISE_FEEDBACK_TYPE_DIRECT) { ?> |
825 | 835 | <th colspan="2" ><?php echo get_lang('Comment'); ?></th> |
826 | - <th ><?php if ($answerType == HOT_SPOT_DELINEATION) echo get_lang('Scenario'); ?></th> |
|
836 | + <th ><?php if ($answerType == HOT_SPOT_DELINEATION) { |
|
837 | + echo get_lang('Scenario'); |
|
838 | +} |
|
839 | +?></th> |
|
827 | 840 | <?php } else { ?> |
828 | 841 | <th colspan="3" ><?php echo get_lang('Comment'); ?></th> |
829 | 842 | <?php } ?> |
@@ -849,7 +862,10 @@ discard block |
||
849 | 862 | <div class="checkbox"> |
850 | 863 | <p> |
851 | 864 | <label> |
852 | - <input type="checkbox" class="checkbox" name="<?php echo 'try[' . $i; ?>]" <?php if (isset($try[$i]) && $try[$i] == 1) echo'checked'; ?> /> |
|
865 | + <input type="checkbox" class="checkbox" name="<?php echo 'try[' . $i; ?>]" <?php if (isset($try[$i]) && $try[$i] == 1) { |
|
866 | + echo'checked'; |
|
867 | +} |
|
868 | +?> /> |
|
853 | 869 | <?php echo get_lang('TryAgain'); ?> |
854 | 870 | </label> |
855 | 871 | </p> |
@@ -998,7 +1014,10 @@ discard block |
||
998 | 1014 | <div class="checkbox"> |
999 | 1015 | <p> |
1000 | 1016 | <label> |
1001 | - <input type="checkbox" class="checkbox" name="try_noerror" <?php if ($try_noerror == 1) echo'checked'; ?> /> |
|
1017 | + <input type="checkbox" class="checkbox" name="try_noerror" <?php if ($try_noerror == 1) { |
|
1018 | + echo'checked'; |
|
1019 | +} |
|
1020 | +?> /> |
|
1002 | 1021 | <?php echo get_lang('TryAgain'); ?> |
1003 | 1022 | </label> |
1004 | 1023 | </p> |
@@ -18,10 +18,11 @@ |
||
18 | 18 | $lang = urldecode($_GET['lang']); |
19 | 19 | if (preg_match('/^[a-zA-Z0-9\._-]+$/', $lang)) { |
20 | 20 | //$lang = str_replace($search,$replace,urldecode($_GET['lang'])); |
21 | - if(file_exists($hotspot_lang_file . $lang . '/hotspot.inc.php')) |
|
22 | - $hotspot_lang_file .= $lang . '/hotspot.inc.php'; |
|
23 | - else |
|
24 | - $hotspot_lang_file .= 'english/hotspot.inc.php'; |
|
21 | + if(file_exists($hotspot_lang_file . $lang . '/hotspot.inc.php')) { |
|
22 | + $hotspot_lang_file .= $lang . '/hotspot.inc.php'; |
|
23 | + } else { |
|
24 | + $hotspot_lang_file .= 'english/hotspot.inc.php'; |
|
25 | + } |
|
25 | 26 | } else { |
26 | 27 | $hotspot_lang_file .= 'english/hotspot.inc.php'; |
27 | 28 | } |
@@ -400,8 +400,9 @@ |
||
400 | 400 | $extra .= $form->return_form(); |
401 | 401 | $extra .= '</div>'; |
402 | 402 | |
403 | -if ($is_allowedToEdit) |
|
403 | +if ($is_allowedToEdit) { |
|
404 | 404 | echo $extra; |
405 | +} |
|
405 | 406 | |
406 | 407 | echo $actions; |
407 | 408 |
@@ -7,7 +7,9 @@ |
||
7 | 7 | * @package chamilo.exercise |
8 | 8 | */ |
9 | 9 | |
10 | -if ( count( get_included_files() ) == 1 ) die( '---' ); |
|
10 | +if ( count( get_included_files() ) == 1 ) { |
|
11 | + die( '---' ); |
|
12 | +} |
|
11 | 13 | |
12 | 14 | if (!function_exists('mime_content_type')) { |
13 | 15 | function mime_content_type($filename) { |
@@ -10,8 +10,9 @@ discard block |
||
10 | 10 | /** |
11 | 11 | * Security check |
12 | 12 | */ |
13 | -if (count(get_included_files()) == 1) |
|
13 | +if (count(get_included_files()) == 1) { |
|
14 | 14 | die('---'); |
15 | +} |
|
15 | 16 | |
16 | 17 | /** |
17 | 18 | * Creates a temporary directory |
@@ -21,8 +22,9 @@ discard block |
||
21 | 22 | * @return string |
22 | 23 | */ |
23 | 24 | function tempdir($dir, $prefix = 'tmp', $mode = 0777) { |
24 | - if (substr($dir, -1) != '/') |
|
25 | - $dir .= '/'; |
|
25 | + if (substr($dir, -1) != '/') { |
|
26 | + $dir .= '/'; |
|
27 | + } |
|
26 | 28 | |
27 | 29 | do { |
28 | 30 | $path = $dir . $prefix . mt_rand(0, 9999999); |