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


PHP question_edit_form::__construct方法代碼示例

本文整理匯總了PHP中question_edit_form::__construct方法的典型用法代碼示例。如果您正苦於以下問題:PHP question_edit_form::__construct方法的具體用法?PHP question_edit_form::__construct怎麽用?PHP question_edit_form::__construct使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在question_edit_form的用法示例。


在下文中一共展示了question_edit_form::__construct方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __construct

    public function __construct($submiturl, $question, $category, $contexts, $formeditable = true) {
        global $SESSION, $CFG, $DB;
        $this->regenerate = true;
        if ("1" == optional_param('reload', '', PARAM_INT)) {
            $this->reload = true;
        } else {
            $this->reload = false;
        }

        $this->used_in_quiz = false;

        if (isset($question->id) && $question->id != 0) {
            $this->savedquestiondisplay = fullclone($question);
            if ($list = $DB->get_records('quiz_question_instances',
                    array('question' => $question->id))) {
                foreach ($list as $key => $li) {
                    $this->nb_of_quiz ++;
                    if ($att = $DB->get_records('quiz_attempts',
                            array('quiz' => $li->quiz, 'preview' => '0'))) {
                        $this->nb_of_attempts += count($att);
                        $this->used_in_quiz = true;
                    }
                }
            }
        }

        parent::__construct($submiturl, $question, $category, $contexts, $formeditable);
    }
開發者ID:nigeldaley,項目名稱:moodle,代碼行數:28,代碼來源:edit_multianswer_form.php

示例2: __construct

 public function __construct($submiturl, $question, $category, $contexts, $formeditable = true)
 {
     global $SESSION, $CFG, $DB;
     $this->regenerate = true;
     $this->reload = optional_param('reload', false, PARAM_BOOL);
     $this->usedinquiz = false;
     if (isset($question->id) && $question->id != 0) {
         // TODO MDL-43779 should not have quiz-specific code here.
         $this->savedquestiondisplay = fullclone($question);
         $this->nbofquiz = $DB->count_records('quiz_slots', array('questionid' => $question->id));
         $this->usedinquiz = $this->nbofquiz > 0;
         $this->nbofattempts = $DB->count_records_sql("\n                    SELECT count(1)\n                      FROM {quiz_slots} slot\n                      JOIN {quiz_attempts} quiza ON quiza.quiz = slot.quizid\n                     WHERE slot.questionid = ?\n                       AND quiza.preview = 0", array($question->id));
     }
     parent::__construct($submiturl, $question, $category, $contexts, $formeditable);
 }
開發者ID:rushi963,項目名稱:moodle,代碼行數:15,代碼來源:edit_multianswer_form.php

示例3: __construct

 public function __construct($submiturl, $question, $category, $contexts, $formeditable = true)
 {
     $this->question = $question;
     $this->qtypeobj = question_bank::get_qtype('calculatedmulti');
     $this->reload = optional_param('reload', false, PARAM_BOOL);
     if (!$this->reload) {
         // Use database data as this is first pass.
         if (isset($this->question->id)) {
             // Remove prefix #{..}# if exists.
             $this->initialname = $question->name;
             $regs = array();
             if (preg_match('~#\\{([^[:space:]]*)#~', $question->name, $regs)) {
                 $question->name = str_replace($regs[0], '', $question->name);
             }
         }
     }
     parent::__construct($submiturl, $question, $category, $contexts, $formeditable);
 }
開發者ID:tyleung,項目名稱:CMPUT401MoodleExams,代碼行數:18,代碼來源:edit_calculatedmulti_form.php

示例4: __construct

 public function __construct($submiturl, $question, $category, $contexts, $formeditable = true)
 {
     parent::__construct($submiturl, $question, $category, $contexts, false);
 }
開發者ID:evltuma,項目名稱:moodle,代碼行數:4,代碼來源:edit_missingtype_form.php


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