ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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 (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)
 Get item by post var. More...
 
- 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...
 

Protected Attributes

 $values = []
 
- 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...
 
- 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)
 

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 28 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 38 of file class.ilRandomTestROInputGUI.php.

39 {
40 parent::__construct($a_title, $a_postvar);
41 $this->setRequired(true);
42 }
setRequired(bool $a_required)
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References ILIAS\GlobalScreen\Provider\__construct(), and ilFormPropertyGUI\setRequired().

+ 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

Reimplemented from ilFormPropertyGUI.

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

81 : bool
82 {
83 return $this->checkSubItemsInput();
84 }

References ilSubEnabledFormPropertyGUI\checkSubItemsInput().

+ Here is the call graph for this function:

◆ getValues()

ilRandomTestROInputGUI::getValues ( )

Get Values.

Returns
array Values

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

72 : array
73 {
74 return $this->values;
75 }

References $values.

◆ insert()

ilRandomTestROInputGUI::insert (   $a_tpl)

Insert property html.

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

90 {
91 $tpl = new ilTemplate("tpl.prop_randomtestroinput.html", true, true, "components/ILIAS/Test");
92 $i = 0;
93 foreach ($this->values as $value) {
94 if ($value['num_of_q'] > 0) {
95 $tpl->setCurrentBlock("num_of_q");
96 $tpl->setVariable("NUM_OF_Q", $value['num_of_q']);
97 $tpl->setVariable("TEXT_FROM", $this->lng->txt('questions_from'));
98 $tpl->parseCurrentBlock();
99 }
100 $tpl->setCurrentBlock("row");
101 $class = ($i % 2 == 0) ? "even" : "odd";
102 if ($i == 0) {
103 $class .= " first";
104 }
105 if ($i == count($this->values) - 1) {
106 $class .= " last";
107 }
108 $tpl->setVariable("ROW_CLASS", $class);
109 $tpl->setVariable("QPL_VALUE", ilLegacyFormElementsUtil::prepareFormOutput($value['title']));
110 $tpl->setVariable("COUNT_VALUE", "(" . $value['count'] . " " . $this->lng->txt('assQuestions') . ")");
111 $tpl->parseCurrentBlock();
112 $i++;
113 }
114 $tpl->setVariable("ELEMENT_ID", $this->getPostVar());
115
116 $a_tpl->setCurrentBlock("prop_generic");
117 $a_tpl->setVariable("PROP_GENERIC", $tpl->get());
118 $a_tpl->parseCurrentBlock();
119 }
static prepareFormOutput($a_str, bool $a_strip=false)
special template class to simplify handling of ITX/PEAR

References ilFormPropertyGUI\getPostVar(), ILIAS\Repository\lng(), and ilLegacyFormElementsUtil\prepareFormOutput().

+ Here is the call graph for this function:

◆ setValue()

ilRandomTestROInputGUI::setValue (   $a_value)

Set Value.

Parameters
string$a_valueValue

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

50 {
51 }

◆ setValueByArray()

ilRandomTestROInputGUI::setValueByArray (   $a_values)

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

54 {
55 }

◆ setValues()

ilRandomTestROInputGUI::setValues (   $a_values)

Set Values.

Parameters
array$a_valueValue

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

63 {
64 $this->values = $a_values;
65 }

Field Documentation

◆ $values

ilRandomTestROInputGUI::$values = []
protected

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

Referenced by getValues().


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