ILIAS  release_8 Revision v8.24
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)
 
 material (bool $checkonly=false)
 Material tab of the survey questions. More...
 
 deleteMaterial ()
 
 addMaterial ()
 Add materials to a question. More...
 
 removeMaterial ()
 
 cancelExplorer ()
 
 addPG ()
 
 addST ()
 
 addGIT ()
 
 linkChilds ()
 
 savePhrase (bool $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)
 
 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)
 
 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 (?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
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

Reimplemented from SurveyQuestionGUI.

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

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->setShowSavePhrase(true);
59 $answers->setUseOtherAnswer(true);
60 $answers->setShowNeutralCategory(true);
61 $answers->setNeutralCategoryTitle($this->lng->txt('svy_neutral_answer'));
62 $answers->setDisabledScale(false);
63 $a_form->addItem($answers);
64
65 // values
66 $orientation->setValue($this->object->getOrientation());
67 if (!$this->object->getCategories()->getCategoryCount()) {
68 $this->object->getCategories()->addCategory("");
69 }
70 $answers->setValues($this->object->getCategories());
71 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class represents a property in a property form.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

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

+ Here is the call graph for this function:

◆ getParsedAnswers()

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

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

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

◆ getPrintView()

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

Reimplemented from SurveyQuestionGUI.

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

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

◆ 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 
)

Reimplemented from SurveyQuestionGUI.

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

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

◆ importEditFormValues()

SurveySingleChoiceQuestionGUI::importEditFormValues ( ilPropertyFormGUI  $a_form)
protected

Reimplemented from SurveyQuestionGUI.

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

73 : void
74 {
75 $this->log->debug("importing edit values");
76
77 $this->object->setOrientation($a_form->getInput("orientation"));
78
79 $this->object->categories->flushCategories();
80 $answers = $this->request->getAnswers();
81 foreach ($answers['answer'] as $key => $value) {
82 if (strlen($value)) {
83 $this->object->getCategories()->addCategory(
84 $value,
85 $answers['other'][$key] ?? 0,
86 0,
87 null,
88 $answers['scale'][$key] ?? null
89 );
90 }
91 }
92 if ($this->request->getNeutral() !== "") {
93 $this->object->getCategories()->addCategory($this->request->getNeutral(), 0, 1, null, $this->request->getNeutralScale());
94 }
95 }
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-...
string $key
Consumer key/client ID value.
Definition: System.php:193

References ILIAS\LTI\ToolProvider\$key, and ilPropertyFormGUI\getInput().

+ Here is the call graph for this function:

◆ initObject()

SurveySingleChoiceQuestionGUI::initObject ( )
protected

Reimplemented from SurveyQuestionGUI.

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 ( )

Reimplemented from SurveyQuestionGUI.

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

38 : void
39 {
40 $this->setQuestionTabsForClass("surveysinglechoicequestiongui");
41 }
setQuestionTabsForClass(string $guiclass)

References SurveyQuestionGUI\setQuestionTabsForClass().

+ Here is the call graph for this function:

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