ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
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 ()
 
 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)
 
- 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
 getTableFilterLabelFor ()
 Get label "for" attribute value. 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 ilFormPropertyGUI
 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
 
ArrayBasedRequestWrapper $post_wrapper
 
- 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

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

References $DIC, $filename, $index, ilFormPropertyGUI\$lng, ilTextInputGUI\$suffix, ilSingleChoiceWizardInputGUI\$values, ilObjAdvancedEditing\_getUsedHTMLTagsAsString(), ilSubEnabledFormPropertyGUI\checkSubItemsInput(), ilTextInputGUI\getMaxLength(), ilFormPropertyGUI\getPostVar(), ilFormPropertyGUI\getRequired(), ilSingleChoiceWizardInputGUI\getSingleline(), ilSingleChoiceWizardInputGUI\getSuffixes(), ILIAS\Repository\refinery(), ilFormPropertyGUI\setAlert(), ilArrayUtil\stripSlashesRecursive(), ilLanguage\txt(), and ilVirusScanner\virusHandling().

50  : bool
51  {
52  global $DIC;
53  $lng = $DIC['lng'];
54 
55  $post_var = $this->getPostVar();
56  if (!$this->post_wrapper->has($post_var)) {
57  return false;
58  }
59 
60  $values = $this->post_wrapper->retrieve($post_var, $this->refinery->custom()->transformation(fn ($v) => $v));
61 
62  $values = ilArrayUtil::stripSlashesRecursive( //TODO: move into transform
63  $values,
64  false,
66  );
67 
68  $foundvalues = $values;
69 
70  if (is_array($foundvalues)) {
71  // check answers
72  if (is_array($foundvalues['answer'])) {
73  foreach ($foundvalues['answer'] as $aidx => $answervalue) {
74  if (((strlen($answervalue)) == 0) && (!isset($foundvalues['imagename']) || !isset($foundvalues['imagename'][$aidx]) || strlen($foundvalues['imagename'][$aidx]) == 0)) {
75  $this->setAlert($lng->txt("msg_input_is_required"));
76  return false;
77  }
78 
79  if (mb_strlen($answervalue) > $this->getMaxLength()) {
80  $this->setAlert($lng->txt("msg_input_char_limit_max"));
81  return false;
82  }
83  }
84  }
85  // check points
86  $max = 0;
87  if (is_array($foundvalues['points'])) {
88  foreach ($foundvalues['points'] as $points) {
89  $points = str_replace(',', '.', $points);
90  if ($points > $max) {
91  $max = $points;
92  }
93  if (((strlen($points)) == 0) || (!is_numeric($points))) {
94  $this->setAlert($lng->txt("form_msg_numeric_value_required"));
95  return false;
96  }
97  }
98  foreach ($foundvalues['points_unchecked'] as $points) {
99  $points = str_replace(',', '.', $points);
100  if (((strlen($points)) == 0) || (!is_numeric($points))) {
101  $this->setAlert($lng->txt("form_msg_numeric_value_required"));
102  return false;
103  }
104  }
105  }
106  if ($max == 0) {
107  $this->setAlert($lng->txt("enter_enough_positive_points_checked"));
108  return false;
109  }
110 
111  if (is_array($_FILES) && count($_FILES) && $this->getSingleline()) {
112  if (!$this->hideImages) {
113  if (is_array($_FILES[$this->getPostVar()]['error']['image'])) {
114  foreach ($_FILES[$this->getPostVar()]['error']['image'] as $index => $error) {
115  // error handling
116  if ($error > 0) {
117  switch ($error) {
118  case UPLOAD_ERR_FORM_SIZE:
119  case UPLOAD_ERR_INI_SIZE:
120  $this->setAlert($lng->txt("form_msg_file_size_exceeds"));
121  return false;
122  break;
123 
124  case UPLOAD_ERR_PARTIAL:
125  $this->setAlert($lng->txt("form_msg_file_partially_uploaded"));
126  return false;
127  break;
128 
129  case UPLOAD_ERR_NO_FILE:
130  if ($this->getRequired()) {
131  if (isset($a_value['imagename']) && (!strlen($foundvalues['imagename'][$index])) && (!strlen($foundvalues['answer'][$index]))) {
132  $this->setAlert($lng->txt("form_msg_file_no_upload"));
133  return false;
134  }
135  }
136  break;
137 
138  case UPLOAD_ERR_NO_TMP_DIR:
139  $this->setAlert($lng->txt("form_msg_file_missing_tmp_dir"));
140  return false;
141  break;
142 
143  case UPLOAD_ERR_CANT_WRITE:
144  $this->setAlert($lng->txt("form_msg_file_cannot_write_to_disk"));
145  return false;
146  break;
147 
148  case UPLOAD_ERR_EXTENSION:
149  $this->setAlert($lng->txt("form_msg_file_upload_stopped_ext"));
150  return false;
151  break;
152  }
153  }
154  }
155  } else {
156  if ($this->getRequired()) {
157  $this->setAlert($lng->txt("form_msg_file_no_upload"));
158  return false;
159  }
160  }
161 
162  if (is_array($_FILES[$this->getPostVar()]['tmp_name']['image'])) {
163  foreach ($_FILES[$this->getPostVar()]['tmp_name']['image'] as $index => $tmpname) {
164  $filename = $_FILES[$this->getPostVar()]['name']['image'][$index];
165  $filename_arr = pathinfo($filename);
166  if (isset($filename_arr["extension"])) {
167  $suffix = $filename_arr["extension"];
168  $mimetype = $_FILES[$this->getPostVar()]['type']['image'][$index];
169  $size_bytes = $_FILES[$this->getPostVar()]['size']['image'][$index];
170  // check suffixes
171  if (strlen($tmpname) && is_array($this->getSuffixes())) {
172  if (!in_array(strtolower($suffix), $this->getSuffixes())) {
173  $this->setAlert($lng->txt("form_msg_file_wrong_file_type"));
174  return false;
175  }
176  }
177  }
178  }
179  }
180 
181  if (is_array($_FILES[$this->getPostVar()]['tmp_name']['image'])) {
182  foreach ($_FILES[$this->getPostVar()]['tmp_name']['image'] as $index => $tmpname) {
183  $filename = $_FILES[$this->getPostVar()]['name']['image'][$index];
184  $filename_arr = pathinfo($filename);
185  if (isset($filename_arr["extension"])) {
186  $suffix = $filename_arr["extension"];
187  $mimetype = $_FILES[$this->getPostVar()]['type']['image'][$index];
188  $size_bytes = $_FILES[$this->getPostVar()]['size']['image'][$index];
189  // virus handling
190  if (strlen($tmpname)) {
191  $vir = ilVirusScanner::virusHandling($tmpname, $filename);
192  if ($vir[0] == false) {
193  $this->setAlert($lng->txt("form_msg_file_virus_found") . "<br />" . $vir[1]);
194  return false;
195  }
196  }
197  }
198  }
199  }
200  }
201  }
202  } else {
203  $this->setAlert($lng->txt("msg_input_is_required"));
204  return false;
205  }
206 
207  return $this->checkSubItemsInput();
208  }
static stripSlashesRecursive($a_data, bool $a_strip_html=true, string $a_allow="")
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 virusHandling(string $a_file, string $a_orig_name='', bool $a_clean=true)
$index
Definition: metadata.php:145
global $DIC
Definition: feed.php:28
static _getUsedHTMLTagsAsString(string $a_module="")
Returns a string of all allowed HTML tags for text editing.
$filename
Definition: buildRTE.php:78
+ Here is the call graph for this function:

◆ getPending()

ilMultipleChoiceWizardInputGUI::getPending ( )

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

References $pending.

389  : string
390  {
391  return $this->pending;
392  }

◆ insert()

ilMultipleChoiceWizardInputGUI::insert ( ilTemplate  $a_tpl)

Insert property html.

Parameters
$a_tplilTemplate

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

References $DIC, $i, ilFormPropertyGUI\$lng, ilTextInputGUI\$suffix, $tpl, ilTextInputGUI\$value, ilGlyphGUI\ADD, ilGlyphGUI\DOWN, ilGlyphGUI\get(), ilSingleChoiceWizardInputGUI\getAllowMove(), ilFormPropertyGUI\getDisabled(), ilFormPropertyGUI\getFieldId(), ilFileUtils\getFileSizeInfo(), ilTextInputGUI\getMaxLength(), ilFormPropertyGUI\getPostVar(), ilSingleChoiceWizardInputGUI\getSingleline(), ilTextInputGUI\getSize(), ilSingleChoiceWizardInputGUI\getSuffixes(), ilTemplate\parseCurrentBlock(), ilLegacyFormElementsUtil\prepareFormOutput(), ilGlyphGUI\REMOVE, ilTemplate\setCurrentBlock(), HTML_Template_IT\setVariable(), ilLanguage\txt(), and ilGlyphGUI\UP.

214  : void
215  {
216  global $DIC;
217  $lng = $DIC['lng'];
218 
219  $tpl = new ilTemplate("tpl.prop_multiplechoicewizardinput.html", true, true, "Modules/TestQuestionPool");
220  $i = 0;
221  foreach ($this->values as $value) {
222  if ($this->getSingleline()) {
223  if (!$this->hideImages) {
224  if (strlen($value->getImage())) {
225  $imagename = $this->qstObject->getImagePathWeb() . $value->getImage();
226  if (($this->getSingleline()) && ($this->qstObject->getThumbSize())) {
227  if (@file_exists($this->qstObject->getImagePath() . $this->qstObject->getThumbPrefix() . $value->getImage())) {
228  $imagename = $this->qstObject->getImagePathWeb() . $this->qstObject->getThumbPrefix() . $value->getImage();
229  }
230  }
231  $tpl->setCurrentBlock('image');
232  $tpl->setVariable('SRC_IMAGE', $imagename);
233  $tpl->setVariable('IMAGE_NAME', $value->getImage());
234  $tpl->setVariable(
235  'ALT_IMAGE',
236  ilLegacyFormElementsUtil::prepareFormOutput($value->getAnswertext())
237  );
238  $tpl->setVariable("TXT_DELETE_EXISTING", $lng->txt("delete_existing_file"));
239  $tpl->setVariable("IMAGE_ROW_NUMBER", $i);
240  $tpl->setVariable("IMAGE_POST_VAR", $this->getPostVar());
241  $tpl->parseCurrentBlock();
242  }
243  $tpl->setCurrentBlock('addimage');
244  $tpl->setVariable("IMAGE_BROWSE", $lng->txt('select_file'));
245  $tpl->setVariable("IMAGE_ID", $this->getPostVar() . "[image][$i]");
246  $tpl->setVariable("IMAGE_SUBMIT", $lng->txt("upload"));
247  $tpl->setVariable("IMAGE_ROW_NUMBER", $i);
248  $tpl->setVariable("IMAGE_POST_VAR", $this->getPostVar());
249  $tpl->parseCurrentBlock();
250  }
251 
252  if (is_object($value)) {
253  $tpl->setCurrentBlock("prop_text_propval");
254  $tpl->setVariable(
255  "PROPERTY_VALUE",
256  ilLegacyFormElementsUtil::prepareFormOutput($value->getAnswertext())
257  );
258  $tpl->parseCurrentBlock();
259  $tpl->setCurrentBlock("prop_points_propval");
260  $tpl->setVariable(
261  "PROPERTY_VALUE",
262  ilLegacyFormElementsUtil::prepareFormOutput($value->getPointsChecked())
263  );
264  $tpl->parseCurrentBlock();
265  $tpl->setCurrentBlock("prop_points_unchecked_propval");
266  $tpl->setVariable(
267  "PROPERTY_VALUE",
268  ilLegacyFormElementsUtil::prepareFormOutput($value->getPointsUnchecked())
269  );
270  $tpl->parseCurrentBlock();
271  $tpl->setCurrentBlock("prop_answer_id_propval");
272  $tpl->setVariable("PROPERTY_VALUE", ilLegacyFormElementsUtil::prepareFormOutput($value->getId()));
273  $tpl->parseCurrentBlock();
274  }
275  $tpl->setCurrentBlock('singleline');
276  $tpl->setVariable("SIZE", $this->getSize());
277  $tpl->setVariable("SINGLELINE_ID", $this->getPostVar() . "[answer][$i]");
278  $tpl->setVariable("SINGLELINE_ROW_NUMBER", $i);
279  $tpl->setVariable("SINGLELINE_POST_VAR", $this->getPostVar());
280  $tpl->setVariable("MAXLENGTH", $this->getMaxLength());
281  if ($this->getDisabled()) {
282  $tpl->setVariable("DISABLED_SINGLELINE", " disabled=\"disabled\"");
283  }
284  $tpl->parseCurrentBlock();
285  } elseif (!$this->getSingleline()) {
286  if (is_object($value)) {
287  $tpl->setCurrentBlock("prop_points_propval");
288  $tpl->setVariable(
289  "PROPERTY_VALUE",
291  );
292  $tpl->parseCurrentBlock();
293  $tpl->setCurrentBlock("prop_points_unchecked_propval");
294  $tpl->setVariable(
295  "PROPERTY_VALUE",
296  ilLegacyFormElementsUtil::prepareFormOutput($value->getPointsUnchecked())
297  );
298  $tpl->parseCurrentBlock();
299  $tpl->setCurrentBlock("prop_answer_id_propval");
300  $tpl->setVariable("PROPERTY_VALUE", ilLegacyFormElementsUtil::prepareFormOutput($value->getId()));
301  $tpl->parseCurrentBlock();
302  }
303  $tpl->setCurrentBlock('multiline');
304  $tpl->setVariable(
305  "PROPERTY_VALUE",
306  ilLegacyFormElementsUtil::prepareFormOutput($value->getAnswertext())
307  );
308  $tpl->setVariable("MULTILINE_ID", $this->getPostVar() . "[answer][$i]");
309  $tpl->setVariable("MULTILINE_ROW_NUMBER", $i);
310  $tpl->setVariable("MULTILINE_POST_VAR", $this->getPostVar());
311  $tpl->setVariable("MAXLENGTH", $this->getMaxLength());
312  if ($this->getDisabled()) {
313  $tpl->setVariable("DISABLED_MULTILINE", " disabled=\"disabled\"");
314  }
315  $tpl->parseCurrentBlock();
316  }
317  if ($this->getAllowMove()) {
318  $tpl->setCurrentBlock("move");
319  $tpl->setVariable("CMD_UP", "cmd[up" . $this->getFieldId() . "][$i]");
320  $tpl->setVariable("CMD_DOWN", "cmd[down" . $this->getFieldId() . "][$i]");
321  $tpl->setVariable("ID", $this->getPostVar() . "[$i]");
322  $tpl->setVariable("UP_BUTTON", ilGlyphGUI::get(ilGlyphGUI::UP));
323  $tpl->setVariable("DOWN_BUTTON", ilGlyphGUI::get(ilGlyphGUI::DOWN));
324  $tpl->parseCurrentBlock();
325  }
326  $tpl->setCurrentBlock("row");
327  $tpl->setVariable("POST_VAR", $this->getPostVar());
328  $tpl->setVariable("ROW_NUMBER", $i);
329  $tpl->setVariable("ID", $this->getPostVar() . "[answer][$i]");
330  $tpl->setVariable("POINTS_ID", $this->getPostVar() . "[points][$i]");
331  $tpl->setVariable("POINTS_UNCHECKED_ID", $this->getPostVar() . "[points_unchecked][$i]");
332  $tpl->setVariable("CMD_ADD", "cmd[add" . $this->getFieldId() . "][$i]");
333  $tpl->setVariable("CMD_REMOVE", "cmd[remove" . $this->getFieldId() . "][$i]");
334  if ($this->getDisabled()) {
335  $tpl->setVariable("DISABLED_POINTS", " disabled=\"disabled\"");
336  }
337  $tpl->setVariable("ADD_BUTTON", ilGlyphGUI::get(ilGlyphGUI::ADD));
338  $tpl->setVariable("REMOVE_BUTTON", ilGlyphGUI::get(ilGlyphGUI::REMOVE));
339  $tpl->parseCurrentBlock();
340  $i++;
341  }
342 
343  if ($this->getSingleline()) {
344  if (!$this->hideImages) {
345  if (is_array($this->getSuffixes())) {
346  $suff_str = $delim = "";
347  foreach ($this->getSuffixes() as $suffix) {
348  $suff_str .= $delim . "." . $suffix;
349  $delim = ", ";
350  }
351  $tpl->setCurrentBlock('allowed_image_suffixes');
352  $tpl->setVariable("TXT_ALLOWED_SUFFIXES", $lng->txt("file_allowed_suffixes") . " " . $suff_str);
353  $tpl->parseCurrentBlock();
354  }
355 
356  $tpl->setCurrentBlock("image_heading");
357  $tpl->setVariable("ANSWER_IMAGE", $lng->txt('answer_image'));
358  $tpl->setVariable("TXT_MAX_SIZE", ilFileUtils::getFileSizeInfo());
359  $tpl->parseCurrentBlock();
360  }
361  }
362 
363  $tpl->setVariable("ELEMENT_ID", $this->getPostVar());
364  $tpl->setVariable("TEXT_YES", $lng->txt('yes'));
365  $tpl->setVariable("TEXT_NO", $lng->txt('no'));
366  $tpl->setVariable("DELETE_IMAGE_HEADER", $lng->txt('delete_image_header'));
367  $tpl->setVariable("DELETE_IMAGE_QUESTION", $lng->txt('delete_image_question'));
368  $tpl->setVariable("ANSWER_TEXT", $lng->txt('answer_text'));
369  $tpl->setVariable("POINTS_TEXT", $lng->txt('points'));
370  $tpl->setVariable("COMMANDS_TEXT", $lng->txt('actions'));
371  $tpl->setVariable("POINTS_CHECKED_TEXT", $lng->txt('checkbox_checked'));
372  $tpl->setVariable("POINTS_UNCHECKED_TEXT", $lng->txt('checkbox_unchecked'));
373 
374  $a_tpl->setCurrentBlock("prop_generic");
375  $a_tpl->setVariable("PROP_GENERIC", $tpl->get());
376  $a_tpl->parseCurrentBlock();
377 
378  global $DIC;
379  $tpl = $DIC['tpl'];
380  $tpl->addJavascript("./Services/Form/js/ServiceFormWizardInput.js");
381  $tpl->addJavascript("./Modules/TestQuestionPool/templates/default/multiplechoicewizard.js");
382  }
parseCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
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 get(string $a_glyph, string $a_text="")
static prepareFormOutput($a_str, bool $a_strip=false)
global $DIC
Definition: feed.php:28
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:514
static getFileSizeInfo()
setCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
Definition: latex.php:41
$i
Definition: metadata.php:41
+ Here is the call graph for this function:

◆ setPending()

ilMultipleChoiceWizardInputGUI::setPending ( string  $a_val)

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

384  : void
385  {
386  $this->pending = $a_val;
387  }

◆ setValue()

ilMultipleChoiceWizardInputGUI::setValue (   $a_value)

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

References $index, and ilTextInputGUI\$value.

30  : void
31  {
32  $this->values = [];
33  if (is_array($a_value) && isset($a_value['answer']) && is_array($a_value['answer'])) {
34  foreach ($a_value['answer'] as $index => $value) {
35  $answer = new ASS_AnswerMultipleResponseImage($value, (float) ($a_value['points'][$index] ?? 0), $index);
36  $answer->setPointsChecked((float) ($a_value['points'][$index] ?? 0));
37  $answer->setPointsUnchecked((float) ($a_value['points_unchecked'][$index] ?? 0));
38  if (isset($a_value['imagename'][$index])) {
39  $answer->setImage($a_value['imagename'][$index]);
40  }
41  $this->values[] = $answer;
42  }
43  }
44  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$index
Definition: metadata.php:145

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: