__construct() public method

public __construct ( Strategy $strategy )
$strategy Strategy
Example #1
0
 /**
  * 构造方法
  * @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);
 }
 /**
  * Constructor
  */
 public function __construct()
 {
     //this is highly important
     parent::__construct();
     $this->type = UNIQUE_ANSWER_NO_OPTION;
     $this->isContent = $this->getIsContent();
 }
Example #3
0
public function __construct($question, $default = true, $trueAnswerRegex = '/^y/i')
{
parent::__construct($question, (bool) $default);

$this->trueAnswerRegex = $trueAnswerRegex;
$this->setNormalizer($this->getDefaultNormalizer());
}
Example #4
0
 function __construct($question, array $choices, $default = null, $multiSelect = false)
 {
     parent::__construct($question, $default);
     $this->choices = $choices;
     $this->multiSelect = $multiSelect;
     $this->setValidator([$this, 'validate']);
 }
 /**
  * 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');
 }
Example #6
0
 function __construct($question, $default = null, $trueRegex = null)
 {
     parent::__construct($question, $default);
     if (!is_null($trueRegex)) {
         $this->trueRegex = $trueRegex;
     }
     $this->setNormalizer([$this, 'normalize']);
 }
 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);
 }
Example #8
0
 public function __construct($question, $default = true)
 {
     parent::__construct($question, (bool) $default);
     $this->setNormalizer($this->getDefaultNormalizer());
 }
 /**
  * Constructor
  */
 public function __construct()
 {
     parent::__construct();
     $this->type = CALCULATED_ANSWER;
     $this->isContent = $this->getIsContent();
 }
 /**
  * Constructor
  */
 public function __construct()
 {
     parent::__construct();
     $this->type = MATCHING;
     $this->isContent = $this->getIsContent();
 }
Example #11
0
 /**
  * Class constructor
  */
 public function __construct()
 {
     parent::__construct();
     $this->type = DRAGGABLE;
     $this->isContent = $this->getIsContent();
 }
Example #12
0
 public function __construct()
 {
     parent::__construct();
     $this->type = HOT_SPOT;
 }
Example #13
0
 /**
  * @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);
 }
Example #14
0
 public function __construct($xml)
 {
     parent::__construct($xml);
     $attrs = $xml->attributes();
     $this->min = $attrs['min'];
     $this->max = $attrs['max'];
 }
Example #15
0
 /**
  * Constructor
  */
 public function __construct($course_id = null)
 {
     $this->rank = self::$_rank++;
     parent::__construct($course_id);
 }
 /**
  * Constructor
  */
 public function __construct()
 {
     parent::__construct();
     $this->type = FILL_IN_BLANKS;
     $this->isContent = $this->getIsContent();
 }
 /**
  * Constructor
  */
 public function __construct()
 {
     parent::__construct();
     $this->type = MULTIPLE_ANSWER;
     $this->isContent = $this->getIsContent();
 }
 /**
  * Constructor
  */
 public function __construct()
 {
     parent::__construct();
     $this->type = ORAL_EXPRESSION;
     $this->isContent = $this->getIsContent();
 }