當前位置: 首頁>>代碼示例>>PHP>>正文


PHP question_preload_questions函數代碼示例

本文整理匯總了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();
 }
開發者ID:arshanam,項目名稱:Moodle-ITScholars-LMS,代碼行數:8,代碼來源:attemptlib.php

示例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');
 }
開發者ID:elie89,項目名稱:moodle,代碼行數:7,代碼來源:attemptlib.php

示例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;
}
開發者ID:tyleung,項目名稱:CMPUT401MoodleExams,代碼行數:22,代碼來源:questionlib.php


注:本文中的question_preload_questions函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。