ILIAS  trunk Revision v11.0_alpha-1715-g7fc467680fb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilAssLacExpressionNotSupportedByQuestion.php
Go to the documentation of this file.
1 <?php
2 
29 {
33  protected $expression;
34 
38  protected $question_index;
39 
45  {
46  $this->expression = $expression;
47  $this->question_index = $question_index;
48 
49  if ($this->getQuestionIndex() === null) {
50  $msg = sprintf(
51  'The expression "%s" is not supported by the current question',
52  $this->getExpression()
53  );
54  } else {
55  $msg = sprintf(
56  'The expression "%s" is not supported by the question with index "Q%s"',
57  $this->getExpression(),
58  $this->getQuestionIndex()
59  );
60  }
61 
62  parent::__construct($msg);
63  }
64 
68  public function getQuestionIndex(): ?int
69  {
70  return $this->question_index;
71  }
72 
76  public function getExpression(): string
77  {
78  return $this->expression;
79  }
80 
85  public function getFormAlert(ilLanguage $lng): string
86  {
87  if ($this->getQuestionIndex() === null) {
88  return sprintf(
89  $lng->txt("ass_lac_expression_not_supported_by_cur_question"),
90  $this->getExpression()
91  );
92  }
93 
94  return sprintf(
95  $lng->txt("ass_lac_expression_not_supported_by_question"),
96  $this->getQuestionIndex(),
97  $this->getExpression()
98  );
99  }
100 }
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...
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
__construct(Container $dic, ilPlugin $plugin)
global $lng
Definition: privfeed.php:31