/** * Create a new ExpressionEngine object. * * @param \qtism\data\QtiComponent $expression The Expression object to be processed. * @param \qtism\runtime\common\State $context (optional) The execution context. If no execution context is given, a virgin one will be set up. */ public function __construct(QtiComponent $expression, State $context = null) { parent::__construct($expression, $context); $this->setExpressionProcessorFactory(new ExpressionProcessorFactory()); $this->setOperatorProcessorFactory(new OperatorProcessorFactory()); $this->setStackTrace(new StackTrace()); $this->setOperands(new OperandsCollection()); }
/** * Create a new ResponseProcessingEngine object. * * @param QtiComponent $responseProcessing * @param State $context * @throws InvalidArgumentException If $responseProcessing is not a ResponseProcessing object. */ public function __construct(QtiComponent $responseProcessing, State $context = null) { parent::__construct($responseProcessing, $context); $templateDir = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'templates' . DIRECTORY_SEPARATOR; $this->addTemplateMapping('http://www.imsglobal.org/question/qti_v2p1/rptemplates/match_correct', $templateDir . '2_1' . DIRECTORY_SEPARATOR . 'match_correct.php'); $this->addTemplateMapping('http://www.imsglobal.org/question/qti_v2p1/rptemplates/map_response', $templateDir . '2_1' . DIRECTORY_SEPARATOR . 'map_response.php'); $this->addTemplateMapping('http://www.imsglobal.org/question/qti_v2p1/rptemplates/map_response_point', $templateDir . '2_1' . DIRECTORY_SEPARATOR . 'map_response_point.php'); $this->addTemplateMapping('http://www.imsglobal.org/question/qti_v2p0/rptemplates/match_correct', $templateDir . '2_0' . DIRECTORY_SEPARATOR . 'match_correct.php'); $this->addTemplateMapping('http://www.imsglobal.org/question/qti_v2p0/rptemplates/map_response', $templateDir . '2_0' . DIRECTORY_SEPARATOR . 'match_correct.php'); $this->addTemplateMapping('http://www.imsglobal.org/question/qti_v2p0/rptemplates/map_response_point', $templateDir . '2_0' . DIRECTORY_SEPARATOR . 'map_response_point.php'); }
/** * Create a new RuleEngine object. * * @param \qtism\data\QtiComponent $rule A rule object to be executed. * @param \qtism\runtime\common\State $context An execution context if needed. */ public function __construct(QtiComponent $rule, State $context = null) { parent::__construct($rule, $context); $this->setRuleProcessorFactory(new RuleProcessorFactory()); }