ILIAS  trunk Revision v11.0_alpha-1715-g7fc467680fb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilAssErrorTextCorrectionsInputGUI Class Reference
+ Inheritance diagram for ilAssErrorTextCorrectionsInputGUI:
+ Collaboration diagram for ilAssErrorTextCorrectionsInputGUI:

Public Member Functions

 setValue ($a_value)
 
 checkInput ()
 
 insert (ilTemplate $a_tpl)
 
- Public Member Functions inherited from ilErrorTextWizardInputGUI
 __construct ($a_title="", $a_postvar="")
 Constructor. More...
 
 setValue ($a_value)
 
 setKeySize ($a_size)
 Set key size. More...
 
 getKeySize ()
 Get key size. More...
 
 setValueSize ($a_size)
 Set value size. More...
 
 getValueSize ()
 Get value size. More...
 
 setKeyMaxlength ($a_maxlength)
 Set key maxlength. More...
 
 getKeyMaxlength ()
 Get key maxlength. More...
 
 setValueMaxlength ($a_maxlength)
 Set value maxlength. More...
 
 getValueMaxlength ()
 Get value maxlength. More...
 
 setValueName ($a_name)
 Set value name. More...
 
 getValueName ()
 Get value name. More...
 
 setKeyName ($a_name)
 Set key name. More...
 
 getKeyName ()
 Get key name. More...
 
 setValues ($a_values)
 Set Values. More...
 
 getValues ()
 Get Values. More...
 
 checkInput ()
 Check input, strip slashes etc. More...
 
 insert (ilTemplate $a_tpl)
 Insert property html. More...
 
- 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...
 

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)
 
- Protected Attributes inherited from ilErrorTextWizardInputGUI
 $values = []
 
 $key_size = 20
 
 $value_size = 20
 
 $key_maxlength = 255
 
 $value_maxlength = 150
 
 $key_name = ""
 
 $value_name = ""
 
ilTestLegacyFormsHelper $forms_helper
 
- Protected Attributes inherited from ilTextInputGUI
 $value = null
 
int $maxlength = 200
 
int $size = 40
 
string $validationRegexp = ""
 
string $validationFailureMessage = ''
 
string $suffix = ""
 
string $style_css = ""
 
string $css_class = ""
 
string $ajax_datasource = ""
 
string $ajax_datasource_delimiter = null
 
bool $ajax_datasource_commit = false
 
string $ajax_datasource_commit_url = ""
 
bool $submit_form_on_enter = false
 
bool $autocomplete_disabled = false
 
string $input_type = ""
 
- Protected Attributes inherited from ilSubEnabledFormPropertyGUI
array $sub_items = array()
 
- Protected Attributes inherited from ilFormPropertyGUI
array $set_params = []
 
ilTable2GUI $parent_table = null
 
ilFormPropertyGUI $parent_gui = null
 
ilCtrl $ctrl
 
ilLanguage $lng
 
string $type = ""
 
string $title = ""
 
string $postvar = ""
 
string $info = ""
 
string $alert = ""
 
bool $required = false
 
ilPropertyFormGUI $parentform = null
 
string $hidden_title = ""
 
bool $multi = false
 
bool $multi_sortable = false
 
bool $multi_addremove = true
 
array $multi_values = []
 
RequestInterface $request
 
HTTP Services $http
 
Refinery Factory $refinery = null
 
bool $disabled = false
 
ilGlobalTemplateInterface $global_tpl = null
 

Detailed Description

Definition at line 27 of file class.ilAssErrorTextCorrectionsInputGUI.php.

Member Function Documentation

◆ checkInput()

ilAssErrorTextCorrectionsInputGUI::checkInput ( )

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

References $data, ilSubEnabledFormPropertyGUI\checkSubItemsInput(), ilFormPropertyGUI\getPostVar(), ilFormPropertyGUI\getRequired(), ILIAS\Repository\lng(), ilFormPropertyGUI\raw(), and ilFormPropertyGUI\setAlert().

36  : bool
37  {
38  $data = $this->raw($this->getPostVar());
39  $result = $this->forms_helper->checkPointsInput($data, $this->getRequired());
40 
41  if (!is_array($result)) {
42  $this->setAlert($this->lng->txt($result));
43  return false;
44  }
45 
46  foreach ($result as $points) {
47  if ($points < 0) {
48  $this->setAlert($this->lng->txt('positive_numbers_required'));
49  return false;
50  }
51  }
52 
53  return $this->checkSubItemsInput();
54  }
+ Here is the call graph for this function:

◆ insert()

ilAssErrorTextCorrectionsInputGUI::insert ( ilTemplate  $a_tpl)

Definition at line 56 of file class.ilAssErrorTextCorrectionsInputGUI.php.

References $DIC, ilFormPropertyGUI\$lng, ilTextInputGUI\$value, ilErrorTextWizardInputGUI\getKeyMaxlength(), ilErrorTextWizardInputGUI\getKeyName(), ilErrorTextWizardInputGUI\getKeySize(), ilFormPropertyGUI\getPostVar(), ilErrorTextWizardInputGUI\getValueMaxlength(), ilErrorTextWizardInputGUI\getValueName(), ilErrorTextWizardInputGUI\getValueSize(), ilTemplate\parseCurrentBlock(), ilLegacyFormElementsUtil\prepareFormOutput(), ilTemplate\setCurrentBlock(), HTML_Template_IT\setVariable(), and ilLanguage\txt().

56  : void
57  {
58  global $DIC;
59  $lng = $DIC['lng'];
60 
61  $tpl = new ilTemplate('tpl.prop_errortextcorrection_input.html', true, true, 'components/ILIAS/TestQuestionPool');
62  $i = 0;
63  foreach ($this->values as $value) {
64  $tpl->setCurrentBlock('prop_points_propval');
65  $tpl->setVariable('PROPERTY_VALUE', ilLegacyFormElementsUtil::prepareFormOutput($value->getPoints()));
66  $tpl->parseCurrentBlock();
67 
68  $tpl->setCurrentBlock('row');
69 
70  $tpl->setVariable('TEXT_WRONG', ilLegacyFormElementsUtil::prepareFormOutput($value->getTextWrong()));
71  $tpl->setVariable('TEXT_CORRECT', ilLegacyFormElementsUtil::prepareFormOutput($value->getTextCorrect()));
72 
73  $class = ($i % 2 === 0) ? 'even' : 'odd';
74  if ($i === 0) {
75  $class .= ' first';
76  }
77  if ($i === count($this->values) - 1) {
78  $class .= ' last';
79  }
80  $tpl->setVariable('ROW_CLASS', $class);
81  $tpl->setVariable('ROW_NUMBER', $i);
82 
83  $tpl->setVariable('KEY_SIZE', $this->getKeySize());
84  $tpl->setVariable('KEY_ID', $this->getPostVar() . "[key][$i]");
85  $tpl->setVariable('KEY_MAXLENGTH', $this->getKeyMaxlength());
86 
87  $tpl->setVariable('VALUE_SIZE', $this->getValueSize());
88  $tpl->setVariable('VALUE_ID', $this->getPostVar() . "[value][$i]");
89  $tpl->setVariable('VALUE_MAXLENGTH', $this->getValueMaxlength());
90 
91  $tpl->setVariable('POST_VAR', $this->getPostVar());
92 
93  $tpl->parseCurrentBlock();
94 
95  $i++;
96  }
97  $tpl->setVariable('ELEMENT_ID', $this->getPostVar());
98  $tpl->setVariable('KEY_TEXT', $this->getKeyName());
99  $tpl->setVariable('VALUE_TEXT', $this->getValueName());
100  $tpl->setVariable('POINTS_TEXT', $lng->txt('points'));
101 
102  $a_tpl->setCurrentBlock('prop_generic');
103  $a_tpl->setVariable('PROP_GENERIC', $tpl->get());
104  $a_tpl->parseCurrentBlock();
105  }
parseCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static 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)
+ Here is the call graph for this function:

◆ setValue()

ilAssErrorTextCorrectionsInputGUI::setValue (   $a_value)

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

29  : void
30  {
31  foreach ($this->forms_helper->transformPoints($a_value) as $index => $points) {
32  $this->values[$index] = $this->values[$index]->withPoints($points);
33  }
34  }

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