|
|
|
@ -98,11 +98,18 @@ if (isset($exercise_stat_info['exe_id'])) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//1. Check if this is a new attempt or a previous |
|
|
|
//1. Check if this is a new attempt or a previous |
|
|
|
|
|
|
|
$countNotFinished = get_attempt_count_incomplete(api_get_user_id(), $objExercise->selectId(), $learnpath_id, $learnpath_item_id); |
|
|
|
$label = get_lang('StartTest'); |
|
|
|
$label = get_lang('StartTest'); |
|
|
|
if ($time_control && !empty($clock_expired_time) || !empty($attempt_list)) { |
|
|
|
if ($time_control && !empty($clock_expired_time) || !empty($attempt_list)) { |
|
|
|
$label = get_lang('ContinueTest'); |
|
|
|
$label = get_lang('ContinueTest'); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ($countNotFinished >= $objExercise->selectAttempts() && !api_is_allowed_to_edit()) { |
|
|
|
|
|
|
|
$message = Display::display_warning_message(sprintf(get_lang('ReachedMaxAttempts'),$objExercise->selectTitle(),$objExercise->selectAttempts()).' '.get_lang('YouTriedToResolveThisExerciseEarlier')); |
|
|
|
|
|
|
|
} elseif ($countNotFinished >= $objExercise->selectAttempts() && api_is_allowed_to_edit()) { |
|
|
|
|
|
|
|
$message = Display::display_warning_message(get_lang('ReachedMaxAttemptsAdmin')); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (!empty($attempt_list)) { |
|
|
|
if (!empty($attempt_list)) { |
|
|
|
$message = Display::return_message(get_lang('YouTriedToResolveThisExerciseEarlier')); |
|
|
|
$message = Display::return_message(get_lang('YouTriedToResolveThisExerciseEarlier')); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -239,7 +246,7 @@ if ($time_control) { |
|
|
|
|
|
|
|
|
|
|
|
$html .= $message; |
|
|
|
$html .= $message; |
|
|
|
|
|
|
|
|
|
|
|
if (!empty($exercise_url_button)) { |
|
|
|
if (!empty($exercise_url_button) && ($countNotFinished == 0 || api_is_allowed_to_edit())) { |
|
|
|
$html .= Display::div(Display::div($exercise_url_button, array('class'=>'exercise_overview_options span12')), array('class'=>' row')); |
|
|
|
$html .= Display::div(Display::div($exercise_url_button, array('class'=>'exercise_overview_options span12')), array('class'=>' row')); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|