Exemplo n.º 1
0
// else anonymous : record nothing !
// Get info about launched module
$module = Database::get()->querySingle("SELECT `contentType`, `startAsset_id`, `name`\n        FROM `lp_module`\n       WHERE `module_id` = ?d\n         AND `course_id` = ?d", $_SESSION['lp_module_id'], $course_id);
$assetPath = Database::get()->querySingle("SELECT `path` FROM `lp_asset` WHERE `asset_id` = ?d", $module->startAsset_id)->path;
// Get path of file of the starting asset to launch
switch ($module->contentType) {
    case CTDOCUMENT_:
        if ($uid) {
            // Directly pass this module
            directly_pass_lp_module($TABLEUSERMODULEPROGRESS, (int) $uid, (int) $learnPathModuleId);
        }
        // else anonymous : record nothing
        $file_url = file_url($assetPath);
        $play_url = file_playurl($assetPath);
        $furl = $file_url;
        if (MultimediaHelper::isSupportedMedia($module->name)) {
            $furl = $play_url;
        }
        $moduleStartAssetPage = $furl;
        break;
    case CTEXERCISE_:
        // clean session vars of exercise
        unset($_SESSION['objExercise']);
        unset($_SESSION['objQuestion']);
        unset($_SESSION['objAnswer']);
        unset($_SESSION['questionList']);
        unset($_SESSION['exerciseResult']);
        unset($_SESSION['exeStartTime']);
        $moduleStartAssetPage = "showExercise.php?course={$course_code}&exerciseId=" . $assetPath;
        break;
    case CTSCORMASSET_: