ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5
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 55 of file ilAssLacEmptyAnswerExpression.php.

References $result.

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  }
$result

◆ getDescription()

ilAssLacEmptyAnswerExpression::getDescription ( )

Get a human readable description of the Composite element.

Returns
string

Implements ilAssLacCompositeInterface.

Definition at line 43 of file ilAssLacEmptyAnswerExpression.php.

44  {
45  return " nicht beantwortet";
46  }

◆ getPattern()

ilAssLacEmptyAnswerExpression::getPattern ( )
protected

Definition at line 25 of file ilAssLacEmptyAnswerExpression.php.

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

◆ getValue()

ilAssLacEmptyAnswerExpression::getValue ( )

Get the value of this Expression.

Returns
string

Implements ilAssLacExpressionInterface.

Definition at line 34 of file ilAssLacEmptyAnswerExpression.php.

35  {
36  return "?";
37  }

◆ 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 96 of file ilAssLacEmptyAnswerExpression.php.

97  {
98  $this->matched = true;
99  }

Field Documentation

◆ $identifier

ilAssLacEmptyAnswerExpression::$identifier = "?"
static

Definition at line 18 of file ilAssLacEmptyAnswerExpression.php.

◆ $matched

ilAssLacEmptyAnswerExpression::$matched
protected

Definition at line 23 of file ilAssLacEmptyAnswerExpression.php.

◆ $pattern

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

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