ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilSingleChoiceWizardInputGUI Class Reference

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

+ Inheritance diagram for ilSingleChoiceWizardInputGUI:
+ Collaboration diagram for ilSingleChoiceWizardInputGUI:

Public Member Functions

 __construct ($a_title="", $a_postvar="")
 Constructor. More...
 
 setValue ($a_value)
 Set Value. More...
 
 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...
 
 checkInput ()
 Check input, strip slashes etc. More...
 
 insert (&$a_tpl)
 Insert property html. More...
 
- Public Member Functions inherited from ilTextInputGUI
 __construct ($a_title="", $a_postvar="")
 Constructor. More...
 
 setValue ($a_value)
 Set Value. More...
 
 getValue ()
 Get Value. More...
 
 setValidationFailureMessage ($a_msg)
 Set message string for validation failure. More...
 
 getValidationFailureMessage ()
 
 setValidationRegexp ($a_value)
 Set validation regexp. More...
 
 getValidationRegexp ()
 Get validation regexp. More...
 
 setMaxLength ($a_maxlength)
 Set Max Length. More...
 
 getMaxLength ()
 Get Max Length. More...
 
 setSize ($a_size)
 Set Size. More...
 
 setInlineStyle ($a_style)
 Set inline style. More...
 
 getInlineStyle ()
 Get inline style. More...
 
 setCssClass ($a_class)
 
 getCssClass ()
 
 setValueByArray ($a_values)
 Set value by array. More...
 
 getSize ()
 Get Size. More...
 
 setSuffix ($a_value)
 Set suffix. More...
 
 getSuffix ()
 Get suffix. More...
 
 setInputType ($a_type)
 set input type More...
 
 getInputType ()
 get input type More...
 
 setSubmitFormOnEnter ($a_val)
 Set submit form on enter. More...
 
 getSubmitFormOnEnter ()
 Get submit form on enter. More...
 
 checkInput ()
 Check input, strip slashes etc. More...
 
 getDataSource ()
 get datasource link for js autocomplete More...
 
 setDataSource ($href, $a_delimiter=null)
 set datasource link for js autocomplete More...
 
 setDataSourceSubmitOnSelection ($a_stat)
 
 getDataSourceSubmitOnSelection ()
 
 setDataSourceSubmitUrl ($a_url)
 
 getDataSourceSubmitUrl ()
 
 setMultiValues (array $a_values)
 Set multi values. More...
 
 insert (&$a_tpl)
 Insert property html. More...
 
 getTableFilterHTML ()
 Get HTML for table filter. More...
 
 getToolbarHTML ()
 Get HTML for toolbar. More...
 
 setDisableHtmlAutoComplete ($autocomplete)
 
 isHtmlAutoCompleteDisabled ()
 
- Public Member Functions inherited from ilSubEnabledFormPropertyGUI
 addSubItem ($a_item)
 Add Subitem. More...
 
 getSubItems ()
 Get Subitems. More...
 
 getSubInputItemsRecursive ()
 returns a flat array of possibly existing subitems recursively More...
 
 checkSubItemsInput ()
 Check SubItems. More...
 
 getSubForm ()
 Get sub form html. More...
 
 getItemByPostVar ($a_post_var)
 Get item by post var. More...
 
- Public Member Functions inherited from ilFormPropertyGUI
 __construct ($a_title="", $a_postvar="")
 Constructor. More...
 
executeCommand ()
 Execute command. More...
 
 getType ()
 Get Type. More...
 
 setTitle ($a_title)
 Set Title. More...
 
 getTitle ()
 Get Title. More...
 
 setPostVar ($a_postvar)
 Set Post Variable. More...
 
 getPostVar ()
 Get Post Variable. More...
 
 getFieldId ()
 Get Post Variable. More...
 
 setInfo ($a_info)
 Set Information Text. More...
 
 getInfo ()
 Get Information Text. More...
 
 setAlert ($a_alert)
 Set Alert Text. More...
 
 getAlert ()
 Get Alert Text. More...
 
 setRequired ($a_required)
 Set Required. More...
 
 getRequired ()
 Get Required. More...
 
 setDisabled ($a_disabled)
 Set Disabled. More...
 
 getDisabled ()
 Get Disabled. More...
 
 checkInput ()
 Check input, strip slashes etc. More...
 
 setParentForm ($a_parentform)
 Set Parent Form. More...
 
 getParentForm ()
 Get Parent Form. More...
 
 setParent ($a_val)
 Set Parent GUI object. More...
 
 getParent ()
 Get Parent GUI object. More...
 
 getSubForm ()
 Get sub form html. More...
 
 hideSubForm ()
 Sub form hidden on init? More...
 
 setHiddenTitle ($a_val)
 Set hidden title (for screenreaders) More...
 
 getHiddenTitle ()
 Get hidden title. More...
 
 getItemByPostVar ($a_post_var)
 Get item by post var. More...
 
 serializeData ()
 serialize data More...
 
 unserializeData ($a_data)
 unserialize data More...
 
 writeToSession ()
 Write to session. More...
 
 clearFromSession ()
 Clear session value. More...
 
 readFromSession ()
 Read from session. More...
 
 getHiddenTag ($a_post_var, $a_value)
 Get hidden tag (used for disabled properties) More...
 
 setMulti ($a_multi, $a_sortable=false, $a_addremove=true)
 Set Multi. More...
 
 getMulti ()
 Get Multi. More...
 
 setMultiValues (array $a_values)
 Set multi values. More...
 
 getMultiValues ()
 Get multi values. More...
 
 getContentOutsideFormTag ()
 Get content that has to reside outside of the parent form tag, e.g. More...
 
 removeProhibitedCharacters ($a_text)
 Remove prohibited characters see #19159. More...
 
 stripSlashesAddSpaceFallback ($a_str)
 Strip slashes with add space fallback, see https://www.ilias.de/mantis/view.php?id=19727. More...
 
 getTableFilterHTML ()
 Get input item HTML to be inserted into table filters. More...
 
 getToolbarHTML ()
 Get input item HTML to be inserted into ilToolbarGUI. More...
 

Protected Attributes

 $values = array()
 
 $allowMove = false
 
 $singleline = true
 
 $qstObject = null
 
 $suffixes = array()
 
 $showPoints = true
 
 $hideImages = false
 
- Protected Attributes inherited from ilTextInputGUI
 $value
 
 $maxlength = 200
 
 $size = 40
 
 $validationRegexp
 
 $validationFailureMessage = ''
 
 $suffix
 
 $style_css
 
 $css_class
 
 $ajax_datasource
 
 $ajax_datasource_delimiter
 
 $ajax_datasource_commit = FALSE
 
 $ajax_datasource_commit_url
 
 $submit_form_on_enter = false
 
 $autocomplete_disabled = false
 
- Protected Attributes inherited from ilSubEnabledFormPropertyGUI
 $sub_items = array()
 
- Protected Attributes inherited from ilFormPropertyGUI
 $type
 
 $title
 
 $postvar
 
 $info
 
 $alert
 
 $required = false
 
 $parentgui
 
 $parentform
 
 $hidden_title = ""
 
 $multi = false
 
 $multi_sortable = false
 
 $multi_addremove = true
 
 $multi_values
 

Additional Inherited Members

- Protected Member Functions inherited from ilFormPropertyGUI
 setType ($a_type)
 Set Type. More...
 
 getMultiIconsHTML ()
 Get HTML for multiple value icons. More...
 

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
Version
$Id$

Definition at line 13 of file class.ilSingleChoiceWizardInputGUI.php.

Constructor & Destructor Documentation

◆ __construct()

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

Constructor.

Parameters
string$a_titleTitle
string$a_postvarPost Variable

Reimplemented from ilTextInputGUI.

Reimplemented in ilKprimChoiceWizardInputGUI.

Definition at line 29 of file class.ilSingleChoiceWizardInputGUI.php.

30 {
31 parent::__construct($a_title, $a_postvar);
32 $this->setSuffixes(array("jpg", "jpeg", "png", "gif"));
33 $this->setSize('25');
34 $this->validationRegexp = "";
35 }
setSuffixes($a_suffixes)
Set Accepted Suffixes.
setSize($a_size)
Set Size.

References ilTextInputGUI\setSize(), and setSuffixes().

+ Here is the call graph for this function:

Member Function Documentation

◆ checkInput()

ilSingleChoiceWizardInputGUI::checkInput ( )

Check input, strip slashes etc.

set alert, if input is not ok.

Returns
boolean Input ok, true/false

Reimplemented from ilTextInputGUI.

Reimplemented in ilEssayKeywordWizardInputGUI, ilKprimChoiceWizardInputGUI, and ilMultipleChoiceWizardInputGUI.

Definition at line 184 of file class.ilSingleChoiceWizardInputGUI.php.

185 {
186 global $lng;
187
188 include_once "./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
189
190 if (is_array($_POST[$this->getPostVar()])) $_POST[$this->getPostVar()] = ilUtil::stripSlashesRecursive($_POST[$this->getPostVar()], true, ilObjAdvancedEditing::_getUsedHTMLTagsAsString("assessment"));
191 $foundvalues = $_POST[$this->getPostVar()];
192 if (is_array($foundvalues))
193 {
194 // check answers
195 if (is_array($foundvalues['answer']))
196 {
197 foreach ($foundvalues['answer'] as $aidx => $answervalue)
198 {
199 if (((strlen($answervalue)) == 0) && (strlen($foundvalues['imagename'][$aidx]) == 0))
200 {
201 $this->setAlert($lng->txt("msg_input_is_required"));
202 return FALSE;
203 }
204 }
205 }
206 // check points
207 $max = 0;
208 if (is_array($foundvalues['points']))
209 {
210 foreach ($foundvalues['points'] as $points)
211 {
212 if ($points > $max) $max = $points;
213 if (((strlen($points)) == 0) || (!is_numeric($points)))
214 {
215 $this->setAlert($lng->txt("form_msg_numeric_value_required"));
216 return FALSE;
217 }
218 }
219 }
220 if ($max == 0)
221 {
222 $this->setAlert($lng->txt("enter_enough_positive_points"));
223 return false;
224 }
225
226 if (is_array($_FILES) && count($_FILES) && $this->getSingleline() && (!$this->hideImages))
227 {
228 if (is_array($_FILES[$this->getPostVar()]['error']['image']))
229 {
230 foreach ($_FILES[$this->getPostVar()]['error']['image'] as $index => $error)
231 {
232 // error handling
233 if ($error > 0)
234 {
235 switch ($error)
236 {
237 case UPLOAD_ERR_INI_SIZE:
238 $this->setAlert($lng->txt("form_msg_file_size_exceeds"));
239 return false;
240 break;
241
242 case UPLOAD_ERR_FORM_SIZE:
243 $this->setAlert($lng->txt("form_msg_file_size_exceeds"));
244 return false;
245 break;
246
247 case UPLOAD_ERR_PARTIAL:
248 $this->setAlert($lng->txt("form_msg_file_partially_uploaded"));
249 return false;
250 break;
251
252 case UPLOAD_ERR_NO_FILE:
253 if ($this->getRequired())
254 {
255 if ((!strlen($foundvalues['imagename'][$index])) && (!strlen($foundvalues['answer'][$index])))
256 {
257 $this->setAlert($lng->txt("form_msg_file_no_upload"));
258 return false;
259 }
260 }
261 break;
262
263 case UPLOAD_ERR_NO_TMP_DIR:
264 $this->setAlert($lng->txt("form_msg_file_missing_tmp_dir"));
265 return false;
266 break;
267
268 case UPLOAD_ERR_CANT_WRITE:
269 $this->setAlert($lng->txt("form_msg_file_cannot_write_to_disk"));
270 return false;
271 break;
272
273 case UPLOAD_ERR_EXTENSION:
274 $this->setAlert($lng->txt("form_msg_file_upload_stopped_ext"));
275 return false;
276 break;
277 }
278 }
279 }
280 }
281 else
282 {
283 if ($this->getRequired())
284 {
285 $this->setAlert($lng->txt("form_msg_file_no_upload"));
286 return false;
287 }
288 }
289
290 if (is_array($_FILES[$this->getPostVar()]['tmp_name']['image']))
291 {
292 foreach ($_FILES[$this->getPostVar()]['tmp_name']['image'] as $index => $tmpname)
293 {
294 $filename = $_FILES[$this->getPostVar()]['name']['image'][$index];
295 $filename_arr = pathinfo($filename);
296 $suffix = $filename_arr["extension"];
297 $mimetype = $_FILES[$this->getPostVar()]['type']['image'][$index];
298 $size_bytes = $_FILES[$this->getPostVar()]['size']['image'][$index];
299 // check suffixes
300 if (strlen($tmpname) && is_array($this->getSuffixes()))
301 {
302 if (!in_array(strtolower($suffix), $this->getSuffixes()))
303 {
304 $this->setAlert($lng->txt("form_msg_file_wrong_file_type"));
305 return false;
306 }
307 }
308 }
309 }
310
311 if (is_array($_FILES[$this->getPostVar()]['tmp_name']['image']))
312 {
313 foreach ($_FILES[$this->getPostVar()]['tmp_name']['image'] as $index => $tmpname)
314 {
315 $filename = $_FILES[$this->getPostVar()]['name']['image'][$index];
316 $filename_arr = pathinfo($filename);
317 $suffix = $filename_arr["extension"];
318 $mimetype = $_FILES[$this->getPostVar()]['type']['image'][$index];
319 $size_bytes = $_FILES[$this->getPostVar()]['size']['image'][$index];
320 // virus handling
321 if (strlen($tmpname))
322 {
323 $vir = ilUtil::virusHandling($tmpname, $filename);
324 if ($vir[0] == false)
325 {
326 $this->setAlert($lng->txt("form_msg_file_virus_found")."<br />".$vir[1]);
327 return false;
328 }
329 }
330 }
331 }
332 }
333 }
334 else
335 {
336 $this->setAlert($lng->txt("msg_input_is_required"));
337 return FALSE;
338 }
339
340 return $this->checkSubItemsInput();
341 }
$filename
Definition: buildRTE.php:89
getPostVar()
Get Post Variable.
setAlert($a_alert)
Set Alert Text.
& _getUsedHTMLTagsAsString($a_module="")
Returns a string of all allowed HTML tags for text editing.
static stripSlashesRecursive($a_data, $a_strip_html=true, $a_allow="")
Strip slashes from array and sub-arrays.
static virusHandling($a_file, $a_orig_name="", $a_clean=true)
scan file for viruses and clean files if possible
$_POST['username']
Definition: cron.php:12
global $lng
Definition: privfeed.php:40

References $_POST, $filename, $lng, ilTextInputGUI\$suffix, ilObjAdvancedEditing\_getUsedHTMLTagsAsString(), ilSubEnabledFormPropertyGUI\checkSubItemsInput(), ilFormPropertyGUI\getPostVar(), ilFormPropertyGUI\getRequired(), getSingleline(), getSuffixes(), ilFormPropertyGUI\setAlert(), ilUtil\stripSlashesRecursive(), and ilUtil\virusHandling().

+ Here is the call graph for this function:

◆ getAllowMove()

ilSingleChoiceWizardInputGUI::getAllowMove ( )

Get allow move.

Returns
boolean Allow move

Definition at line 174 of file class.ilSingleChoiceWizardInputGUI.php.

References $allowMove.

Referenced by ilMultipleChoiceWizardInputGUI\insert(), and insert().

+ Here is the caller graph for this function:

◆ getQuestionObject()

ilSingleChoiceWizardInputGUI::getQuestionObject ( )

Get question object.

Returns
object Value

Definition at line 154 of file class.ilSingleChoiceWizardInputGUI.php.

References $qstObject.

◆ getShowPoints()

ilSingleChoiceWizardInputGUI::getShowPoints ( )

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

References $showPoints.

Referenced by insert().

+ Here is the caller graph for this function:

◆ getSingleline()

ilSingleChoiceWizardInputGUI::getSingleline ( )

◆ getSuffixes()

ilSingleChoiceWizardInputGUI::getSuffixes ( )

Get Accepted Suffixes.

Returns
array Accepted Suffixes

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

References $suffixes.

Referenced by ilMultipleChoiceWizardInputGUI\checkInput(), checkInput(), ilKprimChoiceWizardInputGUI\checkUploads(), ilMultipleChoiceWizardInputGUI\insert(), and insert().

+ Here is the caller graph for this function:

◆ getValues()

ilSingleChoiceWizardInputGUI::getValues ( )

Get Values.

Returns
array Values

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

References $values.

◆ insert()

ilSingleChoiceWizardInputGUI::insert ( $a_tpl)

Insert property html.

Returns
int Size

Reimplemented from ilTextInputGUI.

Reimplemented in ilEssayKeywordWizardInputGUI, and ilMultipleChoiceWizardInputGUI.

Definition at line 348 of file class.ilSingleChoiceWizardInputGUI.php.

349 {
350 global $lng;
351
352 $tpl = new ilTemplate("tpl.prop_singlechoicewizardinput.html", true, true, "Modules/TestQuestionPool");
353 $i = 0;
354 foreach ($this->values as $value)
355 {
356 if ($this->getSingleline())
357 {
358 if (!$this->hideImages)
359 {
360 if (strlen($value->getImage()))
361 {
362 $imagename = $this->qstObject->getImagePathWeb() . $value->getImage();
363 if (($this->getSingleline()) && ($this->qstObject->getThumbSize()))
364 {
365 if (@file_exists($this->qstObject->getImagePath() . $this->qstObject->getThumbPrefix() . $value->getImage()))
366 {
367 $imagename = $this->qstObject->getImagePathWeb() . $this->qstObject->getThumbPrefix() . $value->getImage();
368 }
369 }
370 $tpl->setCurrentBlock('image');
371 $tpl->setVariable('SRC_IMAGE', $imagename);
372 $tpl->setVariable('IMAGE_NAME', $value->getImage());
373 $tpl->setVariable('ALT_IMAGE', ilUtil::prepareFormOutput($value->getAnswertext()));
374 $tpl->setVariable("TXT_DELETE_EXISTING", $lng->txt("delete_existing_file"));
375 $tpl->setVariable("IMAGE_ROW_NUMBER", $i);
376 $tpl->setVariable("IMAGE_POST_VAR", $this->getPostVar());
377 $tpl->parseCurrentBlock();
378 }
379 $tpl->setCurrentBlock('addimage');
380 $tpl->setVariable("IMAGE_ID", $this->getPostVar() . "[image][$i]");
381 $tpl->setVariable("IMAGE_SUBMIT", $lng->txt("upload"));
382 $tpl->setVariable("IMAGE_ROW_NUMBER", $i);
383 $tpl->setVariable("IMAGE_POST_VAR", $this->getPostVar());
384 $tpl->parseCurrentBlock();
385 }
386
387 if (is_object($value))
388 {
389 $tpl->setCurrentBlock("prop_text_propval");
390 $tpl->setVariable("PROPERTY_VALUE", ilUtil::prepareFormOutput($value->getAnswertext()));
391 $tpl->parseCurrentBlock();
392 if( $this->getShowPoints() ) {
393 $tpl->setCurrentBlock("prop_points_propval");
394 $tpl->setVariable("PROPERTY_VALUE", ilUtil::prepareFormOutput($value->getPoints()));
395 $tpl->parseCurrentBlock();
396 }
397 }
398 $tpl->setCurrentBlock('singleline');
399 $tpl->setVariable("SIZE", $this->getSize());
400 $tpl->setVariable("SINGLELINE_ID", $this->getPostVar() . "[answer][$i]");
401 $tpl->setVariable("SINGLELINE_ROW_NUMBER", $i);
402 $tpl->setVariable("SINGLELINE_POST_VAR", $this->getPostVar());
403 $tpl->setVariable("MAXLENGTH", $this->getMaxLength());
404 if ($this->getDisabled())
405 {
406 $tpl->setVariable("DISABLED_SINGLELINE", " disabled=\"disabled\"");
407 }
408 $tpl->parseCurrentBlock();
409 }
410 else if (!$this->getSingleline())
411 {
412 if (is_object($value))
413 {
414 if ($this->getShowPoints())
415 {
416 $tpl->setCurrentBlock("prop_points_propval");
417 $tpl->setVariable("PROPERTY_VALUE", ilUtil::prepareFormOutput($value->getPoints()));
418 $tpl->parseCurrentBlock();
419 }
420 }
421 $tpl->setCurrentBlock('multiline');
422 $tpl->setVariable("PROPERTY_VALUE", ilUtil::prepareFormOutput($value->getAnswertext()));
423 $tpl->setVariable("MULTILINE_ID", $this->getPostVar() . "[answer][$i]");
424 $tpl->setVariable("MULTILINE_ROW_NUMBER", $i);
425 $tpl->setVariable("MULTILINE_POST_VAR", $this->getPostVar());
426 if ($this->getDisabled())
427 {
428 $tpl->setVariable("DISABLED_MULTILINE", " disabled=\"disabled\"");
429 }
430 $tpl->parseCurrentBlock();
431 }
432 if ($this->getAllowMove())
433 {
434 $tpl->setCurrentBlock("move");
435 $tpl->setVariable("CMD_UP", "cmd[up" . $this->getFieldId() . "][$i]");
436 $tpl->setVariable("CMD_DOWN", "cmd[down" . $this->getFieldId() . "][$i]");
437 $tpl->setVariable("ID", $this->getPostVar() . "[$i]");
438 $tpl->setVariable("UP_BUTTON", ilGlyphGUI::get(ilGlyphGUI::UP));
439 $tpl->setVariable("DOWN_BUTTON", ilGlyphGUI::get(ilGlyphGUI::DOWN));
440 $tpl->parseCurrentBlock();
441 }
442 if ($this->getShowPoints())
443 {
444 $tpl->setCurrentBlock("points");
445 $tpl->setVariable("POINTS_ID", $this->getPostVar() . "[points][$i]");
446 $tpl->setVariable("POINTS_POST_VAR", $this->getPostVar());
447 $tpl->setVariable("POINTS_ROW_NUMBER", $i);
448 $tpl->parseCurrentBlock();
449 }
450 $tpl->setCurrentBlock("row");
451 $tpl->setVariable("POST_VAR", $this->getPostVar());
452 $tpl->setVariable("ROW_NUMBER", $i);
453 $tpl->setVariable("ID", $this->getPostVar() . "[answer][$i]");
454 $tpl->setVariable("CMD_ADD", "cmd[add" . $this->getFieldId() . "][$i]");
455 $tpl->setVariable("CMD_REMOVE", "cmd[remove" . $this->getFieldId() . "][$i]");
456 if ($this->getDisabled())
457 {
458 $tpl->setVariable("DISABLED_POINTS", " disabled=\"disabled\"");
459 }
460 $tpl->setVariable("ADD_BUTTON", ilGlyphGUI::get(ilGlyphGUI::ADD));
461 $tpl->setVariable("REMOVE_BUTTON", ilGlyphGUI::get(ilGlyphGUI::REMOVE));
462 $tpl->parseCurrentBlock();
463 $i++;
464 }
465
466 if ($this->getSingleline())
467 {
468 if (!$this->hideImages)
469 {
470 if (is_array($this->getSuffixes()))
471 {
472 $suff_str = $delim = "";
473 foreach($this->getSuffixes() as $suffix)
474 {
475 $suff_str.= $delim.".".$suffix;
476 $delim = ", ";
477 }
478 $tpl->setCurrentBlock('allowed_image_suffixes');
479 $tpl->setVariable("TXT_ALLOWED_SUFFIXES", $lng->txt("file_allowed_suffixes")." ".$suff_str);
480 $tpl->parseCurrentBlock();
481 }
482 $tpl->setCurrentBlock("image_heading");
483 $tpl->setVariable("ANSWER_IMAGE", $lng->txt('answer_image'));
484 $tpl->setVariable("TXT_MAX_SIZE", ilUtil::getFileSizeInfo());
485 $tpl->parseCurrentBlock();
486 }
487 }
488
489 if ($this->getShowPoints())
490 {
491 $tpl->setCurrentBlock("points_heading");
492 $tpl->setVariable("POINTS_TEXT", $lng->txt('points'));
493 $tpl->parseCurrentBlock();
494 }
495
496 $tpl->setVariable("ELEMENT_ID", $this->getPostVar());
497 $tpl->setVariable("TEXT_YES", $lng->txt('yes'));
498 $tpl->setVariable("TEXT_NO", $lng->txt('no'));
499 $tpl->setVariable("DELETE_IMAGE_HEADER", $lng->txt('delete_image_header'));
500 $tpl->setVariable("DELETE_IMAGE_QUESTION", $lng->txt('delete_image_question'));
501 $tpl->setVariable("ANSWER_TEXT", $lng->txt('answer_text'));
502 $tpl->setVariable("COMMANDS_TEXT", $lng->txt('actions'));
503
504 $a_tpl->setCurrentBlock("prop_generic");
505 $a_tpl->setVariable("PROP_GENERIC", $tpl->get());
506 $a_tpl->parseCurrentBlock();
507
508 global $tpl;
509 $tpl->addJavascript("./Services/Form/js/ServiceFormWizardInput.js");
510 $tpl->addJavascript("./Modules/TestQuestionPool/templates/default/singlechoicewizard.js");
511 }
global $tpl
Definition: ilias.php:8
getFieldId()
Get Post Variable.
static get($a_glyph, $a_text="")
Get glyph html.
special template class to simplify handling of ITX/PEAR
getMaxLength()
Get Max Length.
static getFileSizeInfo()
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms @access public

References $lng, ilTextInputGUI\$suffix, $tpl, ilTextInputGUI\$value, ilGlyphGUI\ADD, ilGlyphGUI\DOWN, ilGlyphGUI\get(), getAllowMove(), ilFormPropertyGUI\getDisabled(), ilFormPropertyGUI\getFieldId(), ilUtil\getFileSizeInfo(), ilTextInputGUI\getMaxLength(), ilFormPropertyGUI\getPostVar(), getShowPoints(), getSingleline(), ilTextInputGUI\getSize(), getSuffixes(), ilUtil\prepareFormOutput(), ilGlyphGUI\REMOVE, and ilGlyphGUI\UP.

+ Here is the call graph for this function:

◆ setAllowMove()

ilSingleChoiceWizardInputGUI::setAllowMove (   $a_allow_move)

Set allow move.

Parameters
boolean$a_allow_moveAllow move

Definition at line 164 of file class.ilSingleChoiceWizardInputGUI.php.

165 {
166 $this->allowMove = $a_allow_move;
167 }

◆ setHideImages()

ilSingleChoiceWizardInputGUI::setHideImages (   $a_hide)

Set hide images.

Parameters
array$a_hideHide images

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

75 {
76 $this->hideImages = $a_hide;
77 }

◆ setQuestionObject()

ilSingleChoiceWizardInputGUI::setQuestionObject (   $a_value)

Set question object.

Parameters
object$a_valuetest object

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

145 {
146 $this->qstObject =& $a_value;
147 }

◆ setShowPoints()

ilSingleChoiceWizardInputGUI::setShowPoints (   $a_value)

Definition at line 89 of file class.ilSingleChoiceWizardInputGUI.php.

90 {
91 $this->showPoints = $a_value;
92 }

◆ setSingleline()

ilSingleChoiceWizardInputGUI::setSingleline (   $a_value)

Set singleline.

Parameters
boolean$a_valueValue

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

125 {
126 $this->singleline = $a_value;
127 }

◆ setSuffixes()

ilSingleChoiceWizardInputGUI::setSuffixes (   $a_suffixes)

Set Accepted Suffixes.

Parameters
array$a_suffixesAccepted Suffixes

Definition at line 64 of file class.ilSingleChoiceWizardInputGUI.php.

65 {
66 $this->suffixes = $a_suffixes;
67 }

Referenced by __construct().

+ Here is the caller graph for this function:

◆ setValue()

ilSingleChoiceWizardInputGUI::setValue (   $a_value)

Set Value.

Parameters
string$a_valueValue

Reimplemented from ilTextInputGUI.

Reimplemented in ilEssayKeywordWizardInputGUI, ilKprimChoiceWizardInputGUI, and ilMultipleChoiceWizardInputGUI.

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

43 {
44 $this->values = array();
45 if (is_array($a_value))
46 {
47 if (is_array($a_value['answer']))
48 {
49 foreach ($a_value['answer'] as $index => $value)
50 {
51 include_once "./Modules/TestQuestionPool/classes/class.assAnswerBinaryStateImage.php";
52 $answer = new ASS_AnswerBinaryStateImage($value, $a_value['points'][$index], $index, 1, $a_value['imagename'][$index]);
53 array_push($this->values, $answer);
54 }
55 }
56 }
57 }
Class for answers with a binary state indicator.

References ilTextInputGUI\$value.

◆ setValues()

ilSingleChoiceWizardInputGUI::setValues (   $a_values)

Set Values.

Parameters
array$a_valueValue

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

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

Field Documentation

◆ $allowMove

ilSingleChoiceWizardInputGUI::$allowMove = false
protected

Definition at line 16 of file class.ilSingleChoiceWizardInputGUI.php.

Referenced by getAllowMove().

◆ $hideImages

ilSingleChoiceWizardInputGUI::$hideImages = false
protected

Definition at line 21 of file class.ilSingleChoiceWizardInputGUI.php.

◆ $qstObject

ilSingleChoiceWizardInputGUI::$qstObject = null
protected

Definition at line 18 of file class.ilSingleChoiceWizardInputGUI.php.

Referenced by getQuestionObject().

◆ $showPoints

ilSingleChoiceWizardInputGUI::$showPoints = true
protected

Definition at line 20 of file class.ilSingleChoiceWizardInputGUI.php.

Referenced by getShowPoints().

◆ $singleline

ilSingleChoiceWizardInputGUI::$singleline = true
protected

Definition at line 17 of file class.ilSingleChoiceWizardInputGUI.php.

Referenced by getSingleline().

◆ $suffixes

ilSingleChoiceWizardInputGUI::$suffixes = array()
protected

Definition at line 19 of file class.ilSingleChoiceWizardInputGUI.php.

Referenced by getSuffixes().

◆ $values

ilSingleChoiceWizardInputGUI::$values = array()
protected

Definition at line 15 of file class.ilSingleChoiceWizardInputGUI.php.

Referenced by getValues().


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