ILIAS  trunk Revision v11.0_alpha-1769-g99a433fe2dc
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilAssLacOrderingResultExpression 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 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 = []
 

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 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 26 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 106 of file ilAssLacOrderingResultExpression.php.

References getOrdering(), and null.

106  : bool
107  {
108  $keys = $result->getUserSolutionsByIdentifier("key");
109  $keys = array_filter($keys, function ($element) {
110  return $element != null;
111  });
112 
113  switch ($comperator) {
114  case "=":
115  return $keys == $this->getOrdering();
116  break;
117  case "<>":
118  return $keys != $this->getOrdering();
119  break;
120  default:
121  return false;
122  }
123  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ 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 94 of file ilAssLacOrderingResultExpression.php.

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

◆ getOrdering()

ilAssLacOrderingResultExpression::getOrdering ( )
Returns
[]

Definition at line 76 of file ilAssLacOrderingResultExpression.php.

References $ordering.

Referenced by checkResult().

+ Here is the caller graph for this function:

◆ getPattern()

ilAssLacOrderingResultExpression::getPattern ( )
protected

Definition at line 52 of file ilAssLacOrderingResultExpression.php.

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

◆ getValue()

ilAssLacOrderingResultExpression::getValue ( )

Get the value of this Expression.

Returns
string

Implements ilAssLacExpressionInterface.

Definition at line 85 of file ilAssLacOrderingResultExpression.php.

85  : string
86  {
87  return "$" . join(",", $this->ordering) . "$";
88  }

◆ 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 64 of file ilAssLacOrderingResultExpression.php.

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

Field Documentation

◆ $identifier

ilAssLacOrderingResultExpression::$identifier = '$n,m,o,p$'
static

Definition at line 43 of file ilAssLacOrderingResultExpression.php.

◆ $ordering

ilAssLacOrderingResultExpression::$ordering
protected

Definition at line 50 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: