本文整理汇总了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 {
示例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();