当前位置: 首页>>代码示例>>PHP>>正文


PHP Exercise::getVisibility方法代码示例

本文整理汇总了PHP中Exercise::getVisibility方法的典型用法代码示例。如果您正苦于以下问题:PHP Exercise::getVisibility方法的具体用法?PHP Exercise::getVisibility怎么用?PHP Exercise::getVisibility使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Exercise的用法示例。


在下文中一共展示了Exercise::getVisibility方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: Exercise

}
if (isset($item_list['1']) && is_numeric($item_list['1'])) {
    $quId = (int) $item_list['1'];
} else {
    $quId = null;
}
if (isset($item_list['2']) && is_numeric($item_list['2'])) {
    $exId = (int) $item_list['2'];
} else {
    $exId = null;
}
if ($cmd == 'download') {
    // find exercise informations
    $exercise = new Exercise();
    if ($exercise->load($exId) || $is_allowedToEdit) {
        if ($exercise->getVisibility() == 'VISIBLE' || $is_allowedToEdit) {
            $question = new Question();
            if ($question->load($quId)) {
                $attachmentFile = $question->getQuestionDirSys() . $question->getAttachment();
                if (claro_send_file($attachmentFile)) {
                    die;
                } else {
                    $dialogBox->error(get_lang('Not found'));
                }
            } else {
                $dialogBox->error(get_lang('Not found'));
            }
        } else {
            $dialogBox->error(get_lang('Not allowed'));
        }
    } else {
开发者ID:rhertzog,项目名称:lcs,代码行数:31,代码来源:get_attachment.php

示例2: unset

 */
$resetQuestionList = false;
// if exercise is not in session try to load it.
// if exId has been defined in request force refresh of exercise in session
if (!isset($_SESSION['serializedExercise']) || !is_null($exId)) {
    // clean previous exercise if any
    unset($_SESSION['serializedExercise']);
    $exercise = new Exercise();
    if (is_null($exId) || !$exercise->load($exId)) {
        // exercise is required
        header("Location: " . Url::Contextualize('./exercise.php'));
        exit;
    } else {
        // load successfull
        // exercise must be visible or in learning path to be displayed to a student
        if ($exercise->getVisibility() != 'VISIBLE' && !$is_allowedToEdit && !($inOldLP || $inLP)) {
            $dialogBox->error(get_lang('The exercise is not available'));
            $content = $dialogBox->render();
            $claroline->display->body->appendContent($content);
            echo $claroline->display->render();
            //header("Location: ./exercise.php");
            exit;
        } else {
            $_SESSION['serializedExercise'] = serialize($exercise);
            $resetQuestionList = true;
        }
    }
} else {
    // get it back from session
    $exercise = unserialize($_SESSION['serializedExercise']);
    $exId = $exercise->getId();
开发者ID:rhertzog,项目名称:lcs,代码行数:31,代码来源:exercise_submit.php


注:本文中的Exercise::getVisibility方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。