@@ -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 | } |
@@ -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); |
@@ -171,10 +171,11 @@ |
||
171 | 171 | } |
172 | 172 | echo '</div>'; |
173 | 173 | |
174 | - if ($objExercise->feedback_type == 1) |
|
175 | - Display::display_normal_message( |
|
174 | + if ($objExercise->feedback_type == 1) { |
|
175 | + Display::display_normal_message( |
|
176 | 176 | get_lang('DirectFeedbackCantModifyTypeQuestion') |
177 | 177 | ); |
178 | + } |
|
178 | 179 | |
179 | 180 | if (api_get_setting('search_enabled')=='true' && !extension_loaded('xapian')) { |
180 | 181 | Display::display_error_message(get_lang('SearchXapianModuleNotInstalled')); |
@@ -104,7 +104,11 @@ |
||
104 | 104 | { |
105 | 105 | $this->answerList = $this->getAnswersList(true); |
106 | 106 | $type = $this->getQuestionType(); |
107 | - if ($type == MCMA) $cardinality = 'multiple'; else $cardinality = 'single'; |
|
107 | + if ($type == MCMA) { |
|
108 | + $cardinality = 'multiple'; |
|
109 | + } else { |
|
110 | + $cardinality = 'single'; |
|
111 | + } |
|
108 | 112 | |
109 | 113 | $out = ' <responseDeclaration identifier="' . $questionIdent . '" cardinality="' . $cardinality . '" baseType="identifier">' . "\n"; |
110 | 114 |
@@ -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); |
@@ -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) { |
@@ -327,8 +327,7 @@ discard block |
||
327 | 327 | if($this->response == 'TRUE') |
328 | 328 | { |
329 | 329 | $js .= 'questions_answers_correct['.$this->questionJSId.'] = new Array(\'true\');'."\n"; |
330 | - } |
|
331 | - else |
|
330 | + } else |
|
332 | 331 | { |
333 | 332 | $js .= 'questions_answers_correct['.$this->questionJSId.'] = new Array(\'false\');'."\n"; |
334 | 333 | } |
@@ -471,8 +470,11 @@ discard block |
||
471 | 470 | |
472 | 471 | $s.='</select> </td>'."\n"; |
473 | 472 | $s.='<td width="40%" valign="top">'; |
474 | - if(isset($Select[$cpt2])) $s.='<b>'.$Select[$cpt2]['Lettre'].'.</b> '.$Select[$cpt2]['Reponse']; |
|
475 | - else $s.=' '; |
|
473 | + if(isset($Select[$cpt2])) { |
|
474 | + $s.='<b>'.$Select[$cpt2]['Lettre'].'.</b> '.$Select[$cpt2]['Reponse']; |
|
475 | + } else { |
|
476 | + $s.=' '; |
|
477 | + } |
|
476 | 478 | $s.="</td>\n</tr>\n"; |
477 | 479 | |
478 | 480 | $jstmpc .= '['.$answerCorrect.','.$cpt2.'],'; |
@@ -577,8 +579,7 @@ discard block |
||
577 | 579 | $jstmpw .= 'questions_answers_ponderation['.$this->questionJSId.'][0] = 0;'."\n"; |
578 | 580 | $jstmpw .= 'questions_answers_ponderation['.$this->questionJSId.'][1] = 0;'.";\n"; |
579 | 581 | $header .= $jstmpw; |
580 | - } |
|
581 | - else |
|
582 | + } else |
|
582 | 583 | { |
583 | 584 | $header = ''; |
584 | 585 | $header .= 'questions_answers['.$this->questionJSId.'] = new Array();'."\n"; |
@@ -885,8 +886,7 @@ discard block |
||
885 | 886 | . $this->end_body() |
886 | 887 | . $this->end_page(); |
887 | 888 | return $res; |
888 | - } |
|
889 | - else |
|
889 | + } else |
|
890 | 890 | { |
891 | 891 | return array($js,$html); |
892 | 892 | } |
@@ -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; |