|
|
|
@ -182,6 +182,8 @@ 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(); |
|
|
|
|
|
|
|
|
|
//First time here we create an attempt (getting the exe_id) |
|
|
|
@ -309,7 +311,30 @@ switch ($action) { |
|
|
|
|
if ($debug) error_log("total_score: $total_score "); |
|
|
|
|
if ($debug) error_log("total_weight: $total_weight "); |
|
|
|
|
|
|
|
|
|
update_event_exercice($exe_id, $objExercise->selectId(), $total_score, $total_weight, api_get_session_id(), $exercise_stat_info['orig_lp_id'], $exercise_stat_info['orig_lp_item_id'], $exercise_stat_info['orig_lp_item_view_id'], $exercise_stat_info['exe_duration'], $question_list, 'incomplete', $remind_list); |
|
|
|
|
$key = get_time_control_key($exercise_id); |
|
|
|
|
|
|
|
|
|
$duration = 0; |
|
|
|
|
$now = time(); |
|
|
|
|
|
|
|
|
|
if (isset($_SESSION['duration_time'][$key]) && !empty($_SESSION['duration_time'][$key])) { |
|
|
|
|
$duration = $now - $_SESSION['duration_time'][$key]; |
|
|
|
|
if (!empty($exercise_stat_info['exe_duration'])) { |
|
|
|
|
$duration += $exercise_stat_info['exe_duration']*60; |
|
|
|
|
} |
|
|
|
|
$duration = intval(round($duration/60)); |
|
|
|
|
$_SESSION['duration_time'][$key] = 0; |
|
|
|
|
} else { |
|
|
|
|
if (!empty($exercise_stat_info['exe_duration'])) { |
|
|
|
|
$duration = $exercise_stat_info['exe_duration']; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if ($type == 'all') { |
|
|
|
|
$exercise_stat_info = $objExercise->get_stat_track_exercise_info_by_exe_id($exe_id); |
|
|
|
|
$duration = $exercise_stat_info['exe_duration']; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
update_event_exercice($exe_id, $objExercise->selectId(), $total_score, $total_weight, api_get_session_id(), $exercise_stat_info['orig_lp_id'], $exercise_stat_info['orig_lp_item_id'], $exercise_stat_info['orig_lp_item_view_id'], $duration, $question_list, 'incomplete', $remind_list); |
|
|
|
|
|
|
|
|
|
// Destruction of the Question object |
|
|
|
|
unset($objQuestionTmp); |
|
|
|
|