Test Setup Failed
Push — master ( 43640b...10eb12 )
by Angel Fernando Quiroz
158:47 queued 97:59
created
main/inc/lib/exercise.lib.php 2 patches
Doc Comments   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1255,6 +1255,7 @@  discard block
 block discarded – undo
1255 1255
 
1256 1256
     /**
1257 1257
      * Validates the time control key
1258
+     * @param integer $exercise_id
1258 1259
      */
1259 1260
     public static function exercise_time_control_is_valid(
1260 1261
         $exercise_id,
@@ -1388,7 +1389,7 @@  discard block
 block discarded – undo
1388 1389
      * @param int $in_direction
1389 1390
      * @param string $in_hotpot_path
1390 1391
      * @param bool $in_get_count
1391
-     * @param null $where_condition
1392
+     * @param string $where_condition
1392 1393
      * @return array|int
1393 1394
      */
1394 1395
     public static function get_exam_results_hotpotatoes_data(
@@ -2179,7 +2180,7 @@  discard block
 block discarded – undo
2179 2180
     /**
2180 2181
      * Return true if pass_pourcentage activated (we use the pass pourcentage feature
2181 2182
      * return false if pass_percentage = 0 (we don't use the pass pourcentage feature
2182
-     * @param $in_pass_pourcentage
2183
+     * @param string $in_pass_pourcentage
2183 2184
      * @return boolean
2184 2185
      * In this version, pass_percentage and show_success_message are disabled if
2185 2186
      * pass_percentage is set to 0
@@ -2192,7 +2193,7 @@  discard block
 block discarded – undo
2192 2193
     /**
2193 2194
      * Converts a numeric value in a percentage example 0.66666 to 66.67 %
2194 2195
      * @param $value
2195
-     * @return float Converted number
2196
+     * @return string Converted number
2196 2197
      */
2197 2198
     public static function convert_to_percentage($value)
2198 2199
     {
@@ -2208,7 +2209,7 @@  discard block
 block discarded – undo
2208 2209
      * @param   float $score
2209 2210
      * @param   float $weight
2210 2211
      * @deprecated seem not to be used
2211
-     * @return  float   the score rounded converted to the new range
2212
+     * @return  string|null   the score rounded converted to the new range
2212 2213
      */
2213 2214
     public static function convert_score($score, $weight)
2214 2215
     {
@@ -2759,6 +2760,7 @@  discard block
 block discarded – undo
2759 2760
      * @param    int        exercise id
2760 2761
      * @param    int    $courseId
2761 2762
      * @param    int        session id
2763
+     * @param integer $user_count
2762 2764
      * @return    float    Best average score
2763 2765
      */
2764 2766
     public static function get_best_average_score_by_exercise(
@@ -3198,8 +3200,9 @@  discard block
 block discarded – undo
3198 3200
     }
3199 3201
 
3200 3202
     /**
3201
-     * @param array $answer
3203
+     * @param string|null $answer
3202 3204
      * @param string $user_answer
3205
+     * @param string|null $current_answer
3203 3206
      * @return array
3204 3207
      */
3205 3208
     public static function check_fill_in_blanks($answer, $user_answer, $current_answer)
@@ -3805,7 +3808,7 @@  discard block
 block discarded – undo
3805 3808
 
3806 3809
     /**
3807 3810
      * @param int $countLetter
3808
-     * @return mixed
3811
+     * @return string
3809 3812
      */
3810 3813
     public static function detectInputAppropriateClass($countLetter)
3811 3814
     {
Please login to merge, or discard this patch.
Spacing   +117 added lines, -117 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
                 if ($show_title) {
66 66
                     TestCategory::displayCategoryAndTitle($objQuestionTmp->id);
67 67
                     echo Display::div(
68
-                        $current_item . '. ' . $objQuestionTmp->selectTitle(),
68
+                        $current_item.'. '.$objQuestionTmp->selectTitle(),
69 69
                         array('class' => 'question_title')
70 70
                     );
71 71
                 }
@@ -161,8 +161,8 @@  discard block
 block discarded – undo
161 161
                 $config = array(
162 162
                     'ToolbarSet' => 'TestFreeAnswer'
163 163
                 );
164
-                $form->addHtmlEditor("choice[" . $questionId . "]", null, false, false, $config);
165
-                $form->setDefaults(array("choice[" . $questionId . "]" => $fck_content));
164
+                $form->addHtmlEditor("choice[".$questionId."]", null, false, false, $config);
165
+                $form->setDefaults(array("choice[".$questionId."]" => $fck_content));
166 166
                 $s .= $form->returnForm();
167 167
             } elseif ($answerType == ORAL_EXPRESSION) {
168 168
                 // Add nanog
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
                 $config = array(
192 192
                     'ToolbarSet' => 'TestFreeAnswer'
193 193
                 );
194
-                $form->addHtmlEditor("choice[" . $questionId . "]", null, false, false, $config);
194
+                $form->addHtmlEditor("choice[".$questionId."]", null, false, false, $config);
195 195
                 //$form->setDefaults(array("choice[" . $questionId . "]" => $fck_content));
196 196
                 $s .= $form->returnForm();
197 197
             }
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
 
273 273
                 // Unique answer
274 274
                 if (in_array($answerType, [UNIQUE_ANSWER, UNIQUE_ANSWER_NO_OPTION, UNIQUE_ANSWER_IMAGE])) {
275
-                    $input_id = 'choice-' . $questionId . '-' . $answerId;
275
+                    $input_id = 'choice-'.$questionId.'-'.$answerId;
276 276
                     if (isset($user_choice[0]) && $user_choice[0]->getAnswer() == $numAnswer) {
277 277
                         $attributes = array(
278 278
                             'id' => $input_id,
@@ -297,14 +297,14 @@  discard block
 block discarded – undo
297 297
                     if ($answerType == UNIQUE_ANSWER_IMAGE) {
298 298
                         if ($show_comment) {
299 299
                             if (empty($comment)) {
300
-                                $s .= '<div id="answer' . $questionId . $numAnswer . '" '
300
+                                $s .= '<div id="answer'.$questionId.$numAnswer.'" '
301 301
                                     . 'class="exercise-unique-answer-image" style="text-align: center">';
302 302
                             } else {
303
-                                $s .= '<div id="answer' . $questionId . $numAnswer . '" '
303
+                                $s .= '<div id="answer'.$questionId.$numAnswer.'" '
304 304
                                     . 'class="exercise-unique-answer-image col-xs-6 col-sm-12" style="text-align: center">';
305 305
                             }
306 306
                         } else {
307
-                            $s .= '<div id="answer' . $questionId . $numAnswer . '" '
307
+                            $s .= '<div id="answer'.$questionId.$numAnswer.'" '
308 308
                                 . 'class="exercise-unique-answer-image col-xs-6 col-md-3" style="text-align: center">';
309 309
                         }
310 310
                     }
@@ -312,7 +312,7 @@  discard block
 block discarded – undo
312 312
                     $answer = Security::remove_XSS($answer, STUDENT);
313 313
                     $s .= Display::input(
314 314
                         'hidden',
315
-                        'choice2[' . $questionId . ']',
315
+                        'choice2['.$questionId.']',
316 316
                         '0'
317 317
                     );
318 318
 
@@ -320,13 +320,13 @@  discard block
 block discarded – undo
320 320
 
321 321
                     if ($answerType == UNIQUE_ANSWER_IMAGE) {
322 322
                         $attributes['style'] = 'display: none;';
323
-                        $answer = '<div class="thumbnail">' . $answer . '</div>';
323
+                        $answer = '<div class="thumbnail">'.$answer.'</div>';
324 324
                     }
325 325
 
326 326
                     $answer_input .= '<label class="radio">';
327 327
                     $answer_input .= Display::input(
328 328
                         'radio',
329
-                        'choice[' . $questionId . ']',
329
+                        'choice['.$questionId.']',
330 330
                         $numAnswer,
331 331
                         $attributes
332 332
                     );
@@ -353,7 +353,7 @@  discard block
 block discarded – undo
353 353
                     $answerType == MULTIPLE_ANSWER_TRUE_FALSE ||
354 354
                     $answerType == GLOBAL_MULTIPLE_ANSWER
355 355
                 ) {
356
-                    $input_id = 'choice-' . $questionId . '-' . $answerId;
356
+                    $input_id = 'choice-'.$questionId.'-'.$answerId;
357 357
                     $answer = Security::remove_XSS($answer, STUDENT);
358 358
 
359 359
                     if (in_array($numAnswer, $user_choice_array)) {
@@ -374,12 +374,12 @@  discard block
 block discarded – undo
374 374
                     }
375 375
 
376 376
                     if ($answerType == MULTIPLE_ANSWER || $answerType == GLOBAL_MULTIPLE_ANSWER) {
377
-                        $s .= '<input type="hidden" name="choice2[' . $questionId . ']" value="0" />';
377
+                        $s .= '<input type="hidden" name="choice2['.$questionId.']" value="0" />';
378 378
 
379 379
                         $answer_input = '<label class="checkbox">';
380 380
                         $answer_input .= Display::input(
381 381
                             'checkbox',
382
-                            'choice[' . $questionId . '][' . $numAnswer . ']',
382
+                            'choice['.$questionId.']['.$numAnswer.']',
383 383
                             $numAnswer,
384 384
                             $attributes
385 385
                         );
@@ -432,7 +432,7 @@  discard block
 block discarded – undo
432 432
                                     'td',
433 433
                                     Display::input(
434 434
                                         'radio',
435
-                                        'choice[' . $questionId . '][' . $numAnswer . ']',
435
+                                        'choice['.$questionId.']['.$numAnswer.']',
436 436
                                         $id,
437 437
                                         $attributes
438 438
                                     ),
@@ -450,7 +450,7 @@  discard block
 block discarded – undo
450 450
                     }
451 451
                 } elseif ($answerType == MULTIPLE_ANSWER_COMBINATION) {
452 452
                     // multiple answers
453
-                    $input_id = 'choice-' . $questionId . '-' . $answerId;
453
+                    $input_id = 'choice-'.$questionId.'-'.$answerId;
454 454
 
455 455
                     if (in_array($numAnswer, $user_choice_array)) {
456 456
                         $attributes = array(
@@ -470,11 +470,11 @@  discard block
 block discarded – undo
470 470
                     }
471 471
 
472 472
                     $answer = Security::remove_XSS($answer, STUDENT);
473
-                    $answer_input = '<input type="hidden" name="choice2[' . $questionId . ']" value="0" />';
473
+                    $answer_input = '<input type="hidden" name="choice2['.$questionId.']" value="0" />';
474 474
                     $answer_input .= '<label class="checkbox">';
475 475
                     $answer_input .= Display::input(
476 476
                         'checkbox',
477
-                        'choice[' . $questionId . '][' . $numAnswer . ']',
477
+                        'choice['.$questionId.']['.$numAnswer.']',
478 478
                         1,
479 479
                         $attributes
480 480
                     );
@@ -495,7 +495,7 @@  discard block
 block discarded – undo
495 495
                     }
496 496
 
497 497
                 } elseif ($answerType == MULTIPLE_ANSWER_COMBINATION_TRUE_FALSE) {
498
-                    $s .= '<input type="hidden" name="choice2[' . $questionId . ']" value="0" />';
498
+                    $s .= '<input type="hidden" name="choice2['.$questionId.']" value="0" />';
499 499
 
500 500
                     $my_choice = array();
501 501
                     if (!empty($user_choice_array)) {
@@ -530,7 +530,7 @@  discard block
 block discarded – undo
530 530
                             'td',
531 531
                             Display::input(
532 532
                                 'radio',
533
-                                'choice[' . $questionId . '][' . $numAnswer . ']',
533
+                                'choice['.$questionId.']['.$numAnswer.']',
534 534
                                 $key,
535 535
                                 $attributes
536 536
                             )
@@ -627,8 +627,8 @@  discard block
 block discarded – undo
627 627
                             TABLE_STATISTIC_TRACK_E_ATTEMPT
628 628
                         );
629 629
                         $sql = 'SELECT answer
630
-                                FROM ' . $trackAttempts . '
631
-                                WHERE exe_id=' . $exe_id . ' AND question_id=' . $questionId;
630
+                                FROM ' . $trackAttempts.'
631
+                                WHERE exe_id=' . $exe_id.' AND question_id='.$questionId;
632 632
                         $rsLastAttempt = Database::query($sql);
633 633
                         $rowLastAttempt = Database::fetch_array($rsLastAttempt);
634 634
                         $answer = $rowLastAttempt['answer'];
@@ -687,7 +687,7 @@  discard block
 block discarded – undo
687 687
                                 '',
688 688
                                 $answerCorrected
689 689
                             );
690
-                            $answerCorrected = '[' . $answerCorrected . ']';
690
+                            $answerCorrected = '['.$answerCorrected.']';
691 691
                             $studentAnswerList[] = $answerCorrected;
692 692
                         }
693 693
                     }
@@ -706,7 +706,7 @@  discard block
 block discarded – undo
706 706
                     */
707 707
                     $tabComments = api_preg_split(
708 708
                         '/\[[^]]+\]/',
709
-                        ' ' . $answer . ' '
709
+                        ' '.$answer.' '
710 710
                     );
711 711
                     if (!empty($correctAnswerList) && !empty($studentAnswerList)) {
712 712
                         $answer = "";
@@ -723,7 +723,7 @@  discard block
 block discarded – undo
723 723
                                 $size
724 724
                             );
725 725
 
726
-                            $answer .= $tabComments[$i] .
726
+                            $answer .= $tabComments[$i].
727 727
                                 Display::input(
728 728
                                     'text',
729 729
                                     "choice[$questionId][]",
@@ -769,12 +769,12 @@  discard block
 block discarded – undo
769 769
                         $s .= '<tr><td width="45%" valign="top">';
770 770
                         $parsed_answer = $answer;
771 771
                         //left part questions
772
-                        $s .= '<p class="indent">' . $lines_count . '.&nbsp;' . $parsed_answer . '</p></td>';
772
+                        $s .= '<p class="indent">'.$lines_count.'.&nbsp;'.$parsed_answer.'</p></td>';
773 773
                         //middle part (matches selects)
774 774
 
775 775
                         $s .= '<td width="10%" valign="top" align="center" >
776 776
                                 <div class="select-matching">
777
-                                <select name="choice[' . $questionId . '][' . $numAnswer . ']">';
777
+                                <select name="choice[' . $questionId.']['.$numAnswer.']">';
778 778
 
779 779
                         // fills the list-box
780 780
                         foreach ($select_items as $key => $val) {
@@ -790,14 +790,14 @@  discard block
 block discarded – undo
790 790
                             if (isset($user_choice_array_position[$numAnswer]) && $val['id'] == $user_choice_array_position[$numAnswer]) {
791 791
                                 $selected = 'selected="selected"';
792 792
                             }
793
-                            $s .= '<option value="' . $val['id'] . '" ' . $selected . '>' . $val['letter'] . '</option>';
793
+                            $s .= '<option value="'.$val['id'].'" '.$selected.'>'.$val['letter'].'</option>';
794 794
 
795 795
                         }  // end foreach()
796 796
 
797 797
                         $s .= '</select></div></td><td width="5%" class="separate">&nbsp;</td>';
798 798
                         $s .= '<td width="40%" valign="top" >';
799 799
                         if (isset($select_items[$lines_count])) {
800
-                            $s .= '<div class="text-right"><p class="indent">' . $select_items[$lines_count]['letter'].'.&nbsp; '. $select_items[$lines_count]['answer'].'</p></div>';
800
+                            $s .= '<div class="text-right"><p class="indent">'.$select_items[$lines_count]['letter'].'.&nbsp; '.$select_items[$lines_count]['answer'].'</p></div>';
801 801
                         } else {
802 802
                             $s .= '&nbsp;';
803 803
                         }
@@ -812,7 +812,7 @@  discard block
 block discarded – undo
812 812
                                 $s .= '<tr>
813 813
                                       <td colspan="2"></td>
814 814
                                       <td valign="top">';
815
-                                $s .= '<b>' . $select_items[$lines_count]['letter'] . '.</b> ' . $select_items[$lines_count]['answer'];
815
+                                $s .= '<b>'.$select_items[$lines_count]['letter'].'.</b> '.$select_items[$lines_count]['answer'];
816 816
                                 $s .= "</td>
817 817
                                 </tr>";
818 818
                                 $lines_count++;
@@ -828,9 +828,9 @@  discard block
 block discarded – undo
828 828
                         $data = $objAnswerTmp->getAnswerByAutoId($data['correct']);
829 829
                         $lines_count = $data['answer'];*/
830 830
 
831
-                        $windowId = $questionId . '_' . $lines_count;
831
+                        $windowId = $questionId.'_'.$lines_count;
832 832
 
833
-                        $s .= '<li class="touch-items" id="' . $windowId . '">';
833
+                        $s .= '<li class="touch-items" id="'.$windowId.'">';
834 834
                         $s .= Display::div(
835 835
                             $parsed_answer,
836 836
                             [
@@ -888,7 +888,7 @@  discard block
 block discarded – undo
888 888
                                 Display::tag(
889 889
                                     'b',
890 890
                                     $select_items[$lines_count]['letter']
891
-                                ) . $select_items[$lines_count]['answer'],
891
+                                ).$select_items[$lines_count]['answer'],
892 892
                                 [
893 893
                                     'id' => "window_{$windowId}_answer",
894 894
                                     'style' => 'display: none;'
@@ -1032,7 +1032,7 @@  discard block
 block discarded – undo
1032 1032
 
1033 1033
             if ($show_comment) {
1034 1034
                 $s .= '</table>';
1035
-            } elseif(
1035
+            } elseif (
1036 1036
                 in_array(
1037 1037
                     $answerType,
1038 1038
                     [
@@ -1057,7 +1057,7 @@  discard block
 block discarded – undo
1057 1057
 
1058 1058
                 for ($answerId = 1; $answerId <= $nbrAnswers; $answerId++) {
1059 1059
                     $answerCorrect = $objAnswerTmp->isCorrect($answerId);
1060
-                    $windowId = $questionId . '_' . $counterAnswer;
1060
+                    $windowId = $questionId.'_'.$counterAnswer;
1061 1061
 
1062 1062
                     if ($answerCorrect) {
1063 1063
                         $s .= Display::div(
@@ -1102,7 +1102,7 @@  discard block
 block discarded – undo
1102 1102
                 $course = api_get_course_info();
1103 1103
                 $doc_id = DocumentManager::get_document_id(
1104 1104
                     $course,
1105
-                    '/images/' . $pictureName
1105
+                    '/images/'.$pictureName
1106 1106
                 );
1107 1107
                 if (is_numeric($doc_id)) {
1108 1108
                     $images_folder_visibility = api_get_item_visibility(
@@ -1127,7 +1127,7 @@  discard block
 block discarded – undo
1127 1127
                 echo "
1128 1128
                     <script>
1129 1129
                         $(document).on('ready', function () {
1130
-                            new " . ($answerType == HOT_SPOT ?  "HotspotQuestion" : "DelineationQuestion" ) . "({
1130
+                            new " . ($answerType == HOT_SPOT ? "HotspotQuestion" : "DelineationQuestion")."({
1131 1131
                                 questionId: $questionId,
1132 1132
                                 exerciseId: $exerciseId,
1133 1133
                                 selector: '#hotspot-preview-$questionId',
@@ -1161,7 +1161,7 @@  discard block
 block discarded – undo
1161 1161
             if ($answerType != HOT_SPOT_DELINEATION) {
1162 1162
                 $answerList = '
1163 1163
                     <div class="well well-sm">
1164
-                        <h5 class="page-header">' . get_lang('HotspotZones') . '</h5>
1164
+                        <h5 class="page-header">' . get_lang('HotspotZones').'</h5>
1165 1165
                         <ol>
1166 1166
                 ';
1167 1167
 
@@ -1186,7 +1186,7 @@  discard block
 block discarded – undo
1186 1186
             if (!$only_questions) {
1187 1187
                 if ($show_title) {
1188 1188
                     TestCategory::displayCategoryAndTitle($objQuestionTmp->id);
1189
-                    echo '<div class="question_title">' . $current_item . '. ' . $questionName . '</div>';
1189
+                    echo '<div class="question_title">'.$current_item.'. '.$questionName.'</div>';
1190 1190
                 }
1191 1191
                 //@todo I need to the get the feedback type
1192 1192
                 echo <<<HOTSPOT
@@ -1204,7 +1204,7 @@  discard block
 block discarded – undo
1204 1204
                                 <div class=\"hotspot-image\"></div>
1205 1205
                                 <script>
1206 1206
                                     $(document).on('ready', function () {
1207
-                                        new " . ($answerType == HOT_SPOT_DELINEATION ? 'DelineationQuestion' : 'HotspotQuestion') . "({
1207
+                                        new " . ($answerType == HOT_SPOT_DELINEATION ? 'DelineationQuestion' : 'HotspotQuestion')."({
1208 1208
                                             questionId: $questionId,
1209 1209
                                             exerciseId: $exe_id,
1210 1210
                                             selector: '#question_div_' + $questionId + ' .hotspot-image',
@@ -1323,11 +1323,11 @@  discard block
 block discarded – undo
1323 1323
         $lp_id = intval($lp_id);
1324 1324
         $lp_item_id = intval($lp_item_id);
1325 1325
         return
1326
-            api_get_course_int_id() . '_' .
1327
-            api_get_session_id() . '_' .
1328
-            $exercise_id . '_' .
1329
-            api_get_user_id() . '_' .
1330
-            $lp_id . '_' .
1326
+            api_get_course_int_id().'_'.
1327
+            api_get_session_id().'_'.
1328
+            $exercise_id.'_'.
1329
+            api_get_user_id().'_'.
1330
+            $lp_id.'_'.
1331 1331
             $lp_item_id;
1332 1332
     }
1333 1333
 
@@ -1439,14 +1439,14 @@  discard block
 block discarded – undo
1439 1439
         $res = Database::query($sql);
1440 1440
         $result = array();
1441 1441
         $apiIsAllowedToEdit = api_is_allowed_to_edit();
1442
-        $urlBase = api_get_path(WEB_CODE_PATH) .
1443
-            'exercice/hotpotatoes_exercise_report.php?action=delete&' .
1444
-            api_get_cidreq() . '&id=';
1442
+        $urlBase = api_get_path(WEB_CODE_PATH).
1443
+            'exercice/hotpotatoes_exercise_report.php?action=delete&'.
1444
+            api_get_cidreq().'&id=';
1445 1445
         while ($data = Database::fetch_array($res)) {
1446 1446
             $actions = null;
1447 1447
 
1448 1448
             if ($apiIsAllowedToEdit) {
1449
-                $url = $urlBase . $data['id'] . '&path=' . $data['exe_name'];
1449
+                $url = $urlBase.$data['id'].'&path='.$data['exe_name'];
1450 1450
                 $actions = Display::url(
1451 1451
                     Display::return_icon('delete.png', get_lang('Delete')),
1452 1452
                     $url
@@ -1462,7 +1462,7 @@  discard block
 block discarded – undo
1462 1462
                     GroupManager::get_user_group_name($data['user_id'])
1463 1463
                 ),
1464 1464
                 'exe_date' => $data['exe_date'],
1465
-                'score' => $data['exe_result'] . ' / ' . $data['exe_weighting'],
1465
+                'score' => $data['exe_result'].' / '.$data['exe_weighting'],
1466 1466
                 'actions' => $actions,
1467 1467
             );
1468 1468
         }
@@ -1545,18 +1545,18 @@  discard block
 block discarded – undo
1545 1545
         $TBL_TRACK_HOTPOTATOES = Database:: get_main_table(TABLE_STATISTIC_TRACK_E_HOTPOTATOES);
1546 1546
         $TBL_TRACK_ATTEMPT_RECORDING = Database:: get_main_table(TABLE_STATISTIC_TRACK_E_ATTEMPT_RECORDING);
1547 1547
 
1548
-        $session_id_and = ' AND te.session_id = ' . $sessionId . ' ';
1548
+        $session_id_and = ' AND te.session_id = '.$sessionId.' ';
1549 1549
         $exercise_id = intval($exercise_id);
1550 1550
 
1551 1551
         $exercise_where = '';
1552 1552
         if (!empty($exercise_id)) {
1553
-            $exercise_where .= ' AND te.exe_exo_id = ' . $exercise_id . '  ';
1553
+            $exercise_where .= ' AND te.exe_exo_id = '.$exercise_id.'  ';
1554 1554
         }
1555 1555
 
1556 1556
         $hotpotatoe_where = '';
1557 1557
         if (!empty($_GET['path'])) {
1558 1558
             $hotpotatoe_path = Database::escape_string($_GET['path']);
1559
-            $hotpotatoe_where .= ' AND exe_name = "' . $hotpotatoe_path . '"  ';
1559
+            $hotpotatoe_where .= ' AND exe_name = "'.$hotpotatoe_path.'"  ';
1560 1560
         }
1561 1561
 
1562 1562
         // sql for chamilo-type tests for teacher / tutor view
@@ -1568,7 +1568,7 @@  discard block
 block discarded – undo
1568 1568
             WHERE
1569 1569
                 c_id = $course_id AND
1570 1570
                 exe_exo_id = $exercise_id AND
1571
-                ttte.session_id = " . $sessionId . "
1571
+                ttte.session_id = ".$sessionId."
1572 1572
         )";
1573 1573
 
1574 1574
         if ($is_allowedToEdit) {
@@ -1591,9 +1591,9 @@  discard block
 block discarded – undo
1591 1591
                         g.id as group_id
1592 1592
                     FROM $TBL_USER u
1593 1593
                     INNER JOIN $TBL_GROUP_REL_USER gru
1594
-                    ON (gru.user_id = u.user_id AND gru.c_id=" . $course_id . ")
1594
+                    ON (gru.user_id = u.user_id AND gru.c_id=".$course_id.")
1595 1595
                     INNER JOIN $TBL_GROUP g
1596
-                    ON (gru.group_id = g.id AND g.c_id=" . $course_id . ")
1596
+                    ON (gru.group_id = g.id AND g.c_id=".$course_id.")
1597 1597
                 )";
1598 1598
             }
1599 1599
 
@@ -1655,9 +1655,9 @@  discard block
 block discarded – undo
1655 1655
                     g.id as group_id
1656 1656
                 FROM $TBL_USER u
1657 1657
                 LEFT OUTER JOIN $TBL_GROUP_REL_USER gru
1658
-                ON ( gru.user_id = u.user_id AND gru.c_id=" . $course_id . " )
1658
+                ON ( gru.user_id = u.user_id AND gru.c_id=".$course_id." )
1659 1659
                 LEFT OUTER JOIN $TBL_GROUP g
1660
-                ON (gru.group_id = g.id AND g.c_id = " . $course_id . ")
1660
+                ON (gru.group_id = g.id AND g.c_id = ".$course_id.")
1661 1661
             )";
1662 1662
             }
1663 1663
 
@@ -1670,12 +1670,12 @@  discard block
 block discarded – undo
1670 1670
             (
1671 1671
                 SELECT u.user_id, firstname, lastname, email, username, ' ' as group_name, '' as group_id, official_code
1672 1672
                 FROM $TBL_USER u
1673
-                WHERE u.status NOT IN(" . api_get_users_status_ignored_in_reports('string') . ")
1673
+                WHERE u.status NOT IN(".api_get_users_status_ignored_in_reports('string').")
1674 1674
             )";
1675 1675
             }
1676 1676
 
1677 1677
             $sqlFromOption = " , $TBL_GROUP_REL_USER AS gru ";
1678
-            $sqlWhereOption = "  AND gru.c_id = " . $course_id ." AND gru.user_id = user.user_id ";
1678
+            $sqlWhereOption = "  AND gru.c_id = ".$course_id." AND gru.user_id = user.user_id ";
1679 1679
             $first_and_last_name = api_is_western_name_order() ? "firstname, lastname" : "lastname, firstname";
1680 1680
 
1681 1681
             if ($get_count) {
@@ -1712,8 +1712,8 @@  discard block
 block discarded – undo
1712 1712
                 ON (user.user_id = exe_user_id)
1713 1713
                 WHERE
1714 1714
                     te.status != 'incomplete' AND
1715
-                    te.c_id = " . $course_id . " $session_id_and AND
1716
-                    ce.active <>-1 AND ce.c_id = " . $course_id . "
1715
+                    te.c_id = ".$course_id." $session_id_and AND
1716
+                    ce.active <>-1 AND ce.c_id = ".$course_id."
1717 1717
                     $exercise_where
1718 1718
                     $extra_where_conditions
1719 1719
                 ";
@@ -1740,12 +1740,12 @@  discard block
 block discarded – undo
1740 1740
                     $sqlFromOption
1741 1741
                 WHERE
1742 1742
                     user.user_id=tth.exe_user_id
1743
-                    AND tth.c_id = " . $course_id . "
1743
+                    AND tth.c_id = ".$course_id."
1744 1744
                     $hotpotatoe_where
1745 1745
                     $sqlWhereOption
1746
-                    AND user.status NOT IN(" . api_get_users_status_ignored_in_reports(
1746
+                    AND user.status NOT IN(".api_get_users_status_ignored_in_reports(
1747 1747
                     'string'
1748
-                ) . ")
1748
+                ).")
1749 1749
                 ORDER BY
1750 1750
                     tth.c_id ASC,
1751 1751
                     tth.exe_date DESC";
@@ -1821,12 +1821,12 @@  discard block
 block discarded – undo
1821 1821
 
1822 1822
                     if ($from_gradebook && ($is_allowedToEdit)) {
1823 1823
                         if (in_array(
1824
-                            $results[$i]['username'] . $results[$i]['firstname'] . $results[$i]['lastname'],
1824
+                            $results[$i]['username'].$results[$i]['firstname'].$results[$i]['lastname'],
1825 1825
                             $users_array_id
1826 1826
                         )) {
1827 1827
                             continue;
1828 1828
                         }
1829
-                        $users_array_id[] = $results[$i]['username'] . $results[$i]['firstname'] . $results[$i]['lastname'];
1829
+                        $users_array_id[] = $results[$i]['username'].$results[$i]['firstname'].$results[$i]['lastname'];
1830 1830
                     }
1831 1831
 
1832 1832
                     $lp_obj = isset($results[$i]['orig_lp_id']) && isset($lp_list[$results[$i]['orig_lp_id']]) ? $lp_list[$results[$i]['orig_lp_id']] : null;
@@ -1835,8 +1835,8 @@  discard block
 block discarded – undo
1835 1835
                     if ($lp_obj) {
1836 1836
                         $url = api_get_path(
1837 1837
                                 WEB_CODE_PATH
1838
-                            ) . 'newscorm/lp_controller.php?' . api_get_cidreq(
1839
-                            ) . '&action=view&lp_id=' . $results[$i]['orig_lp_id'];
1838
+                            ).'newscorm/lp_controller.php?'.api_get_cidreq(
1839
+                            ).'&action=view&lp_id='.$results[$i]['orig_lp_id'];
1840 1840
                         $lp_name = Display::url(
1841 1841
                             $lp_obj['lp_name'],
1842 1842
                             $url,
@@ -1854,7 +1854,7 @@  discard block
 block discarded – undo
1854 1854
                         );
1855 1855
 
1856 1856
                         foreach ($group_list as $id) {
1857
-                            $group_name_list .= $clean_group_list[$id] . '<br/>';
1857
+                            $group_name_list .= $clean_group_list[$id].'<br/>';
1858 1858
                         }
1859 1859
                         $results[$i]['group_name'] = $group_name_list;
1860 1860
                     }
@@ -1910,8 +1910,8 @@  discard block
 block discarded – undo
1910 1910
                                 }
1911 1911
                             }
1912 1912
                             if ($revised) {
1913
-                                $actions .= "<a href='exercise_show.php?" . api_get_cidreq(
1914
-                                    ) . "&action=edit&id=$id'>" .
1913
+                                $actions .= "<a href='exercise_show.php?".api_get_cidreq(
1914
+                                    )."&action=edit&id=$id'>".
1915 1915
                                     Display:: return_icon(
1916 1916
                                         'edit.png',
1917 1917
                                         get_lang('Edit'),
@@ -1920,8 +1920,8 @@  discard block
 block discarded – undo
1920 1920
                                     );
1921 1921
                                 $actions .= '&nbsp;';
1922 1922
                             } else {
1923
-                                $actions .= "<a href='exercise_show.php?" . api_get_cidreq(
1924
-                                    ) . "&action=qualify&id=$id'>" .
1923
+                                $actions .= "<a href='exercise_show.php?".api_get_cidreq(
1924
+                                    )."&action=qualify&id=$id'>".
1925 1925
                                     Display:: return_icon(
1926 1926
                                         'quiz.gif',
1927 1927
                                         get_lang('Qualify')
@@ -1931,12 +1931,12 @@  discard block
 block discarded – undo
1931 1931
                             $actions .= "</a>";
1932 1932
 
1933 1933
                             if ($filter == 2) {
1934
-                                $actions .= ' <a href="exercise_history.php?' . api_get_cidreq(
1935
-                                    ) . '&exe_id=' . $id . '">' .
1934
+                                $actions .= ' <a href="exercise_history.php?'.api_get_cidreq(
1935
+                                    ).'&exe_id='.$id.'">'.
1936 1936
                                     Display:: return_icon(
1937 1937
                                         'history.gif',
1938 1938
                                         get_lang('ViewHistoryChange')
1939
-                                    ) . '</a>';
1939
+                                    ).'</a>';
1940 1940
                             }
1941 1941
 
1942 1942
                             //Admin can always delete the attempt
@@ -1948,35 +1948,35 @@  discard block
 block discarded – undo
1948 1948
                                     date('Y-m-d h:i:s'),
1949 1949
                                     false
1950 1950
                                 );
1951
-                                $actions .= '<a href="http://www.whatsmyip.org/ip-geo-location/?ip=' . $ip . '" target="_blank">';
1951
+                                $actions .= '<a href="http://www.whatsmyip.org/ip-geo-location/?ip='.$ip.'" target="_blank">';
1952 1952
                                 $actions .= Display::return_icon('info.png', $ip, ['title' => $ip]);
1953 1953
                                 $actions .= '</a>';
1954 1954
 
1955
-                                $delete_link = '<a href="exercise_report.php?' . api_get_cidreq(
1956
-                                    ) . '&filter_by_user=' . intval(
1955
+                                $delete_link = '<a href="exercise_report.php?'.api_get_cidreq(
1956
+                                    ).'&filter_by_user='.intval(
1957 1957
                                         $_GET['filter_by_user']
1958
-                                    ) . '&filter=' . $filter . '&exerciseId=' . $exercise_id . '&delete=delete&did=' . $id . '"
1958
+                                    ).'&filter='.$filter.'&exerciseId='.$exercise_id.'&delete=delete&did='.$id.'"
1959 1959
                                 onclick="javascript:if(!confirm(\'' . sprintf(
1960 1960
                                         get_lang('DeleteAttempt'),
1961 1961
                                         $results[$i]['username'],
1962 1962
                                         $dt
1963
-                                    ) . '\')) return false;">' . Display:: return_icon(
1963
+                                    ).'\')) return false;">'.Display:: return_icon(
1964 1964
                                         'delete.png',
1965 1965
                                         get_lang('Delete')
1966
-                                    ) . '</a>';
1966
+                                    ).'</a>';
1967 1967
                                 $delete_link = utf8_encode($delete_link);
1968 1968
 
1969 1969
                                 if (api_is_drh() && !api_is_platform_admin()) {
1970 1970
                                     $delete_link = null;
1971 1971
                                 }
1972
-                                $actions .= $delete_link . '&nbsp;';
1972
+                                $actions .= $delete_link.'&nbsp;';
1973 1973
                             }
1974 1974
 
1975 1975
                         } else {
1976 1976
                             $attempt_url = api_get_path(
1977 1977
                                     WEB_CODE_PATH
1978
-                                ) . 'exercice/result.php?' . api_get_cidreq(
1979
-                                ) . '&id=' . $results[$i]['exe_id'] . '&id_session=' . $sessionId;
1978
+                                ).'exercice/result.php?'.api_get_cidreq(
1979
+                                ).'&id='.$results[$i]['exe_id'].'&id_session='.$sessionId;
1980 1980
                             $attempt_link = Display::url(
1981 1981
                                 get_lang('Show'),
1982 1982
                                 $attempt_url,
@@ -2033,7 +2033,7 @@  discard block
 block discarded – undo
2033 2033
                     $hp_result = round(
2034 2034
                             ($hpresults[$i][4] / ($hpresults[$i][5] != 0 ? $hpresults[$i][5] : 1)) * 100,
2035 2035
                             2
2036
-                        ) . '% (' . $hpresults[$i][4] . ' / ' . $hpresults[$i][5] . ')';
2036
+                        ).'% ('.$hpresults[$i][4].' / '.$hpresults[$i][5].')';
2037 2037
                     if ($is_allowedToEdit) {
2038 2038
                         $list_info[] = array(
2039 2039
                             $hpresults[$i][0],
@@ -2106,13 +2106,13 @@  discard block
 block discarded – undo
2106 2106
 
2107 2107
         $html = null;
2108 2108
         if ($show_percentage) {
2109
-            $parent = '(' . $score . ' / ' . $weight . ')';
2110
-            $html = $percentage . "%  $parent";
2109
+            $parent = '('.$score.' / '.$weight.')';
2110
+            $html = $percentage."%  $parent";
2111 2111
             if ($show_only_percentage) {
2112
-                $html = $percentage . "% ";
2112
+                $html = $percentage."% ";
2113 2113
             }
2114 2114
         } else {
2115
-            $html = $score . ' / ' . $weight;
2115
+            $html = $score.' / '.$weight;
2116 2116
         }
2117 2117
         $html = Display::span($html, array('class' => 'score_exercise'));
2118 2118
 
@@ -2206,7 +2206,7 @@  discard block
 block discarded – undo
2206 2206
     {
2207 2207
         $return = '-';
2208 2208
         if ($value != '') {
2209
-            $return = float_format($value * 100, 1) . ' %';
2209
+            $return = float_format($value * 100, 1).' %';
2210 2210
         }
2211 2211
         return $return;
2212 2212
     }
@@ -2284,7 +2284,7 @@  discard block
 block discarded – undo
2284 2284
         }
2285 2285
 
2286 2286
         $needle_where = !empty($search) ? " AND title LIKE '?' " : '';
2287
-        $needle = !empty($search) ? "%" . $search . "%" : '';
2287
+        $needle = !empty($search) ? "%".$search."%" : '';
2288 2288
 
2289 2289
         // Show courses by active status
2290 2290
         $active_sql = '';
@@ -2299,7 +2299,7 @@  discard block
 block discarded – undo
2299 2299
         if ($search_all_sessions == true) {
2300 2300
             $conditions = array(
2301 2301
                 'where' => array(
2302
-                    $active_sql . ' c_id = ? ' . $needle_where . $time_conditions => array(
2302
+                    $active_sql.' c_id = ? '.$needle_where.$time_conditions => array(
2303 2303
                         $course_id,
2304 2304
                         $needle
2305 2305
                     )
@@ -2310,7 +2310,7 @@  discard block
 block discarded – undo
2310 2310
             if ($session_id == 0) {
2311 2311
                 $conditions = array(
2312 2312
                     'where' => array(
2313
-                        $active_sql . ' session_id = ? AND c_id = ? ' . $needle_where . $time_conditions => array(
2313
+                        $active_sql.' session_id = ? AND c_id = ? '.$needle_where.$time_conditions => array(
2314 2314
                             $session_id,
2315 2315
                             $course_id,
2316 2316
                             $needle
@@ -2321,7 +2321,7 @@  discard block
 block discarded – undo
2321 2321
             } else {
2322 2322
                 $conditions = array(
2323 2323
                     'where' => array(
2324
-                        $active_sql . ' (session_id = 0 OR session_id = ? ) AND c_id = ? ' . $needle_where . $time_conditions => array(
2324
+                        $active_sql.' (session_id = 0 OR session_id = ? ) AND c_id = ? '.$needle_where.$time_conditions => array(
2325 2325
                             $session_id,
2326 2326
                             $course_id,
2327 2327
                             $needle
@@ -2500,7 +2500,7 @@  discard block
 block discarded – undo
2500 2500
 
2501 2501
             if ($return_string) {
2502 2502
                 if (!empty($position) && !empty($my_ranking)) {
2503
-                    $return_value = $position . '/' . count($my_ranking);
2503
+                    $return_value = $position.'/'.count($my_ranking);
2504 2504
                 } else {
2505 2505
                     $return_value = '-';
2506 2506
                 }
@@ -2580,7 +2580,7 @@  discard block
 block discarded – undo
2580 2580
 
2581 2581
             if ($return_string) {
2582 2582
                 if (!empty($position) && !empty($my_ranking)) {
2583
-                    return $position . '/' . count($my_ranking);
2583
+                    return $position.'/'.count($my_ranking);
2584 2584
                 }
2585 2585
             }
2586 2586
             return $return_value;
@@ -2980,7 +2980,7 @@  discard block
 block discarded – undo
2980 2980
             $courseCondition = "
2981 2981
             INNER JOIN $courseUser cu
2982 2982
             ON cu.c_id = c.id AND cu.user_id  = exe_user_id";
2983
-            $courseConditionWhere = " AND relation_type <> 2 AND cu.status = " . STUDENT;
2983
+            $courseConditionWhere = " AND relation_type <> 2 AND cu.status = ".STUDENT;
2984 2984
         } else {
2985 2985
             $courseCondition = "
2986 2986
             INNER JOIN $courseUserSession cu
@@ -3056,7 +3056,7 @@  discard block
 block discarded – undo
3056 3056
             $courseCondition = "
3057 3057
             INNER JOIN $courseUser cu
3058 3058
             ON cu.c_id = c.id AND cu.user_id  = exe_user_id";
3059
-            $courseConditionWhere = " AND relation_type <> 2 AND cu.status = " . STUDENT;
3059
+            $courseConditionWhere = " AND relation_type <> 2 AND cu.status = ".STUDENT;
3060 3060
         } else {
3061 3061
             $courseCondition = "
3062 3062
             INNER JOIN $courseUserSession cu
@@ -3148,7 +3148,7 @@  discard block
 block discarded – undo
3148 3148
             $courseCondition = "
3149 3149
             INNER JOIN $courseUser cu
3150 3150
             ON cu.c_id = c.id AND cu.user_id  = exe_user_id";
3151
-            $courseConditionWhere = " AND relation_type <> 2 AND cu.status = " . STUDENT;
3151
+            $courseConditionWhere = " AND relation_type <> 2 AND cu.status = ".STUDENT;
3152 3152
         } else {
3153 3153
             $courseCondition = "
3154 3154
             INNER JOIN $courseUserSession cu
@@ -3330,7 +3330,7 @@  discard block
 block discarded – undo
3330 3330
                 }
3331 3331
             }
3332 3332
             // adds the correct word, followed by ] to close the blank
3333
-            $answer .= ' / <font color="green"><b>' . $real_correct_tags[$i] . '</b></font>]';
3333
+            $answer .= ' / <font color="green"><b>'.$real_correct_tags[$i].'</b></font>]';
3334 3334
             if (isset ($real_text[$i + 1])) {
3335 3335
                 $answer .= $real_text[$i + 1];
3336 3336
             }
@@ -3390,13 +3390,13 @@  discard block
 block discarded – undo
3390 3390
         // check the default value of option
3391 3391
         $tabSelected = array($in_default => " selected='selected' ");
3392 3392
         $res = "";
3393
-        $res .= "<select name='$in_name' id='$in_name' onchange='" . $in_onchange . "' >";
3394
-        $res .= "<option value='-1'" . $tabSelected["-1"] . ">-- " . get_lang(
3393
+        $res .= "<select name='$in_name' id='$in_name' onchange='".$in_onchange."' >";
3394
+        $res .= "<option value='-1'".$tabSelected["-1"].">-- ".get_lang(
3395 3395
                 'AllGroups'
3396
-            ) . " --</option>";
3397
-        $res .= "<option value='0'" . $tabSelected["0"] . ">- " . get_lang(
3396
+            )." --</option>";
3397
+        $res .= "<option value='0'".$tabSelected["0"].">- ".get_lang(
3398 3398
                 'NotInAGroup'
3399
-            ) . " -</option>";
3399
+            )." -</option>";
3400 3400
         $tabGroups = GroupManager::get_group_list();
3401 3401
         $currentCatId = 0;
3402 3402
         for ($i = 0; $i < count($tabGroups); $i++) {
@@ -3404,10 +3404,10 @@  discard block
 block discarded – undo
3404 3404
                 $tabGroups[$i]["id"]
3405 3405
             );
3406 3406
             if ($tabCategory["id"] != $currentCatId) {
3407
-                $res .= "<option value='-1' disabled='disabled'>" . $tabCategory["title"] . "</option>";
3407
+                $res .= "<option value='-1' disabled='disabled'>".$tabCategory["title"]."</option>";
3408 3408
                 $currentCatId = $tabCategory["id"];
3409 3409
             }
3410
-            $res .= "<option " . $tabSelected[$tabGroups[$i]["id"]] . "style='margin-left:40px' value='" . $tabGroups[$i]["id"] . "'>" . $tabGroups[$i]["name"] . "</option>";
3410
+            $res .= "<option ".$tabSelected[$tabGroups[$i]["id"]]."style='margin-left:40px' value='".$tabGroups[$i]["id"]."'>".$tabGroups[$i]["name"]."</option>";
3411 3411
         }
3412 3412
         $res .= "</select>";
3413 3413
         return $res;
@@ -3612,14 +3612,14 @@  discard block
 block discarded – undo
3612 3612
                 if ($show_results) {
3613 3613
                     $comnt = Event::get_comments($exe_id, $questionId);
3614 3614
                     if (!empty($comnt)) {
3615
-                        echo '<b>' . get_lang('Feedback') . '</b>';
3616
-                        echo '<div id="question_feedback">' . $comnt . '</div>';
3615
+                        echo '<b>'.get_lang('Feedback').'</b>';
3616
+                        echo '<div id="question_feedback">'.$comnt.'</div>';
3617 3617
                     }
3618 3618
                 }
3619 3619
 
3620 3620
                 if ($show_results) {
3621 3621
                     $score = array(
3622
-                        'result' => get_lang('Score') . " : " . self::show_score(
3622
+                        'result' => get_lang('Score')." : ".self::show_score(
3623 3623
                                 $my_total_score,
3624 3624
                                 $my_total_weight,
3625 3625
                                 false,
@@ -3693,13 +3693,13 @@  discard block
 block discarded – undo
3693 3693
         }
3694 3694
 
3695 3695
         if ($show_all_but_expected_answer) {
3696
-            $exercise_content .= "<div class='normal-message'>" . get_lang(
3696
+            $exercise_content .= "<div class='normal-message'>".get_lang(
3697 3697
                     "ExerciseWithFeedbackWithoutCorrectionComment"
3698
-                ) . "</div>";
3698
+                )."</div>";
3699 3699
         }
3700 3700
         // Remove audio auto play from questions on results page - refs BT#7939
3701 3701
         $exercise_content = preg_replace(
3702
-            ['/autoplay[\=\".+\"]+/','/autostart[\=\".+\"]+/'],
3702
+            ['/autoplay[\=\".+\"]+/', '/autostart[\=\".+\"]+/'],
3703 3703
             '',
3704 3704
             $exercise_content
3705 3705
         );
@@ -3793,11 +3793,11 @@  discard block
 block discarded – undo
3793 3793
                     $ribbon_total_success_or_error = ' ribbon-total-error';
3794 3794
                 }
3795 3795
             }
3796
-            $ribbon .= '<div class="total ' . $ribbon_total_success_or_error . '">';
3796
+            $ribbon .= '<div class="total '.$ribbon_total_success_or_error.'">';
3797 3797
         } else {
3798 3798
             $ribbon .= '<div class="total">';
3799 3799
         }
3800
-        $ribbon .= '<h3>' . get_lang('YourTotalScore') . ":&nbsp;";
3800
+        $ribbon .= '<h3>'.get_lang('YourTotalScore').":&nbsp;";
3801 3801
         $ribbon .= self::show_score($score, $weight, false, true);
3802 3802
 
3803 3803
         $ribbon .= '</h3>';
Please login to merge, or discard this patch.
main/inc/lib/exercise_show_functions.lib.php 4 patches
Doc Comments   +38 added lines patch added patch discarded remove patch
@@ -24,6 +24,10 @@  discard block
 block discarded – undo
24 24
 	 * @param int       Question ID
25 25
      * @param int $resultsDisabled
26 26
      * @param string $originalStudentAnswer
27
+     * @param integer $feedbackType
28
+     * @param string $answer
29
+     * @param integer $id
30
+     * @param integer $questionId
27 31
 	 * @return void
28 32
 	 */
29 33
 	public static function display_fill_in_blanks_answer($feedbackType, $answer, $id, $questionId, $resultsDisabled, $originalStudentAnswer = '')
@@ -62,6 +66,10 @@  discard block
 block discarded – undo
62 66
      * @param string    Answer text
63 67
      * @param int       Exercise ID
64 68
      * @param int       Question ID
69
+     * @param integer $feedback_type
70
+     * @param string $answer
71
+     * @param integer $id
72
+     * @param integer $questionId
65 73
      * @return void
66 74
      */
67 75
     static function display_calculated_answer($feedback_type, $answer, $id, $questionId)
@@ -95,6 +103,9 @@  discard block
 block discarded – undo
95 103
 	 * @param string    Answer text
96 104
 	 * @param int       Exercise ID
97 105
 	 * @param int       Question ID
106
+	 * @param integer $feedback_type
107
+	 * @param integer $exe_id
108
+	 * @param integer $questionId
98 109
 	 * @return void
99 110
 	 */
100 111
 	static function display_free_answer($feedback_type, $answer, $exe_id, $questionId, $questionScore = null)
@@ -117,6 +128,12 @@  discard block
 block discarded – undo
117 128
         }
118 129
 	}
119 130
 
131
+	/**
132
+	 * @param integer $feedback_type
133
+	 * @param integer $id
134
+	 * @param integer $questionId
135
+	 * @param Nanogong $nano
136
+	 */
120 137
 	static function display_oral_expression_answer($feedback_type, $answer, $id, $questionId, $nano = null)
121 138
     {
122 139
         if (isset($nano)) {
@@ -158,6 +175,7 @@  discard block
 block discarded – undo
158 175
 	 * @param string $answer
159 176
 	 * @param string $studentChoice
160 177
 	 * @param string $answerComment
178
+	 * @param integer $feedback_type
161 179
 	 */
162 180
 	static function display_hotspot_answer($feedback_type, $answerId, $answer, $studentChoice, $answerComment, $in_results_disabled)
163 181
 	 {
@@ -224,6 +242,12 @@  discard block
 block discarded – undo
224 242
 	 * @param integer Exercise ID
225 243
 	 * @param integer Question ID
226 244
 	 * @param boolean Whether to show the answer comment or not
245
+	 * @param integer $answerType
246
+	 * @param string $answer
247
+	 * @param string $answerComment
248
+	 * @param integer $answerCorrect
249
+	 * @param integer $id
250
+	 * @param integer $questionId
227 251
 	 * @return void
228 252
 	 */
229 253
 	static function display_unique_or_multiple_answer(
@@ -308,6 +332,13 @@  discard block
 block discarded – undo
308 332
      * @param integer Exercise ID
309 333
      * @param integer Question ID
310 334
      * @param boolean Whether to show the answer comment or not
335
+     * @param integer $feedback_type
336
+     * @param integer $answerType
337
+     * @param string $answer
338
+     * @param string $answerComment
339
+     * @param integer $answerCorrect
340
+     * @param integer $id
341
+     * @param integer $questionId
311 342
      * @return void
312 343
      */
313 344
     static function display_multiple_answer_true_false(
@@ -398,6 +429,13 @@  discard block
 block discarded – undo
398 429
      * @param integer Exercise ID
399 430
      * @param integer Question ID
400 431
      * @param boolean Whether to show the answer comment or not
432
+     * @param integer $feedback_type
433
+     * @param integer $answerType
434
+     * @param string $answer
435
+     * @param string $answerComment
436
+     * @param integer $answerCorrect
437
+     * @param integer $id
438
+     * @param integer $questionId
401 439
      * @return void
402 440
      */
403 441
     static function display_multiple_answer_combination_true_false(
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
                 </td>
46 46
 
47 47
                 <?php
48
-                if (!api_is_allowed_to_edit(null,true) && $feedbackType != EXERCISE_FEEDBACK_TYPE_EXAM) { ?>
48
+                if (!api_is_allowed_to_edit(null, true) && $feedbackType != EXERCISE_FEEDBACK_TYPE_EXAM) { ?>
49 49
                     <td>
50 50
                         <?php
51 51
                         $comm = Event::get_comments($id, $questionId);
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
     static function display_calculated_answer($feedback_type, $answer, $id, $questionId)
68 68
     {
69 69
         if (empty($id)) {
70
-            echo '<tr><td>'. (Security::remove_XSS($answer)).'</td></tr>';
70
+            echo '<tr><td>'.(Security::remove_XSS($answer)).'</td></tr>';
71 71
         } else {
72 72
         ?>
73 73
             <tr>
@@ -78,10 +78,10 @@  discard block
 block discarded – undo
78 78
                 </td>
79 79
 
80 80
             <?php
81
-            if (!api_is_allowed_to_edit(null,true) && $feedback_type != EXERCISE_FEEDBACK_TYPE_EXAM) { ?>
81
+            if (!api_is_allowed_to_edit(null, true) && $feedback_type != EXERCISE_FEEDBACK_TYPE_EXAM) { ?>
82 82
                 <td>
83 83
                     <?php
84
-                    $comm = Event::get_comments($id,$questionId);
84
+                    $comm = Event::get_comments($id, $questionId);
85 85
                     ?>
86 86
                 </td>
87 87
             <?php } ?>
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
             echo '</tr>';
130 130
             if ($feedback_type != EXERCISE_FEEDBACK_TYPE_EXAM) {
131 131
                 echo '<tr>';
132
-                echo Display::tag('td',get_lang('notCorrectedYet'), array('width'=>'45%'));
132
+                echo Display::tag('td', get_lang('notCorrectedYet'), array('width'=>'45%'));
133 133
                 echo '</tr>';
134 134
             } else {
135 135
                 echo '<tr><td>&nbsp;</td></tr>';
@@ -142,9 +142,9 @@  discard block
 block discarded – undo
142 142
             }
143 143
             echo '</td>';
144 144
 
145
-            if (!api_is_allowed_to_edit(null,true) && $feedback_type != EXERCISE_FEEDBACK_TYPE_EXAM) {
145
+            if (!api_is_allowed_to_edit(null, true) && $feedback_type != EXERCISE_FEEDBACK_TYPE_EXAM) {
146 146
                 echo '<td>';
147
-                $comm = Event::get_comments($id,$questionId);
147
+                $comm = Event::get_comments($id, $questionId);
148 148
                 echo '</td>';
149 149
             }
150 150
             echo '</tr>';
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
 			<td class="text-left" width="10%">
194 194
 				<?php
195 195
                 if (!$hide_expected_answer) {
196
-    				$my_choice = ($studentChoice)?get_lang('Correct'):get_lang('Fault');
196
+    				$my_choice = ($studentChoice) ? get_lang('Correct') : get_lang('Fault');
197 197
     				echo $my_choice;
198 198
                 }
199 199
 				?>
@@ -284,8 +284,8 @@  discard block
 block discarded – undo
284 284
 				}
285 285
 			}
286 286
 		    echo '</td>';
287
-		    if ($ans==1) {
288
-		        $comm = Event::get_comments($id,$questionId);
287
+		    if ($ans == 1) {
288
+		        $comm = Event::get_comments($id, $questionId);
289 289
 			}
290 290
         } else {
291 291
 			echo '<td>&nbsp;</td>';
@@ -327,7 +327,7 @@  discard block
 block discarded – undo
327 327
         <td width="5%">
328 328
         <?php
329 329
 
330
-        $question 	 = new MultipleAnswerTrueFalse();
330
+        $question = new MultipleAnswerTrueFalse();
331 331
         $course_id   = api_get_course_int_id();
332 332
         $new_options = Question::readQuestionOption($questionId, $course_id);
333 333
 
@@ -372,7 +372,7 @@  discard block
 block discarded – undo
372 372
             ?>
373 373
         </td>
374 374
             <?php
375
-            if ($ans==1) {
375
+            if ($ans == 1) {
376 376
                 $comm = Event::get_comments($id, $questionId);
377 377
             }
378 378
             ?>
@@ -470,8 +470,8 @@  discard block
 block discarded – undo
470 470
             ?>
471 471
         </td>
472 472
             <?php
473
-            if ($ans==1) {
474
-                $comm = Event::get_comments($id,$questionId);
473
+            if ($ans == 1) {
474
+                $comm = Event::get_comments($id, $questionId);
475 475
             }
476 476
             ?>
477 477
          <?php } else { ?>
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -434,8 +434,7 @@
 block discarded – undo
434 434
             } else {
435 435
                 echo $question->options[2];
436 436
             }
437
-        }
438
-        else {
437
+        } else {
439 438
             echo '-';
440 439
         }
441 440
         ?>
Please login to merge, or discard this patch.
Indentation   +98 added lines, -98 removed lines patch added patch discarded remove patch
@@ -12,21 +12,21 @@  discard block
 block discarded – undo
12 12
 * @todo convert queries to use Database API
13 13
 */
14 14
 /**
15
- * Class
16
- * @package chamilo.library
17
- */
15
+     * Class
16
+     * @package chamilo.library
17
+     */
18 18
 class ExerciseShowFunctions
19 19
 {
20
-	/**
21
-	 * Shows the answer to a fill-in-the-blanks question, as HTML
22
-	 * @param string    Answer text
23
-	 * @param int       Exercise ID
24
-	 * @param int       Question ID
20
+    /**
21
+     * Shows the answer to a fill-in-the-blanks question, as HTML
22
+     * @param string    Answer text
23
+     * @param int       Exercise ID
24
+     * @param int       Question ID
25 25
      * @param int $resultsDisabled
26 26
      * @param string $originalStudentAnswer
27
-	 * @return void
28
-	 */
29
-	public static function display_fill_in_blanks_answer($feedbackType, $answer, $id, $questionId, $resultsDisabled, $originalStudentAnswer = '')
27
+     * @return void
28
+     */
29
+    public static function display_fill_in_blanks_answer($feedbackType, $answer, $id, $questionId, $resultsDisabled, $originalStudentAnswer = '')
30 30
     {
31 31
         $answerHTML = FillBlanks::getHtmlDisplayForAnswer($answer, $resultsDisabled);
32 32
         if (strpos($originalStudentAnswer, 'font color') !== false) {
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
             </tr>
56 56
         <?php
57 57
         }
58
-	}
58
+    }
59 59
 
60 60
     /**
61 61
      * Shows the answer to a calculated question, as HTML
@@ -90,14 +90,14 @@  discard block
 block discarded – undo
90 90
         }
91 91
     }
92 92
 
93
-	/**
94
-	 * Shows the answer to a free-answer question, as HTML
95
-	 * @param string    Answer text
96
-	 * @param int       Exercise ID
97
-	 * @param int       Question ID
98
-	 * @return void
99
-	 */
100
-	static function display_free_answer($feedback_type, $answer, $exe_id, $questionId, $questionScore = null)
93
+    /**
94
+     * Shows the answer to a free-answer question, as HTML
95
+     * @param string    Answer text
96
+     * @param int       Exercise ID
97
+     * @param int       Question ID
98
+     * @return void
99
+     */
100
+    static function display_free_answer($feedback_type, $answer, $exe_id, $questionId, $questionScore = null)
101 101
     {
102 102
         $comments = Event::get_comments($exe_id, $questionId);
103 103
 
@@ -115,9 +115,9 @@  discard block
 block discarded – undo
115 115
                 echo '</tr>';
116 116
             }
117 117
         }
118
-	}
118
+    }
119 119
 
120
-	static function display_oral_expression_answer($feedback_type, $answer, $id, $questionId, $nano = null)
120
+    static function display_oral_expression_answer($feedback_type, $answer, $id, $questionId, $nano = null)
121 121
     {
122 122
         if (isset($nano)) {
123 123
             echo $nano->show_audio_file();
@@ -151,22 +151,22 @@  discard block
 block discarded – undo
151 151
         }
152 152
     }
153 153
 
154
-	/**
155
-	 * Displays the answer to a hotspot question
156
-	 *
157
-	 * @param int $answerId
158
-	 * @param string $answer
159
-	 * @param string $studentChoice
160
-	 * @param string $answerComment
161
-	 */
162
-	static function display_hotspot_answer($feedback_type, $answerId, $answer, $studentChoice, $answerComment, $in_results_disabled)
163
-	 {
154
+    /**
155
+     * Displays the answer to a hotspot question
156
+     *
157
+     * @param int $answerId
158
+     * @param string $answer
159
+     * @param string $studentChoice
160
+     * @param string $answerComment
161
+     */
162
+    static function display_hotspot_answer($feedback_type, $answerId, $answer, $studentChoice, $answerComment, $in_results_disabled)
163
+        {
164 164
         $hide_expected_answer = false;
165 165
         if ($feedback_type == 0 && $in_results_disabled == 2) {
166 166
             $hide_expected_answer = true;
167 167
         }
168 168
 
169
-		$hotspot_colors = array(
169
+        $hotspot_colors = array(
170 170
             "", // $i starts from 1 on next loop (ugly fix)
171 171
             "#4271B5",
172 172
             "#FE8E16",
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
             "#ED2024",
182 182
             "#3B3B3B",
183 183
             "#F7BDE2");
184
-		?>
184
+        ?>
185 185
 		<table class="data_table">
186 186
 		<tr>
187 187
             <td class="text-center" width="5%">
@@ -193,10 +193,10 @@  discard block
 block discarded – undo
193 193
 			<td class="text-left" width="10%">
194 194
 				<?php
195 195
                 if (!$hide_expected_answer) {
196
-    				$my_choice = ($studentChoice)?get_lang('Correct'):get_lang('Fault');
197
-    				echo $my_choice;
196
+                    $my_choice = ($studentChoice)?get_lang('Correct'):get_lang('Fault');
197
+                    echo $my_choice;
198 198
                 }
199
-				?>
199
+                ?>
200 200
 			</td>
201 201
 			<?php if ($feedback_type != EXERCISE_FEEDBACK_TYPE_EXAM) { ?>
202 202
 			<td class="text-left" width="60%">
@@ -204,29 +204,29 @@  discard block
 block discarded – undo
204 204
                 if ($studentChoice) {
205 205
                     echo '<span style="font-weight: bold; color: #008000;">'.nl2br($answerComment).'</span>';
206 206
                 }
207
-				?>
207
+                ?>
208 208
 			</td>
209 209
 			<?php } else { ?>
210 210
 				<td class="text-left" width="60%">&nbsp;</td>
211 211
 			<?php } ?>
212 212
 		</tr>
213 213
 		<?php
214
-	}
214
+    }
215 215
 
216
-	/**
217
-	 * Display the answers to a multiple choice question
218
-	 * @param int $feedback_type Feedback type
219
-	 * @param integer Answer type
220
-	 * @param integer Student choice
221
-	 * @param string  Textual answer
222
-	 * @param string  Comment on answer
223
-	 * @param string  Correct answer comment
224
-	 * @param integer Exercise ID
225
-	 * @param integer Question ID
226
-	 * @param boolean Whether to show the answer comment or not
227
-	 * @return void
228
-	 */
229
-	static function display_unique_or_multiple_answer(
216
+    /**
217
+     * Display the answers to a multiple choice question
218
+     * @param int $feedback_type Feedback type
219
+     * @param integer Answer type
220
+     * @param integer Student choice
221
+     * @param string  Textual answer
222
+     * @param string  Comment on answer
223
+     * @param string  Correct answer comment
224
+     * @param integer Exercise ID
225
+     * @param integer Question ID
226
+     * @param boolean Whether to show the answer comment or not
227
+     * @return void
228
+     */
229
+    static function display_unique_or_multiple_answer(
230 230
         $feedback_type,
231 231
         $answerType,
232 232
         $studentChoice,
@@ -259,39 +259,39 @@  discard block
 block discarded – undo
259 259
         } else {
260 260
             echo "-";
261 261
         }
262
-		echo '</td>';
263
-		echo '<td width="40%">';
262
+        echo '</td>';
263
+        echo '<td width="40%">';
264 264
         echo $answer;
265
-		echo '</td>';
265
+        echo '</td>';
266 266
 
267 267
         if ($feedback_type != EXERCISE_FEEDBACK_TYPE_EXAM) {
268
-		    echo '<td width="20%">';
268
+            echo '<td width="20%">';
269 269
             if ($studentChoice) {
270
-				if ($answerCorrect) {
270
+                if ($answerCorrect) {
271 271
                     $color = 'green';
272
-					//echo '<span style="font-weight: bold; color: #008000;">'.nl2br($answerComment).'</span>';
273
-				} else {
272
+                    //echo '<span style="font-weight: bold; color: #008000;">'.nl2br($answerComment).'</span>';
273
+                } else {
274 274
                     $color = 'black';
275 275
                     //echo '<span style="font-weight: bold; color: #FF0000;">'.nl2br($answerComment).'</span>';
276
-				}
276
+                }
277 277
                 echo '<span style="font-weight: bold; color: '.$color.';">'.nl2br($answerComment).'</span>';
278 278
 
279
-			} else {
280
-				if ($answerCorrect) {
281
-					//echo '<span style="font-weight: bold; color: #000;">'.nl2br($answerComment).'</span>';
282
-				} else {
279
+            } else {
280
+                if ($answerCorrect) {
281
+                    //echo '<span style="font-weight: bold; color: #000;">'.nl2br($answerComment).'</span>';
282
+                } else {
283 283
                     //echo '<span style="font-weight: normal; color: #000;">'.nl2br($answerComment).'</span>';
284
-				}
285
-			}
286
-		    echo '</td>';
287
-		    if ($ans==1) {
288
-		        $comm = Event::get_comments($id,$questionId);
289
-			}
284
+                }
285
+            }
286
+            echo '</td>';
287
+            if ($ans==1) {
288
+                $comm = Event::get_comments($id,$questionId);
289
+            }
290 290
         } else {
291
-			echo '<td>&nbsp;</td>';
292
-		}
293
-		echo '</tr>';
294
-	}
291
+            echo '<td>&nbsp;</td>';
292
+        }
293
+        echo '</tr>';
294
+    }
295 295
 
296 296
     /**
297 297
      * Display the answers to a multiple choice question
@@ -335,7 +335,7 @@  discard block
 block discarded – undo
335 335
         if (isset($new_options[$studentChoice])) {
336 336
             echo get_lang($new_options[$studentChoice]['name']);
337 337
         } else {
338
-        	echo '-';
338
+            echo '-';
339 339
         }
340 340
 
341 341
         ?>
@@ -343,7 +343,7 @@  discard block
 block discarded – undo
343 343
         <td width="5%">
344 344
         <?php
345 345
 
346
-		//Expected choice
346
+        //Expected choice
347 347
         if (!$hide_expected_answer) {
348 348
             if (isset($new_options[$answerCorrect])) {
349 349
                 echo get_lang($new_options[$answerCorrect]['name']);
@@ -383,19 +383,19 @@  discard block
 block discarded – undo
383 383
         <?php
384 384
     }
385 385
 
386
-     /**
387
-     * Display the answers to a multiple choice question
388
-     *
389
-     * @param integer Answer type
390
-     * @param integer Student choice
391
-     * @param string  Textual answer
392
-     * @param string  Comment on answer
393
-     * @param string  Correct answer comment
394
-     * @param integer Exercise ID
395
-     * @param integer Question ID
396
-     * @param boolean Whether to show the answer comment or not
397
-     * @return void
398
-     */
386
+        /**
387
+         * Display the answers to a multiple choice question
388
+         *
389
+         * @param integer Answer type
390
+         * @param integer Student choice
391
+         * @param string  Textual answer
392
+         * @param string  Comment on answer
393
+         * @param string  Correct answer comment
394
+         * @param integer Exercise ID
395
+         * @param integer Question ID
396
+         * @param boolean Whether to show the answer comment or not
397
+         * @return void
398
+         */
399 399
     static function display_multiple_answer_combination_true_false(
400 400
         $feedback_type,
401 401
         $answerType,
@@ -416,7 +416,7 @@  discard block
 block discarded – undo
416 416
         <tr>
417 417
         <td width="5%">
418 418
         <?php
419
-		//Your choice
419
+        //Your choice
420 420
         $question = new MultipleAnswerCombinationTrueFalse();
421 421
         if (isset($question->options[$studentChoice])) {
422 422
             echo $question->options[$studentChoice];
@@ -427,7 +427,7 @@  discard block
 block discarded – undo
427 427
         </td>
428 428
         <td width="5%">
429 429
         <?php
430
-		//Expected choice
430
+        //Expected choice
431 431
         if (!$hide_expected_answer) {
432 432
             if (isset($question->options[$answerCorrect])) {
433 433
                 echo $question->options[$answerCorrect];
@@ -452,20 +452,20 @@  discard block
 block discarded – undo
452 452
             <?php
453 453
             //@todo replace this harcoded value
454 454
             if ($studentChoice) {
455
-                 $color = "black";
455
+                    $color = "black";
456 456
                 if ($studentChoice == $answerCorrect) {
457 457
                     $color = "green";
458 458
                 }
459 459
                 echo '<span style="font-weight: bold; color: '.$color.';">'.nl2br($answerComment).'</span>';
460 460
             }
461 461
             if ($studentChoice == 2 || $studentChoice == '') {
462
-            	//echo '<span style="font-weight: bold; color: #000;">'.nl2br($answerComment).'</span>';
462
+                //echo '<span style="font-weight: bold; color: #000;">'.nl2br($answerComment).'</span>';
463 463
             } else {
464
-				if ($studentChoice == $answerCorrect) {
465
-	            	//echo '<span style="font-weight: bold; color: #008000;">'.nl2br($answerComment).'</span>';
466
-				} else {
464
+                if ($studentChoice == $answerCorrect) {
465
+                    //echo '<span style="font-weight: bold; color: #008000;">'.nl2br($answerComment).'</span>';
466
+                } else {
467 467
                     //echo '<span style="font-weight: bold; color: #FF0000;">'.nl2br($answerComment).'</span>';
468
-				}
468
+                }
469 469
             }
470 470
             ?>
471 471
         </td>
Please login to merge, or discard this patch.
main/inc/lib/export.lib.inc.php 4 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
      * @param string Name of common tag to place each line in
158 158
      * @param string Name of the root element. A root element should always be given.
159 159
      * @param string Encoding in which the data is provided
160
-     * @return void  Prompts the user for a file download
160
+     * @return boolean  Prompts the user for a file download
161 161
      */
162 162
     public static function export_complex_table_xml(
163 163
         $data,
@@ -283,7 +283,7 @@  discard block
 block discarded – undo
283 283
      * @param string $name
284 284
      * @param string $format
285 285
      *
286
-     * @return bool
286
+     * @return false|null
287 287
      */
288 288
     public static function htmlToOdt($html, $name, $format = 'odt')
289 289
     {
Please login to merge, or discard this patch.
Unused Use Statements   -6 removed lines patch added patch discarded remove patch
@@ -3,14 +3,8 @@
 block discarded – undo
3 3
 
4 4
 use Ddeboer\DataImport\Writer\ExcelWriter;
5 5
 use Ddeboer\DataImport\Writer\CsvWriter;
6
-use Ddeboer\DataImport\Workflow;
7
-
8
-use Ddeboer\DataImport\Reader\CsvReader;
9
-use Ddeboer\DataImport\Reader\ArrayReader;
10
-use Ddeboer\DataImport\Writer\ArrayWriter;
11 6
 use Chamilo\CoreBundle\Component\Editor\Connector;
12 7
 use Chamilo\CoreBundle\Component\Filesystem\Data;
13
-use ChamiloSession as Session;
14 8
 use MediaAlchemyst\Alchemyst;
15 9
 use MediaAlchemyst\DriversContainer;
16 10
 use Neutron\TemporaryFilesystem\Manager;
Please login to merge, or discard this patch.
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 
57 57
         DocumentManager::file_send_for_download($filePath, true, $filename.'.csv');
58 58
         exit;
59
-	}
59
+    }
60 60
 
61 61
     /**
62 62
      * Export tabular data to XLS-file
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 
80 80
         DocumentManager::file_send_for_download($filePath, true, $filename.'.xlsx');
81 81
         exit;
82
-	}
82
+    }
83 83
 
84 84
     /**
85 85
      * Export tabular data to XLS-file (as html table)
@@ -112,13 +112,13 @@  discard block
 block discarded – undo
112 112
     }
113 113
 
114 114
     /**
115
-    * Export tabular data to XML-file
116
-    * @param array  Simple array of data to put in XML
117
-    * @param string Name of file to be given to the user
118
-    * @param string Name of common tag to place each line in
119
-    * @param string Name of the root element. A root element should always be given.
120
-    * @param string Encoding in which the data is provided
121
-    */
115
+     * Export tabular data to XML-file
116
+     * @param array  Simple array of data to put in XML
117
+     * @param string Name of file to be given to the user
118
+     * @param string Name of common tag to place each line in
119
+     * @param string Name of the root element. A root element should always be given.
120
+     * @param string Encoding in which the data is provided
121
+     */
122 122
     public static function arrayToXml(
123 123
         $data,
124 124
         $filename = 'export',
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
         fclose($handle);
149 149
         DocumentManager :: file_send_for_download($file, true, $filename.'.xml');
150 150
         exit;
151
-	}
151
+    }
152 152
 
153 153
     /**
154 154
      * Export hierarchical tabular data to XML-file
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
         foreach ($data as $row) {
198 198
             $string .= "\n".str_repeat("\t",$level).'<'.$row['name'].'>';
199 199
             if (is_array($row['value'])) {
200
-            	$string .= self::_export_complex_table_xml_helper($row['value'],$level+1)."\n";
200
+                $string .= self::_export_complex_table_xml_helper($row['value'],$level+1)."\n";
201 201
                 $string .= str_repeat("\t",$level).'</'.$row['name'].'>';
202 202
             } else {
203 203
                 $string .= $row['value'];
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
         $writer->setStream(fopen($filePath, 'w'));
51 51
 
52 52
         foreach ($data as $item) {
53
-            $item = is_array($item) ? $item : (array)$item;
53
+            $item = is_array($item) ? $item : (array) $item;
54 54
             $writer->writeItem($item);
55 55
         }
56 56
         $writer->finish();
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
         }
101 101
         foreach ($data as $row) {
102 102
             $string = implode("</td><td>", $row);
103
-            $string = '<tr><td>' . $string . '</td></tr>';
103
+            $string = '<tr><td>'.$string.'</td></tr>';
104 104
             if ($encoding != 'utf-8') {
105 105
                 $string = api_convert_encoding($string, $encoding, $systemEncoding);
106 106
             }
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
             fwrite($handle, '<'.$wrapper_tagname.'>');
175 175
         }
176 176
         $s = self::_export_complex_table_xml_helper($data);
177
-        fwrite($handle,$s);
177
+        fwrite($handle, $s);
178 178
         if (!is_null($wrapper_tagname)) {
179 179
             fwrite($handle, '</'.$wrapper_tagname.'>'."\n");
180 180
         }
@@ -196,10 +196,10 @@  discard block
 block discarded – undo
196 196
         }
197 197
         $string = '';
198 198
         foreach ($data as $row) {
199
-            $string .= "\n".str_repeat("\t",$level).'<'.$row['name'].'>';
199
+            $string .= "\n".str_repeat("\t", $level).'<'.$row['name'].'>';
200 200
             if (is_array($row['value'])) {
201
-            	$string .= self::_export_complex_table_xml_helper($row['value'],$level+1)."\n";
202
-                $string .= str_repeat("\t",$level).'</'.$row['name'].'>';
201
+            	$string .= self::_export_complex_table_xml_helper($row['value'], $level + 1)."\n";
202
+                $string .= str_repeat("\t", $level).'</'.$row['name'].'>';
203 203
             } else {
204 204
                 $string .= $row['value'];
205 205
                 $string .= '</'.$row['name'].'>';
Please login to merge, or discard this patch.
main/inc/lib/extra_field.lib.php 3 patches
Doc Comments   +8 added lines, -9 removed lines patch added patch discarded remove patch
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
     }
124 124
 
125 125
     /**
126
-     * @return array
126
+     * @return string[]
127 127
      */
128 128
     public static function getValidExtraFieldTypes()
129 129
     {
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
 
200 200
     /**
201 201
      * @param array $conditions
202
-     * @param null  $order_field_options_by
202
+     * @param string  $order_field_options_by
203 203
      *
204 204
      * @return array
205 205
      */
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
     /**
238 238
      * @param string $variable
239 239
      *
240
-     * @return array|bool
240
+     * @return integer
241 241
      */
242 242
     public function get_handler_field_info_by_field_variable($variable)
243 243
     {
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
     /**
320 320
      * @param string $handler
321 321
      *
322
-     * @return array
322
+     * @return string[]
323 323
      */
324 324
     public static function get_extra_fields_by_handler($handler)
325 325
     {
@@ -496,7 +496,7 @@  discard block
 block discarded – undo
496 496
     }
497 497
 
498 498
     /**
499
-     * @return array
499
+     * @return string[]
500 500
      */
501 501
     public function get_field_types()
502 502
     {
@@ -506,7 +506,7 @@  discard block
 block discarded – undo
506 506
     /**
507 507
      * @param int $id
508 508
      *
509
-     * @return null
509
+     * @return string|null
510 510
      */
511 511
     public function get_field_type_by_id($id)
512 512
     {
@@ -691,7 +691,6 @@  discard block
 block discarded – undo
691 691
      * @param FormValidator $form
692 692
      * @param array $extraData
693 693
      * @param bool $admin_permissions
694
-     * @param int $user_id
695 694
      * @param array $extra
696 695
      * @param int $itemId
697 696
      * @param array $exclude variables of extra field to exclude
@@ -1592,7 +1591,7 @@  discard block
 block discarded – undo
1592 1591
     }
1593 1592
 
1594 1593
     /**
1595
-     * @return array
1594
+     * @return string[]
1596 1595
      */
1597 1596
     public function getJqgridColumnNames()
1598 1597
     {
@@ -1832,7 +1831,7 @@  discard block
 block discarded – undo
1832 1831
     }
1833 1832
 
1834 1833
     /**
1835
-     * @param array $columns
1834
+     * @param string[] $columns
1836 1835
      * @param array  $column_model
1837 1836
      * @param array  $extraFields
1838 1837
      * @return array
Please login to merge, or discard this patch.
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
         'changeable',
20 20
         'filter',
21 21
         'extra_field_type',
22
-         /* Enable this when field_loggeable is introduced as a table field (2.0)
22
+            /* Enable this when field_loggeable is introduced as a table field (2.0)
23 23
         'field_loggeable',
24 24
          */
25 25
         'created_at'
@@ -523,7 +523,7 @@  discard block
 block discarded – undo
523 523
      * France:Paris;Bretagne;Marseilles;Lyon|Belgique:Bruxelles;Namur;Liège;Bruges|Peru:Lima;Piura;
524 524
      * into
525 525
      * array(
526
- *      'France' =>
526
+     *      'France' =>
527 527
      *      array('Paris', 'Bregtane', 'Marseilles'),
528 528
      *  'Belgique' =>
529 529
      *      array('Namur', 'Liège')
@@ -1184,7 +1184,7 @@  discard block
 block discarded – undo
1184 1184
 
1185 1185
                         if ($this->type == 'user') {
1186 1186
 
1187
-                           /* //the magic should be here
1187
+                            /* //the magic should be here
1188 1188
                             $user_tags = UserManager::get_user_tags($user_id, $field_details[0]);
1189 1189
 
1190 1190
                             $tag_list = '';
Please login to merge, or discard this patch.
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -26,19 +26,19 @@  discard block
 block discarded – undo
26 26
     );
27 27
 
28 28
     public $ops = array(
29
-        'eq' => '=',        //equal
30
-        'ne' => '<>',       //not equal
31
-        'lt' => '<',        //less than
32
-        'le' => '<=',       //less than or equal
33
-        'gt' => '>',        //greater than
34
-        'ge' => '>=',       //greater than or equal
35
-        'bw' => 'LIKE',     //begins with
29
+        'eq' => '=', //equal
30
+        'ne' => '<>', //not equal
31
+        'lt' => '<', //less than
32
+        'le' => '<=', //less than or equal
33
+        'gt' => '>', //greater than
34
+        'ge' => '>=', //greater than or equal
35
+        'bw' => 'LIKE', //begins with
36 36
         'bn' => 'NOT LIKE', //doesn't begin with
37
-        'in' => 'LIKE',     //is in
37
+        'in' => 'LIKE', //is in
38 38
         'ni' => 'NOT LIKE', //is not in
39
-        'ew' => 'LIKE',     //ends with
39
+        'ew' => 'LIKE', //ends with
40 40
         'en' => 'NOT LIKE', //doesn't end with
41
-        'cn' => 'LIKE',     //contains
41
+        'cn' => 'LIKE', //contains
42 42
         'nc' => 'NOT LIKE'  //doesn't contain
43 43
     );
44 44
 
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
      */
324 324
     public static function get_extra_fields_by_handler($handler)
325 325
     {
326
-        $types= array();
326
+        $types = array();
327 327
         $types[self::FIELD_TYPE_TEXT] = get_lang('FieldTypeText');
328 328
         $types[self::FIELD_TYPE_TEXTAREA] = get_lang('FieldTypeTextarea');
329 329
         $types[self::FIELD_TYPE_RADIO] = get_lang('FieldTypeRadio');
@@ -962,7 +962,7 @@  discard block
 block discarded – undo
962 962
                         // chzn-select doesn't work for sessions??
963 963
                         $form->addElement(
964 964
                             'select',
965
-                            'extra_' . $field_details['variable'],
965
+                            'extra_'.$field_details['variable'],
966 966
                             $field_details['display_text'],
967 967
                             $options,
968 968
                             array('id' => 'extra_'.$field_details['variable'])
@@ -1021,7 +1021,7 @@  discard block
 block discarded – undo
1021 1021
 
1022 1022
                         if (!$admin_permissions) {
1023 1023
                             if ($field_details['visible'] == 0) {
1024
-                                $form->freeze('extra_' . $field_details['variable']);
1024
+                                $form->freeze('extra_'.$field_details['variable']);
1025 1025
                             }
1026 1026
                         }
1027 1027
                         break;
@@ -1369,9 +1369,9 @@  discard block
 block discarded – undo
1369 1369
 
1370 1370
                         if (is_array($extraData) && array_key_exists($fieldVariable, $extraData)) {
1371 1371
 
1372
-                            if (file_exists(api_get_path(SYS_UPLOAD_PATH) . $extraData[$fieldVariable])) {
1372
+                            if (file_exists(api_get_path(SYS_UPLOAD_PATH).$extraData[$fieldVariable])) {
1373 1373
                                 $fieldTexts[] = Display::img(
1374
-                                    api_get_path(WEB_UPLOAD_PATH) . $extraData[$fieldVariable],
1374
+                                    api_get_path(WEB_UPLOAD_PATH).$extraData[$fieldVariable],
1375 1375
                                     $field_details['display_text'],
1376 1376
                                     array('width' => '300')
1377 1377
                                 );
@@ -1388,10 +1388,10 @@  discard block
 block discarded – undo
1388 1388
                         $form->applyFilter('extra_'.$field_details['variable'], 'stripslashes');
1389 1389
                         $form->applyFilter('extra_'.$field_details['variable'], 'trim');
1390 1390
 
1391
-                        $allowed_picture_types = array ('jpg', 'jpeg', 'png', 'gif');
1391
+                        $allowed_picture_types = array('jpg', 'jpeg', 'png', 'gif');
1392 1392
                         $form->addRule(
1393 1393
                             'extra_'.$field_details['variable'],
1394
-                            get_lang('OnlyImagesAllowed') . ' ('.implode(',', $allowed_picture_types).')',
1394
+                            get_lang('OnlyImagesAllowed').' ('.implode(',', $allowed_picture_types).')',
1395 1395
                             'filetype',
1396 1396
                             $allowed_picture_types
1397 1397
                         );
@@ -1433,10 +1433,10 @@  discard block
 block discarded – undo
1433 1433
                         if (is_array($extraData) &&
1434 1434
                             array_key_exists($fieldVariable, $extraData)
1435 1435
                         ) {
1436
-                            if (file_exists(api_get_path(SYS_UPLOAD_PATH) . $extraData[$fieldVariable])) {
1436
+                            if (file_exists(api_get_path(SYS_UPLOAD_PATH).$extraData[$fieldVariable])) {
1437 1437
                                 $fieldTexts[] = Display::url(
1438
-                                    api_get_path(WEB_UPLOAD_PATH) . $extraData[$fieldVariable],
1439
-                                    api_get_path(WEB_UPLOAD_PATH) . $extraData[$fieldVariable],
1438
+                                    api_get_path(WEB_UPLOAD_PATH).$extraData[$fieldVariable],
1439
+                                    api_get_path(WEB_UPLOAD_PATH).$extraData[$fieldVariable],
1440 1440
                                     array(
1441 1441
                                         'title' => $field_details['display_text'],
1442 1442
                                         'target' => '_blank'
@@ -1486,12 +1486,12 @@  discard block
 block discarded – undo
1486 1486
                             "extra_{$field_details['variable']}",
1487 1487
                             $field_details['display_text']
1488 1488
                         );
1489
-                        $form->applyFilter('extra_' . $field_details['variable'], 'stripslashes');
1489
+                        $form->applyFilter('extra_'.$field_details['variable'], 'stripslashes');
1490 1490
 
1491 1491
                         if (!$admin_permissions) {
1492 1492
                             if ($field_details['visible'] == 0) {
1493 1493
                                 $form->freeze(
1494
-                                    'extra_' . $field_details['variable']
1494
+                                    'extra_'.$field_details['variable']
1495 1495
                                 );
1496 1496
                             }
1497 1497
                         }
@@ -1502,13 +1502,13 @@  discard block
 block discarded – undo
1502 1502
                             $field_details['display_text']
1503 1503
                         );
1504 1504
                         $form->applyFilter(
1505
-                            'extra_' . $field_details['variable'],
1505
+                            'extra_'.$field_details['variable'],
1506 1506
                             'stripslashes'
1507 1507
                         );
1508 1508
                         if (!$admin_permissions) {
1509 1509
                             if ($field_details['visible'] == 0) {
1510 1510
                                 $form->freeze(
1511
-                                    'extra_' . $field_details['variable']
1511
+                                    'extra_'.$field_details['variable']
1512 1512
                                 );
1513 1513
                             }
1514 1514
                         }
@@ -1518,12 +1518,12 @@  discard block
 block discarded – undo
1518 1518
                             "extra_{$field_details['variable']}",
1519 1519
                             $field_details['display_text']
1520 1520
                         );
1521
-                        $form->applyFilter('extra_' . $field_details['variable'], 'stripslashes');
1521
+                        $form->applyFilter('extra_'.$field_details['variable'], 'stripslashes');
1522 1522
 
1523 1523
                         if (!$admin_permissions) {
1524 1524
                             if ($field_details['visible'] == 0) {
1525 1525
                                 $form->freeze(
1526
-                                    'extra_' . $field_details['variable']
1526
+                                    'extra_'.$field_details['variable']
1527 1527
                                 );
1528 1528
                             }
1529 1529
                         }
@@ -1534,13 +1534,13 @@  discard block
 block discarded – undo
1534 1534
                             $field_details['display_text']
1535 1535
                         );
1536 1536
                         $form->applyFilter(
1537
-                            'extra_' . $field_details['variable'],
1537
+                            'extra_'.$field_details['variable'],
1538 1538
                             'stripslashes'
1539 1539
                         );
1540 1540
                         if (!$admin_permissions) {
1541 1541
                             if ($field_details['visible'] == 0) {
1542 1542
                                 $form->freeze(
1543
-                                    'extra_' . $field_details['variable']
1543
+                                    'extra_'.$field_details['variable']
1544 1544
                                 );
1545 1545
                             }
1546 1546
                         }
@@ -2221,19 +2221,19 @@  discard block
 block discarded – undo
2221 2221
                         break;
2222 2222
                     }
2223 2223
 
2224
-                    if (!file_exists(api_get_path(SYS_UPLOAD_PATH) . $valueData['value'])) {
2224
+                    if (!file_exists(api_get_path(SYS_UPLOAD_PATH).$valueData['value'])) {
2225 2225
                         break;
2226 2226
                     }
2227 2227
 
2228 2228
                     $image = Display::img(
2229
-                        api_get_path(WEB_UPLOAD_PATH) . $valueData['value'],
2229
+                        api_get_path(WEB_UPLOAD_PATH).$valueData['value'],
2230 2230
                         $field['display_text'],
2231 2231
                         array('width' => '300')
2232 2232
                     );
2233 2233
 
2234 2234
                     $displayedValue = Display::url(
2235 2235
                         $image,
2236
-                        api_get_path(WEB_UPLOAD_PATH) . $valueData['value'],
2236
+                        api_get_path(WEB_UPLOAD_PATH).$valueData['value'],
2237 2237
                         array('target' => '_blank')
2238 2238
                     );
2239 2239
                     break;
@@ -2242,13 +2242,13 @@  discard block
 block discarded – undo
2242 2242
                         break;
2243 2243
                     }
2244 2244
 
2245
-                    if (!file_exists(api_get_path(SYS_UPLOAD_PATH) . $valueData['value'])) {
2245
+                    if (!file_exists(api_get_path(SYS_UPLOAD_PATH).$valueData['value'])) {
2246 2246
                         break;
2247 2247
                     }
2248 2248
 
2249 2249
                     $displayedValue = Display::url(
2250 2250
                         get_lang('Download'),
2251
-                        api_get_path(WEB_UPLOAD_PATH) . $valueData['value'],
2251
+                        api_get_path(WEB_UPLOAD_PATH).$valueData['value'],
2252 2252
                         array(
2253 2253
                             'title' => $field['display_text'],
2254 2254
                             'target' => '_blank'
Please login to merge, or discard this patch.
main/inc/lib/extra_field_value.lib.php 3 patches
Doc Comments   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
     }
44 44
 
45 45
     /**
46
-     * @return ExtraField
46
+     * @return string
47 47
      */
48 48
     public function getExtraField()
49 49
     {
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
      * This function is used with $extraField->addElements()
73 73
      * @param array $params array for the insertion into the *_field_values table
74 74
      *
75
-     * @return mixed false on empty params, void otherwise
75
+     * @return false|null false on empty params, void otherwise
76 76
      * @assert (array()) === false
77 77
      */
78 78
     public function saveFieldValues($params)
@@ -500,7 +500,7 @@  discard block
 block discarded – undo
500 500
      * @param int $item_id Item ID (It could be a session_id, course_id or user_id)
501 501
      * @param int $field_id Field ID (the ID from the *_field table)
502 502
      * @param bool $transform Whether to transform the result to a human readable strings
503
-     * @return mixed A structured array with the field_id and field_value, or false on error
503
+     * @return string A structured array with the field_id and field_value, or false on error
504 504
      * @assert (-1,-1) === false
505 505
      */
506 506
     public function get_values_by_handler_and_field_id($item_id, $field_id, $transform = false)
@@ -593,7 +593,7 @@  discard block
 block discarded – undo
593 593
      * @param int $item_id Item ID from the original table
594 594
      * @param string $field_variable The name of the field we are looking for
595 595
      * @param bool $transform
596
-     * @param bool $allVisibility
596
+     * @param bool $visibility
597 597
      *
598 598
      * @return mixed Array of results, or false on error or not found
599 599
      * @assert (-1,'') === false
Please login to merge, or discard this patch.
Indentation   +5 added lines, -6 removed lines patch added patch discarded remove patch
@@ -720,11 +720,11 @@  discard block
 block discarded – undo
720 720
         return false;
721 721
     }
722 722
 
723
-     /**
724
-     * @param int $itemId
725
-     * @param int $fieldId
726
-     * @return array
727
-     */
723
+        /**
724
+         * @param int $itemId
725
+         * @param int $fieldId
726
+         * @return array
727
+         */
728 728
     public function getAllValuesByItemAndField($itemId, $fieldId)
729 729
     {
730 730
         $fieldId = intval($fieldId);
@@ -847,7 +847,6 @@  discard block
 block discarded – undo
847 847
     /**
848 848
      * Deletes all values from an item
849 849
      * @param int $itemId (session id, course id, etc)
850
-
851 850
      * @assert (-1,-1) == null
852 851
      */
853 852
     public function deleteValuesByItem($itemId)
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
                             break;
210 210
                     }
211 211
 
212
-                    $fileName = ExtraField::FIELD_TYPE_FILE_IMAGE . "_{$params['item_id']}.png";
212
+                    $fileName = ExtraField::FIELD_TYPE_FILE_IMAGE."_{$params['item_id']}.png";
213 213
 
214 214
                     if (!file_exists($fileDir)) {
215 215
                         mkdir($fileDir, $dirPermissions, true);
@@ -217,11 +217,11 @@  discard block
 block discarded – undo
217 217
 
218 218
                     if ($value['error'] == 0) {
219 219
                         $imageExtraField = new Image($value['tmp_name']);
220
-                        $imageExtraField->send_image($fileDir . $fileName, -1, 'png');
220
+                        $imageExtraField->send_image($fileDir.$fileName, -1, 'png');
221 221
                         $newParams = array(
222 222
                             'item_id' => $params['item_id'],
223 223
                             'field_id' => $extraFieldInfo['id'],
224
-                            'value' => $fileDirStored . $fileName,
224
+                            'value' => $fileDirStored.$fileName,
225 225
                             'comment' => $comment
226 226
                         );
227 227
 
@@ -247,18 +247,18 @@  discard block
 block discarded – undo
247 247
                     }
248 248
 
249 249
                     $cleanedName = api_replace_dangerous_char($value['name']);
250
-                    $fileName = ExtraField::FIELD_TYPE_FILE . "_{$params['item_id']}_$cleanedName";
250
+                    $fileName = ExtraField::FIELD_TYPE_FILE."_{$params['item_id']}_$cleanedName";
251 251
                     if (!file_exists($fileDir)) {
252 252
                         mkdir($fileDir, $dirPermissions, true);
253 253
                     }
254 254
 
255 255
                     if ($value['error'] == 0) {
256
-                        moveUploadedFile($value, $fileDir . $fileName);
256
+                        moveUploadedFile($value, $fileDir.$fileName);
257 257
 
258 258
                         $new_params = array(
259 259
                             'item_id' => $params['item_id'],
260 260
                             'field_id' => $extraFieldInfo['id'],
261
-                            'value' => $fileDirStored . $fileName
261
+                            'value' => $fileDirStored.$fileName
262 262
                         );
263 263
 
264 264
                         if ($this->type !== 'session' && $this->type !== 'course') {
@@ -380,7 +380,7 @@  discard block
 block discarded – undo
380 380
                 */
381 381
                 if (false) {
382 382
                     global $app;
383
-                    switch($this->type) {
383
+                    switch ($this->type) {
384 384
                         case 'question':
385 385
                             $extraFieldValue = new ChamiloLMS\Entity\QuestionFieldValues();
386 386
                             $extraFieldValue->setUserId(api_get_user_id());
@@ -442,7 +442,7 @@  discard block
 block discarded – undo
442 442
                 */
443 443
                 if (false) {
444 444
                     global $app;
445
-                    switch($this->type) {
445
+                    switch ($this->type) {
446 446
                         case 'question':
447 447
                             $extraFieldValue = $app['orm.ems']['db_write']->getRepository('ChamiloLMS\Entity\QuestionFieldValues')->find($field_values['id']);
448 448
                             $extraFieldValue->setUserId(api_get_user_id());
Please login to merge, or discard this patch.
main/inc/lib/formvalidator/Element/DateRangePicker.php 3 patches
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -145,6 +145,7 @@
 block discarded – undo
145 145
 
146 146
     /**
147 147
     * @param array $dates result of parseDateRange()
148
+    * @param string $format
148 149
     *
149 150
     * @return bool
150 151
     */
Please login to merge, or discard this patch.
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -7,8 +7,8 @@  discard block
 block discarded – undo
7 7
 class DateRangePicker extends HTML_QuickForm_text
8 8
 {
9 9
     /**
10
-    * Constructor
11
-    */
10
+     * Constructor
11
+     */
12 12
     public function __construct($elementName = null, $elementLabel = null, $attributes = null)
13 13
     {
14 14
         if (!isset($attributes['id'])) {
@@ -144,10 +144,10 @@  discard block
 block discarded – undo
144 144
     }
145 145
 
146 146
     /**
147
-    * @param array $dates result of parseDateRange()
148
-    *
149
-    * @return bool
150
-    */
147
+     * @param array $dates result of parseDateRange()
148
+     *
149
+     * @return bool
150
+     */
151 151
     public function validateDates($dates, $format = null)
152 152
     {
153 153
         if (empty($dates['start']) || empty($dates['end'])) {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -88,7 +88,7 @@
 block discarded – undo
88 88
         }
89 89
 
90 90
         $timePicker = 'true';
91
-        $timePickerValue =  $this->getAttribute('timePicker');
91
+        $timePickerValue = $this->getAttribute('timePicker');
92 92
         if (!empty($timePickerValue)) {
93 93
             $timePicker = $timePickerValue;
94 94
         }
Please login to merge, or discard this patch.
main/inc/lib/formvalidator/Rule/HTML.php 2 patches
Doc Comments   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -25,8 +25,7 @@
 block discarded – undo
25 25
      * Get allowed tags
26 26
      * @param int $mode NO_HTML, STUDENT_HTML, TEACHER_HTML,
27 27
      * STUDENT_HTML_FULLPAGE or TEACHER_HTML_FULLPAGE
28
-     * @param boolean $fullpage If true, the allowed tags for full-page editing
29
-     * are returned.
28
+     * @return string
30 29
      */
31 30
     static function get_allowed_tags($mode)
32 31
     {
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
      */
17 17
     function validate($html, $mode = NO_HTML)
18 18
     {
19
-        $allowed_tags = self::get_allowed_tags ($mode, $fullpage);
19
+        $allowed_tags = self::get_allowed_tags($mode, $fullpage);
20 20
         $cleaned_html = kses($html, $allowed_tags);
21 21
         return $html == $cleaned_html;
22 22
     }
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
         // Include the allowed tags.
34 34
         //include(dirname(__FILE__).'/allowed_tags.inc.php');
35 35
         global $allowed_tags_student, $allowed_tags_student_full_page, $allowed_tags_teacher, $allowed_tags_teacher_full_page;
36
-        switch($mode)
36
+        switch ($mode)
37 37
         {
38 38
             case NO_HTML:
39 39
                 return array();
Please login to merge, or discard this patch.
main/inc/lib/formvalidator/Rule/MaxFileSize.php 2 patches
Doc Comments   -1 removed lines patch added patch discarded remove patch
@@ -9,7 +9,6 @@
 block discarded – undo
9 9
 {
10 10
 	/**
11 11
 	 * @param $value array     Uploaded file info (from $_FILES)
12
-	 * @param null $options
13 12
 	 * @return bool
14 13
 	 */
15 14
 	public function validate($elementValue, $maxSize)
Please login to merge, or discard this patch.
Indentation   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -7,22 +7,22 @@
 block discarded – undo
7 7
  */
8 8
 class HTML_QuickForm_Rule_MaxFileSize extends HTML_QuickForm_Rule
9 9
 {
10
-	/**
11
-	 * @param $value array     Uploaded file info (from $_FILES)
12
-	 * @param null $options
13
-	 * @return bool
14
-	 */
15
-	public function validate($elementValue, $maxSize)
16
-	{
17
-		if (!empty($elementValue['error']) &&
18
-			(UPLOAD_ERR_FORM_SIZE == $elementValue['error'] || UPLOAD_ERR_INI_SIZE == $elementValue['error'])
19
-		) {
20
-			return false;
21
-		}
22
-		if (!HTML_QuickForm_file::_ruleIsUploadedFile($elementValue)) {
23
-			return true;
24
-		}
10
+    /**
11
+     * @param $value array     Uploaded file info (from $_FILES)
12
+     * @param null $options
13
+     * @return bool
14
+     */
15
+    public function validate($elementValue, $maxSize)
16
+    {
17
+        if (!empty($elementValue['error']) &&
18
+            (UPLOAD_ERR_FORM_SIZE == $elementValue['error'] || UPLOAD_ERR_INI_SIZE == $elementValue['error'])
19
+        ) {
20
+            return false;
21
+        }
22
+        if (!HTML_QuickForm_file::_ruleIsUploadedFile($elementValue)) {
23
+            return true;
24
+        }
25 25
 
26
-		return ($maxSize >= @filesize($elementValue['tmp_name']));
27
-	}
26
+        return ($maxSize >= @filesize($elementValue['tmp_name']));
27
+    }
28 28
 }
Please login to merge, or discard this patch.
main/inc/lib/formvalidator/Rule/MobilePhoneNumber.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@
 block discarded – undo
16 16
      *
17 17
      * @param string Mobile phone number to be validated
18 18
      * @param string Not using it. Just to respect the declaration
19
-     * @return boolean Returns true if valid, false otherwise.
19
+     * @return integer Returns true if valid, false otherwise.
20 20
      */
21 21
     function validate($mobilePhoneNumber, $options = null)
22 22
     {
Please login to merge, or discard this patch.