ILIAS  trunk Revision v11.0_alpha-1715-g7fc467680fb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilAnswerWizardInputGUI Class Reference

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

+ Inheritance diagram for ilAnswerWizardInputGUI:
+ Collaboration diagram for ilAnswerWizardInputGUI:

Public Member Functions

 __construct ($a_title="", $a_postvar="")
 Constructor. More...
 
 setValue ($a_value)
 
 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...
 
 isAddRemoveAllowed ()
 
 setAllowAddRemove ($allowAddRemove)
 
 setMinvalueShouldBeGreater ($a_bool)
 Set minvalueShouldBeGreater. More...
 
 minvalueShouldBeGreater ()
 Get minvalueShouldBeGreater. More...
 
 setMinValue ($a_minvalue)
 Set Minimum Value. More...
 
 getMinValue ()
 Get Minimum Value. More...
 
 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...
 

Protected Member Functions

 getTextInputLabel ($lng)
 
 getPointsInputLabel ($lng)
 
 getTemplate ()
 
 prepareFormOutput (float|string $input, bool $strip=false)
 
- Protected Member Functions inherited from ilFormPropertyGUI
 symbol ()
 
 setType (string $a_type)
 
 checkParentFormTable ()
 
 getSessionKey ()
 
 getMultiIconsHTML ()
 
 int ($key)
 
 intArray ($key)
 
 str ($key)
 
 raw ($key)
 
 strArray ($key)
 
 arrayArray ($key)
 
 isRequestParamArray (string $key)
 
 getRequestParam (string $key, Refinery\Transformation $t)
 

Protected Attributes

 $values = []
 
 $allowMove = false
 
 $allowAddRemove = true
 
 $singleline = true
 
 $qstObject = null
 
 $minvalue = false
 
 $minvalueShouldBeGreater = false
 
ilTestLegacyFormsHelper $forms_helper
 
GlyphFactory $glyph_factory
 
Renderer $renderer
 
- 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
 

Additional Inherited Members

- Static Public Member Functions inherited from ilFormPropertyGUI
static removeProhibitedCharacters (string $a_text)
 Remove prohibited characters see #19159. 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 30 of file class.ilAnswerWizardInputGUI.php.

Constructor & Destructor Documentation

◆ __construct()

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

Constructor.

Parameters
string$a_titleTitle
string$a_postvarPost Variable

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

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), renderer(), and ilTextInputGUI\setSize().

51  {
52  parent::__construct($a_title, $a_postvar);
53 
54  global $DIC;
55 
56  $this->forms_helper = new ilTestLegacyFormsHelper();
57  $this->glyph_factory = $DIC->ui()->factory()->symbol()->glyph();
58  $this->renderer = $DIC->ui()->renderer();
59 
60  $this->setSize('25');
61  $this->validationRegexp = "";
62  }
renderer()
global $DIC
Definition: shib_login.php:22
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ checkInput()

ilAnswerWizardInputGUI::checkInput ( )

Check input, strip slashes etc.

set alert, if input is not ok.

Returns
boolean Input ok, true/false

Definition at line 226 of file class.ilAnswerWizardInputGUI.php.

References $data, ilTextInputGUI\$value, ilSubEnabledFormPropertyGUI\checkSubItemsInput(), getMinValue(), ilFormPropertyGUI\getPostVar(), ILIAS\Repository\lng(), minvalueShouldBeGreater(), ilFormPropertyGUI\raw(), ILIAS\Repository\refinery(), and ilFormPropertyGUI\setAlert().

226  : bool
227  {
228  $data = $this->raw($this->getPostVar());
229 
230  if (!is_array($data)) {
231  $this->setAlert($this->lng->txt('msg_input_is_required'));
232  return false;
233  }
234 
235  // check points
236  $points = $this->forms_helper->checkPointsInputEnoughPositive($data, true);
237  if (!is_array($points)) {
238  $this->setAlert($this->lng->txt($points));
239  return false;
240  }
241  foreach ($points as $value) {
242  if ($value !== 0.0 && $this->getMinValue() !== false) {
243  if (($this->minvalueShouldBeGreater() && $points <= $this->getMinValue()) ||
244  (!$this->minvalueShouldBeGreater() && $points < $this->getMinValue())) {
245  $this->setAlert($this->lng->txt('form_msg_value_too_low'));
246  return false;
247  }
248  }
249  }
250 
251  // check answers
252  $answers = $this->forms_helper->transformArray($data, 'answer', $this->refinery->kindlyTo()->string());
253  foreach ($answers as $answer) {
254  if ($answer === '') {
255  $this->setAlert($this->lng->txt('msg_input_is_required'));
256  return false;
257  }
258  }
259 
260  return $this->checkSubItemsInput();
261  }
minvalueShouldBeGreater()
Get minvalueShouldBeGreater.
+ Here is the call graph for this function:

◆ getAllowMove()

ilAnswerWizardInputGUI::getAllowMove ( )

Get allow move.

Returns
boolean Allow move

Definition at line 163 of file class.ilAnswerWizardInputGUI.php.

References $allowMove.

Referenced by insert().

163  : bool
164  {
165  return $this->allowMove;
166  }
+ Here is the caller graph for this function:

◆ getMinValue()

ilAnswerWizardInputGUI::getMinValue ( )

Get Minimum Value.

Returns
float Minimum Value

Definition at line 218 of file class.ilAnswerWizardInputGUI.php.

References $minvalue.

Referenced by checkInput().

+ Here is the caller graph for this function:

◆ getPointsInputLabel()

ilAnswerWizardInputGUI::getPointsInputLabel (   $lng)
protected
Parameters
$lng
Returns
mixed

Definition at line 376 of file class.ilAnswerWizardInputGUI.php.

References ilFormPropertyGUI\$lng, and ilLanguage\txt().

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

377  {
378  return $lng->txt('points');
379  }
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...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getQuestionObject()

ilAnswerWizardInputGUI::getQuestionObject ( )

Get question object.

Returns
object Value

Definition at line 143 of file class.ilAnswerWizardInputGUI.php.

References $qstObject.

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

◆ getSingleline()

ilAnswerWizardInputGUI::getSingleline ( )

Get singleline.

Returns
boolean Value

Definition at line 123 of file class.ilAnswerWizardInputGUI.php.

References $singleline.

Referenced by insert().

123  : bool
124  {
125  return $this->singleline;
126  }
+ Here is the caller graph for this function:

◆ getTemplate()

ilAnswerWizardInputGUI::getTemplate ( )
protected
Returns
string

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

Referenced by insert().

384  : string
385  {
386  return "tpl.prop_answerwizardinput.html";
387  }
+ Here is the caller graph for this function:

◆ getTextInputLabel()

ilAnswerWizardInputGUI::getTextInputLabel (   $lng)
protected
Parameters
$lng
Returns
mixed

Definition at line 367 of file class.ilAnswerWizardInputGUI.php.

References ilFormPropertyGUI\$lng, and ilLanguage\txt().

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

368  {
369  return $lng->txt('answer_text');
370  }
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...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getValues()

ilAnswerWizardInputGUI::getValues ( )

Get Values.

Returns
array Values

Definition at line 103 of file class.ilAnswerWizardInputGUI.php.

References $values.

103  : array
104  {
105  return $this->values;
106  }

◆ insert()

ilAnswerWizardInputGUI::insert ( ilTemplate  $a_tpl)

Definition at line 263 of file class.ilAnswerWizardInputGUI.php.

References $DIC, ilTextInputGUI\$value, getAllowMove(), ilFormPropertyGUI\getDisabled(), ilFormPropertyGUI\getFieldId(), ilTextInputGUI\getMaxLength(), getPointsInputLabel(), ilFormPropertyGUI\getPostVar(), getSingleline(), ilTextInputGUI\getSize(), getTemplate(), getTextInputLabel(), isAddRemoveAllowed(), ILIAS\Repository\lng(), ilTemplate\parseCurrentBlock(), ilLegacyFormElementsUtil\prepareFormOutput(), ilLegacyFormElementsUtil\prepareTextareaOutput(), renderer(), ilTemplate\setCurrentBlock(), and HTML_Template_IT\setVariable().

263  : void
264  {
265  $tpl = new ilTemplate($this->getTemplate(), true, true, "components/ILIAS/TestQuestionPool");
266  $i = 0;
267  foreach ($this->values as $value) {
268  if ($this->getSingleline()) {
269  if (is_object($value)) {
270  $tpl->setCurrentBlock("prop_text_propval");
271  $tpl->setVariable(
272  "PROPERTY_VALUE",
273  ilLegacyFormElementsUtil::prepareFormOutput($value->getAnswertext())
274  );
275  $tpl->parseCurrentBlock();
276  $tpl->setCurrentBlock("prop_points_propval");
277  $tpl->setVariable(
278  "PROPERTY_VALUE",
280  );
281  $tpl->parseCurrentBlock();
282  }
283  $tpl->setCurrentBlock('singleline');
284  $tpl->setVariable("SIZE", $this->getSize());
285  $tpl->setVariable("SINGLELINE_ID", $this->getPostVar() . "[answer][$i]");
286  $tpl->setVariable("SINGLELINE_ROW_NUMBER", $i);
287  $tpl->setVariable("SINGLELINE_POST_VAR", $this->getPostVar());
288  $tpl->setVariable("MAXLENGTH", $this->getMaxLength());
289  if ($this->getDisabled()) {
290  $tpl->setVariable("DISABLED_SINGLELINE", " disabled=\"disabled\"");
291  }
292  $tpl->parseCurrentBlock();
293  } elseif (!$this->getSingleline()) {
294  if (is_object($value)) {
295  $tpl->setCurrentBlock("prop_points_propval");
296  $tpl->setVariable(
297  "PROPERTY_VALUE",
299  );
300  $tpl->parseCurrentBlock();
301  }
302  $tpl->setCurrentBlock('multiline');
303  $tpl->setVariable("PROPERTY_VALUE", ilLegacyFormElementsUtil::prepareTextareaOutput($value->getAnswertext()));
304  $tpl->setVariable("MULTILINE_ID", $this->getPostVar() . "[answer][$i]");
305  $tpl->setVariable("MULTILINE_ROW_NUMBER", $i);
306  $tpl->setVariable("MULTILINE_POST_VAR", $this->getPostVar());
307  if ($this->getDisabled()) {
308  $tpl->setVariable("DISABLED_MULTILINE", " disabled=\"disabled\"");
309  }
310  $tpl->parseCurrentBlock();
311  }
312  if ($this->getAllowMove()) {
313  $tpl->setCurrentBlock("move");
314  $tpl->setVariable("CMD_UP", "cmd[up" . $this->getFieldId() . "][$i]");
315  $tpl->setVariable("CMD_DOWN", "cmd[down" . $this->getFieldId() . "][$i]");
316  $tpl->setVariable("ID", $this->getPostVar() . "[$i]");
317  $tpl->setVariable("UP_BUTTON", $this->renderer->render(
318  $this->glyph_factory->up()->withAction('#')
319  ));
320  $tpl->setVariable("DOWN_BUTTON", $this->renderer->render(
321  $this->glyph_factory->down()->withAction('#')
322  ));
323  $tpl->parseCurrentBlock();
324  }
325  $tpl->setCurrentBlock("row");
326  $tpl->setVariable("POST_VAR", $this->getPostVar());
327  $tpl->setVariable("ROW_NUMBER", $i);
328  $tpl->setVariable("ID", $this->getPostVar() . "[answer][$i]");
329  $tpl->setVariable("POINTS_ID", $this->getPostVar() . "[points][$i]");
330  if ($this->isAddRemoveAllowed()) {
331  $tpl->setVariable("ADD_REMOVE_ID", $this->getPostVar() . "[$i]");
332  $tpl->setVariable("CMD_ADD", "cmd[add" . $this->getFieldId() . "][$i]");
333  $tpl->setVariable("CMD_REMOVE", "cmd[remove" . $this->getFieldId() . "][$i]");
334  $tpl->setVariable("ADD_BUTTON", $this->renderer->render(
335  $this->glyph_factory->add()->withAction('#')
336  ));
337  $tpl->setVariable("REMOVE_BUTTON", $this->renderer->render(
338  $this->glyph_factory->remove()->withAction('#')
339  ));
340  }
341  if ($this->getDisabled()) {
342  $tpl->setVariable("DISABLED_POINTS", " disabled=\"disabled\"");
343  }
344  $tpl->parseCurrentBlock();
345  $i++;
346  }
347 
348  $tpl->setVariable("ELEMENT_ID", $this->getPostVar());
349  $tpl->setVariable("ANSWER_TEXT", $this->getTextInputLabel($this->lng));
350  $tpl->setVariable("POINTS_TEXT", $this->getPointsInputLabel($this->lng));
351  $tpl->setVariable("COMMANDS_TEXT", $this->lng->txt('actions'));
352 
353  $a_tpl->setCurrentBlock("prop_generic");
354  $a_tpl->setVariable("PROP_GENERIC", $tpl->get());
355  $a_tpl->parseCurrentBlock();
356 
357  global $DIC;
358  $tpl = $DIC['tpl'];
359  $tpl->addJavascript("assets/js/answerwizardinput.js");
360  $tpl->addJavascript("assets/js/answerwizard.js");
361  }
parseCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
renderer()
static prepareFormOutput($a_str, bool $a_strip=false)
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:544
global $DIC
Definition: shib_login.php:22
setCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
static prepareTextareaOutput(string $txt_output, bool $prepare_for_latex_output=false, bool $omitNl2BrWhenTextArea=false)
Prepares a string for a text area output where latex code may be in it If the text is HTML-free...
+ Here is the call graph for this function:

◆ isAddRemoveAllowed()

ilAnswerWizardInputGUI::isAddRemoveAllowed ( )
Returns
bool

Definition at line 171 of file class.ilAnswerWizardInputGUI.php.

References $allowAddRemove.

Referenced by insert().

171  : bool
172  {
173  return $this->allowAddRemove;
174  }
+ Here is the caller graph for this function:

◆ minvalueShouldBeGreater()

ilAnswerWizardInputGUI::minvalueShouldBeGreater ( )

Get minvalueShouldBeGreater.

Returns
boolean true if the minimum value should be greater than minvalue

Definition at line 199 of file class.ilAnswerWizardInputGUI.php.

References $minvalueShouldBeGreater.

Referenced by checkInput(), and setMinvalueShouldBeGreater().

199  : bool
200  {
202  }
+ Here is the caller graph for this function:

◆ prepareFormOutput()

ilAnswerWizardInputGUI::prepareFormOutput ( float|string  $input,
bool  $strip = false 
)
protected

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

References null, ILIAS\Repository\refinery(), and ilUtil\stripSlashes().

Referenced by ilAssAnswerCorrectionsInputGUI\insert().

389  : string
390  {
391  $input_string = $this->refinery->kindlyTo()->string()->transform($input);
392  return str_replace(
393  ['{', '}', '\\'],
394  ['&#123;', '&#125;', '&#92;'],
395  htmlspecialchars(
396  $strip ? ilUtil::stripSlashes($input_string) : $input_string,
397  ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401,
398  null,
399  false
400  )
401  );
402  }
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setAllowAddRemove()

ilAnswerWizardInputGUI::setAllowAddRemove (   $allowAddRemove)
Parameters
bool$allowAddRemove

Definition at line 179 of file class.ilAnswerWizardInputGUI.php.

References $allowAddRemove.

179  : void
180  {
181  $this->allowAddRemove = $allowAddRemove;
182  }

◆ setAllowMove()

ilAnswerWizardInputGUI::setAllowMove (   $a_allow_move)

Set allow move.

Parameters
boolean$a_allow_moveAllow move

Definition at line 153 of file class.ilAnswerWizardInputGUI.php.

153  : void
154  {
155  $this->allowMove = $a_allow_move;
156  }

◆ setMinValue()

ilAnswerWizardInputGUI::setMinValue (   $a_minvalue)

Set Minimum Value.

Parameters
float$a_minvalueMinimum Value

Definition at line 208 of file class.ilAnswerWizardInputGUI.php.

208  : void
209  {
210  $this->minvalue = $a_minvalue;
211  }

◆ setMinvalueShouldBeGreater()

ilAnswerWizardInputGUI::setMinvalueShouldBeGreater (   $a_bool)

Set minvalueShouldBeGreater.

Parameters
boolean$a_booltrue if the minimum value should be greater than minvalue

Definition at line 189 of file class.ilAnswerWizardInputGUI.php.

References minvalueShouldBeGreater().

189  : void
190  {
191  $this->minvalueShouldBeGreater = $a_bool;
192  }
minvalueShouldBeGreater()
Get minvalueShouldBeGreater.
+ Here is the call graph for this function:

◆ setQuestionObject()

ilAnswerWizardInputGUI::setQuestionObject (   $a_value)

Set question object.

Parameters
object$a_valuetest object

Definition at line 133 of file class.ilAnswerWizardInputGUI.php.

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

◆ setSingleline()

ilAnswerWizardInputGUI::setSingleline (   $a_value)

Set singleline.

Parameters
boolean$a_valueValue

Definition at line 113 of file class.ilAnswerWizardInputGUI.php.

113  : void
114  {
115  $this->singleline = $a_value;
116  }

◆ setValue()

ilAnswerWizardInputGUI::setValue (   $a_value)

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

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

64  : void
65  {
66  $this->values = [];
67 
68  $answers = $this->forms_helper->transformArray($a_value, 'answer', $this->refinery->kindlyTo()->string());
69  $images = $this->forms_helper->transformArray($a_value, 'imagename', $this->refinery->kindlyTo()->string());
70  $points = $this->forms_helper->transformPoints($a_value);
71 
72  foreach ($answers as $index => $value) {
73  $answer = new ASS_AnswerBinaryStateImage(
74  $value,
75  $points[$index] ?? 0.0,
76  $index,
77  true,
78  null,
79  -1
80  );
81  if ($this->forms_helper->inArray($images, $index)) {
82  $answer->setImage($images[$index]);
83  }
84  $this->values[] = $answer;
85  }
86  }
Class for answers with a binary state indicator.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:

◆ setValues()

ilAnswerWizardInputGUI::setValues (   $a_values)

Set Values.

Parameters
array$a_valueValue

Definition at line 93 of file class.ilAnswerWizardInputGUI.php.

93  : void
94  {
95  $this->values = $a_values;
96  }

Field Documentation

◆ $allowAddRemove

ilAnswerWizardInputGUI::$allowAddRemove = true
protected

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

Referenced by isAddRemoveAllowed(), and setAllowAddRemove().

◆ $allowMove

ilAnswerWizardInputGUI::$allowMove = false
protected

Definition at line 33 of file class.ilAnswerWizardInputGUI.php.

Referenced by getAllowMove().

◆ $forms_helper

ilTestLegacyFormsHelper ilAnswerWizardInputGUI::$forms_helper
protected

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

◆ $glyph_factory

GlyphFactory ilAnswerWizardInputGUI::$glyph_factory
protected

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

◆ $minvalue

ilAnswerWizardInputGUI::$minvalue = false
protected

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

Referenced by getMinValue().

◆ $minvalueShouldBeGreater

ilAnswerWizardInputGUI::$minvalueShouldBeGreater = false
protected

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

Referenced by minvalueShouldBeGreater().

◆ $qstObject

ilAnswerWizardInputGUI::$qstObject = null
protected

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

Referenced by getQuestionObject().

◆ $renderer

Renderer ilAnswerWizardInputGUI::$renderer
protected

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

◆ $singleline

ilAnswerWizardInputGUI::$singleline = true
protected

Definition at line 35 of file class.ilAnswerWizardInputGUI.php.

Referenced by getSingleline().

◆ $values

ilAnswerWizardInputGUI::$values = []
protected

Definition at line 32 of file class.ilAnswerWizardInputGUI.php.

Referenced by getValues().


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