本文整理汇总了PHP中quiz_access_manager::load_settings方法的典型用法代码示例。如果您正苦于以下问题:PHP quiz_access_manager::load_settings方法的具体用法?PHP quiz_access_manager::load_settings怎么用?PHP quiz_access_manager::load_settings使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类quiz_access_manager
的用法示例。
在下文中一共展示了quiz_access_manager::load_settings方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: data_preprocessing
public function data_preprocessing(&$toform)
{
if (isset($toform['grade'])) {
// Convert to a real number, so we don't get 0.0000.
$toform['grade'] = $toform['grade'] + 0;
}
if (count($this->_feedbacks)) {
$key = 0;
foreach ($this->_feedbacks as $feedback) {
$draftid = file_get_submitted_draft_itemid('feedbacktext[' . $key . ']');
$toform['feedbacktext[' . $key . ']']['text'] = file_prepare_draft_area($draftid, $this->context->id, 'mod_quiz', 'feedback', !empty($feedback->id) ? (int) $feedback->id : null, null, $feedback->feedbacktext);
$toform['feedbacktext[' . $key . ']']['format'] = $feedback->feedbacktextformat;
$toform['feedbacktext[' . $key . ']']['itemid'] = $draftid;
if ($toform['grade'] == 0) {
// When a quiz is un-graded, there can only be one lot of
// feedback. If the quiz previously had a maximum grade and
// several lots of feedback, we must now avoid putting text
// into input boxes that are disabled, but which the
// validation will insist are blank.
break;
}
if ($feedback->mingrade > 0) {
$toform['feedbackboundaries[' . $key . ']'] = 100.0 * $feedback->mingrade / $toform['grade'] . '%';
}
$key++;
}
}
if (isset($toform['timelimit'])) {
$toform['timelimitenable'] = $toform['timelimit'] > 0;
}
$this->preprocessing_review_settings($toform, 'during', mod_quiz_display_options::DURING);
$this->preprocessing_review_settings($toform, 'immediately', mod_quiz_display_options::IMMEDIATELY_AFTER);
$this->preprocessing_review_settings($toform, 'open', mod_quiz_display_options::LATER_WHILE_OPEN);
$this->preprocessing_review_settings($toform, 'closed', mod_quiz_display_options::AFTER_CLOSE);
$toform['attemptduring'] = true;
$toform['overallfeedbackduring'] = false;
// Password field - different in form to stop browsers that remember
// passwords from getting confused.
if (isset($toform['password'])) {
$toform['quizpassword'] = $toform['password'];
unset($toform['password']);
}
// Load any settings belonging to the access rules.
if (!empty($toform['instance'])) {
$accesssettings = quiz_access_manager::load_settings($toform['instance']);
foreach ($accesssettings as $name => $value) {
$toform[$name] = $value;
}
}
}