|
|
|
@ -218,7 +218,7 @@ if (!empty($exercise_stat_info['questions_to_check'])) { |
|
|
|
$my_remind_list = array_filter($my_remind_list); |
|
|
|
$my_remind_list = array_filter($my_remind_list); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$params = 'exe_id'.$exe_id.'&exerciseId='.$exerciseId.'&origin='.$origin.'&learnpath_id='.$learnpath_id.'&learnpath_item_id='.$learnpath_item_id.'&learnpath_item_view_id='.$learnpath_item_view_id; |
|
|
|
$params = 'exe_id='.$exe_id.'&exerciseId='.$exerciseId.'&origin='.$origin.'&learnpath_id='.$learnpath_id.'&learnpath_item_id='.$learnpath_item_id.'&learnpath_item_view_id='.$learnpath_item_view_id; |
|
|
|
if ($debug) { error_log("5.1 params: -> $params"); }; |
|
|
|
if ($debug) { error_log("5.1 params: -> $params"); }; |
|
|
|
|
|
|
|
|
|
|
|
if ($reminder == 2 && empty($my_remind_list)) { |
|
|
|
if ($reminder == 2 && empty($my_remind_list)) { |
|
|
|
@ -231,7 +231,6 @@ if ($reminder == 2 && empty($my_remind_list)) { |
|
|
|
* If the expired time is major that zero(0) then the expired time is compute on this time. Disable for learning path |
|
|
|
* If the expired time is major that zero(0) then the expired time is compute on this time. Disable for learning path |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ($time_control) { |
|
|
|
if ($time_control) { |
|
|
|
if ($debug) error_log('6.1. Time control is enabled'); |
|
|
|
if ($debug) error_log('6.1. Time control is enabled'); |
|
|
|
if ($debug) {error_log('6.2. $current_expired_time_key '.$current_expired_time_key); }; |
|
|
|
if ($debug) {error_log('6.2. $current_expired_time_key '.$current_expired_time_key); }; |
|
|
|
@ -473,61 +472,63 @@ if (!$current_question || $_REQUEST['num']) { |
|
|
|
$current_question++; |
|
|
|
$current_question++; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
//var_dump($current_question , $question_count); |
|
|
|
if ($question_count != 0) { |
|
|
|
if (($objExercise->type == ALL_ON_ONE_PAGE || $current_question > $question_count)) { |
|
|
|
if (($objExercise->type == ALL_ON_ONE_PAGE || $current_question > $question_count)) { |
|
|
|
if (api_is_allowed_to_session_edit()) { |
|
|
|
if (api_is_allowed_to_session_edit()) { |
|
|
|
// goes to the script that will show the result of the exercise |
|
|
|
// goes to the script that will show the result of the exercise |
|
|
|
if ($objExercise->type == ALL_ON_ONE_PAGE) { |
|
|
|
if ($objExercise->type == ALL_ON_ONE_PAGE) { |
|
|
|
if ($debug) { error_log('Exercise ALL_ON_ONE_PAGE -> Redirecting to exercise_result.php'); } |
|
|
|
if ($debug) { error_log('Exercise ALL_ON_ONE_PAGE -> Redirecting to exercise_result.php'); } |
|
|
|
|
|
|
|
|
|
|
|
//We check if the user attempts before sending to the exercise_result.php |
|
|
|
//We check if the user attempts before sending to the exercise_result.php |
|
|
|
if ($objExercise->selectAttempts() > 0) { |
|
|
|
if ($objExercise->selectAttempts() > 0) { |
|
|
|
$attempt_count = get_attempt_count(api_get_user_id(), $exerciseId, $safe_lp_id, $safe_lp_item_id, $safe_lp_item_view_id); |
|
|
|
$attempt_count = get_attempt_count(api_get_user_id(), $exerciseId, $safe_lp_id, $safe_lp_item_id, $safe_lp_item_view_id); |
|
|
|
if ($attempt_count >= $objExercise->selectAttempts()) { |
|
|
|
if ($attempt_count >= $objExercise->selectAttempts()) { |
|
|
|
Display :: display_warning_message(sprintf(get_lang('ReachedMaxAttempts'), $exercise_title, $objExercise->selectAttempts()), false); |
|
|
|
Display :: display_warning_message(sprintf(get_lang('ReachedMaxAttempts'), $exercise_title, $objExercise->selectAttempts()), false); |
|
|
|
if ($origin != 'learnpath') { |
|
|
|
if ($origin != 'learnpath') { |
|
|
|
//so we are not in learnpath tool |
|
|
|
//so we are not in learnpath tool |
|
|
|
echo '</div>'; //End glossary div |
|
|
|
echo '</div>'; //End glossary div |
|
|
|
Display :: display_footer(); |
|
|
|
Display :: display_footer(); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
echo '</body></html>'; |
|
|
|
echo '</body></html>'; |
|
|
|
} |
|
|
|
} |
|
|
|
exit; |
|
|
|
exit; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
//header("Location: exercise_result.php?origin=$origin&learnpath_id=$safe_lp_id&learnpath_item_id=$safe_lp_item_id&learnpath_item_view_id=$safe_lp_item_view_id"); |
|
|
|
//header("Location: exercise_result.php?origin=$origin&learnpath_id=$safe_lp_id&learnpath_item_id=$safe_lp_item_id&learnpath_item_view_id=$safe_lp_item_view_id"); |
|
|
|
//exit; |
|
|
|
//exit; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
|
|
|
|
|
|
|
|
//Time control is only enabled for ONE PER PAGE |
|
|
|
//Time control is only enabled for ONE PER PAGE |
|
|
|
if (!empty($exe_id) && is_numeric($exe_id)) { |
|
|
|
if (!empty($exe_id) && is_numeric($exe_id)) { |
|
|
|
//Verify if the current test is fraudulent |
|
|
|
//Verify if the current test is fraudulent |
|
|
|
$check = exercise_time_control_is_valid($exerciseId); |
|
|
|
$check = exercise_time_control_is_valid($exerciseId); |
|
|
|
|
|
|
|
|
|
|
|
if ($check) { |
|
|
|
if ($check) { |
|
|
|
$sql_exe_result = ""; |
|
|
|
$sql_exe_result = ""; |
|
|
|
if ($debug) { error_log('exercise_time_control_is_valid is valid'); } |
|
|
|
if ($debug) { error_log('exercise_time_control_is_valid is valid'); } |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
$sql_exe_result = ", exe_result = 0"; |
|
|
|
$sql_exe_result = ", exe_result = 0"; |
|
|
|
if ($debug) { error_log('exercise_time_control_is_valid is NOT valid then exe_result = 0 '); } |
|
|
|
if ($debug) { error_log('exercise_time_control_is_valid is NOT valid then exe_result = 0 '); } |
|
|
|
} |
|
|
|
} |
|
|
|
/* |
|
|
|
/* |
|
|
|
//Clean incomplete - @todo why setting to blank the status? |
|
|
|
//Clean incomplete - @todo why setting to blank the status? |
|
|
|
$update_query = "UPDATE $stat_table SET status = '', exe_date = '".api_get_utc_datetime() ."' , orig_lp_item_view_id = '$safe_lp_item_view_id' $sql_exe_result WHERE exe_id = ".$exe_id; |
|
|
|
$update_query = "UPDATE $stat_table SET status = '', exe_date = '".api_get_utc_datetime() ."' , orig_lp_item_view_id = '$safe_lp_item_view_id' $sql_exe_result WHERE exe_id = ".$exe_id; |
|
|
|
|
|
|
|
|
|
|
|
//if ($debug) { error_log('Updating track_e_exercises '.$update_query); } |
|
|
|
//if ($debug) { error_log('Updating track_e_exercises '.$update_query); } |
|
|
|
Database::query($update_query);*/ |
|
|
|
Database::query($update_query);*/ |
|
|
|
} |
|
|
|
} |
|
|
|
//if ($debug) { error_log('Redirecting to exercise_show.php'); } |
|
|
|
header('Location: exercise_reminder.php?'.$params); |
|
|
|
header('Location: exercise_reminder.php?'.$params); |
|
|
|
exit; |
|
|
|
exit; |
|
|
|
//header("Location: exercise_submit.php?exerciseId=$exerciseId"); |
|
|
|
//header("Location: exercise_submit.php?exerciseId=$exerciseId"); |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
if ($debug) { error_log('Redirecting to exercise_submit.php'); } |
|
|
|
if ($debug) { error_log('Redirecting to exercise_submit.php'); } |
|
|
|
//header("Location: exercise_submit.php?exerciseId=$exerciseId"); |
|
|
|
//header("Location: exercise_submit.php?exerciseId=$exerciseId"); |
|
|
|
exit; |
|
|
|
exit; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
$error = get_lang('QuestionNotFound'); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (!empty ($_GET['gradebook']) && $_GET['gradebook'] == 'view') { |
|
|
|
if (!empty ($_GET['gradebook']) && $_GET['gradebook'] == 'view') { |
|
|
|
|