ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5
ilAssLacAnswerOfQuestionExpression.php
Go to the documentation of this file.
1 <?php
2 
3 include_once "Modules/TestQuestionPool/classes/questions/LogicalAnswerCompare/Expressions/ilAssLacAbstractExpression.php";
4 require_once "Modules/TestQuestionPool/classes/questions/LogicalAnswerCompare/Expressions/ilAssLacQuestionExpressionInterface.php";
5 
14 {
15 
29 // public static $pattern = '/Q[0-9]+([^\[|0-9]|$)/';
30  public static $pattern = '/(Q\d+)(?=\=|<|>|\s|$)/';
31 
35  public static $identifier = "Qn";
36 
42  protected $question_index;
43 
51  protected function setMatches($matches)
52  {
53  $this->question_index = $matches[0][0];
54  }
55 
61  public function getQuestionIndex()
62  {
63  return $this->question_index;
64  }
65 
70  public function getValue()
71  {
72  return "Q" . $this->question_index;
73  }
74 
79  public function getDescription()
80  {
81  return "Frage " . $this->question_index . " ";
82  }
83 
88  protected function getPattern()
89  {
90  return '/-?[0-9]+/';
91  }
92 }
getValue()
Get the value of this Expression.
setMatches($matches)
Sets the result of the parsed value by a specific expression pattern.
Class AnswerOfQuestionExpression for the expression Qn.
getPattern()
Get the Pattern to match relevant informations for an Expression.
getDescription()
Get a human readable description of the Composite element.