ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilAssLacEmptyAnswerExpression.php
Go to the documentation of this file.
1<?php
2
27{
28 public static $pattern = '/(\?)/';
29
30 public static $identifier = "?";
31
35 protected $matched;
36
37 protected function getPattern(): string
38 {
39 return '/(\?)/';
40 }
41
46 public function getValue(): string
47 {
48 return "?";
49 }
50
55 public function getDescription(): string
56 {
57 return " nicht beantwortet";
58 }
59
67 public function checkResult($result, $comperator, $index = null): bool
68 {
69 if ($index == null) {
70 switch ($comperator) {
71 case "=":
72 return !$result->hasSolutions();
73 break;
74 case "<>":
75 return $result->hasSolutions();
76 break;
77 default:
78 return false;
79 }
80 } else {
81 $solution = $result->getSolutionForKey($index);
82 switch ($comperator) {
83 case "=":
84 return $solution == null;
85 break;
86 case "<>":
87 return $solution != null;
88 break;
89 default:
90 return false;
91 }
92 }
93 }
94
102 protected function setMatches($matches): void
103 {
104 $this->matched = true;
105 }
106}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...