ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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...
 
 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 = '/\$[0-9]+(?:,[0-9]+)*\$/'
 
static $identifier = '$n,m,o,p$'
 

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

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

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

References $result, and getOrdering().

+ 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
\int[]

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

Get the Pattern to match relevant informations for an Expression.

Returns
string

Reimplemented from ilAssLacAbstractExpression.

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

Reimplemented from ilAssLacAbstractExpression.

Definition at line 51 of file ilAssLacOrderingResultExpression.php.

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

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: