ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilMultipleChoiceWizardInputGUI 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 ilMultipleChoiceWizardInputGUI:
+ Collaboration diagram for ilMultipleChoiceWizardInputGUI:

Public Member Functions

 setValue ($a_value)
 
 checkInput ()
 Check input, strip slashes etc. More...
 
 insert (ilTemplate $a_tpl)
 Insert property html. More...
 
 setPending (string $a_val)
 
 getPending ()
 
- Public Member Functions inherited from ilSingleChoiceWizardInputGUI
 __construct ($a_title='', $a_postvar='')
 Constructor. More...
 
 setValue ($a_value)
 
 setValueByArray (array $a_values)
 
 setSuffixes ($a_suffixes)
 Set Accepted Suffixes. More...
 
 setHideImages ($a_hide)
 Set hide images. More...
 
 getSuffixes ()
 Get Accepted Suffixes. More...
 
 setShowPoints ($a_value)
 
 getShowPoints ()
 
 setValues ($a_values)
 Set Values. More...
 
 getValues ()
 Get Values. More...
 
 setSingleline ($a_value)
 Set singleline. More...
 
 getSingleline ()
 Get singleline. More...
 
 setQuestionObject ($a_value)
 Set question object. More...
 
 getQuestionObject ()
 Get question object. More...
 
 setAllowMove ($a_allow_move)
 Set allow move. More...
 
 getAllowMove ()
 Get allow move. More...
 
 setPending (string $val)
 
 checkInput ()
 Check input, strip slashes etc. More...
 
 insert (ilTemplate $a_tpl)
 
- Public Member Functions inherited from ilTextInputGUI
 __construct (string $a_title="", string $a_postvar="")
 
 setValue ($a_value)
 
 getValue ()
 
 setValidationFailureMessage (string $a_msg)
 
 getValidationFailureMessage ()
 
 setValidationRegexp (string $a_value)
 
 getValidationRegexp ()
 
 setMaxLength (?int $a_maxlength)
 
 getMaxLength ()
 
 setSize (int $a_size)
 
 setInlineStyle (string $a_style)
 
 getInlineStyle ()
 
 setCssClass (string $a_class)
 
 getCssClass ()
 
 setValueByArray (array $a_values)
 
 getSize ()
 
 setSuffix (string $a_value)
 
 getSuffix ()
 
 setInputType (string $a_type)
 set input type More...
 
 getInputType ()
 
 setSubmitFormOnEnter (bool $a_val)
 
 getSubmitFormOnEnter ()
 
 checkInput ()
 Check input, strip slashes etc. More...
 
 getInput ()
 
 getDataSource ()
 
 setDataSource (string $href, ?string $a_delimiter=null)
 
 setDataSourceSubmitOnSelection (bool $a_stat)
 
 getDataSourceSubmitOnSelection ()
 
 setDataSourceSubmitUrl (string $a_url)
 
 getDataSourceSubmitUrl ()
 
 setMultiValues (array $a_values)
 
 render (string $a_mode="")
 
 insert (ilTemplate $a_tpl)
 
 getTableFilterHTML ()
 Get input item HTML to be inserted into table filters. More...
 
 getToolbarHTML ()
 Get input item HTML to be inserted into ilToolbarGUI. More...
 
 setDisableHtmlAutoComplete (bool $autocomplete)
 
 isHtmlAutoCompleteDisabled ()
 
 getPostValueForComparison ()
 
- Public Member Functions inherited from ilSubEnabledFormPropertyGUI
 addSubItem (ilFormPropertyGUI $a_item)
 
 getSubItems ()
 
 getSubInputItemsRecursive ()
 returns a flat array of possibly existing subitems recursively More...
 
 checkSubItemsInput ()
 Check SubItems. More...
 
 getSubForm ()
 
 getItemByPostVar (string $a_post_var)
 Get item by post var. More...
 
- Public Member Functions inherited from ilFormPropertyGUI
 __construct (string $a_title="", string $a_postvar="")
 
 executeCommand ()
 
 getType ()
 
 setTitle (string $a_title)
 
 getTitle ()
 
 setPostVar (string $a_postvar)
 
 getPostVar ()
 
 getFieldId ()
 
 setInfo (string $a_info)
 
 getInfo ()
 
 setAlert (string $a_alert)
 
 getAlert ()
 
 setRequired (bool $a_required)
 
 getRequired ()
 
 setDisabled (bool $a_disabled)
 
 getDisabled ()
 
 checkInput ()
 Check input, strip slashes etc. More...
 
 setParentForm (ilPropertyFormGUI $a_parentform)
 
 getParentForm ()
 
 setParent (ilFormPropertyGUI $a_val)
 
 getParent ()
 
 getSubForm ()
 
 hideSubForm ()
 
 setHiddenTitle (string $a_val)
 
 getHiddenTitle ()
 
 getItemByPostVar (string $a_post_var)
 Get item by post var. More...
 
 serializeData ()
 
 unserializeData (string $a_data)
 
 setParentTable ($a_val)
 Set parent table. More...
 
 getParentTable ()
 Get parent table. More...
 
 writeToSession ()
 
 clearFromSession ()
 
 readFromSession ()
 
 getHiddenTag (string $a_post_var, string $a_value)
 
 setMulti (bool $a_multi, bool $a_sortable=false, bool $a_addremove=true)
 
 getMulti ()
 
 setMultiValues (array $a_values)
 
 getMultiValues ()
 
 getContentOutsideFormTag ()
 Get content that has to reside outside of the parent form tag, e.g. More...
 
 stripSlashesAddSpaceFallback (string $a_str)
 Strip slashes with add space fallback, see https://www.ilias.de/mantis/view.php?id=19727. More...
 
 getTableFilterLabelFor ()
 Get label "for" attribute value for filter. More...
 
 getFormLabelFor ()
 Get label "for" attribute value for form. More...
 
 setRequestParam (string $key, $val)
 This writes the request (aka post) values. More...
 
- Public Member Functions inherited from ilTableFilterItem
 getTableFilterHTML ()
 Get input item HTML to be inserted into table filters. More...
 
 getTableFilterLabelFor ()
 Get label "for" attribute value. More...
 
 getToolbarHTML ()
 Get input item HTML to be inserted into ilToolbarGUI. More...
 

Private Attributes

string $pending
 

Additional Inherited Members

- Static Public Member Functions inherited from ilFormPropertyGUI
static removeProhibitedCharacters (string $a_text)
 Remove prohibited characters see #19159. More...
 
- Protected Member Functions inherited from ilSingleChoiceWizardInputGUI
 checkAnswersInput (array $data)
 Checks the input of the answers and returns the answers as an array if the input is valid or a string with the error message if the input is invalid. More...
 
- Protected Member Functions inherited from ilFormPropertyGUI
 symbol ()
 
 setType (string $a_type)
 
 checkParentFormTable ()
 
 getSessionKey ()
 
 getMultiIconsHTML ()
 
 int ($key)
 
 intArray ($key)
 
 str ($key)
 
 raw ($key)
 
 strArray ($key)
 
 arrayArray ($key)
 
 isRequestParamArray (string $key)
 
 getRequestParam (string $key, Refinery\Transformation $t)
 
- Protected Attributes inherited from ilSingleChoiceWizardInputGUI
 $values = []
 
 $allowMove = false
 
 $singleline = true
 
 $qstObject = null
 
 $suffixes = []
 
 $showPoints = true
 
 $hideImages = false
 
ilTestLegacyFormsHelper $forms_helper
 
GlyphFactory $glyph_factory
 
Renderer $renderer
 
UploadLimitResolver $upload_limit
 
- Protected Attributes inherited from ilTextInputGUI
 $value = null
 
int $maxlength = 200
 
int $size = 40
 
string $validationRegexp = ""
 
string $validationFailureMessage = ''
 
string $suffix = ""
 
string $style_css = ""
 
string $css_class = ""
 
string $ajax_datasource = ""
 
string $ajax_datasource_delimiter = null
 
bool $ajax_datasource_commit = false
 
string $ajax_datasource_commit_url = ""
 
bool $submit_form_on_enter = false
 
bool $autocomplete_disabled = false
 
string $input_type = ""
 
- Protected Attributes inherited from ilSubEnabledFormPropertyGUI
array $sub_items = array()
 
- Protected Attributes inherited from ilFormPropertyGUI
array $set_params = []
 
ilTable2GUI $parent_table = null
 
ilFormPropertyGUI $parent_gui = null
 
ilCtrl $ctrl
 
ilLanguage $lng
 
string $type = ""
 
string $title = ""
 
string $postvar = ""
 
string $info = ""
 
string $alert = ""
 
bool $required = false
 
ilPropertyFormGUI $parentform = null
 
string $hidden_title = ""
 
bool $multi = false
 
bool $multi_sortable = false
 
bool $multi_addremove = true
 
array $multi_values = []
 
RequestInterface $request
 
HTTP Services $http
 
Refinery Factory $refinery = null
 
bool $disabled = false
 
ilGlobalTemplateInterface $global_tpl = null
 

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 This class represents a multiple choice wizard property in a property form.

Author
Helmut Schottmüller ilias.nosp@m.@aur.nosp@m.ealis.nosp@m..de
Version
$Id$

Definition at line 26 of file class.ilMultipleChoiceWizardInputGUI.php.

Member Function Documentation

◆ checkInput()

ilMultipleChoiceWizardInputGUI::checkInput ( )

Check input, strip slashes etc.

set alert, if input is not ok.

Returns
boolean Input ok, true/false

Reimplemented from ilSingleChoiceWizardInputGUI.

Reimplemented in ilAssMultipleChoiceCorrectionsInputGUI.

Definition at line 56 of file class.ilMultipleChoiceWizardInputGUI.php.

56 : bool
57 {
58 $data = $this->raw($this->getPostVar());
59
60 if (!is_array($data)) {
61 $this->setAlert($this->lng->txt('msg_input_is_required'));
62 return false;
63 }
64
65 // check points
66 $points = $this->forms_helper->checkPointsInputEnoughPositive($data, true);
67 if (!is_array($points)) {
68 $this->setAlert($this->lng->txt($points));
69 return false;
70 }
71 $points_unchecked = $this->forms_helper->checkPointsInput($data, true, 'points_unchecked');
72 if (!is_array($points_unchecked)) {
73 $this->setAlert($this->lng->txt($points_unchecked));
74 return false;
75 }
76
77 // check answers
78 $answers = $this->checkAnswersInput($data);
79 if (!is_array($answers)) {
80 $this->setAlert($this->lng->txt($answers));
81 return false;
82 }
83 $image_names = $this->forms_helper->transformArray($data, 'imagename', $this->refinery->kindlyTo()->string());
84
85 // check upload
86 if (is_array($_FILES) && count($_FILES) && $this->getSingleline()) {
87 if (!$this->hideImages) {
88 if (is_array($_FILES[$this->getPostVar()]['error']['image'])) {
89 foreach ($_FILES[$this->getPostVar()]['error']['image'] as $index => $error) {
90 // error handling
91 if ($error > 0) {
92 switch ($error) {
93 case UPLOAD_ERR_FORM_SIZE:
94 case UPLOAD_ERR_INI_SIZE:
95 $this->setAlert($this->lng->txt('form_msg_file_size_exceeds'));
96 return false;
97 break;
98
99 case UPLOAD_ERR_PARTIAL:
100 $this->setAlert($this->lng->txt('form_msg_file_partially_uploaded'));
101 return false;
102 break;
103
104 case UPLOAD_ERR_NO_FILE:
105 if (
106 !$this->forms_helper->inArray($image_names, $index)
107 && !$this->forms_helper->inArray($answers, $index)
108 && $this->getRequired()
109 ) {
110 $this->setAlert($this->lng->txt('form_msg_file_no_upload'));
111 return false;
112 }
113 break;
114
115 case UPLOAD_ERR_NO_TMP_DIR:
116 $this->setAlert($this->lng->txt('form_msg_file_missing_tmp_dir'));
117 return false;
118 break;
119
120 case UPLOAD_ERR_CANT_WRITE:
121 $this->setAlert($this->lng->txt('form_msg_file_cannot_write_to_disk'));
122 return false;
123 break;
124
125 case UPLOAD_ERR_EXTENSION:
126 $this->setAlert($this->lng->txt('form_msg_file_upload_stopped_ext'));
127 return false;
128 break;
129 }
130 }
131 }
132 } else {
133 if ($this->getRequired()) {
134 $this->setAlert($this->lng->txt('form_msg_file_no_upload'));
135 return false;
136 }
137 }
138
139 if (is_array($_FILES[$this->getPostVar()]['tmp_name']['image'])) {
140 foreach ($_FILES[$this->getPostVar()]['tmp_name']['image'] as $index => $tmpname) {
141 $filename = $_FILES[$this->getPostVar()]['name']['image'][$index];
142 $filename_arr = pathinfo($filename);
143 if (isset($filename_arr['extension'])) {
144 $suffix = $filename_arr['extension'];
145 $mimetype = $_FILES[$this->getPostVar()]['type']['image'][$index];
146 $size_bytes = $_FILES[$this->getPostVar()]['size']['image'][$index];
147 // check suffixes
148 if (strlen($tmpname) && is_array($this->getSuffixes())) {
149 if (!in_array(strtolower($suffix), $this->getSuffixes())) {
150 $this->setAlert($this->lng->txt('form_msg_file_wrong_file_type'));
151 return false;
152 }
153 }
154 }
155 }
156 }
157
158 if (is_array($_FILES[$this->getPostVar()]['tmp_name']['image'])) {
159 foreach ($_FILES[$this->getPostVar()]['tmp_name']['image'] as $index => $tmpname) {
160 $filename = $_FILES[$this->getPostVar()]['name']['image'][$index];
161 $filename_arr = pathinfo($filename);
162 if (isset($filename_arr['extension'])) {
163 $suffix = $filename_arr['extension'];
164 $mimetype = $_FILES[$this->getPostVar()]['type']['image'][$index];
165 $size_bytes = $_FILES[$this->getPostVar()]['size']['image'][$index];
166 // virus handling
167 if (strlen($tmpname)) {
169 if ($vir[0] == false) {
170 $this->setAlert($this->lng->txt('form_msg_file_virus_found') . '<br />' . $vir[1]);
171 return false;
172 }
173 }
174 }
175 }
176 }
177 }
178 }
179
180 return $this->checkSubItemsInput();
181 }
$filename
Definition: buildRTE.php:78
checkAnswersInput(array $data)
Checks the input of the answers and returns the answers as an array if the input is valid or a string...
static virusHandling(string $a_file, string $a_orig_name='', bool $a_clean=true)

References $data, $filename, ilTextInputGUI\$suffix, ilSingleChoiceWizardInputGUI\checkAnswersInput(), ilSubEnabledFormPropertyGUI\checkSubItemsInput(), ilFormPropertyGUI\getPostVar(), ilFormPropertyGUI\getRequired(), ilSingleChoiceWizardInputGUI\getSingleline(), ilSingleChoiceWizardInputGUI\getSuffixes(), ILIAS\Repository\lng(), ilFormPropertyGUI\raw(), ILIAS\Repository\refinery(), ilFormPropertyGUI\setAlert(), and ilVirusScanner\virusHandling().

+ Here is the call graph for this function:

◆ getPending()

ilMultipleChoiceWizardInputGUI::getPending ( )

Definition at line 368 of file class.ilMultipleChoiceWizardInputGUI.php.

368 : string
369 {
370 return $this->pending;
371 }

References $pending.

◆ insert()

ilMultipleChoiceWizardInputGUI::insert ( ilTemplate  $a_tpl)

Insert property html.

Parameters
$a_tplilTemplate

Reimplemented from ilSingleChoiceWizardInputGUI.

Reimplemented in ilAssMultipleChoiceCorrectionsInputGUI.

Definition at line 187 of file class.ilMultipleChoiceWizardInputGUI.php.

187 : void
188 {
189 global $DIC;
190 $lng = $DIC['lng'];
191
192 $tpl = new ilTemplate("tpl.prop_multiplechoicewizardinput.html", true, true, "components/ILIAS/TestQuestionPool");
193 $i = 0;
194 foreach ($this->values as $value) {
195 if ($this->getSingleline()) {
196 if (!$this->hideImages) {
197 if ($value->hasImage()) {
198 $imagename = $this->qstObject->getImagePathWeb() . $value->getImage();
199 if (($this->getSingleline()) && ($this->qstObject->getThumbSize())) {
200 if (file_exists($this->qstObject->getImagePath() . $this->qstObject->getThumbPrefix() . $value->getImage())) {
201 $imagename = $this->qstObject->getImagePathWeb() . $this->qstObject->getThumbPrefix() . $value->getImage();
202 }
203 }
204 $tpl->setCurrentBlock('image');
205 $tpl->setVariable('SRC_IMAGE', $imagename);
206 $tpl->setVariable('IMAGE_NAME', $value->getImage());
207 $tpl->setVariable(
208 'ALT_IMAGE',
210 );
211 $tpl->setVariable("TXT_DELETE_EXISTING", $lng->txt("delete_existing_file"));
212 $tpl->setVariable("IMAGE_ROW_NUMBER", $i);
213 $tpl->setVariable("IMAGE_POST_VAR", $this->getPostVar());
214 $tpl->parseCurrentBlock();
215 }
216 $tpl->setCurrentBlock('addimage');
217 $tpl->setVariable("IMAGE_BROWSE", $lng->txt('select_file'));
218 $tpl->setVariable("IMAGE_ID", $this->getPostVar() . "[image][$i]");
219 $tpl->setVariable('MAX_SIZE_WARNING', $this->lng->txt('form_msg_file_size_exceeds'));
220 $tpl->setVariable('MAX_SIZE', $this->upload_limit->getPhpUploadLimitInBytes());
221 $tpl->setVariable("IMAGE_SUBMIT", $lng->txt("upload"));
222 $tpl->setVariable("IMAGE_ROW_NUMBER", $i);
223 $tpl->setVariable("IMAGE_POST_VAR", $this->getPostVar());
224 $tpl->parseCurrentBlock();
225 }
226
227 if (is_object($value)) {
228 $tpl->setCurrentBlock("prop_text_propval");
229 $tpl->setVariable(
230 "PROPERTY_VALUE",
232 );
233 $tpl->parseCurrentBlock();
234 $tpl->setCurrentBlock("prop_points_propval");
235 $tpl->setVariable(
236 "PROPERTY_VALUE",
238 );
239 $tpl->parseCurrentBlock();
240 $tpl->setCurrentBlock("prop_points_unchecked_propval");
241 $tpl->setVariable(
242 "PROPERTY_VALUE",
244 );
245 $tpl->parseCurrentBlock();
246 $tpl->setCurrentBlock("prop_answer_id_propval");
247 $tpl->setVariable("PROPERTY_VALUE", ilLegacyFormElementsUtil::prepareFormOutput($value->getId()));
248 $tpl->parseCurrentBlock();
249 }
250 $tpl->setCurrentBlock('singleline');
251 $tpl->setVariable("SIZE", $this->getSize());
252 $tpl->setVariable("SINGLELINE_ID", $this->getPostVar() . "[answer][$i]");
253 $tpl->setVariable("SINGLELINE_ROW_NUMBER", $i);
254 $tpl->setVariable("SINGLELINE_POST_VAR", $this->getPostVar());
255 $tpl->setVariable("MAXLENGTH", $this->getMaxLength());
256 if ($this->getDisabled()) {
257 $tpl->setVariable("DISABLED_SINGLELINE", " disabled=\"disabled\"");
258 }
259 $tpl->parseCurrentBlock();
260 } elseif (!$this->getSingleline()) {
261 if (is_object($value)) {
262 $tpl->setCurrentBlock("prop_points_propval");
263 $tpl->setVariable(
264 "PROPERTY_VALUE",
266 );
267 $tpl->parseCurrentBlock();
268 $tpl->setCurrentBlock("prop_points_unchecked_propval");
269 $tpl->setVariable(
270 "PROPERTY_VALUE",
272 );
273 $tpl->parseCurrentBlock();
274 $tpl->setCurrentBlock("prop_answer_id_propval");
275 $tpl->setVariable("PROPERTY_VALUE", ilLegacyFormElementsUtil::prepareFormOutput($value->getId()));
276 $tpl->parseCurrentBlock();
277 }
278 $tpl->setCurrentBlock('multiline');
279 $tpl->setVariable(
280 "PROPERTY_VALUE",
282 );
283 $tpl->setVariable("MULTILINE_ID", $this->getPostVar() . "[answer][$i]");
284 $tpl->setVariable("MULTILINE_ROW_NUMBER", $i);
285 $tpl->setVariable("MULTILINE_POST_VAR", $this->getPostVar());
286 $tpl->setVariable("MAXLENGTH", $this->getMaxLength());
287 if ($this->getDisabled()) {
288 $tpl->setVariable("DISABLED_MULTILINE", " disabled=\"disabled\"");
289 }
290 $tpl->parseCurrentBlock();
291 }
292 if ($this->getAllowMove()) {
293 $tpl->setCurrentBlock("move");
294 $tpl->setVariable("ID", $this->getPostVar() . "[$i]");
295 $tpl->setVariable("UP_BUTTON", $this->renderer->render(
296 $this->glyph_factory->up()->withAction('#')
297 ));
298 $tpl->setVariable("DOWN_BUTTON", $this->renderer->render(
299 $this->glyph_factory->down()->withAction('#')
300 ));
301 $tpl->parseCurrentBlock();
302 }
303 $tpl->setCurrentBlock("row");
304 $tpl->setVariable("POST_VAR", $this->getPostVar());
305 $tpl->setVariable("ROW_NUMBER", $i);
306 $tpl->setVariable("ID", $this->getPostVar() . "[answer][$i]");
307 $tpl->setVariable("POINTS_ID", $this->getPostVar() . "[points][$i]");
308 $tpl->setVariable("POINTS_UNCHECKED_ID", $this->getPostVar() . "[points_unchecked][$i]");
309 if ($this->getDisabled()) {
310 $tpl->setVariable("DISABLED_POINTS", " disabled=\"disabled\"");
311 }
312 $tpl->setVariable("ADD_BUTTON", $this->renderer->render(
313 $this->glyph_factory->add()->withAction('#')
314 ));
315 $tpl->setVariable("REMOVE_BUTTON", $this->renderer->render(
316 $this->glyph_factory->remove()->withAction('#')
317 ));
318 $tpl->parseCurrentBlock();
319 $i++;
320 }
321
322 if ($this->getSingleline()) {
323 if (!$this->hideImages) {
324 if (is_array($this->getSuffixes())) {
325 $suff_str = $delim = "";
326 foreach ($this->getSuffixes() as $suffix) {
327 $suff_str .= $delim . "." . $suffix;
328 $delim = ", ";
329 }
330 $tpl->setCurrentBlock('allowed_image_suffixes');
331 $tpl->setVariable("TXT_ALLOWED_SUFFIXES", $lng->txt("file_allowed_suffixes") . " " . $suff_str);
332 $tpl->parseCurrentBlock();
333 }
334
335 $tpl->setCurrentBlock("image_heading");
336 $tpl->setVariable("ANSWER_IMAGE", $lng->txt('answer_image'));
337 $tpl->setVariable("TXT_MAX_SIZE", ilFileUtils::getFileSizeInfo());
338 $tpl->parseCurrentBlock();
339 }
340 }
341
342 $tpl->setVariable("ELEMENT_ID", $this->getPostVar());
343 $tpl->setVariable("TEXT_YES", $lng->txt('yes'));
344 $tpl->setVariable("TEXT_NO", $lng->txt('no'));
345 $tpl->setVariable("DELETE_IMAGE_HEADER", $lng->txt('delete_image_header'));
346 $tpl->setVariable("DELETE_IMAGE_QUESTION", $lng->txt('delete_image_question'));
347 $tpl->setVariable("ANSWER_TEXT", $lng->txt('answer_text'));
348 $tpl->setVariable("POINTS_TEXT", $lng->txt('points'));
349 $tpl->setVariable("COMMANDS_TEXT", $lng->txt('actions'));
350 $tpl->setVariable("POINTS_CHECKED_TEXT", $lng->txt('checkbox_checked'));
351 $tpl->setVariable("POINTS_UNCHECKED_TEXT", $lng->txt('checkbox_unchecked'));
352
353 $a_tpl->setCurrentBlock("prop_generic");
354 $a_tpl->setVariable("PROP_GENERIC", $tpl->get());
355 $a_tpl->parseCurrentBlock();
356
357 global $DIC;
358 $tpl = $DIC['tpl'];
359 $tpl->addJavascript("assets/js/answerwizardinput.js");
360 $tpl->addJavascript("assets/js/multiplechoicewizard.js");
361 }
renderer()
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:544
static getFileSizeInfo()
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...
static prepareFormOutput($a_str, bool $a_strip=false)
special template class to simplify handling of ITX/PEAR
setCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
parseCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
global $DIC
Definition: shib_login.php:26

References $DIC, ilFormPropertyGUI\$lng, ilTextInputGUI\$suffix, ilTextInputGUI\$value, ilSingleChoiceWizardInputGUI\getAllowMove(), ilFormPropertyGUI\getDisabled(), ilFileUtils\getFileSizeInfo(), ilTextInputGUI\getMaxLength(), ilFormPropertyGUI\getPostVar(), ilSingleChoiceWizardInputGUI\getSingleline(), ilTextInputGUI\getSize(), ilSingleChoiceWizardInputGUI\getSuffixes(), ILIAS\Repository\lng(), ilTemplate\parseCurrentBlock(), ilLegacyFormElementsUtil\prepareFormOutput(), renderer(), ilTemplate\setCurrentBlock(), HTML_Template_IT\setVariable(), and ilLanguage\txt().

+ Here is the call graph for this function:

◆ setPending()

ilMultipleChoiceWizardInputGUI::setPending ( string  $a_val)

Reimplemented from ilSingleChoiceWizardInputGUI.

Definition at line 363 of file class.ilMultipleChoiceWizardInputGUI.php.

363 : void
364 {
365 $this->pending = $a_val;
366 }

◆ setValue()

ilMultipleChoiceWizardInputGUI::setValue (   $a_value)
Parameters
string | array$a_value

Reimplemented from ilSingleChoiceWizardInputGUI.

Reimplemented in ilAssMultipleChoiceCorrectionsInputGUI.

Definition at line 30 of file class.ilMultipleChoiceWizardInputGUI.php.

30 : void
31 {
32 $this->values = [];
33
34 $answers = $this->forms_helper->transformArray($a_value, 'answer', $this->refinery->kindlyTo()->string());
35 $points = $this->forms_helper->transformPoints($a_value);
36 $points_unchecked = $this->forms_helper->transformPoints($a_value, 'points_unchecked');
37 $images = $this->forms_helper->transformArray($a_value, 'imagename', $this->refinery->kindlyTo()->string());
38
39 foreach ($answers as $index => $value) {
40 $answer = new ASS_AnswerMultipleResponseImage($value, $points[$index] ?? 0.0, $index);
41 $answer->setPointsChecked($points[$index] ?? 0.0);
42 $answer->setPointsUnchecked($points_unchecked[$index] ?? 0.0);
43
44 if ($this->forms_helper->inArray($images, $index)) {
45 $answer->setImage($images[$index]);
46 }
47
48 $this->values[] = $answer;
49 }
50 }
ASS_AnswerBinaryStateImage is a class for answers with a binary state indicator (checked/unchecked,...

References ilTextInputGUI\$value, and ILIAS\Repository\refinery().

+ Here is the call graph for this function:

Field Documentation

◆ $pending

string ilMultipleChoiceWizardInputGUI::$pending
private

Definition at line 28 of file class.ilMultipleChoiceWizardInputGUI.php.

Referenced by getPending().


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