ILIAS  trunk Revision v11.0_alpha-1761-g6dbbfa7b760
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilAssLacAnswerValueNotExist Class Reference
+ Inheritance diagram for ilAssLacAnswerValueNotExist:
+ Collaboration diagram for ilAssLacAnswerValueNotExist:

Public Member Functions

 __construct ($question_index, $value, $answer_index=null)
 
 getQuestionIndex ()
 
 getAnswerIndex ()
 
 getValue ()
 
 getFormAlert (ilLanguage $lng)
 
- Public Member Functions inherited from ilException
 __construct ($a_message, $a_code=0)
 A code isn't optional as in build in class Exception. More...
 

Protected Attributes

 $question_index
 
 $value
 
 $answer_index
 

Detailed Description

Definition at line 28 of file ilAssLacAnswerValueNotExist.php.

Constructor & Destructor Documentation

◆ __construct()

ilAssLacAnswerValueNotExist::__construct (   $question_index,
  $value,
  $answer_index = null 
)
Parameters
int$question_index
string$value
int$answer_index

Definition at line 50 of file ilAssLacAnswerValueNotExist.php.

References $answer_index, $question_index, $value, ILIAS\GlobalScreen\Provider\__construct(), getAnswerIndex(), getQuestionIndex(), and null.

51  {
52  $this->question_index = $question_index;
53  $this->answer_index = $answer_index;
54  $this->value = $value;
55 
56  if ($this->getQuestionIndex() === null && $this->getAnswerIndex() === null) {
57  $msg = sprintf(
58  'The value "%s" does not exist for the current question',
59  $value
60  );
61  } elseif ($this->getQuestionIndex() === null) {
62  $msg = sprintf(
63  'The value "%s" does not exist for the answer with index "%s" of the current question',
64  $value,
65  $this->getAnswerIndex()
66  );
67  } elseif ($this->getAnswerIndex() === null) {
68  $msg = sprintf(
69  'The value "%s" does not exist for the question Q%s',
70  $value,
71  $this->getQuestionIndex()
72  );
73  } else {
74  $msg = sprintf(
75  'The value "%s" does not exist for the question Q%s[%s]',
76  $value,
77  $this->getQuestionIndex(),
78  $this->getAnswerIndex()
79  );
80  }
81 
82  parent::__construct($msg);
83  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ getAnswerIndex()

ilAssLacAnswerValueNotExist::getAnswerIndex ( )
Returns
int

Definition at line 96 of file ilAssLacAnswerValueNotExist.php.

References $answer_index.

Referenced by __construct(), and getFormAlert().

96  : ?int
97  {
98  return $this->answer_index;
99  }
+ Here is the caller graph for this function:

◆ getFormAlert()

ilAssLacAnswerValueNotExist::getFormAlert ( ilLanguage  $lng)
Parameters
ilLanguage$lng
Returns
string

Implements ilAssLacFormAlertProvider.

Definition at line 113 of file ilAssLacAnswerValueNotExist.php.

References getAnswerIndex(), getQuestionIndex(), getValue(), null, and ilLanguage\txt().

113  : string
114  {
115  if ($this->getQuestionIndex() === null && $this->getAnswerIndex() === null) {
116  return sprintf(
117  $lng->txt("ass_lac_answer_value_not_exists_cur_qst_one_answer"),
118  $this->getValue()
119  );
120  }
121 
122  if ($this->getQuestionIndex() === null) {
123  return sprintf(
124  $lng->txt("ass_lac_answer_value_not_exists_cur_qst"),
125  $this->getValue(),
126  $this->getAnswerIndex()
127  );
128  }
129 
130  if ($this->getAnswerIndex() === null) {
131  return sprintf(
132  $lng->txt("ass_lac_answer_value_not_exists_one_answer"),
133  $this->getValue(),
134  $this->getQuestionIndex()
135  );
136  }
137 
138  return sprintf(
139  $lng->txt("ass_lac_answer_value_not_exists"),
140  $this->getValue(),
141  $this->getQuestionIndex(),
142  $this->getAnswerIndex()
143  );
144  }
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...
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:

◆ getQuestionIndex()

ilAssLacAnswerValueNotExist::getQuestionIndex ( )
Returns
int

Definition at line 88 of file ilAssLacAnswerValueNotExist.php.

References $question_index.

Referenced by __construct(), and getFormAlert().

88  : int
89  {
90  return $this->question_index;
91  }
+ Here is the caller graph for this function:

◆ getValue()

ilAssLacAnswerValueNotExist::getValue ( )
Returns
string

Definition at line 104 of file ilAssLacAnswerValueNotExist.php.

References $value.

Referenced by getFormAlert().

104  : string
105  {
106  return $this->value;
107  }
+ Here is the caller graph for this function:

Field Documentation

◆ $answer_index

ilAssLacAnswerValueNotExist::$answer_index
protected

Definition at line 43 of file ilAssLacAnswerValueNotExist.php.

Referenced by __construct(), and getAnswerIndex().

◆ $question_index

ilAssLacAnswerValueNotExist::$question_index
protected

Definition at line 33 of file ilAssLacAnswerValueNotExist.php.

Referenced by __construct(), and getQuestionIndex().

◆ $value

ilAssLacAnswerValueNotExist::$value
protected

Definition at line 38 of file ilAssLacAnswerValueNotExist.php.

Referenced by __construct(), and getValue().


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