ILIAS  trunk Revision v11.0_alpha-1761-g6dbbfa7b760
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilMatchingWizardInputGUI Class Reference

This class represents a single choice wizard property in a property form. More...

+ Inheritance diagram for ilMatchingWizardInputGUI:
+ Collaboration diagram for ilMatchingWizardInputGUI:

Public Member Functions

 __construct ($a_title="", $a_postvar="")
 
 setSuffixes ($a_suffixes)
 Set Accepted Suffixes. More...
 
 getSuffixes ()
 Get Accepted Suffixes. More...
 
 setHideImages ($a_hide)
 Set hide images. More...
 
 setValues ($a_values)
 Set Values. More...
 
 getValues ()
 Get Values. More...
 
 setTextName ($a_value)
 
 setImageName ($a_value)
 
 setQuestionObject ($a_value)
 Set question object. More...
 
 getQuestionObject ()
 Get question object. More...
 
 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 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...
 

Protected Attributes

 $text_name = ''
 
 $image_name = ''
 
 $values = []
 
 $qstObject = null
 
 $suffixes = []
 
 $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
 

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

Detailed Description

This class represents a single choice wizard property in a property form.

Author
Helmut Schottmüller ilias.nosp@m.@aur.nosp@m.ealis.nosp@m..de
Maximilian Becker mbeck.nosp@m.er@d.nosp@m.ataba.nosp@m.y.de
Version
$Id$

\

Definition at line 34 of file class.ilMatchingWizardInputGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilMatchingWizardInputGUI::__construct (   $a_title = "",
  $a_postvar = "" 
)

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

References $DIC, ilFormPropertyGUI\$lng, ILIAS\GlobalScreen\Provider\__construct(), renderer(), ilTextInputGUI\setMaxLength(), ilTextInputGUI\setSize(), setSuffixes(), and ilLanguage\txt().

50  {
51  parent::__construct($a_title, $a_postvar);
52 
53  global $DIC;
54 
55  $this->forms_helper = new ilTestLegacyFormsHelper();
56  $this->glyph_factory = $DIC->ui()->factory()->symbol()->glyph();
57  $this->renderer = $DIC->ui()->renderer();
58  $this->upload_limit = $DIC['ui.upload_limit_resolver'];
59 
60  $this->setSuffixes(["jpg", "jpeg", "png", "gif"]);
61  $this->setSize('40');
62  $this->setMaxLength(800);
63 
64  $lng = $DIC['lng'];
65  $this->text_name = $lng->txt('answer_text');
66  $this->image_name = $lng->txt('answer_image');
67  }
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...
renderer()
setSuffixes($a_suffixes)
Set Accepted Suffixes.
global $DIC
Definition: shib_login.php:22
setMaxLength(?int $a_maxlength)
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ checkInput()

ilMatchingWizardInputGUI::checkInput ( )

Check input, strip slashes etc.

set alert, if input is not ok.

Returns
boolean Input ok, true/false

Definition at line 170 of file class.ilMatchingWizardInputGUI.php.

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

170  : bool
171  {
172  $data = $this->raw($this->getPostVar());
173 
174  if (!is_array($data)) {
175  $this->setAlert($this->lng->txt('msg_input_is_required'));
176  return false;
177  }
178 
179  // check answers
180  $answers = $this->forms_helper->transformArray($data, 'answer', $this->refinery->kindlyTo()->string());
181  $images = $this->forms_helper->transformArray($data, 'imagename', $this->refinery->kindlyTo()->string());
182  foreach ($answers as $index => $value) {
183  if (
184  $value === ''
185  && !$this->forms_helper->inArray($images, $index)
186  && !isset($_FILES[$this->getPostVar()]['tmp_name']['image'][$index])
187  ) {
188  $this->setAlert($this->lng->txt('msg_input_is_required'));
189  return false;
190  }
191  }
192 
193  if (!$this->hideImages) {
194  if (is_array($_FILES[$this->getPostVar()]['error']['image'])) {
195  foreach ($_FILES[$this->getPostVar()]['error']['image'] as $index => $error) {
196  // error handling
197  if ($error > 0) {
198  switch ($error) {
199  case UPLOAD_ERR_FORM_SIZE:
200  case UPLOAD_ERR_INI_SIZE:
201  $this->setAlert($this->lng->txt('form_msg_file_size_exceeds'));
202  return false;
203  break;
204 
205  case UPLOAD_ERR_PARTIAL:
206  $this->setAlert($this->lng->txt('form_msg_file_partially_uploaded'));
207  return false;
208  break;
209 
210  case UPLOAD_ERR_NO_FILE:
211  if (
212  !$this->forms_helper->inArray($images, $index)
213  && !$this->forms_helper->inArray($answers, $index)
214  && $this->getRequired()
215  ) {
216  $this->setAlert($this->lng->txt('form_msg_file_no_upload'));
217  return false;
218  }
219  break;
220 
221  case UPLOAD_ERR_NO_TMP_DIR:
222  $this->setAlert($this->lng->txt('form_msg_file_missing_tmp_dir'));
223  return false;
224  break;
225 
226  case UPLOAD_ERR_CANT_WRITE:
227  $this->setAlert($this->lng->txt('form_msg_file_cannot_write_to_disk'));
228  return false;
229  break;
230 
231  case UPLOAD_ERR_EXTENSION:
232  $this->setAlert($this->lng->txt('form_msg_file_upload_stopped_ext'));
233  return false;
234  break;
235  }
236  }
237  }
238  }
239 
240  if (is_array($_FILES[$this->getPostVar()]['tmp_name']['image'])) {
241  foreach ($_FILES[$this->getPostVar()]['tmp_name']['image'] as $index => $tmpname) {
242  $filename = $_FILES[$this->getPostVar()]['name']['image'][$index];
243  $filename_arr = pathinfo($filename);
244  $suffix = $filename_arr['extension'] ?? '';
245 
246  // check suffixes
247  if ($tmpname !== '' && is_array($this->getSuffixes())) {
248  $vir = ilVirusScanner::virusHandling($tmpname, $filename);
249  if ($vir[0] == false) {
250  $this->setAlert($this->lng->txt('form_msg_file_virus_found') . '<br />' . $vir[1]);
251  return false;
252  }
253 
254  if (!in_array(strtolower($suffix), $this->getSuffixes(), true)) {
255  $this->setAlert($this->lng->txt('form_msg_file_wrong_file_type'));
256  return false;
257  }
258  }
259  }
260  }
261  }
262 
263  return $this->checkSubItemsInput();
264  }
static virusHandling(string $a_file, string $a_orig_name='', bool $a_clean=true)
$filename
Definition: buildRTE.php:78
+ Here is the call graph for this function:

◆ getPending()

ilMatchingWizardInputGUI::getPending ( )

Definition at line 379 of file class.ilMatchingWizardInputGUI.php.

References $pending.

379  : string
380  {
381  return $this->pending;
382  }

◆ getQuestionObject()

ilMatchingWizardInputGUI::getQuestionObject ( )

Get question object.

Returns
object Value

Definition at line 144 of file class.ilMatchingWizardInputGUI.php.

References $qstObject.

144  : ?object
145  {
146  return $this->qstObject;
147  }

◆ getSuffixes()

ilMatchingWizardInputGUI::getSuffixes ( )

Get Accepted Suffixes.

Returns
array Accepted Suffixes

Definition at line 84 of file class.ilMatchingWizardInputGUI.php.

References $suffixes.

Referenced by checkInput(), and insert().

84  : array
85  {
86  return $this->suffixes;
87  }
+ Here is the caller graph for this function:

◆ getValues()

ilMatchingWizardInputGUI::getValues ( )

Get Values.

Returns
array Values

Definition at line 114 of file class.ilMatchingWizardInputGUI.php.

References $values.

114  : array
115  {
116  return $this->values;
117  }

◆ insert()

ilMatchingWizardInputGUI::insert ( ilTemplate  $a_tpl)

Insert property html.

Returns
void Size

Definition at line 270 of file class.ilMatchingWizardInputGUI.php.

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

270  : void
271  {
272  global $DIC;
273  $lng = $DIC['lng'];
274  $global_tpl = $DIC['tpl'];
275  $global_tpl->addJavascript('assets/js/matchinginput.js');
276  $global_tpl->addOnLoadCode('il.test.matchingquestion.init();');
277 
278  $tpl = new ilTemplate("tpl.prop_matchingwizardinput.html", true, true, "components/ILIAS/TestQuestionPool");
279  $i = 0;
280  foreach ($this->values as $value) {
281  if (!$this->hideImages) {
282  if ($value->getPicture() &&
283  file_exists($this->qstObject->getImagePath() . $value->getPicture())
284  ) {
285  $imagename = $this->qstObject->getImagePathWeb() . $value->getPicture();
286  if ($this->qstObject->getThumbSize()) {
287  if (file_exists($this->qstObject->getImagePath() . $this->qstObject->getThumbPrefix() . $value->getPicture())) {
288  $imagename = $this->qstObject->getImagePathWeb() . $this->qstObject->getThumbPrefix() . $value->getPicture();
289  }
290  }
291 
292  $tpl->setCurrentBlock('image');
293  $tpl->setVariable('SRC_IMAGE', $imagename);
294  $tpl->setVariable('IMAGE_NAME', $value->getPicture());
295  $tpl->setVariable('ALT_IMAGE', ilLegacyFormElementsUtil::prepareFormOutput($value->getText()));
296  $tpl->setVariable("TXT_DELETE_EXISTING", $lng->txt("delete_existing_file"));
297  $tpl->setVariable("IMAGE_ROW_NUMBER", $i);
298  $tpl->setVariable("IMAGE_POST_VAR", $this->getPostVar());
299  $tpl->parseCurrentBlock();
300  }
301  $tpl->setCurrentBlock('addimage');
302  $tpl->setVariable("IMAGE_BROWSE", $lng->txt('select_file'));
303  $tpl->setVariable("IMAGE_ID", $this->getPostVar() . "[image][$i]");
304  $tpl->setVariable('MAX_SIZE_WARNING', $this->lng->txt('form_msg_file_size_exceeds'));
305  $tpl->setVariable('MAX_SIZE', $this->upload_limit->getPhpUploadLimitInBytes());
306  $tpl->setVariable("IMAGE_SUBMIT", $lng->txt("upload"));
307  $tpl->setVariable("IMAGE_ROW_NUMBER", $i);
308  $tpl->setVariable("IMAGE_POST_VAR", $this->getPostVar());
309  $tpl->parseCurrentBlock();
310  }
311 
312  if (is_object($value)) {
313  $tpl->setCurrentBlock("prop_text_propval");
314  $tpl->setVariable("PROPERTY_VALUE", ilLegacyFormElementsUtil::prepareFormOutput($value->getText()));
315  $tpl->parseCurrentBlock();
316  }
317  // this block does not exist in the template
318  // $tpl->setCurrentBlock('singleline');
319  $tpl->setVariable("SIZE", $this->getSize());
320  $tpl->setVariable("SINGLELINE_ID", $this->getPostVar() . "[answer][$i]");
321  $tpl->setVariable("SINGLELINE_ROW_NUMBER", $i);
322  $tpl->setVariable("SINGLELINE_POST_VAR", $this->getPostVar());
323  $tpl->setVariable("MAXLENGTH", $this->getMaxLength());
324  if ($this->getDisabled()) {
325  $tpl->setVariable("DISABLED_SINGLELINE", " disabled=\"disabled\"");
326  }
327  $tpl->parseCurrentBlock();
328  $tpl->setCurrentBlock("row");
329  $tpl->setVariable("POST_VAR", $this->getPostVar());
330  $tpl->setVariable("ROW_NUMBER", $i + 1);
331  $tpl->setVariable("ROW_IDENTIFIER", $value->getIdentifier());
332  $tpl->setVariable("ID", $this->getPostVar() . "[answer][$i]");
333  $tpl->setVariable("ADD_BUTTON", $this->renderer->render(
334  $this->glyph_factory->add()->withAction('#')
335  ));
336  $tpl->setVariable("REMOVE_BUTTON", $this->renderer->render(
337  $this->glyph_factory->remove()->withAction('#')
338  ));
339  $tpl->parseCurrentBlock();
340  $i++;
341  }
342 
343  if (!$this->hideImages) {
344  if (is_array($this->getSuffixes())) {
345  $suff_str = $delim = "";
346  foreach ($this->getSuffixes() as $suffix) {
347  $suff_str .= $delim . "." . $suffix;
348  $delim = ", ";
349  }
350  $tpl->setCurrentBlock('allowed_image_suffixes');
351  $tpl->setVariable("TXT_ALLOWED_SUFFIXES", $lng->txt("file_allowed_suffixes") . " " . $suff_str);
352  $tpl->parseCurrentBlock();
353  }
354  $tpl->setCurrentBlock("image_heading");
355  $tpl->setVariable("ANSWER_IMAGE", $this->image_name);
356  $tpl->setVariable("TXT_MAX_SIZE", ilFileUtils::getFileSizeInfo());
357  $tpl->parseCurrentBlock();
358  }
359 
360  $tpl->setVariable("ELEMENT_ID", $this->getPostVar());
361  $tpl->setVariable("TEXT_YES", $lng->txt('yes'));
362  $tpl->setVariable("TEXT_NO", $lng->txt('no'));
363  $tpl->setVariable("DELETE_IMAGE_HEADER", $lng->txt('delete_image_header'));
364  $tpl->setVariable("DELETE_IMAGE_QUESTION", $lng->txt('delete_image_question'));
365  $tpl->setVariable("ANSWER_TEXT", $this->text_name);
366  $tpl->setVariable("NUMBER_TEXT", $lng->txt('row'));
367  $tpl->setVariable("COMMANDS_TEXT", $lng->txt('actions'));
368 
369  $a_tpl->setCurrentBlock("prop_generic");
370  $a_tpl->setVariable("PROP_GENERIC", $tpl->get());
371  $a_tpl->parseCurrentBlock();
372  }
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...
addOnLoadCode(string $a_code, int $a_batch=2)
Add on load code.
renderer()
static prepareFormOutput($a_str, bool $a_strip=false)
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:544
ilGlobalTemplateInterface $global_tpl
global $DIC
Definition: shib_login.php:22
static getFileSizeInfo()
setCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
+ Here is the call graph for this function:

◆ setHideImages()

ilMatchingWizardInputGUI::setHideImages (   $a_hide)

Set hide images.

Parameters
bool$a_hideHide images

Definition at line 94 of file class.ilMatchingWizardInputGUI.php.

Referenced by assMatchingQuestionGUI\populateAnswerSpecificFormPart().

94  : void
95  {
96  $this->hideImages = $a_hide;
97  }
+ Here is the caller graph for this function:

◆ setImageName()

ilMatchingWizardInputGUI::setImageName (   $a_value)

Definition at line 124 of file class.ilMatchingWizardInputGUI.php.

124  : void
125  {
126  $this->image_name = $a_value;
127  }

◆ setPending()

ilMatchingWizardInputGUI::setPending ( string  $a_val)

Definition at line 374 of file class.ilMatchingWizardInputGUI.php.

374  : void
375  {
376  $this->pending = $a_val;
377  }

◆ setQuestionObject()

ilMatchingWizardInputGUI::setQuestionObject (   $a_value)

Set question object.

Parameters
object$a_valuetest object

Definition at line 134 of file class.ilMatchingWizardInputGUI.php.

134  : void
135  {
136  $this->qstObject = &$a_value;
137  }

◆ setSuffixes()

ilMatchingWizardInputGUI::setSuffixes (   $a_suffixes)

Set Accepted Suffixes.

Parameters
array$a_suffixesAccepted Suffixes

Definition at line 74 of file class.ilMatchingWizardInputGUI.php.

Referenced by __construct().

74  : void
75  {
76  $this->suffixes = $a_suffixes;
77  }
+ Here is the caller graph for this function:

◆ setTextName()

ilMatchingWizardInputGUI::setTextName (   $a_value)

Definition at line 119 of file class.ilMatchingWizardInputGUI.php.

119  : void
120  {
121  $this->text_name = $a_value;
122  }

◆ setValue()

ilMatchingWizardInputGUI::setValue (   $a_value)

Definition at line 149 of file class.ilMatchingWizardInputGUI.php.

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

149  : void
150  {
151  $this->values = [];
152 
153  $answers = $this->forms_helper->transformArray($a_value, 'answer', $this->refinery->kindlyTo()->string());
154  $imagename = $this->forms_helper->transformArray($a_value, 'imagename', $this->refinery->kindlyTo()->string());
155  $identifier = $this->forms_helper->transformArray($a_value, 'identifier', $this->refinery->kindlyTo()->int());
156 
157  foreach ($answers as $index => $value) {
158  $this->values[] = new assAnswerMatchingTerm(
159  $value,
160  $imagename[$index] ?? '',
161  $identifier[$index] ?? 0
162  );
163  }
164  }
Class for matching question terms.
+ Here is the call graph for this function:

◆ setValues()

ilMatchingWizardInputGUI::setValues (   $a_values)

Set Values.

Parameters
array$a_valueValue

Definition at line 104 of file class.ilMatchingWizardInputGUI.php.

104  : void
105  {
106  $this->values = $a_values;
107  }

Field Documentation

◆ $forms_helper

ilTestLegacyFormsHelper ilMatchingWizardInputGUI::$forms_helper
protected

Definition at line 44 of file class.ilMatchingWizardInputGUI.php.

◆ $glyph_factory

GlyphFactory ilMatchingWizardInputGUI::$glyph_factory
protected

Definition at line 45 of file class.ilMatchingWizardInputGUI.php.

◆ $hideImages

ilMatchingWizardInputGUI::$hideImages = false
protected

Definition at line 42 of file class.ilMatchingWizardInputGUI.php.

◆ $image_name

ilMatchingWizardInputGUI::$image_name = ''
protected

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

◆ $pending

string ilMatchingWizardInputGUI::$pending
private

Definition at line 36 of file class.ilMatchingWizardInputGUI.php.

Referenced by getPending().

◆ $qstObject

ilMatchingWizardInputGUI::$qstObject = null
protected

Definition at line 40 of file class.ilMatchingWizardInputGUI.php.

Referenced by getQuestionObject().

◆ $renderer

Renderer ilMatchingWizardInputGUI::$renderer
protected

Definition at line 46 of file class.ilMatchingWizardInputGUI.php.

◆ $suffixes

ilMatchingWizardInputGUI::$suffixes = []
protected

Definition at line 41 of file class.ilMatchingWizardInputGUI.php.

Referenced by getSuffixes().

◆ $text_name

ilMatchingWizardInputGUI::$text_name = ''
protected

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

◆ $upload_limit

UploadLimitResolver ilMatchingWizardInputGUI::$upload_limit
protected

Definition at line 47 of file class.ilMatchingWizardInputGUI.php.

◆ $values

ilMatchingWizardInputGUI::$values = []
protected

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

Referenced by getValues().


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