ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilAssLacExpressionManufacturer 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 ilAssLacExpressionManufacturer:
+ Collaboration diagram for ilAssLacExpressionManufacturer:

Public Member Functions

 manufacture (string $attribute)
 /** Create a new specific Composite object which is representing the delivered Attribute More...
 
 getPattern ()
 This function create a regular expression to match all expression in a condition. More...
 
- Public Member Functions inherited from ilAssLacAbstractManufacturer
 match (string $subject)
 Matches a delivered string with a the pattern returned by getPattern implemented in the explicit Manufacturer. More...
 
 manufacture (string $attribute)
 Create a new specific Composite object which is representing the delivered Attribute. More...
 
 getPattern ()
 
 match (string $subject)
 Matches a delivered string with a the pattern returned by getPattern implemented in the explicit Manufacturer. More...
 

Static Public Member Functions

static _getInstance ()
 Get an Instance of ExpressionManufacturer. More...
 
static _getInstance ()
 Get an singleton of the manufacturer. More...
 

Static Protected Attributes

static $instance = null
 

Private Member Functions

 __clone ()
 Private clone to prevent cloning an object of ExpressionManufacturer. More...
 

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 ExpressionManufacturer

Date: 25.03.13 Time: 15:12

Author
Thomas Joußen tjous.nosp@m.sen@.nosp@m.datab.nosp@m.ay.d.nosp@m.e

Definition at line 26 of file ilAssLacExpressionManufacturer.php.

Member Function Documentation

◆ __clone()

ilAssLacExpressionManufacturer::__clone ( )
private

Private clone to prevent cloning an object of ExpressionManufacturer.

Definition at line 146 of file ilAssLacExpressionManufacturer.php.

147 {
148 }

◆ _getInstance()

static ilAssLacExpressionManufacturer::_getInstance ( )
static

Get an Instance of ExpressionManufacturer.

Returns
ilAssLacExpressionManufacturer

Implements ilAssLacManufacturerInterface.

Definition at line 43 of file ilAssLacExpressionManufacturer.php.

44 {
45 if (self::$instance == null) {
46 self::$instance = new ilAssLacExpressionManufacturer();
47 }
48 return self::$instance;
49 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References $instance.

Referenced by ilAssLacConditionParser\cannonicalizeCondition(), ilAssLacConditionParser\fetchExpressions(), and ilAssLacCompositeBuilder\getExpression().

+ Here is the caller graph for this function:

◆ getPattern()

ilAssLacExpressionManufacturer::getPattern ( )

This function create a regular expression to match all expression in a condition.


The following string is created by this function '/%[0-9]+%|#[0-9]+#|+[0-9]++|Q[0-9]+([^[|0-9]|$)|Q[0-9]+[[0-9]+]|~.*?~'
It matches all expression in a condition and is divided into the following parts:

Qn        /Q[0-9]+(?!\[)/
Qn[m]     /Q[0-9]+\[[0-9]+\]/
n%       /%[0-9]+%/
+n+       /\+[0-9]+\+/
#n#       /#[0-9]+#/
~TEXT~    /~.*?~/                               Hier gibt es noch Probleme, wenn im Text ein ~ enthalten ist
Returns
string

Implements ilAssLacManufacturerInterface.

Definition at line 124 of file ilAssLacExpressionManufacturer.php.

124 : string
125 {
126 return
127 "/" .
140 "/";
141 }

References ilAssLacAnswerOfCurrentQuestionExpression\$pattern, ilAssLacAnswerOfQuestionExpression\$pattern, ilAssLacEmptyAnswerExpression\$pattern, ilAssLacExclusiveResultExpression\$pattern, ilAssLacMatchingResultExpression\$pattern, ilAssLacNumberOfResultExpression\$pattern, ilAssLacNumericResultExpression\$pattern, ilAssLacOrderingResultExpression\$pattern, ilAssLacPercentageResultExpression\$pattern, ilAssLacResultOfAnswerOfCurrentQuestionExpression\$pattern, ilAssLacResultOfAnswerOfQuestionExpression\$pattern, and ilAssLacStringResultExpression\$pattern.

◆ manufacture()

ilAssLacExpressionManufacturer::manufacture ( string  $attribute)

/** Create a new specific Composite object which is representing the delivered Attribute

Parameters
string$attribute
Returns
ilAssLacAbstractComposite
Exceptions
ilAssLacUnsupportedExpression

Implements ilAssLacManufacturerInterface.

Definition at line 58 of file ilAssLacExpressionManufacturer.php.

59 {
60 $expression = null;
61
62 switch (true) {
65 break;
68 break;
69 case preg_match(ilAssLacAnswerOfQuestionExpression::$pattern, $attribute):
70 $expression = new ilAssLacAnswerOfQuestionExpression();
71 break;
72 case preg_match(ilAssLacAnswerOfCurrentQuestionExpression::$pattern, $attribute):
74 break;
75 case preg_match(ilAssLacPercentageResultExpression::$pattern, $attribute):
76 $expression = new ilAssLacPercentageResultExpression();
77 break;
78 case preg_match(ilAssLacNumberOfResultExpression::$pattern, $attribute):
79 $expression = new ilAssLacNumberOfResultExpression();
80 break;
81 case preg_match(ilAssLacNumericResultExpression::$pattern, $attribute):
82 $expression = new ilAssLacNumericResultExpression();
83 break;
84 case preg_match(ilAssLacStringResultExpression::$pattern, $attribute):
85 $expression = new ilAssLacStringResultExpression();
86 break;
87 case preg_match(ilAssLacMatchingResultExpression::$pattern, $attribute):
88 $expression = new ilAssLacMatchingResultExpression();
89 break;
90 case preg_match(ilAssLacOrderingResultExpression::$pattern, $attribute):
91 $expression = new ilAssLacOrderingResultExpression();
92 break;
93 case preg_match(ilAssLacExclusiveResultExpression::$pattern, $attribute):
94 $expression = new ilAssLacExclusiveResultExpression();
95 break;
96 case preg_match(ilAssLacEmptyAnswerExpression::$pattern, $attribute):
97 $expression = new ilAssLacEmptyAnswerExpression();
98 break;
99 default:
100 throw new ilAssLacUnsupportedExpression($attribute);
101 break;
102 }
103
104 $expression->parseValue($attribute);
105 return $expression;
106 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References ilAssLacAnswerOfCurrentQuestionExpression\$pattern, ilAssLacAnswerOfQuestionExpression\$pattern, ilAssLacEmptyAnswerExpression\$pattern, ilAssLacExclusiveResultExpression\$pattern, ilAssLacMatchingResultExpression\$pattern, ilAssLacNumberOfResultExpression\$pattern, ilAssLacNumericResultExpression\$pattern, ilAssLacOrderingResultExpression\$pattern, ilAssLacPercentageResultExpression\$pattern, ilAssLacResultOfAnswerOfCurrentQuestionExpression\$pattern, ilAssLacResultOfAnswerOfQuestionExpression\$pattern, and ilAssLacStringResultExpression\$pattern.

Field Documentation

◆ $instance

ilAssLacExpressionManufacturer::$instance = null
staticprotected

Definition at line 36 of file ilAssLacExpressionManufacturer.php.

Referenced by _getInstance().


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