ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 message isn't optional as in build in class Exception. More...
 

Protected Attributes

 $question_index
 
 $value
 
 $answer_index
 

Detailed Description

Definition at line 15 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 37 of file ilAssLacAnswerValueNotExist.php.

References $answer_index, $question_index, $value, getAnswerIndex(), and getQuestionIndex().

38  {
39  $this->question_index = $question_index;
40  $this->answer_index = $answer_index;
41  $this->value = $value;
42 
43  if( $this->getQuestionIndex() === null && $this->getAnswerIndex() === null )
44  {
45  $msg = sprintf(
46  'The value "%s" does not exist for the current question', $value
47  );
48  }
49  elseif( $this->getQuestionIndex() === null )
50  {
51  $msg = sprintf(
52  'The value "%s" does not exist for the answer with index "%s" of the current question',
53  $value, $this->getAnswerIndex()
54  );
55  }
56  elseif( $this->getAnswerIndex() === null )
57  {
58  $msg = sprintf(
59  'The value "%s" does not exist for the question Q%s',
60  $value, $this->getQuestionIndex()
61  );
62  }
63  else
64  {
65  $msg = sprintf(
66  'The value "%s" does not exist for the question Q%s[%s]',
67  $value, $this->getQuestionIndex(), $this->getAnswerIndex()
68  );
69  }
70 
71  parent::__construct($msg);
72  }
+ Here is the call graph for this function:

Member Function Documentation

◆ getAnswerIndex()

ilAssLacAnswerValueNotExist::getAnswerIndex ( )
Returns
int

Definition at line 85 of file ilAssLacAnswerValueNotExist.php.

References $answer_index.

Referenced by __construct(), and getFormAlert().

+ Here is the caller graph for this function:

◆ getFormAlert()

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

Implements ilAssLacFormAlertProvider.

Definition at line 102 of file ilAssLacAnswerValueNotExist.php.

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

103  {
104  if( $this->getQuestionIndex() === null && $this->getAnswerIndex() === null )
105  {
106  return sprintf($lng->txt("ass_lac_answer_value_not_exists_cur_qst_one_answer"), $this->getValue()
107  );
108  }
109 
110  if( $this->getQuestionIndex() === null )
111  {
112  return sprintf($lng->txt("ass_lac_answer_value_not_exists_cur_qst"),
113  $this->getValue(), $this->getAnswerIndex()
114  );
115  }
116 
117  if( $this->getAnswerIndex() === null )
118  {
119  return sprintf($lng->txt("ass_lac_answer_value_not_exists_one_answer"),
120  $this->getValue(), $this->getQuestionIndex()
121  );
122  }
123 
124  return sprintf($lng->txt("ass_lac_answer_value_not_exists"),
125  $this->getValue(), $this->getQuestionIndex(), $this->getAnswerIndex()
126  );
127  }
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:

◆ getQuestionIndex()

ilAssLacAnswerValueNotExist::getQuestionIndex ( )
Returns
int

Definition at line 77 of file ilAssLacAnswerValueNotExist.php.

References $question_index.

Referenced by __construct(), and getFormAlert().

+ Here is the caller graph for this function:

◆ getValue()

ilAssLacAnswerValueNotExist::getValue ( )
Returns
string

Definition at line 93 of file ilAssLacAnswerValueNotExist.php.

References $value.

Referenced by getFormAlert().

+ Here is the caller graph for this function:

Field Documentation

◆ $answer_index

ilAssLacAnswerValueNotExist::$answer_index
protected

Definition at line 30 of file ilAssLacAnswerValueNotExist.php.

Referenced by __construct(), and getAnswerIndex().

◆ $question_index

ilAssLacAnswerValueNotExist::$question_index
protected

Definition at line 20 of file ilAssLacAnswerValueNotExist.php.

Referenced by __construct(), and getQuestionIndex().

◆ $value

ilAssLacAnswerValueNotExist::$value
protected

Definition at line 25 of file ilAssLacAnswerValueNotExist.php.

Referenced by __construct(), and getValue().


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