ILIAS  release_7 Revision v7.30-3-g800a261c036
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 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}
$result
An exception for terminatinating execution or to throw for unit testing.
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.
$index
Definition: metadata.php:128