ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilAssLacEmptyAnswerExpression Class Reference

Class EmptyAnswerExpression. 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...
 

Static Public Attributes

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

Protected Member Functions

 getPattern ()
 
 setMatches ($matches)
 Sets the result of the parsed value by a specific expression pattern. More...
 
- Protected Member Functions inherited from ilAssLacAbstractExpression
 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 = array()
 

Detailed Description

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 13 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 54 of file ilAssLacEmptyAnswerExpression.php.

References $index, and $result.

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  }
$result
$index
Definition: metadata.php:60

◆ getDescription()

ilAssLacEmptyAnswerExpression::getDescription ( )

Get a human readable description of the Composite element.

Returns
string

Implements ilAssLacCompositeInterface.

Definition at line 42 of file ilAssLacEmptyAnswerExpression.php.

43  {
44  return " nicht beantwortet";
45  }

◆ getPattern()

ilAssLacEmptyAnswerExpression::getPattern ( )
protected

Definition at line 24 of file ilAssLacEmptyAnswerExpression.php.

25  {
26  return '/(\?)/';
27  }

◆ getValue()

ilAssLacEmptyAnswerExpression::getValue ( )

Get the value of this Expression.

Returns
string

Implements ilAssLacExpressionInterface.

Definition at line 33 of file ilAssLacEmptyAnswerExpression.php.

34  {
35  return "?";
36  }

◆ 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

Definition at line 89 of file ilAssLacEmptyAnswerExpression.php.

90  {
91  $this->matched = true;
92  }

Field Documentation

◆ $identifier

ilAssLacEmptyAnswerExpression::$identifier = "?"
static

Definition at line 17 of file ilAssLacEmptyAnswerExpression.php.

◆ $matched

ilAssLacEmptyAnswerExpression::$matched
protected

Definition at line 22 of file ilAssLacEmptyAnswerExpression.php.

◆ $pattern

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

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