ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
SurveyMultipleChoiceQuestionGUI Class Reference

MultipleChoice survey question GUI representation. More...

+ Inheritance diagram for SurveyMultipleChoiceQuestionGUI:
+ Collaboration diagram for SurveyMultipleChoiceQuestionGUI:

Public Member Functions

 setQuestionTabs ()
 
 getParsedAnswers (array $a_working_data=null, $a_only_user_anwers=false)
 
 getPrintView ($question_title=1, $show_questiontext=1, $survey_id=null, array $a_working_data=null)
 Creates a HTML representation of the question. More...
 
 getWorkingForm ($working_data="", $question_title=1, $show_questiontext=1, $error_message="", $survey_id=null)
 Creates the question output form for the learner. More...
 
- Public Member Functions inherited from SurveyQuestionGUI
 __construct ($a_id=-1)
 
 setQuestionTabs ()
 
executeCommand ()
 
 getQuestionType ()
 Returns the question type string. More...
 
 setBackUrl ($a_url)
 
 setQuestionTabsForClass ($guiclass)
 
 getPrintView ($question_title=1, $show_questiontext=1)
 
 preview ()
 Creates a preview of the question. More...
 
 getWorkingForm ($working_data="", $question_title=1, $show_questiontext=1, $error_message="", $survey_id=null)
 
 material ($checkonly=false)
 Material tab of the survey questions. More...
 
 deleteMaterial ()
 
 addMaterial ()
 Add materials to a question. More...
 
 removeMaterial ()
 
 cancelExplorer ()
 
 addPG ()
 
 addST ()
 
 addGIT ()
 
 linkChilds ()
 
 savePhrase ($a_reload=false)
 Creates an output to save the current answers as a phrase. More...
 
 confirmSavePhrase ()
 Save a new phrase to the database. More...
 

Protected Member Functions

 initObject ()
 
 addFieldsToEditForm (ilPropertyFormGUI $a_form)
 
 validateEditForm (ilPropertyFormGUI $a_form)
 
 importEditFormValues (ilPropertyFormGUI $a_form)
 
- Protected Member Functions inherited from SurveyQuestionGUI
 initObject ()
 
 outQuestionText ($template)
 
 initEditForm ()
 
 addCommandButtons ($a_form)
 
 editQuestion (ilPropertyFormGUI $a_form=null)
 
 saveSync ()
 
 saveReturn ()
 
 saveForm ()
 
 save ($a_return=false, $a_sync=false)
 
 copySyncForm ()
 
 syncCopies ()
 
 originalSyncForm ()
 
 sync ()
 
 cancelSync ()
 
 redirectAfterSaving ($a_return=false)
 Redirect to calling survey or to edit form. More...
 
 cancel ()
 
 validateEditForm (ilPropertyFormGUI $a_form)
 
 addFieldsToEditForm (ilPropertyFormGUI $a_form)
 
 importEditFormValues (ilPropertyFormGUI $a_form)
 
 getPrintViewQuestionTitle ($question_title=1)
 
 getMaterialOutput ()
 Creates the HTML output of the question material(s) More...
 
 initPhrasesForm ()
 
 addPhrase (ilPropertyFormGUI $a_form=null)
 Creates an output for the addition of phrases. More...
 
 addSelectedPhrase ()
 
 renderStatisticsDetailsTable (array $a_head, array $a_rows, array $a_foot=null)
 

Additional Inherited Members

- Static Public Member Functions inherited from SurveyQuestionGUI
static _getQuestionGUI ($questiontype, $question_id=-1)
 Creates a question gui representation. More...
 
static _getGUIClassNameForId ($a_q_id)
 
static _getClassNameForQType ($q_type)
 
- Data Fields inherited from SurveyQuestionGUI
 $object
 
- Protected Attributes inherited from SurveyQuestionGUI
 $rbacsystem
 
 $user
 
 $access
 
 $tree
 
 $toolbar
 
 $tabs
 
 $tpl
 
 $lng
 
 $ctrl
 
 $cumulated
 
 $parent_url
 
 $log
 

Detailed Description

MultipleChoice survey question GUI representation.

The SurveyMultipleChoiceQuestionGUI class encapsulates the GUI representation for multiple choice survey question types.

Author
Helmut Schottmüller helmu.nosp@m.t.sc.nosp@m.hottm.nosp@m.uell.nosp@m.er@ma.nosp@m.c.co.nosp@m.m
Version
$Id$

Definition at line 37 of file class.SurveyMultipleChoiceQuestionGUI.php.

Member Function Documentation

◆ addFieldsToEditForm()

SurveyMultipleChoiceQuestionGUI::addFieldsToEditForm ( ilPropertyFormGUI  $a_form)
protected

Reimplemented from SurveyQuestionGUI.

Definition at line 54 of file class.SurveyMultipleChoiceQuestionGUI.php.

55 {
56 // orientation
57 $orientation = new ilRadioGroupInputGUI($this->lng->txt("orientation"), "orientation");
58 $orientation->setRequired(false);
59 $orientation->addOption(new ilRadioOption($this->lng->txt('vertical'), 0));
60 $orientation->addOption(new ilRadioOption($this->lng->txt('horizontal'), 1));
61 $a_form->addItem($orientation);
62
63 // minimum answers
64 $minanswers = new ilCheckboxInputGUI($this->lng->txt("use_min_answers"), "use_min_answers");
65 $minanswers->setValue(1);
66 $minanswers->setOptionTitle($this->lng->txt("use_min_answers_option"));
67 $minanswers->setRequired(false);
68
69 $nranswers = new ilNumberInputGUI($this->lng->txt("nr_min_answers"), "nr_min_answers");
70 $nranswers->setSize(5);
71 $nranswers->setDecimals(0);
72 $nranswers->setRequired(false);
73 $nranswers->setMinValue(1);
74 $minanswers->addSubItem($nranswers);
75
76 $nrmaxanswers = new ilNumberInputGUI($this->lng->txt("nr_max_answers"), "nr_max_answers");
77 $nrmaxanswers->setSize(5);
78 $nrmaxanswers->setDecimals(0);
79 $nrmaxanswers->setRequired(false);
80 $nrmaxanswers->setMinValue(1);
81 $minanswers->addSubItem($nrmaxanswers);
82
83 $a_form->addItem($minanswers);
84
85 // Answers
86 include_once "./Modules/SurveyQuestionPool/classes/class.ilCategoryWizardInputGUI.php";
87 $answers = new ilCategoryWizardInputGUI($this->lng->txt("answers"), "answers");
88 $answers->setRequired(false);
89 $answers->setAllowMove(true);
90 $answers->setShowWizard(false);
91 $answers->setShowSavePhrase(false);
92 $answers->setUseOtherAnswer(true);
93 $answers->setShowNeutralCategory(true);
94 $answers->setNeutralCategoryTitle($this->lng->txt('svy_neutral_answer'));
95 $answers->setDisabledScale(false);
96 $a_form->addItem($answers);
97
98
99 // values
100 $orientation->setValue($this->object->getOrientation());
101 $minanswers->setChecked($this->object->use_min_answers);
102 $nranswers->setValue($this->object->nr_min_answers);
103 $nrmaxanswers->setValue($this->object->nr_max_answers);
104 if (!$this->object->getCategories()->getCategoryCount()) {
105 $this->object->getCategories()->addCategory("");
106 }
107 $answers->setValues($this->object->getCategories());
108 }
This class represents a survey question category wizard property in a property form.
This class represents a checkbox property in a property form.
This class represents a number property in a property form.
addItem($a_item)
Add Item (Property, SectionHeader).
This class represents a property in a property form.
This class represents an option in a radio group.

References ilPropertyFormGUI\addItem().

+ Here is the call graph for this function:

◆ getParsedAnswers()

SurveyMultipleChoiceQuestionGUI::getParsedAnswers ( array  $a_working_data = null,
  $a_only_user_anwers = false 
)

Definition at line 168 of file class.SurveyMultipleChoiceQuestionGUI.php.

169 {
170 if (is_array($a_working_data)) {
171 $user_answers = $a_working_data;
172 }
173
174 $options = array();
175 for ($i = 0; $i < $this->object->categories->getCategoryCount(); $i++) {
176 $cat = $this->object->categories->getCategory($i);
177 $value = ($cat->scale) ? ($cat->scale - 1) : $i;
178
179 $checked = "unchecked";
180 $text = null;
181 if (is_array($a_working_data)) {
182 foreach ($user_answers as $user_answer) {
183 if ($value == $user_answer["value"]) {
184 $checked = "checked";
185 if ($user_answer["textanswer"]) {
186 $text = $user_answer["textanswer"];
187 }
188 break;
189 }
190 }
191 }
192
193 // "other" options have to be last or horizontal will be screwed
194 $idx = $cat->other . "_" . $value;
195
196 if (!$a_only_user_anwers || $checked == "checked") {
197 $options[$idx] = array(
198 "value" => $value
199 ,"title" => trim($cat->title)
200 ,"other" => (bool) $cat->other
201 ,"checked" => $checked
202 ,"textanswer" => $text
203 );
204 }
205
206 ksort($options);
207 }
208
209 return array_values($options);
210 }
if(!isset( $_REQUEST[ 'ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options
Definition: as_login.php:20
$i
Definition: disco.tpl.php:19
$text
Definition: errorreport.php:18

References $i, $options, and $text.

Referenced by getPrintView().

+ Here is the caller graph for this function:

◆ getPrintView()

SurveyMultipleChoiceQuestionGUI::getPrintView (   $question_title = 1,
  $show_questiontext = 1,
  $survey_id = null,
array  $a_working_data = null 
)

Creates a HTML representation of the question.

@access private

Definition at line 217 of file class.SurveyMultipleChoiceQuestionGUI.php.

218 {
219 $options = $this->getParsedAnswers($a_working_data);
220
221 $template = new ilTemplate("tpl.il_svy_qpl_mc_printview.html", true, true, "Modules/SurveyQuestionPool");
222 switch ($this->object->getOrientation()) {
223 case 0:
224 // vertical orientation
225 foreach ($options as $option) {
226 if ($option["other"]) {
227 $template->setCurrentBlock("other_row");
228 $template->setVariable("IMAGE_CHECKBOX", ilUtil::getHtmlPath(ilUtil::getImagePath("checkbox_" . $option["checked"] . ".png")));
229 $template->setVariable("ALT_CHECKBOX", $this->lng->txt($option["checked"]));
230 $template->setVariable("TITLE_CHECKBOX", $this->lng->txt($option["checked"]));
231 $template->setVariable("OTHER_LABEL", ilUtil::prepareFormOutput($option["title"]));
232 $template->setVariable("OTHER_ANSWER", $option["textanswer"]
233 ? ilUtil::prepareFormOutput($option["textanswer"])
234 : "&nbsp;");
235 $template->parseCurrentBlock();
236 } else {
237 $template->setCurrentBlock("mc_row");
238 $template->setVariable("IMAGE_CHECKBOX", ilUtil::getHtmlPath(ilUtil::getImagePath("checkbox_" . $option["checked"] . ".png")));
239 $template->setVariable("ALT_CHECKBOX", $this->lng->txt($option["checked"]));
240 $template->setVariable("TITLE_CHECKBOX", $this->lng->txt($option["checked"]));
241 $template->setVariable("TEXT_MC", ilUtil::prepareFormOutput($option["title"]));
242 $template->parseCurrentBlock();
243 }
244 }
245 break;
246 case 1:
247 // horizontal orientation
248 foreach ($options as $option) {
249 $template->setCurrentBlock("checkbox_col");
250 $template->setVariable("IMAGE_CHECKBOX", ilUtil::getHtmlPath(ilUtil::getImagePath("checkbox_" . $option["checked"] . ".png")));
251 $template->setVariable("ALT_CHECKBOX", $this->lng->txt($option["checked"]));
252 $template->setVariable("TITLE_CHECKBOX", $this->lng->txt($option["checked"]));
253 $template->parseCurrentBlock();
254 }
255 foreach ($options as $option) {
256 if ($option["other"]) {
257 $template->setCurrentBlock("other_text_col");
258 $template->setVariable("OTHER_LABEL", ilUtil::prepareFormOutput($option["title"]));
259 $template->setVariable("OTHER_ANSWER", $option["textanswer"]
260 ? ilUtil::prepareFormOutput($option["textanswer"])
261 : "&nbsp;");
262 $template->parseCurrentBlock();
263 } else {
264 $template->setCurrentBlock("text_col");
265 $template->setVariable("TEXT_MC", ilUtil::prepareFormOutput($option["title"]));
266 $template->parseCurrentBlock();
267 }
268 }
269 break;
270 }
271
272 if ($this->object->use_min_answers) {
273 $template->setCurrentBlock('min_max_msg');
274 if ($this->object->nr_min_answers > 0 && $this->object->nr_max_answers > 0) {
275 $template->setVariable('MIN_MAX_MSG', sprintf($this->lng->txt('msg_min_max_nr_answers'), $this->object->nr_min_answers, $this->object->nr_max_answers));
276 } elseif ($this->object->nr_min_answers > 0) {
277 $template->setVariable('MIN_MAX_MSG', sprintf($this->lng->txt('msg_min_nr_answers'), $this->object->nr_min_answers));
278 } elseif ($this->object->nr_max_answers > 0) {
279 $template->setVariable('MIN_MAX_MSG', sprintf($this->lng->txt('msg_max_nr_answers'), $this->object->nr_max_answers));
280 }
281 $template->parseCurrentBlock();
282 }
283 if ($show_questiontext) {
285 }
286 if ($question_title) {
287 $template->setVariable("QUESTION_TITLE", $this->getPrintViewQuestionTitle($question_title));
288 }
289 $template->parseCurrentBlock();
290 return $template->get();
291 }
sprintf('%.4f', $callTime)
getParsedAnswers(array $a_working_data=null, $a_only_user_anwers=false)
getPrintViewQuestionTitle($question_title=1)
special template class to simplify handling of ITX/PEAR
static getHtmlPath($relative_path)
get url of path
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms @access public
$template

References $options, $template, ilUtil\getHtmlPath(), ilUtil\getImagePath(), getParsedAnswers(), SurveyQuestionGUI\getPrintViewQuestionTitle(), SurveyQuestionGUI\outQuestionText(), ilUtil\prepareFormOutput(), and sprintf.

+ Here is the call graph for this function:

◆ getWorkingForm()

SurveyMultipleChoiceQuestionGUI::getWorkingForm (   $working_data = "",
  $question_title = 1,
  $show_questiontext = 1,
  $error_message = "",
  $survey_id = null 
)

Creates the question output form for the learner.

@access public

Reimplemented from SurveyQuestionGUI.

Definition at line 303 of file class.SurveyMultipleChoiceQuestionGUI.php.

304 {
305 $template = new ilTemplate("tpl.il_svy_out_mc.html", true, true, "Modules/SurveyQuestionPool");
306 $template->setCurrentBlock("material");
307 $template->setVariable("TEXT_MATERIAL", $this->getMaterialOutput());
308 $template->parseCurrentBlock();
309 switch ($this->object->getOrientation()) {
310 case 0:
311 // vertical orientation
312 for ($i = 0; $i < $this->object->categories->getCategoryCount(); $i++) {
313 $cat = $this->object->categories->getCategory($i);
314 if ($cat->other) {
315 $template->setCurrentBlock("other_row");
316 if (strlen($cat->title)) {
317 $template->setVariable("OTHER_LABEL", $cat->title);
318 }
319 $template->setVariable("VALUE_MC", ($cat->scale) ? ($cat->scale - 1) : $i);
320 $template->setVariable("QUESTION_ID", $this->object->getId());
321 if (is_array($working_data)) {
322 foreach ($working_data as $value) {
323 if (strlen($value["value"])) {
324 if ($value["value"] == $cat->scale-1) {
325 $template->setVariable("OTHER_VALUE", ' value="' . ilUtil::prepareFormOutput($value['textanswer']) . '"');
326 if (!$value['uncheck']) {
327 $template->setVariable("CHECKED_MC", " checked=\"checked\"");
328 }
329 }
330 }
331 }
332 }
333 $template->parseCurrentBlock();
334 } else {
335 $template->setCurrentBlock("mc_row");
336 if ($cat->neutral) {
337 $template->setVariable('ROWCLASS', ' class="neutral"');
338 }
339 $template->setVariable("TEXT_MC", ilUtil::prepareFormOutput($cat->title));
340 $template->setVariable("VALUE_MC", ($cat->scale) ? ($cat->scale - 1) : $i);
341 $template->setVariable("QUESTION_ID", $this->object->getId());
342 if (is_array($working_data)) {
343 foreach ($working_data as $value) {
344 if (strlen($value["value"])) {
345 if ($value["value"] == $cat->scale-1) {
346 if (!$value['uncheck']) {
347 $template->setVariable("CHECKED_MC", " checked=\"checked\"");
348 }
349 }
350 }
351 }
352 }
353 $template->parseCurrentBlock();
354 }
355 $template->touchBlock('outer_row');
356 }
357 break;
358 case 1:
359 // horizontal orientation
360
361 // #15477 - reverting the categorizing of answers
362 for ($i = 0; $i < $this->object->categories->getCategoryCount(); $i++) {
363 $cat = $this->object->categories->getCategory($i);
364
365 // checkbox
366 $template->setCurrentBlock("checkbox_col");
367 if ($cat->neutral) {
368 $template->setVariable('COLCLASS', ' neutral');
369 }
370 $template->setVariable("VALUE_MC", ($cat->scale) ? ($cat->scale - 1) : $i);
371 $template->setVariable("QUESTION_ID", $this->object->getId());
372 if (is_array($working_data)) {
373 foreach ($working_data as $value) {
374 if (strlen($value["value"])) {
375 if ($value["value"] == $cat->scale-1) {
376 if (!$value['uncheck']) {
377 $template->setVariable("CHECKED_MC", " checked=\"checked\"");
378 }
379 }
380 }
381 }
382 }
383 $template->parseCurrentBlock();
384
385 // answer & input
386 if ($cat->other) {
387 $template->setCurrentBlock("text_other_col");
388 $template->setVariable("VALUE_MC", ($cat->scale) ? ($cat->scale - 1) : $i);
389 $template->setVariable("QUESTION_ID", $this->object->getId());
390 if (strlen($cat->title)) {
391 $template->setVariable("OTHER_LABEL", $cat->title);
392 }
393 if (is_array($working_data)) {
394 foreach ($working_data as $value) {
395 if (strlen($value["value"])) {
396 if ($value["value"] == $cat->scale-1) {
397 $template->setVariable("OTHER_VALUE", ' value="' . ilUtil::prepareFormOutput($value['textanswer']) . '"');
398 }
399 }
400 }
401 }
402 $template->parseCurrentBlock();
403 }
404 // answer
405 else {
406 $template->setCurrentBlock("text_col");
407 if ($cat->neutral) {
408 $template->setVariable('COLCLASS', ' neutral');
409 }
410 $template->setVariable("VALUE_MC", ($cat->scale) ? ($cat->scale - 1) : $i);
411 $template->setVariable("TEXT_MC", ilUtil::prepareFormOutput($cat->title));
412 $template->setVariable("QUESTION_ID", $this->object->getId());
413 $template->parseCurrentBlock();
414 }
415 $template->touchBlock('text_outer_col');
416 }
417 break;
418 }
419
420 $template->setCurrentBlock("question_data");
421 if ($this->object->use_min_answers) {
422 $template->setCurrentBlock('min_max_msg');
423 if ($this->object->nr_min_answers > 0 && $this->object->nr_max_answers > 0) {
424 if ($this->object->nr_min_answers == $this->object->nr_max_answers) {
425 $template->setVariable('MIN_MAX_MSG', sprintf($this->lng->txt('msg_min_max_exact_answers'), $this->object->nr_min_answers));
426 } else {
427 $template->setVariable('MIN_MAX_MSG', sprintf($this->lng->txt('msg_min_max_nr_answers'), $this->object->nr_min_answers, $this->object->nr_max_answers));
428 }
429 } elseif ($this->object->nr_min_answers > 0) {
430 $template->setVariable('MIN_MAX_MSG', sprintf($this->lng->txt('msg_min_nr_answers'), $this->object->nr_min_answers));
431 } elseif ($this->object->nr_max_answers > 0) {
432 $template->setVariable('MIN_MAX_MSG', sprintf($this->lng->txt('msg_max_nr_answers'), $this->object->nr_max_answers));
433 }
434 $template->parseCurrentBlock();
435 }
436 if (strcmp($error_message, "") != 0) {
437 $template->setVariable("ERROR_MESSAGE", "<p class=\"warning\">$error_message</p>");
438 }
439 if ($show_questiontext) {
441 }
442 if ($question_title) {
443 $template->setVariable("QUESTION_TITLE", $this->object->getTitle());
444 }
445 $template->parseCurrentBlock();
446 return $template->get();
447 }
getMaterialOutput()
Creates the HTML output of the question material(s)

References $i, $template, SurveyQuestionGUI\getMaterialOutput(), SurveyQuestionGUI\outQuestionText(), ilUtil\prepareFormOutput(), and sprintf.

+ Here is the call graph for this function:

◆ importEditFormValues()

SurveyMultipleChoiceQuestionGUI::importEditFormValues ( ilPropertyFormGUI  $a_form)
protected

Reimplemented from SurveyQuestionGUI.

Definition at line 146 of file class.SurveyMultipleChoiceQuestionGUI.php.

147 {
148 $this->object->setOrientation($a_form->getInput("orientation"));
149 $this->object->use_other_answer = ($a_form->getInput('use_other_answer')) ? 1 : 0;
150 $this->object->other_answer_label = $this->object->use_other_answer ? $a_form->getInput('other_answer_label') : null;
151 $this->object->use_min_answers = ($a_form->getInput('use_min_answers')) ? true : false;
152 $this->object->nr_min_answers = ($a_form->getInput('nr_min_answers') > 0) ? $a_form->getInput('nr_min_answers') : null;
153 $this->object->nr_max_answers = ($a_form->getInput('nr_max_answers') > 0) ? $a_form->getInput('nr_max_answers') : null;
154 $this->object->label = $a_form->getInput('label');
155
156 $this->object->categories->flushCategories();
157
158 foreach ($_POST['answers']['answer'] as $key => $value) {
159 if (strlen($value)) {
160 $this->object->getCategories()->addCategory($value, $_POST['answers']['other'][$key], 0, null, $_POST['answers']['scale'][$key]);
161 }
162 }
163 if (strlen($_POST['answers']['neutral'])) {
164 $this->object->getCategories()->addCategory($_POST['answers']['neutral'], 0, 1, null, $_POST['answers_neutral_scale']);
165 }
166 }
$_POST["username"]
getInput($a_post_var, $ensureValidation=true)
Returns the value of a HTTP-POST variable, identified by the passed id.
$key
Definition: croninfo.php:18

References $_POST, $key, and ilPropertyFormGUI\getInput().

+ Here is the call graph for this function:

◆ initObject()

SurveyMultipleChoiceQuestionGUI::initObject ( )
protected

Reimplemented from SurveyQuestionGUI.

Definition at line 39 of file class.SurveyMultipleChoiceQuestionGUI.php.

40 {
41 include_once "./Modules/SurveyQuestionPool/classes/class.SurveyMultipleChoiceQuestion.php";
42 $this->object = new SurveyMultipleChoiceQuestion();
43 }

◆ setQuestionTabs()

SurveyMultipleChoiceQuestionGUI::setQuestionTabs ( )

Reimplemented from SurveyQuestionGUI.

Definition at line 49 of file class.SurveyMultipleChoiceQuestionGUI.php.

50 {
51 $this->setQuestionTabsForClass("surveymultiplechoicequestiongui");
52 }

References SurveyQuestionGUI\setQuestionTabsForClass().

+ Here is the call graph for this function:

◆ validateEditForm()

SurveyMultipleChoiceQuestionGUI::validateEditForm ( ilPropertyFormGUI  $a_form)
protected

Reimplemented from SurveyQuestionGUI.

Definition at line 110 of file class.SurveyMultipleChoiceQuestionGUI.php.

111 {
112 if ($a_form->getInput("use_min_answers")) {
113 // #13927 - see importEditFormValues()
114 $cnt_answers = 0;
115 foreach ($_POST['answers']['answer'] as $key => $value) {
116 if (strlen($value)) {
117 $cnt_answers++;
118 }
119 }
120 if (strlen($_POST['answers']['neutral'])) {
121 $cnt_answers++;
122 }
123 /* this would be the DB-values
124 $cnt_answers = $a_form->getItemByPostVar("answers");
125 $cnt_answers = $cnt_answers->getCategoryCount();
126 */
127 $min_anwers = $a_form->getInput("nr_min_answers");
128 $max_anwers = $a_form->getInput("nr_max_answers");
129
130 if ($min_anwers &&
131 $min_anwers > $cnt_answers) {
132 $a_form->getItemByPostVar("nr_min_answers")->setAlert($this->lng->txt('err_minvalueganswers'));
133 $errors = true;
134 }
135 if ($max_anwers > 0 &&
136 ($max_anwers > $cnt_answers || $max_anwers < $min_anwers)) {
137 $a_form->getItemByPostVar("nr_max_answers")->setAlert($this->lng->txt('err_maxvaluegeminvalue'));
138 $errors = true;
139 }
140 }
141
142 ilUtil::sendFailure($this->lng->txt('form_input_not_valid'));
143 return !$errors;
144 }
getItemByPostVar($a_post_var)
Get Item by POST variable.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$errors
Definition: index.php:6

References $_POST, $errors, $key, ilPropertyFormGUI\getInput(), ilPropertyFormGUI\getItemByPostVar(), and ilUtil\sendFailure().

+ Here is the call graph for this function:

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