ILIAS  release_7 Revision v7.30-3-g800a261c036
ilAssQuestionLifecycle Class Reference
+ Collaboration diagram for ilAssQuestionLifecycle:

Public Member Functions

 getIdentifier ()
 
 setIdentifier ($identifier)
 
 getValidIdentifiers ()
 
 getMappedLomLifecycle ()
 
 getTranslation (ilLanguage $lng)
 
 getSelectOptions (ilLanguage $lng)
 
 validateIdentifier ($identifier)
 

Static Public Member Functions

static getInstance ($identifier)
 
static getDraftInstance ()
 

Data Fields

const DRAFT = 'draft'
 
const REVIEW = 'review'
 
const REJECTED = 'rejected'
 
const FINAL = 'final'
 
const SHARABLE = 'sharable'
 
const OUTDATED = 'outdated'
 

Protected Member Functions

 __construct ()
 ilAssQuestionLifecycle constructor. More...
 
 getTranslationByIdentifier (ilLanguage $lng, $identifier)
 

Protected Attributes

 $identifier
 

Detailed Description

Definition at line 13 of file class.ilAssQuestionLifecycle.php.

Constructor & Destructor Documentation

◆ __construct()

ilAssQuestionLifecycle::__construct ( )
protected

ilAssQuestionLifecycle constructor.

Definition at line 30 of file class.ilAssQuestionLifecycle.php.

31 {
32 $this->setIdentifier(self::DRAFT);
33 }

References setIdentifier().

+ Here is the call graph for this function:

Member Function Documentation

◆ getDraftInstance()

◆ getIdentifier()

ilAssQuestionLifecycle::getIdentifier ( )
Returns
string

Definition at line 38 of file class.ilAssQuestionLifecycle.php.

References $identifier.

Referenced by getMappedLomLifecycle(), and getTranslation().

+ Here is the caller graph for this function:

◆ getInstance()

◆ getMappedLomLifecycle()

ilAssQuestionLifecycle::getMappedLomLifecycle ( )
Returns
string

Definition at line 62 of file class.ilAssQuestionLifecycle.php.

References DRAFT, ilAssQuestionLomLifecycle\DRAFT, FINAL, ilAssQuestionLomLifecycle\FINAL, getIdentifier(), OUTDATED, REJECTED, REVIEW, SHARABLE, and ilAssQuestionLomLifecycle\UNAVAILABLE.

+ Here is the call graph for this function:

◆ getSelectOptions()

ilAssQuestionLifecycle::getSelectOptions ( ilLanguage  $lng)
Parameters
ilLanguage$lng
Returns
array

Definition at line 131 of file class.ilAssQuestionLifecycle.php.

132 {
133 $selectOptions = [];
134
135 foreach ($this->getValidIdentifiers() as $identifier) {
136 $selectOptions[$identifier] = $this->getTranslationByIdentifier($lng, $identifier);
137 }
138
139 return $selectOptions;
140 }
getTranslationByIdentifier(ilLanguage $lng, $identifier)

References $identifier, getTranslationByIdentifier(), and getValidIdentifiers().

+ Here is the call graph for this function:

◆ getTranslation()

ilAssQuestionLifecycle::getTranslation ( ilLanguage  $lng)
Parameters
ilLanguage$lng
Returns
string

Definition at line 87 of file class.ilAssQuestionLifecycle.php.

88 {
89 return $this->getTranslationByIdentifier($lng, $this->getIdentifier());
90 }

References getIdentifier(), and getTranslationByIdentifier().

+ Here is the call graph for this function:

◆ getTranslationByIdentifier()

ilAssQuestionLifecycle::getTranslationByIdentifier ( ilLanguage  $lng,
  $identifier 
)
protected
Parameters
ilLanguage$lng
Returns
string

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

97 {
98 switch ($identifier) {
99 case self::DRAFT:
100
101 return $lng->txt('qst_lifecycle_draft');
102
103 case self::REVIEW:
104
105 return $lng->txt('qst_lifecycle_review');
106
107 case self::REJECTED:
108
109 return $lng->txt('qst_lifecycle_rejected');
110
111 case self::FINAL:
112
113 return $lng->txt('qst_lifecycle_final');
114
115 case self::SHARABLE:
116
117 return $lng->txt('qst_lifecycle_sharable');
118
119 case self::OUTDATED:
120
121 return $lng->txt('qst_lifecycle_outdated');
122
123 default: return '';
124 }
125 }
$lng

References $identifier, $lng, DRAFT, FINAL, OUTDATED, REJECTED, REVIEW, and SHARABLE.

Referenced by getSelectOptions(), and getTranslation().

+ Here is the caller graph for this function:

◆ getValidIdentifiers()

ilAssQuestionLifecycle::getValidIdentifiers ( )
Returns
string[]

Definition at line 54 of file class.ilAssQuestionLifecycle.php.

References DRAFT, FINAL, OUTDATED, REJECTED, REVIEW, and SHARABLE.

Referenced by getSelectOptions(), and validateIdentifier().

+ Here is the caller graph for this function:

◆ setIdentifier()

ilAssQuestionLifecycle::setIdentifier (   $identifier)
Parameters
string$identifier

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

47 {
48 $this->identifier = $identifier;
49 }

References $identifier.

Referenced by __construct().

+ Here is the caller graph for this function:

◆ validateIdentifier()

ilAssQuestionLifecycle::validateIdentifier (   $identifier)
Parameters
string$identifier
Exceptions
ilTestQuestionPoolInvalidArgumentException

Definition at line 146 of file class.ilAssQuestionLifecycle.php.

147 {
148 if (!in_array($identifier, $this->getValidIdentifiers())) {
150 'invalid ilias lifecycle given: ' . $identifier
151 );
152 }
153 }

References $identifier, and getValidIdentifiers().

+ Here is the call graph for this function:

Field Documentation

◆ $identifier

ilAssQuestionLifecycle::$identifier
protected

◆ DRAFT

◆ FINAL

◆ OUTDATED

◆ REJECTED

const ilAssQuestionLifecycle::REJECTED = 'rejected'

◆ REVIEW

const ilAssQuestionLifecycle::REVIEW = 'review'

◆ SHARABLE

const ilAssQuestionLifecycle::SHARABLE = 'sharable'

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