本文整理汇总了PHP中question_preload_questions函数的典型用法代码示例。如果您正苦于以下问题:PHP question_preload_questions函数的具体用法?PHP question_preload_questions怎么用?PHP question_preload_questions使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了question_preload_questions函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: preload_questions
public function preload_questions()
{
if (empty($this->questionids)) {
throw new moodle_quiz_exception($this, 'noquestions', $this->edit_url());
}
$this->questions = question_preload_questions($this->questionids, 'qqi.grade AS maxgrade, qqi.id AS instance', '{quiz_question_instances} qqi ON qqi.quiz = :quizid AND q.id = qqi.question', array('quizid' => $this->quiz->id));
$this->number_questions();
}
示例2: preload_questions
/**
* Load just basic information about all the questions in this quiz.
*/
public function preload_questions()
{
$this->questions = question_preload_questions(null, 'slot.maxmark, slot.id AS slotid, slot.slot, slot.page', '{quiz_slots} slot ON slot.quizid = :quizid AND q.id = slot.questionid', array('quizid' => $this->quiz->id), 'slot.slot');
}
示例3: question_load_questions
/**
* Load a set of questions, given a list of ids. The $join and $extrafields arguments can be used
* together to pull in extra data. See, for example, the usage in mod/quiz/attempt.php, and
* read the code below to see how the SQL is assembled. Throws exceptions on error.
*
* @param array $questionids array of question ids.
* @param string $extrafields extra SQL code to be added to the query.
* @param string $join extra SQL code to be added to the query.
* @param array $extraparams values for any placeholders in $join.
* You are strongly recommended to use named placeholder.
*
* @return array question objects.
*/
function question_load_questions($questionids, $extrafields = '', $join = '')
{
$questions = question_preload_questions($questionids, $extrafields, $join);
// Load the question type specific information
if (!get_question_options($questions)) {
return 'Could not load the question options';
}
return $questions;
}