本文整理汇总了PHP中Exercise::setAnonymousAttempts方法的典型用法代码示例。如果您正苦于以下问题:PHP Exercise::setAnonymousAttempts方法的具体用法?PHP Exercise::setAnonymousAttempts怎么用?PHP Exercise::setAnonymousAttempts使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Exercise
的用法示例。
在下文中一共展示了Exercise::setAnonymousAttempts方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
$exercise->setUseSameShuffle(0);
}
$exercise->setShowAnswers($_REQUEST['showAnswers']);
$exercise->setStartDate(mktime($_REQUEST['startHour'], $_REQUEST['startMinute'], 0, $_REQUEST['startMonth'], $_REQUEST['startDay'], $_REQUEST['startYear']));
if (isset($_REQUEST['useEndDate']) && $_REQUEST['useEndDate']) {
$exercise->setEndDate(mktime($_REQUEST['endHour'], $_REQUEST['endMinute'], 0, $_REQUEST['endMonth'], $_REQUEST['endDay'], $_REQUEST['endYear']));
} else {
$exercise->setEndDate(null);
}
if (isset($_REQUEST['useTimeLimit']) && $_REQUEST['useTimeLimit']) {
$exercise->setTimeLimit($_REQUEST['timeLimitMin'] * 60 + $_REQUEST['timeLimitSec']);
} else {
$exercise->setTimeLimit(0);
}
$exercise->setAttempts($_REQUEST['attempts']);
$exercise->setAnonymousAttempts($_REQUEST['anonymousAttempts']);
$exercise->setQuizEndMessage($_REQUEST['quizEndMessage']);
if ($exercise->validate()) {
if ($insertedId = $exercise->save()) {
if (is_null($exId)) {
$dialogBox->success(get_lang('Exercise added'));
$eventNotifier->notifyCourseEvent("exercise_added", claro_get_current_course_id(), claro_get_current_tool_id(), $insertedId, claro_get_current_group_id(), "0");
$exId = $insertedId;
} else {
$dialogBox->success(get_lang('Exercise modified'));
$eventNotifier->notifyCourseEvent("exercise_updated", claro_get_current_course_id(), claro_get_current_tool_id(), $insertedId, claro_get_current_group_id(), "0");
}
$displaySettings = true;
} else {
// sql error in save() ?
$cmd = 'rqEdit';