ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilAssLacExpressionNotSupportedByQuestion Class Reference
+ Inheritance diagram for ilAssLacExpressionNotSupportedByQuestion:
+ Collaboration diagram for ilAssLacExpressionNotSupportedByQuestion:

Public Member Functions

 __construct ($expression, $question_index)
 
 getQuestionIndex ()
 
 getExpression ()
 
 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

 $expression
 
 $question_index
 

Detailed Description

Definition at line 15 of file ilAssLacExpressionNotSupportedByQuestion.php.

Constructor & Destructor Documentation

◆ __construct()

ilAssLacExpressionNotSupportedByQuestion::__construct (   $expression,
  $question_index 
)
Parameters
string$expression
int$question_index

Definition at line 31 of file ilAssLacExpressionNotSupportedByQuestion.php.

References $expression, $question_index, getExpression(), and getQuestionIndex().

32  {
33  $this->expression = $expression;
34  $this->question_index = $question_index;
35 
36  if ($this->getQuestionIndex() === null) {
37  $msg = sprintf(
38  'The expression "%s" is not supported by the current question',
39  $this->getExpression()
40  );
41  } else {
42  $msg = sprintf(
43  'The expression "%s" is not supported by the question with index "Q%s"',
44  $this->getExpression(),
45  $this->getQuestionIndex()
46  );
47  }
48 
49  parent::__construct($msg);
50  }
+ Here is the call graph for this function:

Member Function Documentation

◆ getExpression()

ilAssLacExpressionNotSupportedByQuestion::getExpression ( )
Returns
string

Definition at line 63 of file ilAssLacExpressionNotSupportedByQuestion.php.

References $expression.

Referenced by __construct(), and getFormAlert().

+ Here is the caller graph for this function:

◆ getFormAlert()

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

Implements ilAssLacFormAlertProvider.

Definition at line 72 of file ilAssLacExpressionNotSupportedByQuestion.php.

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

73  {
74  if ($this->getQuestionIndex() === null) {
75  return sprintf(
76  $lng->txt("ass_lac_expression_not_supported_by_cur_question"),
77  $this->getExpression()
78  );
79  }
80 
81  return sprintf(
82  $lng->txt("ass_lac_expression_not_supported_by_question"),
83  $this->getQuestionIndex(),
84  $this->getExpression()
85  );
86  }
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()

ilAssLacExpressionNotSupportedByQuestion::getQuestionIndex ( )
Returns
int

Definition at line 55 of file ilAssLacExpressionNotSupportedByQuestion.php.

References $question_index.

Referenced by __construct(), and getFormAlert().

+ Here is the caller graph for this function:

Field Documentation

◆ $expression

ilAssLacExpressionNotSupportedByQuestion::$expression
protected

Definition at line 20 of file ilAssLacExpressionNotSupportedByQuestion.php.

Referenced by __construct(), and getExpression().

◆ $question_index

ilAssLacExpressionNotSupportedByQuestion::$question_index
protected

Definition at line 25 of file ilAssLacExpressionNotSupportedByQuestion.php.

Referenced by __construct(), and getQuestionIndex().


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