|
|
|
|
@ -28,7 +28,7 @@ $sessionId = api_get_session_id(); |
|
|
|
|
$exercise_id = isset($_REQUEST['exerciseId']) ? intval($_REQUEST['exerciseId']) : 0; |
|
|
|
|
|
|
|
|
|
$objExercise = new Exercise(); |
|
|
|
|
$result = $objExercise->read($exercise_id, false); |
|
|
|
|
$result = $objExercise->read($exercise_id, true); |
|
|
|
|
|
|
|
|
|
if (!$result) { |
|
|
|
|
api_not_allowed(true); |
|
|
|
|
@ -392,7 +392,14 @@ if ($disable && empty($exercise_stat_info)) { |
|
|
|
|
$exercise_url_button = Display::return_message(get_lang('NewExerciseAttemptDisabled')); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (!empty($exercise_url_button)) { |
|
|
|
|
$isLimitReached = ExerciseLib::isQuestionsLimitPerDayReached( |
|
|
|
|
api_get_user_id(), |
|
|
|
|
count($objExercise->get_validated_question_list()), |
|
|
|
|
api_get_course_int_id(), |
|
|
|
|
api_get_session_id() |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
if (!empty($exercise_url_button) && !$isLimitReached) { |
|
|
|
|
$html .= Display::div( |
|
|
|
|
Display::div( |
|
|
|
|
$exercise_url_button, |
|
|
|
|
|