本文整理匯總了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);
}