ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilAssLacEmptyAnswerExpression.php
Go to the documentation of this file.
1 <?php
2 
3 include_once "Modules/TestQuestionPool/classes/questions/LogicalAnswerCompare/Expressions/ilAssLacAbstractExpression.php";
4 include_once "Modules/TestQuestionPool/classes/questions/LogicalAnswerCompare/Expressions/ilAssLacSolutionExpressionInterface.php";
5 
14 {
15  public static $pattern = '/(\?)/';
16 
17  public static $identifier = "?";
18 
22  protected $matched;
23 
24  protected function getPattern()
25  {
26  return '/(\?)/';
27  }
28 
33  public function getValue()
34  {
35  return "?";
36  }
37 
42  public function getDescription()
43  {
44  return " nicht beantwortet";
45  }
46 
54  public function checkResult($result, $comperator, $index = null)
55  {
56  if ($index == null) {
57  switch ($comperator) {
58  case "=":
59  return !$result->hasSolutions();
60  break;
61  case "<>":
62  return $result->hasSolutions();
63  break;
64  default:
65  return false;
66  }
67  } else {
68  $solution = $result->getSolutionForKey($index);
69  switch ($comperator) {
70  case "=":
71  return $solution == null;
72  break;
73  case "<>":
74  return $solution != null;
75  break;
76  default:
77  return false;
78  }
79  }
80  }
81 
89  protected function setMatches($matches)
90  {
91  $this->matched = true;
92  }
93 }
checkResult($result, $comperator, $index=null)
$result
setMatches($matches)
Sets the result of the parsed value by a specific expression pattern.
$index
Definition: metadata.php:60
getDescription()
Get a human readable description of the Composite element.
getValue()
Get the value of this Expression.