ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilAssLacEmptyAnswerExpression Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilAssLacEmptyAnswerExpression:
+ Collaboration diagram for ilAssLacEmptyAnswerExpression:

Public Member Functions

 getValue ()
 Get the value of this Expression. More...
 
 getDescription ()
 Get a human readable description of the Composite element. More...
 
 checkResult ($result, $comperator, $index=null)
 
- Public Member Functions inherited from ilAssLacAbstractExpression
 parseValue ($value)
 Parses the delivered Value and sets the relevant information for an Expression as attributes. More...
 
- Public Member Functions inherited from ilAssLacAbstractComposite
 addNode (ilAssLacCompositeInterface $node)
 Adds an ilAssLacCompositeInterface object to the node array which represents the condition tree structure. More...
 
 describe ()
 Describes a Composite tree Structure as human readable string. More...
 
 addNode (ilAssLacCompositeInterface $node)
 Adds an CompositeInterface object to the node array which represents the condition tree structure. More...
 
 describe ()
 Describes a Composite tree Structure as human readable string. More...
 
 getDescription ()
 Get a human readable description of the Composite element. More...
 
 getValue ()
 Get the value of this Expression. More...
 
 parseValue ($value)
 Parses the delivered Value and sets the relevant information for an Expression as attributes. More...
 
 checkResult ($result, $comperator, $index=null)
 

Static Public Attributes

static $pattern = '/(\?)/'
 
static $identifier = "?"
 

Protected Member Functions

 getPattern ()
 Get the Pattern to match relevant informations for an Expression. More...
 
 setMatches ($matches)
 Sets the result of the parsed value by a specific expression pattern. More...
 
 getPattern ()
 Get the Pattern to match relevant informations for an Expression. More...
 
 setMatches ($matches)
 Sets the result of the parsed value by a specific expression pattern. More...
 

Protected Attributes

 $matched
 

Additional Inherited Members

- Data Fields inherited from ilAssLacAbstractComposite
 $nodes = []
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Class EmptyAnswerExpression

Date: 15.05.14 Time: 08:51

Author
Thomas Joußen tjous.nosp@m.sen@.nosp@m.datab.nosp@m.ay.d.nosp@m.e

Definition at line 26 of file ilAssLacEmptyAnswerExpression.php.

Member Function Documentation

◆ checkResult()

ilAssLacEmptyAnswerExpression::checkResult (   $result,
  $comperator,
  $index = null 
)
Parameters
ilUserQuestionResult$result
string$comperator
null | int$index
Returns
bool

Implements ilAssLacSolutionExpressionInterface.

Definition at line 67 of file ilAssLacEmptyAnswerExpression.php.

67 : 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 }

◆ getDescription()

ilAssLacEmptyAnswerExpression::getDescription ( )

Get a human readable description of the Composite element.

Returns
string

Implements ilAssLacCompositeInterface.

Definition at line 55 of file ilAssLacEmptyAnswerExpression.php.

55 : string
56 {
57 return " nicht beantwortet";
58 }

◆ getPattern()

ilAssLacEmptyAnswerExpression::getPattern ( )
protected

Get the Pattern to match relevant informations for an Expression.

Returns
string

Reimplemented from ilAssLacAbstractExpression.

Definition at line 37 of file ilAssLacEmptyAnswerExpression.php.

37 : string
38 {
39 return '/(\?)/';
40 }

◆ getValue()

ilAssLacEmptyAnswerExpression::getValue ( )

Get the value of this Expression.

Returns
string

Implements ilAssLacExpressionInterface.

Definition at line 46 of file ilAssLacEmptyAnswerExpression.php.

46 : string
47 {
48 return "?";
49 }

◆ setMatches()

ilAssLacEmptyAnswerExpression::setMatches (   $matches)
protected

Sets the result of the parsed value by a specific expression pattern.

See also
ExpressionInterface::parseValue()
ExpressionInterface::getPattern()
Parameters
array$matches

Reimplemented from ilAssLacAbstractExpression.

Definition at line 102 of file ilAssLacEmptyAnswerExpression.php.

102 : void
103 {
104 $this->matched = true;
105 }

Field Documentation

◆ $identifier

ilAssLacEmptyAnswerExpression::$identifier = "?"
static

Definition at line 30 of file ilAssLacEmptyAnswerExpression.php.

◆ $matched

ilAssLacEmptyAnswerExpression::$matched
protected

Definition at line 35 of file ilAssLacEmptyAnswerExpression.php.

◆ $pattern

ilAssLacEmptyAnswerExpression::$pattern = '/(\?)/'
static

The documentation for this class was generated from the following file: