ILIAS  trunk Revision v12.0_alpha-1227-g7ff6d300864
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 ()
 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...
 

Protected Attributes

 $text_name = ''
 
 $image_name = ''
 
 $values = []
 
 $qstObject = null
 
 $suffixes = []
 
 $hideImages = false
 
ilTestLegacyFormsHelper $forms_helper
 
GlyphFactory $glyph_factory
 
ButtonFactory $button_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 35 of file class.ilMatchingWizardInputGUI.php.

Constructor & Destructor Documentation

◆ __construct()

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

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

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

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

+ 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

Reimplemented from ilTextInputGUI.

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

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

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

+ Here is the call graph for this function:

◆ getPending()

ilMatchingWizardInputGUI::getPending ( )

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

382 : string
383 {
384 return $this->pending;
385 }

References $pending.

◆ getQuestionObject()

ilMatchingWizardInputGUI::getQuestionObject ( )

Get question object.

Returns
object Value

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

147 : ?object
148 {
149 return $this->qstObject;
150 }

References $qstObject.

◆ getSuffixes()

ilMatchingWizardInputGUI::getSuffixes ( )

Get Accepted Suffixes.

Returns
array Accepted Suffixes

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

References $suffixes.

Referenced by checkInput(), and insert().

+ Here is the caller graph for this function:

◆ getValues()

ilMatchingWizardInputGUI::getValues ( )

Get Values.

Returns
array Values

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

117 : array
118 {
119 return $this->values;
120 }

References $values.

◆ insert()

ilMatchingWizardInputGUI::insert ( ilTemplate  $a_tpl)

Insert property html.

Returns
void Size

Reimplemented from ilTextInputGUI.

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

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

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

+ Here is the call graph for this function:

◆ setHideImages()

ilMatchingWizardInputGUI::setHideImages (   $a_hide)

Set hide images.

Parameters
bool$a_hideHide images

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

97 : void
98 {
99 $this->hideImages = $a_hide;
100 }

◆ setImageName()

ilMatchingWizardInputGUI::setImageName (   $a_value)

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

127 : void
128 {
129 $this->image_name = $a_value;
130 }

◆ setPending()

ilMatchingWizardInputGUI::setPending ( string  $a_val)

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

377 : void
378 {
379 $this->pending = $a_val;
380 }

◆ setQuestionObject()

ilMatchingWizardInputGUI::setQuestionObject (   $a_value)

Set question object.

Parameters
object$a_valuetest object

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

137 : void
138 {
139 $this->qstObject = &$a_value;
140 }

◆ setSuffixes()

ilMatchingWizardInputGUI::setSuffixes (   $a_suffixes)

Set Accepted Suffixes.

Parameters
array$a_suffixesAccepted Suffixes

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

77 : void
78 {
79 $this->suffixes = $a_suffixes;
80 }

Referenced by __construct().

+ Here is the caller graph for this function:

◆ setTextName()

ilMatchingWizardInputGUI::setTextName (   $a_value)

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

122 : void
123 {
124 $this->text_name = $a_value;
125 }

◆ setValue()

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

Reimplemented from ilTextInputGUI.

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

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

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

+ Here is the call graph for this function:

◆ setValues()

ilMatchingWizardInputGUI::setValues (   $a_values)

Set Values.

Parameters
array$a_valueValue

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

107 : void
108 {
109 $this->values = $a_values;
110 }

Field Documentation

◆ $button_factory

ButtonFactory ilMatchingWizardInputGUI::$button_factory
protected

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

◆ $forms_helper

ilTestLegacyFormsHelper ilMatchingWizardInputGUI::$forms_helper
protected

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

◆ $glyph_factory

GlyphFactory ilMatchingWizardInputGUI::$glyph_factory
protected

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

◆ $hideImages

ilMatchingWizardInputGUI::$hideImages = false
protected

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

◆ $image_name

ilMatchingWizardInputGUI::$image_name = ''
protected

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

◆ $pending

string ilMatchingWizardInputGUI::$pending
private

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

Referenced by getPending().

◆ $qstObject

ilMatchingWizardInputGUI::$qstObject = null
protected

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

Referenced by getQuestionObject().

◆ $renderer

Renderer ilMatchingWizardInputGUI::$renderer
protected

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

◆ $suffixes

ilMatchingWizardInputGUI::$suffixes = []
protected

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

Referenced by getSuffixes().

◆ $text_name

ilMatchingWizardInputGUI::$text_name = ''
protected

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

◆ $upload_limit

UploadLimitResolver ilMatchingWizardInputGUI::$upload_limit
protected

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

◆ $values

ilMatchingWizardInputGUI::$values = []
protected

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

Referenced by getValues().


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