ILIAS  release_5-2 Revision v5.2.25-18-g3f80b82851
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  {
38  $msg = sprintf(
39  'The expression "%s" is not supported by the current question', $this->getExpression()
40  );
41  }
42  else
43  {
44  $msg = sprintf(
45  'The expression "%s" is not supported by the question with index "Q%s"',
46  $this->getExpression(), $this->getQuestionIndex()
47  );
48  }
49 
50  parent::__construct($msg);
51  }
+ Here is the call graph for this function:

Member Function Documentation

◆ getExpression()

ilAssLacExpressionNotSupportedByQuestion::getExpression ( )
Returns
string

Definition at line 64 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 73 of file ilAssLacExpressionNotSupportedByQuestion.php.

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

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