本文整理汇总了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);
}
示例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);
}
示例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);
}
示例4: __construct
public function __construct($submiturl, $question, $category, $contexts, $formeditable = true)
{
parent::__construct($submiturl, $question, $category, $contexts, false);
}