Browse Source

Minor - format code.

jmontoyaa 7 years ago
parent
commit
5a27b57a30
2 changed files with 14 additions and 14 deletions
  1. 7 7
      main/inc/ajax/exercise.ajax.php
  2. 7 7
      main/inc/lib/events.lib.php

+ 7 - 7
main/inc/ajax/exercise.ajax.php

@@ -305,7 +305,7 @@ switch ($action) {
             // Getting information of the current exercise.
             $exercise_stat_info = $objExercise->get_stat_track_exercise_info_by_exe_id($exe_id);
             $exercise_id = $exercise_stat_info['exe_exo_id'];
-            $attempt_list = array();
+            $attemptList = array();
 
             // First time here we create an attempt (getting the exe_id).
             if (!empty($exercise_stat_info)) {
@@ -313,8 +313,8 @@ switch ($action) {
                 $exe_id = $exercise_stat_info['exe_id'];
                 $total_score = $exercise_stat_info['exe_result'];
 
-                //Getting the list of attempts
-                $attempt_list = Event::getAllExerciseEventByExeId($exe_id);
+                // Getting the list of attempts
+                $attemptList = Event::getAllExerciseEventByExeId($exe_id);
             }
 
             // Updating Reminder algorythm.
@@ -423,7 +423,7 @@ switch ($action) {
                 }
 
                 // Deleting old attempt
-                if (isset($attempt_list) && !empty($attempt_list[$my_question_id])) {
+                if (isset($attemptList) && !empty($attemptList[$my_question_id])) {
                     if ($debug) {
                         error_log("delete_attempt  exe_id : $exe_id, my_question_id: $my_question_id");
                     }
@@ -444,10 +444,10 @@ switch ($action) {
                         );
                     }
 
-                    if (isset($attempt_list[$my_question_id]) &&
-                        isset($attempt_list[$my_question_id]['marks'])
+                    if (isset($attemptList[$my_question_id]) &&
+                        isset($attemptList[$my_question_id]['marks'])
                     ) {
-                        $total_score -= $attempt_list[$my_question_id]['marks'];
+                        $total_score -= $attemptList[$my_question_id]['marks'];
                     }
                 }
 

+ 7 - 7
main/inc/lib/events.lib.php

@@ -1728,14 +1728,14 @@ class Event
      */
     public static function getAllExerciseEventByExeId($exe_id)
     {
-        $table_track_attempt = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ATTEMPT);
+        $table = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ATTEMPT);
         $exe_id = intval($exe_id);
-        $list = array();
 
-        $sql = "SELECT * FROM $table_track_attempt
+        $sql = "SELECT * FROM $table
                 WHERE exe_id = $exe_id
                 ORDER BY position";
         $res_question = Database::query($sql);
+        $list = array();
         if (Database::num_rows($res_question)) {
             while ($row = Database::fetch_array($res_question, 'ASSOC')) {
                 $list[$row['question_id']][] = $row;
@@ -1759,7 +1759,7 @@ class Event
         $session_id,
         $question_id
     ) {
-        $table_track_attempt = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ATTEMPT);
+        $table = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ATTEMPT);
 
         $exe_id = intval($exe_id);
         $user_id = intval($user_id);
@@ -1767,7 +1767,7 @@ class Event
         $session_id = intval($session_id);
         $question_id = intval($question_id);
 
-        $sql = "DELETE FROM $table_track_attempt
+        $sql = "DELETE FROM $table
                 WHERE
                     exe_id = $exe_id AND
                     user_id = $user_id AND
@@ -1801,7 +1801,7 @@ class Event
         $question_id,
         $sessionId = null
     ) {
-        $table_track_attempt = Database::get_main_table(TABLE_STATISTIC_TRACK_E_HOTSPOT);
+        $table = Database::get_main_table(TABLE_STATISTIC_TRACK_E_HOTSPOT);
 
         $exe_id = intval($exe_id);
         $user_id = intval($user_id);
@@ -1811,7 +1811,7 @@ class Event
             $sessionId = api_get_session_id();
         }
 
-        $sql = "DELETE FROM $table_track_attempt
+        $sql = "DELETE FROM $table
                 WHERE   
                     hotspot_exe_id = $exe_id AND
                     hotspot_user_id = $user_id AND