Explorar el Código

Minor - format code

jmontoyaa hace 7 años
padre
commit
45225f7523
Se han modificado 2 ficheros con 27 adiciones y 11 borrados
  1. 2 4
      main/exercise/exercise_report.php
  2. 25 7
      main/exercise/exercise_show.php

+ 2 - 4
main/exercise/exercise_report.php

@@ -18,7 +18,7 @@ $this_section = SECTION_COURSES;
 
 $htmlHeadXtra[] = api_get_jqgrid_js();
 
-$filter_user = isset($_REQUEST['filter_by_user']) ? intval($_REQUEST['filter_by_user']) : null;
+$filter_user = isset($_REQUEST['filter_by_user']) ? (int) $_REQUEST['filter_by_user'] : null;
 $isBossOfStudent = false;
 if (api_is_student_boss() && !empty($filter_user)) {
     // Check if boss has access to user info.
@@ -155,7 +155,6 @@ if (isset($_REQUEST['comments']) &&
 
     foreach ($_POST as $key_index => $key_value) {
         $my_post_info = explode('_', $key_index);
-
         $post_content_id[] = isset($my_post_info[1]) ? $my_post_info[1] : null;
 
         if ($my_post_info[0] == 'comments') {
@@ -240,8 +239,7 @@ if (isset($_REQUEST['comments']) &&
     }
 
     // Updating LP score here
-    if (in_array($origin, array('tracking_course', 'user_course', 'correct_exercise_in_lp'))
-    ) {
+    if (in_array($origin, array('tracking_course', 'user_course', 'correct_exercise_in_lp'))) {
         $sql = "UPDATE $TBL_LP_ITEM_VIEW 
                 SET score = '".floatval($tot)."'
                 WHERE c_id = ".$course_id." AND id = ".$lp_item_view_id;

+ 25 - 7
main/exercise/exercise_show.php

@@ -149,12 +149,15 @@ if (!empty($gradebook) && $gradebook == 'view') {
     );
 }
 
-$interbreadcrumb[] = array("url" => "exercise.php?".api_get_cidreq(), "name" => get_lang('Exercises'));
+$interbreadcrumb[] = array(
+    "url" => "exercise.php?".api_get_cidreq(),
+    'name' => get_lang('Exercises')
+);
 $interbreadcrumb[] = array(
     "url" => "overview.php?exerciseId=".$exercise_id.'&'.api_get_cidreq(),
     "name" => $objExercise->selectTitle(true)
 );
-$interbreadcrumb[] = array("url" => "#", "name" => get_lang('Result'));
+$interbreadcrumb[] = array('url' => '#', 'name' => get_lang('Result'));
 
 $this_section = SECTION_COURSES;
 
@@ -268,7 +271,11 @@ if (!empty($track_exercise_info)) {
             $show_only_total_score = true;
             if ($origin != 'learnpath') {
                 if ($currentUserId == $student_id) {
-                    echo Display::return_message(get_lang('ThankYouForPassingTheTest'), 'warning', false);
+                    echo Display::return_message(
+                        get_lang('ThankYouForPassingTheTest'),
+                        'warning',
+                        false
+                    );
                 }
             }
         } elseif ($result_disabled == RESULT_DISABLE_SHOW_SCORE_ATTEMPT_SHOW_ANSWERS_LAST_ATTEMPT) {
@@ -320,7 +327,6 @@ if ($show_results || $show_only_total_score || $showTotalScoreAndUserChoicesInLa
 }
 
 $i = $totalScore = $totalWeighting = 0;
-
 if ($debug > 0) {
     error_log("ExerciseResult: ".print_r($exerciseResult, 1));
     error_log("QuestionList: ".print_r($questionList, 1));
@@ -977,7 +983,10 @@ if (!empty($category_list) && ($show_results || $show_only_total_score || $showT
         'score' => $my_total_score_temp,
         'total' => $totalWeighting
     );
-    echo TestCategory::get_stats_table_by_attempt($objExercise->id, $category_list);
+    echo TestCategory::get_stats_table_by_attempt(
+        $objExercise->id,
+        $category_list
+    );
 }
 
 echo $total_score_text;
@@ -1019,7 +1028,13 @@ if ($isFeedbackAllowed && $origin != 'learnpath' && $origin != 'student_progress
             'exeid' => $id
         ]);
 
-        $emailForm = new FormValidator('myform', 'post', $formUrl, '', ['id' => 'myform']);
+        $emailForm = new FormValidator(
+            'myform',
+            'post',
+            $formUrl,
+            '',
+            ['id' => 'myform']
+        );
     }
 
     $emailForm->addCheckBox(
@@ -1100,7 +1115,10 @@ if ($origin != 'learnpath') {
         echo "<script>window.parent.API.void_save_asset('$totalScore', '$totalWeighting', 0, 'completed'); </script>";
         echo '</body></html>';
     } else {
-        echo Display::return_message(get_lang('ExerciseFinished').' '.get_lang('ToContinueUseMenu'), 'normal');
+        echo Display::return_message(
+            get_lang('ExerciseFinished').' '.get_lang('ToContinueUseMenu'),
+            'normal'
+        );
         echo '<br />';
     }
 }