本文整理匯總了PHP中quiz_access_manager::load_quiz_and_settings方法的典型用法代碼示例。如果您正苦於以下問題:PHP quiz_access_manager::load_quiz_and_settings方法的具體用法?PHP quiz_access_manager::load_quiz_and_settings怎麽用?PHP quiz_access_manager::load_quiz_and_settings使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類quiz_access_manager
的用法示例。
在下文中一共展示了quiz_access_manager::load_quiz_and_settings方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: create_helper
/**
* Used by {create()} and {create_from_usage_id()}.
* @param array $conditions passed to $DB->get_record('quiz_attempts', $conditions).
*/
protected static function create_helper($conditions)
{
global $DB;
$attempt = $DB->get_record('quiz_attempts', $conditions, '*', MUST_EXIST);
$quiz = quiz_access_manager::load_quiz_and_settings($attempt->quiz);
$course = $DB->get_record('course', array('id' => $quiz->course), '*', MUST_EXIST);
$cm = get_coursemodule_from_instance('quiz', $quiz->id, $course->id, false, MUST_EXIST);
// Update quiz with override information.
$quiz = quiz_update_effective_access($quiz, $attempt->userid);
return new quiz_attempt($attempt, $quiz, $cm, $course);
}