예제 #1
0
 /**
  * Set the Rule object to be executed by the engine.
  *
  * @param \qtism\data\QtiComponent $rule A Rule object to be executed.
  * @throws \InvalidArgumentException If $rule is not a Rule object.
  */
 public function setComponent(QtiComponent $rule)
 {
     if ($rule instanceof Rule) {
         parent::setComponent($rule);
     } else {
         $msg = "The RuleEngine class only accepts to execute Rule objects.";
         throw new InvalidArgumentException($msg);
     }
 }
예제 #2
0
 /**
  * Set the ResponseProcessing object to be executed.
  *
  * @param \qtism\data\QtiComponent $responseProcessing A ResponseProcessing object.
  * @throws \InvalidArgumentException If $responseProcessing is not a ResponseProcessing object.
  */
 public function setComponent(QtiComponent $responseProcessing)
 {
     if ($responseProcessing instanceof ResponseProcessing) {
         parent::setComponent($responseProcessing);
     } else {
         $msg = "The ResponseProcessingEngine class only accepts ResponseProcessing objects to be executed.";
         throw new InvalidArgumentException($msg);
     }
 }
예제 #3
0
 /**
  * Set the TemplateProcessing object to be executed by the engine depending
  * on the current context.
  *
  * @param \qtism\data\QtiComponent $templateProcessing A TemplateProcessing object.
  * @throws \InvalidArgumentException If $templateProcessing is not A TemplateProcessing object.
  */
 public function setComponent(QtiComponent $templateProcessing)
 {
     if ($templateProcessing instanceof TemplateProcessing) {
         parent::setComponent($templateProcessing);
     } else {
         $msg = "The TemplateProcessing class only accepts TemplateProcessing objects to be executed.";
         throw new InvalidArgumentException($msg);
     }
 }
 /**
  * Set the PrintedVariable object to be executed by the engine depending
  * on the current context.
  *
  * @param QtiComponent $printedVariable A PrintedVariable object.
  * @throws InvalidArgumentException If $printedVariable is not a PrintedVariable object.
  */
 public function setComponent(QtiComponent $printedVariable)
 {
     if ($printedVariable instanceof PrintedVariable) {
         parent::setComponent($printedVariable);
     } else {
         $msg = "The PrintedVariableEngine class only accepts PrintedVariable objects to be executed.";
         throw new InvalidArgumentException($msg);
     }
 }
 /**
  * Set the Expression object to be processed.
  * 
  * @param QtiComponent $expression An Expression object.
  * @throws InvalidArgumentException If $expression is not an Expression object.
  */
 public function setComponent(QtiComponent $expression)
 {
     if ($expression instanceof Expression) {
         parent::setComponent($expression);
     } else {
         $msg = "The ExpressionEngine class only accepts QTI Data Model Expression objects to be processed.";
         throw new InvalidArgumentException($msg);
     }
 }