ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilAssLacEmptyAnswerExpression.php
Go to the documentation of this file.
1<?php
2
3include_once "Modules/TestQuestionPool/classes/questions/LogicalAnswerCompare/Expressions/ilAssLacAbstractExpression.php";
4include_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
$result
getDescription()
Get a human readable description of the Composite element.
getPattern()
Get the Pattern to match relevant informations for an Expression.
setMatches($matches)
Sets the result of the parsed value by a specific expression pattern.
checkResult($result, $comperator, $index=null)
getValue()
Get the value of this Expression.