ILIAS
release_5-2 Revision v5.2.25-18-g3f80b828510
◀ ilDoc Overview
ilAssLacAnswerValueNotExist.php
Go to the documentation of this file.
1
<?
php
2
3
require_once
'Modules/TestQuestionPool/classes/questions/LogicalAnswerCompare/Exception/ilAssLacException.php'
;
4
require_once
'Modules/TestQuestionPool/classes/questions/LogicalAnswerCompare/Exception/ilAssLacFormAlertProvider.php'
;
5
15
class
ilAssLacAnswerValueNotExist
extends
ilAssLacException
implements
ilAssLacFormAlertProvider
16
{
20
protected
$question_index
;
21
25
protected
$value
;
26
30
protected
$answer_index
;
31
37
public
function
__construct
(
$question_index
,
$value
,
$answer_index
= null)
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
}
73
77
public
function
getQuestionIndex
()
78
{
79
return
$this->question_index
;
80
}
81
85
public
function
getAnswerIndex
()
86
{
87
return
$this->answer_index
;
88
}
89
93
public
function
getValue
()
94
{
95
return
$this->value
;
96
}
97
102
public
function
getFormAlert
(
ilLanguage
$lng
)
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
}
128
}
ilAssLacAnswerValueNotExist\getValue
getValue()
Definition:
ilAssLacAnswerValueNotExist.php:93
ilAssLacAnswerValueNotExist\$value
$value
Definition:
ilAssLacAnswerValueNotExist.php:25
ilAssLacAnswerValueNotExist\$answer_index
$answer_index
Definition:
ilAssLacAnswerValueNotExist.php:30
ilAssLacAnswerValueNotExist
Definition:
ilAssLacAnswerValueNotExist.php:15
ilAssLacAnswerValueNotExist\getQuestionIndex
getQuestionIndex()
Definition:
ilAssLacAnswerValueNotExist.php:77
ilAssLacFormAlertProvider
Definition:
ilAssLacFormAlertProvider.php:10
ilAssLacAnswerValueNotExist\__construct
__construct($question_index, $value, $answer_index=null)
Definition:
ilAssLacAnswerValueNotExist.php:37
ilAssLacAnswerValueNotExist\getAnswerIndex
getAnswerIndex()
Definition:
ilAssLacAnswerValueNotExist.php:85
ilAssLacAnswerValueNotExist\getFormAlert
getFormAlert(ilLanguage $lng)
Definition:
ilAssLacAnswerValueNotExist.php:102
$lng
global $lng
Definition:
privfeed.php:17
ilLanguage
language handling
Definition:
class.ilLanguage.php:26
php
ilLanguage\txt
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...
Definition:
class.ilLanguage.php:253
ilAssLacException
Definition:
ilAssLacException.php:12
ilAssLacAnswerValueNotExist\$question_index
$question_index
Definition:
ilAssLacAnswerValueNotExist.php:20
Modules
TestQuestionPool
classes
questions
LogicalAnswerCompare
Exception
ilAssLacAnswerValueNotExist.php
Generated on Fri Jan 17 2025 19:01:06 for ILIAS by
1.8.13 (using
Doxyfile
)