本文整理汇总了PHP中Question::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Question::__construct方法的具体用法?PHP Question::__construct怎么用?PHP Question::__construct使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Question
的用法示例。
在下文中一共展示了Question::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* 构造方法
* @param string $question 问题
* @param array $choices 选项
* @param mixed $default 默认答案
*/
public function __construct($question, array $choices, $default = null)
{
parent::__construct($question, $default);
$this->choices = $choices;
$this->setValidator($this->getDefaultValidator());
$this->setAutocompleterValues($choices);
}
示例2: __construct
/**
* Constructor
*/
public function __construct()
{
//this is highly important
parent::__construct();
$this->type = UNIQUE_ANSWER_NO_OPTION;
$this->isContent = $this->getIsContent();
}
示例3: __construct
public function __construct($question, $default = true, $trueAnswerRegex = '/^y/i')
{
parent::__construct($question, (bool) $default);
$this->trueAnswerRegex = $trueAnswerRegex;
$this->setNormalizer($this->getDefaultNormalizer());
}
示例4:
function __construct($question, array $choices, $default = null, $multiSelect = false)
{
parent::__construct($question, $default);
$this->choices = $choices;
$this->multiSelect = $multiSelect;
$this->setValidator([$this, 'validate']);
}
示例5: __construct
/**
* Constructor
*/
public function __construct()
{
parent::__construct();
$this->type = MULTIPLE_ANSWER_TRUE_FALSE;
$this->isContent = $this->getIsContent();
$this->options = array(1 => 'True', 2 => 'False', 3 => 'DoubtScore');
}
示例6:
function __construct($question, $default = null, $trueRegex = null)
{
parent::__construct($question, $default);
if (!is_null($trueRegex)) {
$this->trueRegex = $trueRegex;
}
$this->setNormalizer([$this, 'normalize']);
}
示例7: __construct
public function __construct(Registry $Registry, array $a = null)
{
/**
* 3 Lines below to change the database
* that's going to be used to the test database
*
* This in theory is not necessary because boostrap.php
* is used in all tests and it defines MONGO_DBNAME as LAMPCMS_TEST
* but this is just an extra precaution
*/
$aMongo = $Registry->Ini->getSection('MONGO');
$aMongo['db'] = 'LAMPCMS_TEST';
$Registry->Ini->setSection('MONGO', $aMongo);
$a = \json_decode($this->JSON_ENCODED, true);
parent::__construct($Registry, $a);
}
示例8: __construct
public function __construct($question, $default = true)
{
parent::__construct($question, (bool) $default);
$this->setNormalizer($this->getDefaultNormalizer());
}
示例9: __construct
/**
* Constructor
*/
public function __construct()
{
parent::__construct();
$this->type = CALCULATED_ANSWER;
$this->isContent = $this->getIsContent();
}
示例10: __construct
/**
* Constructor
*/
public function __construct()
{
parent::__construct();
$this->type = MATCHING;
$this->isContent = $this->getIsContent();
}
示例11: __construct
/**
* Class constructor
*/
public function __construct()
{
parent::__construct();
$this->type = DRAGGABLE;
$this->isContent = $this->getIsContent();
}
示例12: __construct
public function __construct()
{
parent::__construct();
$this->type = HOT_SPOT;
}
示例13: __construct
/**
* @param string $question The question text
* @param bool $defaultAnswer The default answer to the question
*/
public function __construct($question, $defaultAnswer = true)
{
parent::__construct($question, $defaultAnswer);
}
示例14: __construct
public function __construct($xml)
{
parent::__construct($xml);
$attrs = $xml->attributes();
$this->min = $attrs['min'];
$this->max = $attrs['max'];
}
示例15: __construct
/**
* Constructor
*/
public function __construct($course_id = null)
{
$this->rank = self::$_rank++;
parent::__construct($course_id);
}