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

A PostCondition does restrict the progression of a user through the learning sequence. More...

+ Collaboration diagram for ilLSPostCondition:

Public Member Functions

 __construct (int $ref_id, string $operator,?string $value=null)
 
 getRefId ()
 
 withRefId (int $ref_id)
 
 getConditionOperator ()
 
 withConditionOperator (string $operator)
 
 getValue ()
 
 withValue (string $value)
 

Data Fields

const OPERATOR_LP = 'learning_progress'
 
const OPERATOR_ALWAYS = 'always'
 
const OPERATOR_FAILED = 'failed'
 
const OPERATOR_FINISHED = 'finished'
 
const OPERATOR_NOT_FINISHED = 'not_finished'
 
const OPERATOR_PASSED = 'passed'
 

Protected Attributes

int $ref_id
 
string $operator
 
string $value
 

Static Protected Attributes

static $known_operators
 

Detailed Description

A PostCondition does restrict the progression of a user through the learning sequence.

Thus, instead of saying "You may only _visit_ this object if you did this", a PostCondition says "you may only _leave_ this object if you did this".

LSPostConditions are being applied by the LearningSequenceConditionController.

Definition at line 28 of file class.ilLSPostCondition.php.

Constructor & Destructor Documentation

◆ __construct()

ilLSPostCondition::__construct ( int  $ref_id,
string  $operator,
?string  $value = null 
)

Definition at line 50 of file class.ilLSPostCondition.php.

References $operator, $ref_id, and $value.

54  {
55  if (!in_array($operator, self::$known_operators)) {
56  throw new \InvalidArgumentException(
57  "Unknown operator: $operator"
58  );
59  }
60 
61  $this->ref_id = $ref_id;
62  $this->operator = $operator;
63  $this->value = $value;
64  }

Member Function Documentation

◆ getConditionOperator()

ilLSPostCondition::getConditionOperator ( )

Definition at line 78 of file class.ilLSPostCondition.php.

References $operator.

78  : string
79  {
80  return $this->operator;
81  }

◆ getRefId()

ilLSPostCondition::getRefId ( )

Definition at line 66 of file class.ilLSPostCondition.php.

References $ref_id.

Referenced by ilLSPostConditionDB\upsert().

66  : int
67  {
68  return $this->ref_id;
69  }
+ Here is the caller graph for this function:

◆ getValue()

ilLSPostCondition::getValue ( )

Definition at line 96 of file class.ilLSPostCondition.php.

References $value.

96  : ?string
97  {
98  return $this->value;
99  }

◆ withConditionOperator()

ilLSPostCondition::withConditionOperator ( string  $operator)

Definition at line 83 of file class.ilLSPostCondition.php.

References $operator.

84  {
85  if (!in_array($operator, self::$known_operators)) {
86  throw new \InvalidArgumentException(
87  "Unknown operator: $operator"
88  );
89  }
90 
91  $clone = clone $this;
92  $clone->operator = $operator;
93  return $clone;
94  }
A PostCondition does restrict the progression of a user through the learning sequence.

◆ withRefId()

ilLSPostCondition::withRefId ( int  $ref_id)

Definition at line 71 of file class.ilLSPostCondition.php.

References $ref_id.

71  : self
72  {
73  $clone = clone $this;
74  $clone->ref_id = $ref_id;
75  return $clone;
76  }

◆ withValue()

ilLSPostCondition::withValue ( string  $value)

Definition at line 101 of file class.ilLSPostCondition.php.

References $value.

102  {
103  $clone = clone $this;
104  $clone->value = $value;
105  return $clone;
106  }
A PostCondition does restrict the progression of a user through the learning sequence.

Field Documentation

◆ $known_operators

ilLSPostCondition::$known_operators
staticprotected
Initial value:
= [
self::OPERATOR_ALWAYS,
self::OPERATOR_FAILED,
self::OPERATOR_FINISHED,
self::OPERATOR_NOT_FINISHED,
self::OPERATOR_PASSED,
self::OPERATOR_LP
]

Definition at line 37 of file class.ilLSPostCondition.php.

◆ $operator

string ilLSPostCondition::$operator
protected

◆ $ref_id

int ilLSPostCondition::$ref_id
protected

Definition at line 46 of file class.ilLSPostCondition.php.

Referenced by __construct(), getRefId(), and withRefId().

◆ $value

string ilLSPostCondition::$value
protected

Definition at line 48 of file class.ilLSPostCondition.php.

Referenced by __construct(), getValue(), and withValue().

◆ OPERATOR_ALWAYS

const ilLSPostCondition::OPERATOR_ALWAYS = 'always'

Definition at line 31 of file class.ilLSPostCondition.php.

◆ OPERATOR_FAILED

const ilLSPostCondition::OPERATOR_FAILED = 'failed'

Definition at line 32 of file class.ilLSPostCondition.php.

◆ OPERATOR_FINISHED

const ilLSPostCondition::OPERATOR_FINISHED = 'finished'

Definition at line 33 of file class.ilLSPostCondition.php.

◆ OPERATOR_LP

const ilLSPostCondition::OPERATOR_LP = 'learning_progress'

◆ OPERATOR_NOT_FINISHED

const ilLSPostCondition::OPERATOR_NOT_FINISHED = 'not_finished'

Definition at line 34 of file class.ilLSPostCondition.php.

◆ OPERATOR_PASSED

const ilLSPostCondition::OPERATOR_PASSED = 'passed'

Definition at line 35 of file class.ilLSPostCondition.php.


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