本文整理汇总了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);
}