ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
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 setIdentifier().

36  {
37  $this->setIdentifier(self::DRAFT);
38  }
+ Here is the call graph for this function:

Member Function Documentation

◆ getDraftInstance()

◆ getIdentifier()

ilAssQuestionLifecycle::getIdentifier ( )

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

References $identifier.

Referenced by getMappedLomLifecycle(), and getTranslation().

40  : string
41  {
42  return $this->identifier;
43  }
+ Here is the caller graph for this function:

◆ getInstance()

◆ getMappedLomLifecycle()

ilAssQuestionLifecycle::getMappedLomLifecycle ( )

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

References ilAssQuestionLomLifecycle\DRAFT, ilAssQuestionLomLifecycle\FINAL, getIdentifier(), and ilAssQuestionLomLifecycle\UNAVAILABLE.

58  : string
59  {
60  switch ($this->getIdentifier()) {
61  case self::OUTDATED:
63 
64  case self::SHARABLE:
65  case self::FINAL:
67 
68  case self::REJECTED:
69  case self::REVIEW:
70  case self::DRAFT:
71  default:
73  }
74  }
+ 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.

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

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)
+ Here is the call graph for this function:

◆ getTranslation()

ilAssQuestionLifecycle::getTranslation ( ilLanguage  $lng)

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

References getIdentifier(), and getTranslationByIdentifier().

76  : string
77  {
78  return $this->getTranslationByIdentifier($lng, $this->getIdentifier());
79  }
getTranslationByIdentifier(ilLanguage $lng, string $identifier)
+ 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.

References ilLanguage\txt().

Referenced by getSelectOptions(), and getTranslation().

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  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getValidIdentifiers()

ilAssQuestionLifecycle::getValidIdentifiers ( )
Returns
string[]

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

Referenced by getSelectOptions(), and validateIdentifier().

53  : array
54  {
55  return [self::DRAFT, self::REVIEW, self::REJECTED, self::FINAL, self::SHARABLE, self::OUTDATED];
56  }
+ Here is the caller graph for this function:

◆ setIdentifier()

ilAssQuestionLifecycle::setIdentifier ( string  $identifier)
private

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

References $identifier.

Referenced by __construct().

45  : void
46  {
47  $this->identifier = $identifier;
48  }
+ 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.

References getValidIdentifiers().

126  : void
127  {
128  if (!in_array($identifier, $this->getValidIdentifiers(), true)) {
130  'Invalid ilias lifecycle given: ' . $identifier
131  );
132  }
133  }
+ Here is the call graph for this function:

Field Documentation

◆ $identifier

string ilAssQuestionLifecycle::$identifier
protected

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

Referenced by getIdentifier(), getSelectOptions(), and setIdentifier().

◆ DRAFT

const ilAssQuestionLifecycle::DRAFT = 'draft'

◆ FINAL

const ilAssQuestionLifecycle::FINAL = 'final'

◆ OUTDATED

const ilAssQuestionLifecycle::OUTDATED = 'outdated'

◆ REJECTED

const ilAssQuestionLifecycle::REJECTED = 'rejected'

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

◆ REVIEW

const ilAssQuestionLifecycle::REVIEW = 'review'

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

◆ SHARABLE

const ilAssQuestionLifecycle::SHARABLE = 'sharable'

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


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