ILIAS  trunk Revision v11.0_alpha-1811-gd2d5443e411
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
SurveySingleChoiceQuestionGUI Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for SurveySingleChoiceQuestionGUI:
+ Collaboration diagram for SurveySingleChoiceQuestionGUI:

Public Member Functions

 setQuestionTabs ()
 
 getParsedAnswers (?array $a_working_data=null, $a_only_user_anwers=false)
 
 getPrintView (int $question_title=1, bool $show_questiontext=true, ?int $survey_id=null, ?array $working_data=null)
 
 getWorkingForm (?array $working_data=null, int $question_title=1, bool $show_questiontext=true, string $error_message="", ?int $survey_id=null, bool $compress_view=false)
 
- Public Member Functions inherited from SurveyQuestionGUI
 __construct ($a_id=-1)
 
 setQuestionTabs ()
 
 executeCommand ()
 
 getQuestionType ()
 Returns the question type string. More...
 
 setBackUrl (string $a_url)
 
 setQuestionTabsForClass (string $guiclass)
 
 getPrintView (int $question_title=1, bool $show_questiontext=true, ?int $survey_id=null, ?array $working_data=null)
 
 preview ()
 
 getWorkingForm (?array $working_data=null, int $question_title=1, bool $show_questiontext=true, string $error_message="", ?int $survey_id=null, bool $compress_view=false)
 

Protected Member Functions

 initObject ()
 
 addFieldsToEditForm (ilPropertyFormGUI $a_form)
 
 importEditFormValues (ilPropertyFormGUI $a_form)
 
- Protected Member Functions inherited from SurveyQuestionGUI
 initObject ()
 
 outQuestionText (ilTemplate $template)
 
 initEditForm ()
 
 addCommandButtons (ilPropertyFormGUI $a_form)
 
 editQuestion (?ilPropertyFormGUI $a_form=null)
 
 saveSync ()
 
 saveReturn ()
 
 saveForm ()
 
 save (bool $a_return=false, bool $a_sync=false)
 
 copySyncForm ()
 
 syncCopies ()
 
 originalSyncForm ()
 
 sync ()
 
 cancelSync ()
 
 redirectAfterSaving (bool $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 (int $question_title=1)
 
 getQuestionTitle (int $question_title_mode=1)
 
 renderStatisticsDetailsTable (array $a_head, array $a_rows, ?array $a_foot=null)
 

Additional Inherited Members

- Static Public Member Functions inherited from SurveyQuestionGUI
static _getQuestionGUI (?string $questiontype, int $question_id=-1)
 Creates a question gui representation. More...
 
static _getGUIClassNameForId (int $a_q_id)
 
static _getClassNameForQType (string $q_type)
 
- Data Fields inherited from SurveyQuestionGUI
SurveyQuestion $object = null
 
- Protected Attributes inherited from SurveyQuestionGUI
ILIAS Survey InternalGUIService $gui
 
EditingGUIRequest $request
 
EditManager $edit_manager
 
ilRbacSystem $rbacsystem
 
ilObjUser $user
 
ilAccessHandler $access
 
ilTree $tree
 
ilToolbarGUI $toolbar
 
ilTabsGUI $tabs
 
ilGlobalTemplateInterface $tpl
 
ilLanguage $lng
 
ilCtrl $ctrl
 
array $cumulated = []
 
string $parent_url = ""
 
ilLogger $log
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning SingleChoice survey question GUI representation

The SurveySingleChoiceQuestionGUI class encapsulates the GUI representation for single 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

Definition at line 27 of file class.SurveySingleChoiceQuestionGUI.php.

Member Function Documentation

◆ addFieldsToEditForm()

SurveySingleChoiceQuestionGUI::addFieldsToEditForm ( ilPropertyFormGUI  $a_form)
protected

Definition at line 43 of file class.SurveySingleChoiceQuestionGUI.php.

References ilPropertyFormGUI\addItem(), ILIAS\Repository\lng(), ILIAS\Repository\object(), and ilFormPropertyGUI\setRequired().

43  : void
44  {
45  // orientation
46  $orientation = new ilRadioGroupInputGUI($this->lng->txt("orientation"), "orientation");
47  $orientation->setRequired(false);
48  $orientation->addOption(new ilRadioOption($this->lng->txt('vertical'), 0));
49  $orientation->addOption(new ilRadioOption($this->lng->txt('horizontal'), 1));
50  $orientation->addOption(new ilRadioOption($this->lng->txt('combobox'), 2));
51  $a_form->addItem($orientation);
52 
53  // Answers
54  $answers = new ilCategoryWizardInputGUI($this->lng->txt("answers"), "answers");
55  $answers->setRequired(false);
56  $answers->setAllowMove(true);
57  $answers->setShowWizard(true);
58  $answers->setUseOtherAnswer(true);
59  $answers->setShowNeutralCategory(true);
60  $answers->setNeutralCategoryTitle($this->lng->txt('svy_neutral_answer'));
61  $answers->setDisabledScale(false);
62  $a_form->addItem($answers);
63 
64  // values
65  $orientation->setValue($this->object->getOrientation());
66  if (!$this->object->getCategories()->getCategoryCount()) {
67  $this->object->getCategories()->addCategory("");
68  }
69  $answers->setValues($this->object->getCategories());
70  }
This class represents an option in a radio group.
This class represents a property in a property form.
setRequired(bool $a_required)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ getParsedAnswers()

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

Definition at line 96 of file class.SurveySingleChoiceQuestionGUI.php.

References null.

Referenced by getPrintView().

99  : array {
100  if (is_array($a_working_data)) {
101  $user_answer = $a_working_data[0] ?? null;
102  }
103 
104  $options = array();
105  for ($i = 0; $i < $this->object->categories->getCategoryCount(); $i++) {
106  $cat = $this->object->categories->getCategory($i);
107  $value = ($cat->scale) ? ($cat->scale - 1) : $i;
108 
109  $checked = "unchecked";
110  $text = null;
111  if (is_array($a_working_data) &&
112  is_array($user_answer)) {
113  if ($value == $user_answer["value"]) {
114  $checked = "checked";
115  if ($user_answer["textanswer"]) {
116  $text = $user_answer["textanswer"];
117  }
118  }
119  }
120 
121  // "other" options have to be last or horizontal will be screwed
122  $idx = $cat->other . "_" . $value;
123 
124  if (!$a_only_user_anwers || $checked === "checked") {
125  $options[$idx] = array(
126  "value" => $value
127  ,"title" => trim($cat->title)
128  ,"other" => (bool) $cat->other
129  ,"checked" => $checked
130  ,"textanswer" => $text
131  );
132  }
133 
134  ksort($options);
135  }
136 
137  return array_values($options);
138  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the caller graph for this function:

◆ getPrintView()

SurveySingleChoiceQuestionGUI::getPrintView ( int  $question_title = 1,
bool  $show_questiontext = true,
?int  $survey_id = null,
?array  $working_data = null 
)

Definition at line 140 of file class.SurveySingleChoiceQuestionGUI.php.

References ilUtil\getHtmlPath(), ilUtil\getImagePath(), getParsedAnswers(), SurveyQuestionGUI\getPrintViewQuestionTitle(), ILIAS\Repository\lng(), ILIAS\Repository\object(), SurveyQuestionGUI\outQuestionText(), and ilLegacyFormElementsUtil\prepareFormOutput().

145  : string {
146  $options = $this->getParsedAnswers($working_data);
147 
148  // rendering
149 
150  $template = new ilTemplate("tpl.il_svy_qpl_sc_printview.html", true, true, "components/ILIAS/SurveyQuestionPool");
151  switch ($this->object->orientation) {
152  case 0:
153  // vertical orientation
154  foreach ($options as $option) {
155  if ($option["other"]) {
156  $template->setCurrentBlock("other_row");
157  $template->setVariable("IMAGE_RADIO", ilUtil::getHtmlPath(ilUtil::getImagePath("object/radiobutton_" . $option["checked"] . ".png")));
158  $template->setVariable("ALT_RADIO", $this->lng->txt($option["checked"]));
159  $template->setVariable("TITLE_RADIO", $this->lng->txt($option["checked"]));
160  $template->setVariable(
161  "OTHER_LABEL",
163  );
164  $template->setVariable("OTHER_ANSWER", $option["textanswer"]
165  ? ilLegacyFormElementsUtil::prepareFormOutput($option["textanswer"])
166  : "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
167  } else {
168  $template->setCurrentBlock("row");
169  $template->setVariable("IMAGE_RADIO", ilUtil::getHtmlPath(ilUtil::getImagePath("object/radiobutton_" . $option["checked"] . ".png")));
170  $template->setVariable("ALT_RADIO", $this->lng->txt($option["checked"]));
171  $template->setVariable("TITLE_RADIO", $this->lng->txt($option["checked"]));
172  $template->setVariable("TEXT_SC", ilLegacyFormElementsUtil::prepareFormOutput($option["title"]));
173  }
174  $template->parseCurrentBlock();
175  }
176  break;
177  case 1:
178  // horizontal orientation
179  foreach ($options as $option) {
180  $template->setCurrentBlock("radio_col");
181  $template->setVariable("IMAGE_RADIO", ilUtil::getHtmlPath(ilUtil::getImagePath("object/radiobutton_" . $option["checked"] . ".png")));
182  $template->setVariable("ALT_RADIO", $this->lng->txt($option["checked"]));
183  $template->setVariable("TITLE_RADIO", $this->lng->txt($option["checked"]));
184  $template->parseCurrentBlock();
185  }
186  foreach ($options as $option) {
187  if ($option["other"]) {
188  $template->setCurrentBlock("other_text_col");
189  $template->setVariable(
190  "OTHER_LABEL",
192  );
193  $template->setVariable("OTHER_ANSWER", $option["textanswer"]
194  ? ilLegacyFormElementsUtil::prepareFormOutput($option["textanswer"])
195  : "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
196  } else {
197  $template->setCurrentBlock("text_col");
198  $template->setVariable("TEXT_SC", ilLegacyFormElementsUtil::prepareFormOutput($option["title"]));
199  }
200  $template->parseCurrentBlock();
201  }
202  break;
203  case 2:
204  foreach ($options as $option) {
205  $template->setCurrentBlock("comborow");
206  $template->setVariable("TEXT_SC", ilLegacyFormElementsUtil::prepareFormOutput($option["title"]));
207  $template->setVariable("VALUE_SC", $option["value"]);
208  if ($option["checked"] === "checked") {
209  $template->setVariable("SELECTED_SC", ' selected="selected"');
210  }
211  $template->parseCurrentBlock();
212  }
213  $template->setCurrentBlock("combooutput");
214  $template->setVariable("QUESTION_ID", $this->object->getId());
215  $template->setVariable("SELECT_OPTION", $this->lng->txt("select_option"));
216  $template->setVariable("TEXT_SELECTION", $this->lng->txt("selection"));
217  $template->parseCurrentBlock();
218  break;
219  }
220  if ($question_title) {
221  $template->setVariable("QUESTION_TITLE", $this->getPrintViewQuestionTitle($question_title));
222  }
223  if ($show_questiontext) {
224  $this->outQuestionText($template);
225  }
226  $template->parseCurrentBlock();
227  return $template->get();
228  }
getPrintViewQuestionTitle(int $question_title=1)
static prepareFormOutput($a_str, bool $a_strip=false)
getParsedAnswers(?array $a_working_data=null, $a_only_user_anwers=false)
outQuestionText(ilTemplate $template)
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
static getHtmlPath(string $relative_path)
get url of path
+ Here is the call graph for this function:

◆ getWorkingForm()

SurveySingleChoiceQuestionGUI::getWorkingForm ( ?array  $working_data = null,
int  $question_title = 1,
bool  $show_questiontext = true,
string  $error_message = "",
?int  $survey_id = null,
bool  $compress_view = false 
)

Definition at line 235 of file class.SurveySingleChoiceQuestionGUI.php.

References SurveyQuestionGUI\getQuestionTitle(), ILIAS\Repository\lng(), ILIAS\Repository\object(), SurveyQuestionGUI\outQuestionText(), and ilLegacyFormElementsUtil\prepareFormOutput().

242  : string {
243  $orientation = $this->object->orientation;
244  $template_file = "tpl.il_svy_out_sc.html";
245  if ($compress_view && $orientation === 1) {
246  $template_file = "tpl.il_svy_out_sc_comp.html";
247  $orientation = 3;
248  }
249  $template = new ilTemplate($template_file, true, true, "components/ILIAS/SurveyQuestionPool");
250  switch ($orientation) {
251  case 0:
252  // vertical orientation
253  for ($i = 0; $i < $this->object->categories->getCategoryCount(); $i++) {
254  $cat = $this->object->categories->getCategory($i);
255 
256  $debug_scale = ($cat->scale) ? ($cat->scale - 1) : $i;
257  $this->log->debug("Vertical orientation - Original scale = " . $cat->scale . " If(scale) scale -1 else i. The new scale value is = " . $debug_scale);
258 
259  if ($cat->other) {
260  $template->setCurrentBlock("other_row");
261  if (strlen($cat->title ?? "")) {
262  $template->setVariable("OTHER_LABEL", $cat->title);
263  }
264  $template->setVariable("VALUE_SC", ($cat->scale) ? ($cat->scale - 1) : $i);
265  $template->setVariable("QUESTION_ID", $this->object->getId());
266  if (is_array($working_data)) {
267  foreach ($working_data as $value) {
268  if (strlen($value["value"] ?? "")) {
269  if ($value["value"] == $cat->scale - 1) {
270  if (strlen($value['textanswer'] ?? "")) {
271  $template->setVariable("OTHER_VALUE", ' value="' . ilLegacyFormElementsUtil::prepareFormOutput(
272  $value['textanswer']
273  ) . '"');
274  }
275  if (!($value['uncheck'] ?? false)) {
276  $template->setVariable("CHECKED_SC", " checked=\"checked\"");
277  }
278  }
279  }
280  }
281  }
282  } else {
283  $template->setCurrentBlock("row");
284  if ($cat->neutral) {
285  $template->setVariable('ROWCLASS', ' class="neutral"');
286  }
287  $template->setVariable("TEXT_SC", ilLegacyFormElementsUtil::prepareFormOutput($cat->title));
288  $template->setVariable("VALUE_SC", ($cat->scale) ? ($cat->scale - 1) : $i);
289  $template->setVariable("QUESTION_ID", $this->object->getId());
290  if (is_array($working_data)) {
291  foreach ($working_data as $value) {
292  if (strcmp($value["value"], "") !== 0) {
293  if ($value["value"] == $cat->scale - 1) {
294  if (!($value['uncheck'] ?? false)) {
295  $template->setVariable("CHECKED_SC", " checked=\"checked\"");
296  }
297  }
298  }
299  }
300  }
301  }
302  $template->parseCurrentBlock();
303  $template->touchBlock('outer_row');
304  }
305  break;
306  case 1:
307  // horizontal orientation
308  for ($i = 0; $i < $this->object->categories->getCategoryCount(); $i++) {
309  $cat = $this->object->categories->getCategory($i);
310 
311  $debug_scale = ($cat->scale) ? ($cat->scale - 1) : $i;
312  $this->log->debug("Horizontal orientation - Original NEUTRAL scale = " . $cat->scale . " If(scale) scale -1 else i. The new scale value is = " . $debug_scale);
313 
314  $template->setCurrentBlock("radio_col");
315  if ($cat->neutral) {
316  $template->setVariable('COLCLASS', ' neutral');
317  }
318  $template->setVariable("VALUE_SC", ($cat->scale) ? ($cat->scale - 1) : $i);
319  $template->setVariable("QUESTION_ID", $this->object->getId());
320  if (is_array($working_data)) {
321  foreach ($working_data as $value) {
322  if (strcmp($value["value"], "") !== 0) {
323  if ($value["value"] == $cat->scale - 1) {
324  if (!($value['uncheck'] ?? false)) {
325  $template->setVariable("CHECKED_SC", " checked=\"checked\"");
326  }
327  }
328  }
329  }
330  }
331  $template->parseCurrentBlock();
332  }
333  for ($i = 0; $i < $this->object->categories->getCategoryCount(); $i++) {
334  $cat = $this->object->categories->getCategory($i);
335 
336  $debug_scale = ($cat->scale) ? ($cat->scale - 1) : $i;
337  $this->log->debug("Horizontal orientation - Original scale = " . $cat->scale . " If(scale) scale -1 else i. The new scale value is = " . $debug_scale);
338 
339  if ($cat->other) {
340  $template->setCurrentBlock("text_other_col");
341  $template->setVariable("VALUE_SC", ($cat->scale) ? ($cat->scale - 1) : $i);
342  $template->setVariable("QUESTION_ID", $this->object->getId());
343  if (strlen($cat->title ?? "")) {
344  $template->setVariable("OTHER_LABEL", $cat->title);
345  }
346  if (is_array($working_data)) {
347  foreach ($working_data as $value) {
348  if (strlen($value["value"] ?? "")) {
349  if ($value["value"] == $cat->scale - 1 && strlen($value['textanswer'] ?? "")) {
350  $template->setVariable("OTHER_VALUE", ' value="' . ilLegacyFormElementsUtil::prepareFormOutput(
351  $value['textanswer']
352  ) . '"');
353  }
354  }
355  }
356  }
357  } else {
358  $template->setCurrentBlock("text_col");
359  if ($cat->neutral) {
360  $template->setVariable('COLCLASS', ' neutral');
361  }
362  $template->setVariable("VALUE_SC", ($cat->scale) ? ($cat->scale - 1) : $i);
363  $template->setVariable("TEXT_SC", ilLegacyFormElementsUtil::prepareFormOutput($cat->title));
364  $template->setVariable("QUESTION_ID", $this->object->getId());
365  }
366  $template->parseCurrentBlock();
367  $template->touchBlock('text_outer_col');
368  }
369  break;
370  case 2:
371  // combobox output
372  for ($i = 0; $i < $this->object->categories->getCategoryCount(); $i++) {
373  $cat = $this->object->categories->getCategory($i);
374 
375  $debug_scale = ($cat->scale) ? ($cat->scale - 1) : $i;
376  $this->log->debug("Combobox - Original scale = " . $cat->scale . " If(scale) scale -1 else i. The new scale value is = " . $debug_scale);
377 
378  $template->setCurrentBlock("comborow");
379  $template->setVariable("TEXT_SC", $cat->title);
380  $template->setVariable("VALUE_SC", ($cat->scale) ? ($cat->scale - 1) : $i);
381  if (is_array($working_data)) {
382  if (strcmp($working_data[0]["value"] ?? "", "") !== 0) {
383  if ($working_data[0]["value"] == $cat->scale - 1) {
384  $template->setVariable("SELECTED_SC", " selected=\"selected\"");
385  }
386  }
387  }
388  $template->parseCurrentBlock();
389  }
390  $template->setCurrentBlock("combooutput");
391  $template->setVariable("QUESTION_ID", $this->object->getId());
392  $template->setVariable("SELECT_OPTION", $this->lng->txt("select_option"));
393  $template->setVariable("TEXT_SELECTION", $this->lng->txt("selection"));
394  $template->parseCurrentBlock();
395  break;
396  case 3:
397  // horizontal orientation, compressed
398  for ($i = 0; $i < $this->object->categories->getCategoryCount(); $i++) {
399  $cat = $this->object->categories->getCategory($i);
400 
401  $debug_scale = ($cat->scale) ? ($cat->scale - 1) : $i;
402  $this->log->debug("Horizontal orientation (compressed) - Original NEUTRAL scale = " . $cat->scale . " If(scale) scale -1 else i. The new scale value is = " . $debug_scale);
403 
404  if ($cat->other) {
405  $template->setCurrentBlock("other");
406  $template->setVariable("VALUE_SC", ($cat->scale) ? ($cat->scale - 1) : $i);
407  $template->setVariable("OTHER_Q_ID", $this->object->getId());
408  if (is_array($working_data)) {
409  foreach ($working_data as $value) {
410  if (strlen($value["value"])) {
411  if ($value["value"] == $cat->scale - 1 && strlen($value['textanswer'] ?? "")) {
412  $template->setVariable("OTHER_VALUE", ' value="' . ilLegacyFormElementsUtil::prepareFormOutput(
413  $value['textanswer']
414  ) . '"');
415  }
416  }
417  }
418  }
419  $template->parseCurrentBlock();
420  }
421 
422 
423  $template->setCurrentBlock("radio_col");
424  if ($cat->neutral) {
425  $template->setVariable('COLCLASS', ' neutral');
426  }
427  $template->setVariable("VALUE_SC", ($cat->scale) ? ($cat->scale - 1) : $i);
428  $template->setVariable("QUESTION_ID", $this->object->getId());
429  if (is_array($working_data)) {
430  foreach ($working_data as $value) {
431  if (strcmp($value["value"], "") !== 0) {
432  if ($value["value"] == $cat->scale - 1) {
433  if (!($value['uncheck'] ?? false)) {
434  $template->setVariable("CHECKED_SC", " checked=\"checked\"");
435  }
436  }
437  }
438  }
439  }
440  $template->parseCurrentBlock();
441  }
442  $perc = round(70 / $this->object->categories->getCategoryCount(), 2);
443  for ($i = 0; $i < $this->object->categories->getCategoryCount(); $i++) {
444  $cat = $this->object->categories->getCategory($i);
445 
446  $debug_scale = ($cat->scale) ? ($cat->scale - 1) : $i;
447  $this->log->debug("Horizontal orientation - Original scale = " . $cat->scale . " If(scale) scale -1 else i. The new scale value is = " . $debug_scale);
448 
449  $template->setCurrentBlock("text_col");
450  if ($cat->neutral) {
451  $template->setVariable('COLCLASS', ' neutral');
452  }
453  $template->setVariable("VALUE_SC", ($cat->scale) ? ($cat->scale - 1) : $i);
454  $template->setVariable("TEXT_SC", ilLegacyFormElementsUtil::prepareFormOutput($cat->title));
455  $template->setVariable("PERC", $perc);
456  $template->setVariable("QUESTION_ID", $this->object->getId());
457  $template->parseCurrentBlock();
458  }
459  break;
460  }
461  $template->setVariable("QUESTION_TITLE", $this->getQuestionTitle($question_title));
462  $template->setCurrentBlock("question_data");
463  if (strcmp($error_message, "") !== 0) {
464  $template->setVariable("ERROR_MESSAGE", "<p class=\"warning\">$error_message</p>");
465  }
466  if ($show_questiontext) {
467  $this->outQuestionText($template);
468  }
469  $template->parseCurrentBlock();
470  return $template->get();
471  }
getQuestionTitle(int $question_title_mode=1)
static prepareFormOutput($a_str, bool $a_strip=false)
outQuestionText(ilTemplate $template)
+ Here is the call graph for this function:

◆ importEditFormValues()

SurveySingleChoiceQuestionGUI::importEditFormValues ( ilPropertyFormGUI  $a_form)
protected

Definition at line 72 of file class.SurveySingleChoiceQuestionGUI.php.

References ilPropertyFormGUI\getInput(), and null.

72  : void
73  {
74  $this->log->debug("importing edit values");
75 
76  $this->object->setOrientation($a_form->getInput("orientation"));
77 
78  $this->object->categories->flushCategories();
79  $answers = $this->request->getAnswers();
80  foreach ($answers['answer'] as $key => $value) {
81  if (strlen($value ?? "")) {
82  $this->object->getCategories()->addCategory(
83  $value,
84  $answers['other'][$key] ?? 0,
85  0,
86  null,
87  $answers['scale'][$key] ?? null
88  );
89  }
90  }
91  if ($this->request->getNeutral() !== "") {
92  $this->object->getCategories()->addCategory($this->request->getNeutral(), 0, 1, null, $this->request->getNeutralScale());
93  }
94  }
getInput(string $a_post_var, bool $ensureValidation=true)
Returns the input of an item, if item provides getInput method and as fallback the value of the HTTP-...
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:

◆ initObject()

SurveySingleChoiceQuestionGUI::initObject ( )
protected

Definition at line 29 of file class.SurveySingleChoiceQuestionGUI.php.

29  : void
30  {
31  $this->object = new SurveySingleChoiceQuestion();
32  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ setQuestionTabs()

SurveySingleChoiceQuestionGUI::setQuestionTabs ( )

Definition at line 38 of file class.SurveySingleChoiceQuestionGUI.php.

References SurveyQuestionGUI\setQuestionTabsForClass().

38  : void
39  {
40  $this->setQuestionTabsForClass("surveysinglechoicequestiongui");
41  }
setQuestionTabsForClass(string $guiclass)
+ Here is the call graph for this function:

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