ILIAS  trunk Revision v12.0_alpha-1221-g4e438232683
ilAssLacAnswerValueNotExist Class Reference
+ Inheritance diagram for ilAssLacAnswerValueNotExist:
+ Collaboration diagram for ilAssLacAnswerValueNotExist:

Public Member Functions

 __construct (protected ?int $question_index, protected string $value, protected ?int $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...
 
 getFormAlert (ilLanguage $lng)
 

Detailed Description

Definition at line 30 of file ilAssLacAnswerValueNotExist.php.

Constructor & Destructor Documentation

◆ __construct()

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

Definition at line 32 of file ilAssLacAnswerValueNotExist.php.

36 {
37 if ($this->getQuestionIndex() === null && $this->getAnswerIndex() === null) {
38 $msg = "The value \"{$value}\" does not exist for the current question";
39 } elseif ($this->getQuestionIndex() === null) {
40 $msg = "The value \"{$value}\" does not exist for the answer with index \"{$this->getAnswerIndex()}\" of the current question";
41 } elseif ($this->getAnswerIndex() === null) {
42 $msg = "The value \"{$value}\" does not exist for the question Q{$this->getQuestionIndex()}";
43 } else {
44 $msg = "The value \"{$value}\" does not exist for the question Q{$this->getQuestionIndex()}[{$this->getAnswerIndex()}]";
45 }
46
48 }
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

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

+ Here is the call graph for this function:

Member Function Documentation

◆ getAnswerIndex()

ilAssLacAnswerValueNotExist::getAnswerIndex ( )

Definition at line 55 of file ilAssLacAnswerValueNotExist.php.

55 : ?int
56 {
57 return $this->answer_index;
58 }

Referenced by __construct(), and getFormAlert().

+ Here is the caller graph for this function:

◆ getFormAlert()

ilAssLacAnswerValueNotExist::getFormAlert ( ilLanguage  $lng)

Implements ilAssLacFormAlertProvider.

Definition at line 65 of file ilAssLacAnswerValueNotExist.php.

65 : string
66 {
67 if ($this->getQuestionIndex() === null && $this->getAnswerIndex() === null) {
68 return sprintf(
69 $lng->txt('ass_lac_answer_value_not_exists_cur_qst_one_answer'),
70 $this->getValue()
71 );
72 }
73
74 if ($this->getQuestionIndex() === null) {
75 return sprintf(
76 $lng->txt('ass_lac_answer_value_not_exists_cur_qst'),
77 $this->getValue(),
78 $this->getAnswerIndex()
79 );
80 }
81
82 if ($this->getAnswerIndex() === null) {
83 return sprintf(
84 $lng->txt('ass_lac_answer_value_not_exists_one_answer'),
85 $this->getValue(),
86 $this->getQuestionIndex()
87 );
88 }
89
90 return sprintf(
91 $lng->txt('ass_lac_answer_value_not_exists'),
92 $this->getValue(),
93 $this->getQuestionIndex(),
94 $this->getAnswerIndex()
95 );
96 }
global $lng
Definition: privfeed.php:31

References $lng, getAnswerIndex(), and getQuestionIndex().

+ Here is the call graph for this function:

◆ getQuestionIndex()

ilAssLacAnswerValueNotExist::getQuestionIndex ( )

Definition at line 50 of file ilAssLacAnswerValueNotExist.php.

50 : ?int
51 {
52 return $this->question_index;
53 }

Referenced by __construct(), and getFormAlert().

+ Here is the caller graph for this function:

◆ getValue()

ilAssLacAnswerValueNotExist::getValue ( )

Definition at line 60 of file ilAssLacAnswerValueNotExist.php.

60 : string
61 {
62 return $this->value;
63 }

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