ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilAssLacOrderingResultExpression Class Reference

Class OrderingResultExpression for the expression $a,..,n,m$. More...

+ Inheritance diagram for ilAssLacOrderingResultExpression:
+ Collaboration diagram for ilAssLacOrderingResultExpression:

Public Member Functions

 getOrdering ()
 
 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 = '/\$[0-9]+(?:,[0-9]+)*\$/'
 
static $identifier = '$n,m,o,p$'
 

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

 $ordering
 

Additional Inherited Members

- Data Fields inherited from ilAssLacAbstractComposite
 $nodes = array()
 

Detailed Description

Class OrderingResultExpression for the expression $a,..,n,m$.

Date: 25.03.13 Time: 16:41

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

Definition at line 13 of file ilAssLacOrderingResultExpression.php.

Member Function Documentation

◆ checkResult()

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

Implements ilAssLacSolutionExpressionInterface.

Definition at line 93 of file ilAssLacOrderingResultExpression.php.

References $keys, $result, and getOrdering().

94  {
95  $keys = $result->getUserSolutionsByIdentifier("key");
96  $keys = array_filter($keys, function ($element) {
97  return $element != null;
98  });
99 
100  switch ($comperator) {
101  case "=":
102  return $keys == $this->getOrdering();
103  break;
104  case "<>":
105  return $keys != $this->getOrdering();
106  break;
107  default:
108  return false;
109  }
110  }
$result
$keys
+ Here is the call graph for this function:

◆ getDescription()

ilAssLacOrderingResultExpression::getDescription ( )

Get a human readable description of the Composite element.

Returns
string

Implements ilAssLacCompositeInterface.

Definition at line 81 of file ilAssLacOrderingResultExpression.php.

82  {
83  return join(",", $this->ordering) . " beantwortet ";
84  }

◆ getOrdering()

ilAssLacOrderingResultExpression::getOrdering ( )
Returns
[]

Definition at line 63 of file ilAssLacOrderingResultExpression.php.

References $ordering.

Referenced by checkResult().

+ Here is the caller graph for this function:

◆ getPattern()

ilAssLacOrderingResultExpression::getPattern ( )
protected

Definition at line 39 of file ilAssLacOrderingResultExpression.php.

40  {
41  return '/(\d+)/';
42  }

◆ getValue()

ilAssLacOrderingResultExpression::getValue ( )

Get the value of this Expression.

Returns
string

Implements ilAssLacExpressionInterface.

Definition at line 72 of file ilAssLacOrderingResultExpression.php.

73  {
74  return "$" . join(",", $this->ordering) . "$";
75  }

◆ setMatches()

ilAssLacOrderingResultExpression::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 51 of file ilAssLacOrderingResultExpression.php.

52  {
53  $this->ordering = array();
54 
55  foreach ($matches[0] as $match) {
56  $this->ordering[] = $match;
57  }
58  }

Field Documentation

◆ $identifier

ilAssLacOrderingResultExpression::$identifier = '$n,m,o,p$'
static

Definition at line 30 of file ilAssLacOrderingResultExpression.php.

◆ $ordering

ilAssLacOrderingResultExpression::$ordering
protected

Definition at line 37 of file ilAssLacOrderingResultExpression.php.

Referenced by getOrdering().

◆ $pattern

ilAssLacOrderingResultExpression::$pattern = '/\$[0-9]+(?:,[0-9]+)*\$/'
static

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