ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilAssQuestionLifecycle Class Reference
+ Collaboration diagram for ilAssQuestionLifecycle:

Public Member Functions

 getIdentifier ()
 
 getValidIdentifiers ()
 
 getMappedLomLifecycle ()
 
 getTranslation (ilLanguage $lng)
 
 getSelectOptions (ilLanguage $lng)
 

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 Attributes

string $identifier
 

Private Member Functions

 __construct ()
 
 setIdentifier (string $identifier)
 
 getTranslationByIdentifier (ilLanguage $lng, string $identifier)
 
 validateIdentifier ($identifier)
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

ilAssQuestionLifecycle::__construct ( )
private

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

References ILIAS\ResourceStorage\Revision\DRAFT, and setIdentifier().

+ Here is the call graph for this function:

Member Function Documentation

◆ getDraftInstance()

◆ getIdentifier()

ilAssQuestionLifecycle::getIdentifier ( )

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

40 : string
41 {
42 return $this->identifier;
43 }

References $identifier.

Referenced by getMappedLomLifecycle(), and getTranslation().

+ Here is the caller graph for this function:

◆ getInstance()

◆ getMappedLomLifecycle()

ilAssQuestionLifecycle::getMappedLomLifecycle ( )

Definition at line 58 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<string, string>

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

111 : array
112 {
113 $selectOptions = [];
114
115 foreach ($this->getValidIdentifiers() as $identifier) {
116 $selectOptions[$identifier] = $this->getTranslationByIdentifier($lng, $identifier);
117 }
118
119 return $selectOptions;
120 }
getTranslationByIdentifier(ilLanguage $lng, string $identifier)

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

+ Here is the call graph for this function:

◆ getTranslation()

ilAssQuestionLifecycle::getTranslation ( ilLanguage  $lng)

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

76 : string
77 {
78 return $this->getTranslationByIdentifier($lng, $this->getIdentifier());
79 }

References getIdentifier(), and getTranslationByIdentifier().

+ Here is the call graph for this function:

◆ getTranslationByIdentifier()

ilAssQuestionLifecycle::getTranslationByIdentifier ( ilLanguage  $lng,
string  $identifier 
)
private

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

81 : string
82 {
83 switch ($identifier) {
84 case self::DRAFT:
85 return $lng->txt('qst_lifecycle_draft');
86
87 case self::REVIEW:
88 return $lng->txt('qst_lifecycle_review');
89
90 case self::REJECTED:
91 return $lng->txt('qst_lifecycle_rejected');
92
93 case self::FINAL:
94 return $lng->txt('qst_lifecycle_final');
95
96 case self::SHARABLE:
97 return $lng->txt('qst_lifecycle_sharable');
98
99 case self::OUTDATED:
100 return $lng->txt('qst_lifecycle_outdated');
101
102 default:
103 return '';
104 }
105 }
global $lng
Definition: privfeed.php:31

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 53 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 ( string  $identifier)
private

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

45 : void
46 {
47 $this->identifier = $identifier;
48 }

References $identifier.

Referenced by __construct().

+ Here is the caller graph for this function:

◆ validateIdentifier()

ilAssQuestionLifecycle::validateIdentifier (   $identifier)
private
Parameters
mixed$identifier
Exceptions
ilTestQuestionPoolInvalidArgumentException

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

126 : void
127 {
128 if (!in_array($identifier, $this->getValidIdentifiers(), true)) {
130 'Invalid ilias lifecycle given: ' . $identifier
131 );
132 }
133 }

References $identifier, and getValidIdentifiers().

+ Here is the call graph for this function:

Field Documentation

◆ $identifier

string 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: