ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilAssLacAnswerIndexNotExist Class Reference
+ Inheritance diagram for ilAssLacAnswerIndexNotExist:
+ Collaboration diagram for ilAssLacAnswerIndexNotExist:

Public Member Functions

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

Protected Attributes

 $question_index
 
 $answer_index
 

Detailed Description

Definition at line 28 of file ilAssLacAnswerIndexNotExist.php.

Constructor & Destructor Documentation

◆ __construct()

ilAssLacAnswerIndexNotExist::__construct (   $question_index,
  $answer_index 
)
Parameters
int$question_index
int$answer_index

Definition at line 44 of file ilAssLacAnswerIndexNotExist.php.

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

45  {
46  $this->question_index = $question_index;
47  $this->answer_index = $answer_index;
48 
49  if ($this->getQuestionIndex() === null) {
50  $msg = sprintf(
51  'The Current Question does not have an answer with the index "%s"',
52  $this->getAnswerIndex()
53  );
54  } else {
55  $msg = sprintf(
56  'The Question with index "Q%s" does not have an answer with the index "%s" ',
57  $this->getQuestionIndex(),
58  $this->getAnswerIndex()
59  );
60  }
61 
62  parent::__construct($msg);
63  }
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ getAnswerIndex()

ilAssLacAnswerIndexNotExist::getAnswerIndex ( )
Returns
int

Definition at line 76 of file ilAssLacAnswerIndexNotExist.php.

References $answer_index.

Referenced by __construct(), and getFormAlert().

76  : int
77  {
78  return $this->answer_index;
79  }
+ Here is the caller graph for this function:

◆ getFormAlert()

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

Implements ilAssLacFormAlertProvider.

Definition at line 85 of file ilAssLacAnswerIndexNotExist.php.

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

85  : string
86  {
87  if ($this->getQuestionIndex() === null) {
88  return sprintf(
89  $lng->txt("ass_lac_answer_index_not_exist_cur_qst"),
90  $this->getAnswerIndex()
91  );
92  }
93 
94  return sprintf(
95  $lng->txt("ass_lac_answer_index_not_exist"),
96  $this->getQuestionIndex(),
97  $this->getAnswerIndex()
98  );
99  }
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:

◆ getQuestionIndex()

ilAssLacAnswerIndexNotExist::getQuestionIndex ( )
Returns
int

Definition at line 68 of file ilAssLacAnswerIndexNotExist.php.

References $question_index.

Referenced by __construct(), and getFormAlert().

68  : int
69  {
70  return $this->question_index;
71  }
+ Here is the caller graph for this function:

Field Documentation

◆ $answer_index

ilAssLacAnswerIndexNotExist::$answer_index
protected

Definition at line 38 of file ilAssLacAnswerIndexNotExist.php.

Referenced by __construct(), and getAnswerIndex().

◆ $question_index

ilAssLacAnswerIndexNotExist::$question_index
protected

Definition at line 33 of file ilAssLacAnswerIndexNotExist.php.

Referenced by __construct(), and getQuestionIndex().


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