ILIAS  release_7 Revision v7.30-3-g800a261c036
ilAssMatchingPairCorrectionsInputGUI Class Reference
+ Inheritance diagram for ilAssMatchingPairCorrectionsInputGUI:
+ Collaboration diagram for ilAssMatchingPairCorrectionsInputGUI:

Public Member Functions

 getPairs ()
 
 setValue ($a_value)
 Set Value. More...
 
 checkInput ()
 Check input, strip slashes etc. More...
 
 insert ($a_tpl)
 Insert property html. More...
 
- Public Member Functions inherited from ilMatchingPairWizardInputGUI
 __construct ($a_title="", $a_postvar="")
 Constructor. More...
 
 setValue ($a_value)
 Set Value. More...
 
 setTerms ($a_terms)
 Set terms. More...
 
 setDefinitions ($a_definitions)
 Set definitions. More...
 
 setPairs ($a_pairs)
 Set pairs. 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...
 
 stripSlashesAddSpaceFallback ($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...
 
- 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...
 

Additional Inherited Members

- Static Public Member Functions inherited from ilFormPropertyGUI
static removeProhibitedCharacters ($a_text)
 Remove prohibited characters see #19159. More...
 
- Protected Member Functions inherited from ilFormPropertyGUI
 setType ($a_type)
 Set Type. More...
 
 getMultiIconsHTML ()
 Get HTML for multiple value icons. More...
 
- Protected Attributes inherited from ilMatchingPairWizardInputGUI
 $pairs = array()
 
 $allowMove = false
 
 $terms = array()
 
 $definitions = array()
 
- 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
 $ctrl
 
 $lng
 
 $type
 
 $title
 
 $postvar
 
 $info
 
 $alert
 
 $required = false
 
 $parentgui
 
 $parentform
 
 $hidden_title = ""
 
 $multi = false
 
 $multi_sortable = false
 
 $multi_addremove = true
 
 $multi_values
 

Detailed Description

Member Function Documentation

◆ checkInput()

ilAssMatchingPairCorrectionsInputGUI::checkInput ( )

Check input, strip slashes etc.

set alert, if input is not ok.

Returns
boolean Input ok, true/false

Reimplemented from ilMatchingPairWizardInputGUI.

Definition at line 31 of file class.ilAssMatchingPairCorrectionsInputGUI.php.

32 {
33 global $DIC;
34 $lng = $DIC['lng'];
35
36 if (is_array($_POST[$this->getPostVar()])) {
38 }
39 $foundvalues = $_POST[$this->getPostVar()];
40 if (is_array($foundvalues)) {
41 $max = 0;
42 foreach ($foundvalues['points'] as $val) {
43 if ($val > 0) {
44 $max += $val;
45 }
46 if ($this->getRequired() && (strlen($val)) == 0) {
47 $this->setAlert($lng->txt("msg_input_is_required"));
48 return false;
49 }
50 }
51 if ($max <= 0) {
52 $this->setAlert($lng->txt("enter_enough_positive_points"));
53 return false;
54 }
55 } else {
56 if ($this->getRequired()) {
57 $this->setAlert($lng->txt("msg_input_is_required"));
58 return false;
59 }
60 }
61
62 return $this->checkSubItemsInput();
63 }
$_POST["username"]
getPostVar()
Get Post Variable.
setAlert($a_alert)
Set Alert Text.
static stripSlashesRecursive($a_data, $a_strip_html=true, $a_allow="")
Strip slashes from array and sub-arrays.
global $DIC
Definition: goto.php:24

References $_POST, $DIC, ilFormPropertyGUI\$lng, ilSubEnabledFormPropertyGUI\checkSubItemsInput(), ilFormPropertyGUI\getPostVar(), ilFormPropertyGUI\getRequired(), ilFormPropertyGUI\setAlert(), and ilUtil\stripSlashesRecursive().

+ Here is the call graph for this function:

◆ getPairs()

ilAssMatchingPairCorrectionsInputGUI::getPairs ( )

◆ insert()

ilAssMatchingPairCorrectionsInputGUI::insert (   $a_tpl)

Insert property html.

Returns
int Size

Reimplemented from ilMatchingPairWizardInputGUI.

Definition at line 65 of file class.ilAssMatchingPairCorrectionsInputGUI.php.

66 {
67 global $DIC;
68 $lng = $DIC['lng'];
69
70 $tpl = new ilTemplate("tpl.prop_matchingpaircorrection_input.html", true, true, "Modules/TestQuestionPool");
71 $i = 0;
72
73 foreach ($this->pairs as $pair) {
74 $tpl->setCurrentBlock("row");
75
76 foreach ($this->terms as $term) {
77 if ($pair->term->identifier == $term->identifier) {
78 $tpl->setVariable('TERM', $term->text);
79 }
80 }
81 foreach ($this->definitions as $definition) {
82 if ($pair->definition->identifier == $definition->identifier) {
83 $tpl->setVariable('DEFINITION', $definition->text);
84 }
85 }
86
87 $tpl->setVariable('POINTS_VALUE', $pair->points);
88 $tpl->setVariable("ROW_NUMBER", $i);
89
90 $tpl->setVariable("ID", $this->getPostVar() . "[$i]");
91 $tpl->setVariable("POST_VAR", $this->getPostVar());
92
93 $tpl->parseCurrentBlock();
94
95 $i++;
96 }
97
98 $tpl->setCurrentBlock('term_ids');
99 $ids = array();
100 foreach ($this->terms as $term) {
101 array_push($ids, $term->identifier);
102 }
103 $tpl->setVariable("POST_VAR", $this->getPostVar());
104 $tpl->setVariable("TERM_IDS", join(",", $ids));
105 $tpl->parseCurrentBlock();
106
107 $tpl->setCurrentBlock('definition_ids');
108 $ids = array();
109 foreach ($this->definitions as $definition) {
110 array_push($ids, $definition->identifier);
111 }
112 $tpl->setVariable("POST_VAR", $this->getPostVar());
113 $tpl->setVariable("DEFINITION_IDS", join(",", $ids));
114 $tpl->parseCurrentBlock();
115
116 $tpl->setVariable("ELEMENT_ID", $this->getPostVar());
117 $tpl->setVariable("TEXT_POINTS", $lng->txt('points'));
118 $tpl->setVariable("TEXT_DEFINITION", $lng->txt('definition'));
119 $tpl->setVariable("TEXT_TERM", $lng->txt('term'));
120 $tpl->setVariable("TEXT_ACTIONS", $lng->txt('actions'));
121
122 $a_tpl->setCurrentBlock("prop_generic");
123 $a_tpl->setVariable("PROP_GENERIC", $tpl->get());
124 $a_tpl->parseCurrentBlock();
125 }
special template class to simplify handling of ITX/PEAR
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
Definition: latex.php:41
$i
Definition: metadata.php:24

References $DIC, $i, ilFormPropertyGUI\$lng, $tpl, and ilFormPropertyGUI\getPostVar().

+ Here is the call graph for this function:

◆ setValue()

ilAssMatchingPairCorrectionsInputGUI::setValue (   $a_value)

Set Value.

Parameters
string$a_valueValue

Reimplemented from ilMatchingPairWizardInputGUI.

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

21 {
22 if (is_array($a_value)) {
23 if (is_array($a_value['points'])) {
24 foreach ($a_value['points'] as $idx => $term) {
25 $this->pairs[$idx]->points = $a_value['points'][$idx];
26 }
27 }
28 }
29 }

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