Explorar o código

Renamed update_event_exercice to update_event_exercise()

Yannick Warnier %!s(int64=12) %!d(string=hai) anos
pai
achega
5e037265e7

+ 2 - 2
main/exercice/exercise.lib.php

@@ -2406,7 +2406,7 @@ function display_question_list_by_attempt($objExercise, $exe_id, $save_user_resu
         $learnpath_item_view_id = $exercise_stat_info['orig_lp_item_view_id'];
 
         if (api_is_allowed_to_session_edit()) {
-            update_event_exercice($exercise_stat_info['exe_id'], $objExercise->selectId(), $total_score, $total_weight, api_get_session_id(), $learnpath_id, $learnpath_item_id, $learnpath_item_view_id, $exercise_stat_info['exe_duration']);
+            update_event_exercise($exercise_stat_info['exe_id'], $objExercise->selectId(), $total_score, $total_weight, api_get_session_id(), $learnpath_id, $learnpath_item_id, $learnpath_item_view_id, $exercise_stat_info['exe_duration']);
         }
 
         // Send notification ..
@@ -2446,4 +2446,4 @@ function get_question_ribbon($objExercise, $score, $weight, $check_pass_percenta
 
     $ribbon .= '</div>';
     return $ribbon;
-}
+}

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

@@ -380,7 +380,7 @@ switch ($action) {
 
                 $_SESSION['duration_time'][$key] = time();
 
-                update_event_exercice(  $exe_id,
+                update_event_exercise(  $exe_id,
                                         $objExercise->selectId(),
                                         $total_score,
                                         $total_weight,

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

@@ -328,12 +328,12 @@ function event_link($link_id)
  * @author Julio Montoya Armas <gugli100@gmail.com> Reworked 2010
  * @desc Record result of user when an exercice was done
  */
-function update_event_exercice($exeid, $exo_id, $score, $weighting, $session_id, $learnpath_id = 0, $learnpath_item_id = 0, $learnpath_item_view_id = 0, $duration = 0, $status = '', $remind_list = array(), $end_date = null)
+function update_event_exercise($exeid, $exo_id, $score, $weighting, $session_id, $learnpath_id = 0, $learnpath_item_id = 0, $learnpath_item_view_id = 0, $duration = 0, $status = '', $remind_list = array(), $end_date = null)
 {
     require_once api_get_path(SYS_CODE_PATH).'exercice/exercise.lib.php';
     global $debug;
     if ($debug) {
-        error_log('Called to update_event_exercice');
+        error_log('Called to update_event_exercise');
         error_log('duration:'.$duration);
     }
 
@@ -379,7 +379,7 @@ function update_event_exercice($exeid, $exo_id, $score, $weighting, $session_id,
         $res = Database::query($sql);
 
         if ($debug)
-            error_log('update_event_exercice called');
+            error_log('update_event_exercise called');
         if ($debug)
             error_log("$sql");
 
@@ -393,7 +393,7 @@ function update_event_exercice($exeid, $exo_id, $score, $weighting, $session_id,
 
 /**
  * This function creates an empty Exercise in STATISTIC_TRACK_E_EXERCICES table.
- * After that in exercise_result.php we call the update_event_exercice() to update the exercise
+ * After that in exercise_result.php we call the update_event_exercise() to update the exercise
  * @return $id the last id registered, or false on error
  * @author Julio Montoya <gugli100@gmail.com>
  * @desc Record result of user when an exercice was done
@@ -520,7 +520,7 @@ function exercise_attempt($score, $answer, $question_id, $exe_id, $position, $ex
         if (Database::num_rows($result)) {
             if ($debug)
                 error_log("Attempt already exist: exe_id: $exe_id - user_id:$user_id - question_id:$question_id");
-            //The attempt already exist do not update use  update_event_exercice() instead
+            //The attempt already exist do not update use  update_event_exercise() instead
             return false;
         }
 
@@ -1567,4 +1567,4 @@ function portal_homepage_edited_event_send_mail_filter_func(&$values)
     $res = _event_send_mail_filter_func($values);
     // proper logic for this filter
     return $res;
-}
+}

+ 2 - 2
tests/main/inc/lib/events.lib.inc.test.php

@@ -143,8 +143,8 @@ class TestEvents extends UnitTestCase {
 		$session_id='';
 		$duration='';
 		$question_list = array();
-		$res=update_event_exercice($exeid,$exo_id, $score, $weighting,$session_id,$learnpath_id=0,$learnpath_item_id=0, $duration);
+		$res=update_event_exercise($exeid,$exo_id, $score, $weighting,$session_id,$learnpath_id=0,$learnpath_item_id=0, $duration);
 		$this->assertTrue(is_bool($res));
 		//var_dump($res);
 	}
-}
+}