ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
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.

References setIdentifier().

31  {
32  $this->setIdentifier(self::DRAFT);
33  }
+ 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 ilAssQuestionLomLifecycle\DRAFT, ilAssQuestionLomLifecycle\FINAL, getIdentifier(), and ilAssQuestionLomLifecycle\UNAVAILABLE.

63  {
64  switch ($this->getIdentifier()) {
65  case self::OUTDATED:
66 
68 
69  case self::SHARABLE:
70  case self::FINAL:
71 
73 
74  case self::REJECTED:
75  case self::REVIEW:
76  case self::DRAFT:
77  default:
78 
80  }
81  }
+ 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.

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

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)
+ 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.

References getIdentifier(), and getTranslationByIdentifier().

88  {
89  return $this->getTranslationByIdentifier($lng, $this->getIdentifier());
90  }
getTranslationByIdentifier(ilLanguage $lng, $identifier)
+ 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.

References $identifier, and ilLanguage\txt().

Referenced by getSelectOptions(), and getTranslation().

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  }
txt($a_topic, $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 54 of file class.ilAssQuestionLifecycle.php.

Referenced by getSelectOptions(), and validateIdentifier().

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

◆ setIdentifier()

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

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

References $identifier.

Referenced by __construct().

47  {
48  $this->identifier = $identifier;
49  }
+ 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.

References $identifier, and getValidIdentifiers().

+ Here is the call graph for this function:

Field Documentation

◆ $identifier

ilAssQuestionLifecycle::$identifier
protected

◆ DRAFT

const ilAssQuestionLifecycle::DRAFT = 'draft'

◆ FINAL

const ilAssQuestionLifecycle::FINAL = 'final'

◆ OUTDATED

const ilAssQuestionLifecycle::OUTDATED = 'outdated'

◆ REJECTED

const ilAssQuestionLifecycle::REJECTED = 'rejected'

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

◆ REVIEW

const ilAssQuestionLifecycle::REVIEW = 'review'

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

◆ SHARABLE

const ilAssQuestionLifecycle::SHARABLE = 'sharable'

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


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