if (empty($remind_list)) {
    $remind_list = isset($_REQUEST['remind_list']) ? $_REQUEST['remind_list'] : null;
}
$exe_id = isset($_REQUEST['exe_id']) ? intval($_REQUEST['exe_id']) : 0;
if (empty($objExercise)) {
    // Redirect to the exercise overview
    // Check if the exe_id exists
    $objExercise = new Exercise();
    $exercise_stat_info = $objExercise->get_stat_track_exercise_info_by_exe_id($exe_id);
    if (!empty($exercise_stat_info) && isset($exercise_stat_info['exe_exo_id'])) {
        header("Location: overview.php?exerciseId=" . $exercise_stat_info['exe_exo_id']);
        exit;
    }
    api_not_allowed();
}
if (api_is_in_gradebook()) {
    $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH) . 'gradebook/index.php?' . api_get_cidreq(), 'name' => get_lang('ToolGradebook'));
}
$nameTools = get_lang('Exercises');
$interbreadcrumb[] = array("url" => "exercise.php?" . api_get_cidreq(), "name" => get_lang('Exercises'));
$htmlHeadXtra[] = '<script src="' . api_get_path(WEB_LIBRARY_JS_PATH) . 'hotspot/js/hotspot.js"></script>';
$htmlHeadXtra[] = '<link rel="stylesheet" href="' . api_get_path(WEB_LIBRARY_JS_PATH) . 'hotspot/css/hotspot.css">';
if ($origin != 'learnpath') {
    // So we are not in learnpath tool
    Display::display_header($nameTools, get_lang('Exercise'));
} else {
    $htmlHeadXtra[] = "\n    <style>\n    body { background: none;}\n    </style>\n    ";
    Display::display_reduced_header();
}
/* DISPLAY AND MAIN PROCESS */
// I'm in a preview mode as course admin. Display the action menu.
示例#2
0
/**
 * Returns the cidreq parameter name + current course id taken from
 * $GLOBALS['_cid'] and returns a string like 'cidReq=ABC&id_session=123
 *
 * @param bool $addSessionId
 * @param bool $addGroupId
 * @return  string  Course & session references to add to a URL
 *
 */
function api_get_cidreq($addSessionId = true, $addGroupId = true)
{
    $courseCode = api_get_course_id();
    $url = empty($courseCode) ? '' : 'cidReq=' . htmlspecialchars($courseCode);
    $origin = api_get_origin();
    if ($addSessionId) {
        if (!empty($url)) {
            $url .= api_get_session_id() == 0 ? '&id_session=0' : '&id_session=' . api_get_session_id();
        }
    }
    if ($addGroupId) {
        if (!empty($url)) {
            $url .= api_get_group_id() == 0 ? '&gidReq=0' : '&gidReq=' . api_get_group_id();
        }
    }
    $url .= '&gradebook=' . intval(api_is_in_gradebook());
    $url .= '&origin=' . $origin;
    return $url;
}