ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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...
 

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

 $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 94 of file ilAssLacExclusiveResultExpression.php.

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

95  {
96  $values = $result->getUserSolutionsByIdentifier("value");
97  $exclusive = $this->getExclusive();
98  sort($values);
99  sort($exclusive);
100 
101  switch ($comperator) {
102  case "=":
103  return $values == $exclusive;
104  break;
105  case "<>":
106  return $values != $exclusive;
107  break;
108  default:
109  return false;
110  }
111  }
$result
+ 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 82 of file ilAssLacExclusiveResultExpression.php.

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

◆ getExclusive()

ilAssLacExclusiveResultExpression::getExclusive ( )
Returns
[]

Definition at line 64 of file ilAssLacExclusiveResultExpression.php.

References $exclusive.

Referenced by checkResult().

+ Here is the caller graph for this function:

◆ getPattern()

ilAssLacExclusiveResultExpression::getPattern ( )
protected

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

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

◆ 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

Definition at line 52 of file ilAssLacExclusiveResultExpression.php.

References array.

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

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: