}
if (empty($objExercise)) {
    if (!empty($_SESSION['objExercise'])) {
        $objExercise = Session::read('objExercise');
    } else {
        $objExercise = null;
    }
}
if (!$objExercise) {
    //Redirect to the exercise overview
    //Check if the exe_id exists
    header("Location: overview.php?exerciseId=" . $exerciseId);
    exit;
}
$time_control = false;
$clock_expired_time = ExerciseLib::get_session_time_control_key($objExercise->id, $learnpath_id, $learnpath_item_id);
if ($objExercise->expired_time != 0 && !empty($clock_expired_time)) {
    $time_control = true;
}
if ($time_control) {
    // Get time left for exipiring time
    $time_left = api_strtotime($clock_expired_time, 'UTC') - time();
    $htmlHeadXtra[] = api_get_css(api_get_path(WEB_LIBRARY_PATH) . 'javascript/epiclock/stylesheet/jquery.epiclock.css');
    $htmlHeadXtra[] = api_get_css(api_get_path(WEB_LIBRARY_PATH) . 'javascript/epiclock/renderers/minute/epiclock.minute.css');
    $htmlHeadXtra[] = api_get_js('epiclock/javascript/jquery.dateformat.min.js');
    $htmlHeadXtra[] = api_get_js('epiclock/javascript/jquery.epiclock.min.js');
    $htmlHeadXtra[] = api_get_js('epiclock/renderers/minute/epiclock.minute.js');
    $htmlHeadXtra[] = $objExercise->show_time_control_js($time_left);
}
$exe_id = intval(Session::read('exe_id'));
$exercise_stat_info = $objExercise->get_stat_track_exercise_info_by_exe_id($exe_id);