当前位置: 首页>>代码示例>>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;未经允许,请勿转载。