ILIAS  trunk Revision v11.0_alpha-1831-g8615d53dadb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilAssLacExclusiveResultExpression Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. 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 = []
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning 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 26 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 107 of file ilAssLacExclusiveResultExpression.php.

References $exclusive, getExclusive(), and ILIAS\UI\examples\Symbol\Glyph\Sort\sort().

107  : bool
108  {
109  $values = $result->getUserSolutionsByIdentifier("value");
110  $exclusive = $this->getExclusive();
111  sort($values);
112  sort($exclusive);
113 
114  switch ($comperator) {
115  case "=":
116  return $values == $exclusive;
117  break;
118  case "<>":
119  return $values != $exclusive;
120  break;
121  default:
122  return false;
123  }
124  }
sort()
description: > Example for rendering a Sort Glyph.
Definition: sort.php:41
+ 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 95 of file ilAssLacExclusiveResultExpression.php.

95  : string
96  {
97  return join(",", $this->exclusive) . " beantwortet ";
98  }

◆ getExclusive()

ilAssLacExclusiveResultExpression::getExclusive ( )
Returns
[]

Definition at line 77 of file ilAssLacExclusiveResultExpression.php.

References $exclusive.

Referenced by checkResult().

+ Here is the caller graph for this function:

◆ getPattern()

ilAssLacExclusiveResultExpression::getPattern ( )
protected

Definition at line 53 of file ilAssLacExclusiveResultExpression.php.

53  : string
54  {
55  return '/(\d+)/';
56  }

◆ getValue()

ilAssLacExclusiveResultExpression::getValue ( )

Get the value of this Expression.

Returns
string

Implements ilAssLacExpressionInterface.

Definition at line 86 of file ilAssLacExclusiveResultExpression.php.

86  : string
87  {
88  return "*" . join(",", $this->exclusive) . "*";
89  }

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

65  : void
66  {
67  $this->exclusive = [];
68 
69  foreach ($matches[0] as $match) {
70  $this->exclusive[] = $match;
71  }
72  }

Field Documentation

◆ $exclusive

ilAssLacExclusiveResultExpression::$exclusive
protected

Definition at line 51 of file ilAssLacExclusiveResultExpression.php.

Referenced by checkResult(), and getExclusive().

◆ $identifier

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

Definition at line 44 of file ilAssLacExclusiveResultExpression.php.

◆ $pattern

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

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