ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilAssLacExclusiveResultExpression Class Reference

Class ExclusiveResultExpression for the expression m,n,o,p More...

+ Inheritance diagram for ilAssLacExclusiveResultExpression:
+ Collaboration diagram for ilAssLacExclusiveResultExpression:

Public Member Functions

 getExclusive ()
 
 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

 $exclusive
 

Additional Inherited Members

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

Detailed Description

Class ExclusiveResultExpression for the expression m,n,o,p

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 ilAssLacExclusiveResultExpression.php.

Member Function Documentation

◆ checkResult()

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

Implements ilAssLacSolutionExpressionInterface.

Definition at line 95 of file ilAssLacExclusiveResultExpression.php.

96 {
97 $values = $result->getUserSolutionsByIdentifier("value");
98 $exclusive = $this->getExclusive();
99 sort($values);
100 sort($exclusive);
101
102 switch($comperator)
103 {
104 case "=":
105 return $values == $exclusive;
106 break;
107 case "<>":
108 return $values != $exclusive;
109 break;
110 default:
111 return false;
112 }
113 }
$result

References $exclusive, $result, and getExclusive().

+ Here is the call graph for this function:

◆ getDescription()

ilAssLacExclusiveResultExpression::getDescription ( )

Get a human readable description of the Composite element.

Returns
string

Implements ilAssLacCompositeInterface.

Definition at line 83 of file ilAssLacExclusiveResultExpression.php.

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

◆ getExclusive()

ilAssLacExclusiveResultExpression::getExclusive ( )
Returns
\int[]

Definition at line 65 of file ilAssLacExclusiveResultExpression.php.

66 {
67 return $this->exclusive;
68 }

References $exclusive.

Referenced by checkResult().

+ Here is the caller graph for this function:

◆ getPattern()

ilAssLacExclusiveResultExpression::getPattern ( )
protected

Get the Pattern to match relevant informations for an Expression.

Returns
string

Reimplemented from ilAssLacAbstractExpression.

Definition at line 40 of file ilAssLacExclusiveResultExpression.php.

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

◆ getValue()

ilAssLacExclusiveResultExpression::getValue ( )

Get the value of this Expression.

Returns
string

Implements ilAssLacExpressionInterface.

Definition at line 74 of file ilAssLacExclusiveResultExpression.php.

75 {
76 return "*" . join(",", $this->exclusive) . "*";
77 }

◆ setMatches()

ilAssLacExclusiveResultExpression::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 52 of file ilAssLacExclusiveResultExpression.php.

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

Field Documentation

◆ $exclusive

ilAssLacExclusiveResultExpression::$exclusive
protected

Definition at line 38 of file ilAssLacExclusiveResultExpression.php.

Referenced by checkResult(), and getExclusive().

◆ $identifier

ilAssLacExclusiveResultExpression::$identifier = "*n,m,o,p*"
static

Definition at line 31 of file ilAssLacExclusiveResultExpression.php.

◆ $pattern

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

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