ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 
16  public static $pattern = '/(\?)/';
17 
18  public static $identifier = "?";
19 
23  protected $matched;
24 
25  protected function getPattern()
26  {
27  return '/(\?)/';
28  }
29 
34  public function getValue()
35  {
36  return "?";
37  }
38 
43  public function getDescription()
44  {
45  return " nicht beantwortet";
46  }
47 
55  public function checkResult($result, $comperator, $index = null)
56  {
57  if($index == null)
58  {
59  switch($comperator)
60  {
61  case "=":
62  return !$result->hasSolutions();
63  break;
64  case "<>":
65  return $result->hasSolutions();
66  break;
67  default:
68  return false;
69  }
70  }
71  else
72  {
73  $solution = $result->getSolutionForKey($index);
74  switch($comperator)
75  {
76  case "=":
77  return $solution == null;
78  break;
79  case "<>":
80  return $solution != null;
81  break;
82  default:
83  return false;
84  }
85  }
86 
87  }
88 
96  protected function setMatches($matches)
97  {
98  $this->matched = true;
99  }
100 }
101 
checkResult($result, $comperator, $index=null)
$result
setMatches($matches)
Sets the result of the parsed value by a specific expression pattern.
getDescription()
Get a human readable description of the Composite element.
getValue()
Get the value of this Expression.