ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilRandomTestROInputGUI Class Reference

This class represents a random test input property in a property form. More...

+ Inheritance diagram for ilRandomTestROInputGUI:
+ Collaboration diagram for ilRandomTestROInputGUI:

Public Member Functions

 __construct ($a_title="", $a_postvar="")
 Constructor. More...
 
 setValue ($a_value)
 Set Value. More...
 
 setValueByArray ($a_values)
 
 setValues ($a_values)
 Set Values. More...
 
 getValues ()
 Get Values. More...
 
 checkInput ()
 Check input, strip slashes etc. More...
 
 insert (&$a_tpl)
 Insert property html. More...
 
- 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...
 

Protected Attributes

 $values = array()
 
- 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
 

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

Detailed Description

This class represents a random test input property in a property form.

Author
Helmut Schottmüller ilias.nosp@m.@aur.nosp@m.ealis.nosp@m..de
Version
$Id$

Definition at line 11 of file class.ilRandomTestROInputGUI.php.

Constructor & Destructor Documentation

◆ __construct()

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

Constructor.

Parameters
string$a_titleTitle
string$a_postvarPost Variable

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

References ilFormPropertyGUI\setRequired().

22  {
23  parent::__construct($a_title, $a_postvar);
24  $this->setRequired(true);
25  }
setRequired($a_required)
Set Required.
+ Here is the call graph for this function:

Member Function Documentation

◆ checkInput()

ilRandomTestROInputGUI::checkInput ( )

Check input, strip slashes etc.

set alert, if input is not ok.

Returns
boolean Input ok, true/false

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

References ilSubEnabledFormPropertyGUI\checkSubItemsInput().

66  {
67  return $this->checkSubItemsInput();
68  }
+ Here is the call graph for this function:

◆ getValues()

ilRandomTestROInputGUI::getValues ( )

Get Values.

Returns
array Values

Definition at line 55 of file class.ilRandomTestROInputGUI.php.

References $values.

◆ insert()

ilRandomTestROInputGUI::insert ( $a_tpl)

Insert property html.

Returns
int Size

Definition at line 75 of file class.ilRandomTestROInputGUI.php.

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

76  {
77  global $DIC;
78  $lng = $DIC['lng'];
79 
80  $tpl = new ilTemplate("tpl.prop_randomtestroinput.html", true, true, "Modules/Test");
81  $i = 0;
82  foreach ($this->values as $value) {
83  if ($value['num_of_q'] > 0) {
84  $tpl->setCurrentBlock("num_of_q");
85  $tpl->setVariable("NUM_OF_Q", $value['num_of_q']);
86  $tpl->setVariable("TEXT_FROM", $lng->txt('questions_from'));
87  $tpl->parseCurrentBlock();
88  }
89  $tpl->setCurrentBlock("row");
90  $class = ($i % 2 == 0) ? "even" : "odd";
91  if ($i == 0) {
92  $class .= " first";
93  }
94  if ($i == count($this->values) - 1) {
95  $class .= " last";
96  }
97  $tpl->setVariable("ROW_CLASS", $class);
98  $tpl->setVariable("QPL_VALUE", ilUtil::prepareFormOutput($value['title']));
99  $tpl->setVariable("COUNT_VALUE", "(" . $value['count'] . " " . $lng->txt('assQuestions') . ")");
100  $tpl->parseCurrentBlock();
101  $i++;
102  }
103  $tpl->setVariable("ELEMENT_ID", $this->getPostVar());
104 
105  $a_tpl->setCurrentBlock("prop_generic");
106  $a_tpl->setVariable("PROP_GENERIC", $tpl->get());
107  $a_tpl->parseCurrentBlock();
108  }
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
global $DIC
Definition: saml.php:7
$tpl
Definition: ilias.php:10
getPostVar()
Get Post Variable.
special template class to simplify handling of ITX/PEAR
$i
Definition: disco.tpl.php:19
+ Here is the call graph for this function:

◆ setValue()

ilRandomTestROInputGUI::setValue (   $a_value)

Set Value.

Parameters
string$a_valueValue

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

33  {
34  }

◆ setValueByArray()

ilRandomTestROInputGUI::setValueByArray (   $a_values)

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

37  {
38  }

◆ setValues()

ilRandomTestROInputGUI::setValues (   $a_values)

Set Values.

Parameters
array$a_valueValue

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

46  {
47  $this->values = $a_values;
48  }

Field Documentation

◆ $values

ilRandomTestROInputGUI::$values = array()
protected

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

Referenced by getValues().


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