ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 94 of file ilAssLacOrderingResultExpression.php.

References $result, and getOrdering().

95  {
96  $keys = $result->getUserSolutionsByIdentifier("key");
97  $keys = array_filter($keys,function($element) {
98  return $element != null;
99  });
100 
101  switch($comperator)
102  {
103  case "=":
104  return $keys == $this->getOrdering();
105  break;
106  case "<>":
107  return $keys != $this->getOrdering();
108  break;
109  default:
110  return false;
111  }
112  }
$result
+ 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 82 of file ilAssLacOrderingResultExpression.php.

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

◆ getOrdering()

ilAssLacOrderingResultExpression::getOrdering ( )
Returns
[]

Definition at line 64 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 73 of file ilAssLacOrderingResultExpression.php.

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

◆ 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.

References array.

52  {
53  $this->ordering = array();
54 
55  foreach($matches[0] as $match)
56  {
57  $this->ordering[] = $match;
58  }
59  }
Create styles array
The data for the language used.

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: