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

Public Member Functions

 setValue ($a_value)
 
 checkInput ()
 
 insert (ilTemplate $a_tpl)
 
- Public Member Functions inherited from ilSingleChoiceWizardInputGUI
 __construct ($a_title='', $a_postvar='')
 Constructor. More...
 
 setValue ($a_value)
 
 setValueByArray (array $a_values)
 
 setSuffixes ($a_suffixes)
 Set Accepted Suffixes. More...
 
 setHideImages ($a_hide)
 Set hide images. More...
 
 getSuffixes ()
 Get Accepted Suffixes. More...
 
 setShowPoints ($a_value)
 
 getShowPoints ()
 
 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...
 
 setPending (string $val)
 
 checkInput ()
 
 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 Attributes

 $qstObject
 
- Protected Attributes inherited from ilSingleChoiceWizardInputGUI
 $values = []
 
 $allowMove = false
 
 $singleline = true
 
 $qstObject = null
 
 $suffixes = []
 
 $showPoints = true
 
 $hideImages = false
 
ilTestLegacyFormsHelper $forms_helper
 
GlyphFactory $glyph_factory
 
Renderer $renderer
 
UploadLimitResolver $upload_limit
 
- 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...
 
- Protected Member Functions inherited from ilSingleChoiceWizardInputGUI
 checkAnswersInput (array $data)
 Checks the input of the answers and returns the answers as an array if the input is valid or a string with the error message if the input is invalid. 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

Member Function Documentation

◆ checkInput()

ilAssSingleChoiceCorrectionsInputGUI::checkInput ( )

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

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

41  : bool
42  {
43  $data = $this->raw($this->getPostVar());
44 
45  $result = $this->forms_helper->checkPointsInputEnoughPositive($data, $this->getRequired());
46  if (!is_array($result)) {
47  $this->setAlert($this->lng->txt($result));
48  return false;
49  }
50 
51  return $this->checkSubItemsInput();
52  }
+ Here is the call graph for this function:

◆ insert()

ilAssSingleChoiceCorrectionsInputGUI::insert ( ilTemplate  $a_tpl)

Definition at line 54 of file class.ilAssSingleChoiceCorrectionsInputGUI.php.

References $DIC, ilFormPropertyGUI\$lng, ilTextInputGUI\$value, ilFileUtils\getFileSizeInfo(), ilFormPropertyGUI\getPostVar(), ilSingleChoiceWizardInputGUI\getSingleline(), null, ilTemplate\parseCurrentBlock(), ilLegacyFormElementsUtil\prepareFormOutput(), ilTemplate\setCurrentBlock(), HTML_Template_IT\setVariable(), and ilLanguage\txt().

54  : void
55  {
56  global $DIC; /* @var ILIAS\DI\Container $DIC */
57  $lng = $DIC->language();
58 
59  $tpl = new ilTemplate('tpl.prop_singlechoicecorrection_input.html', true, true, 'components/ILIAS/TestQuestionPool');
60 
61  if ($this->values === null) {
62  $this->values = $this->value;
63  }
64 
65  foreach ($this->values as $value) {
66  if ($this->qstObject->isSingleline()) {
67  if ($value->hasImage()) {
68  $imagename = $this->qstObject->getImagePathWeb() . $value->getImage();
69  if (($this->getSingleline()) && ($this->qstObject->getThumbSize())) {
70  if (@file_exists($this->qstObject->getImagePath() . $this->qstObject->getThumbPrefix() . $value->getImage())) {
71  $imagename = $this->qstObject->getImagePathWeb() . $this->qstObject->getThumbPrefix() . $value->getImage();
72  }
73  }
74 
75  $tpl->setCurrentBlock('image');
76  $tpl->setVariable('SRC_IMAGE', $imagename);
77  $tpl->setVariable('IMAGE_NAME', $value->getImage());
78  $tpl->setVariable('ALT_IMAGE', ilLegacyFormElementsUtil::prepareFormOutput($value->getAnswertext()));
79  $tpl->parseCurrentBlock();
80  } else {
81  $tpl->setCurrentBlock('image');
82  $tpl->touchBlock('image');
83  $tpl->parseCurrentBlock();
84  }
85  }
86 
87  $tpl->setCurrentBlock('answer');
88  $tpl->setVariable('ANSWER', $value->getAnswertext());
89  $tpl->parseCurrentBlock();
90 
91  $tpl->setCurrentBlock('prop_points_propval');
92  $tpl->setVariable('POINTS_POST_VAR', $this->getPostVar());
93  $tpl->setVariable('PROPERTY_VALUE', ilLegacyFormElementsUtil::prepareFormOutput($value->getPoints()));
94  $tpl->parseCurrentBlock();
95 
96  $tpl->setCurrentBlock('row');
97  $tpl->parseCurrentBlock();
98  }
99 
100  if ($this->qstObject->isSingleline()) {
101  $tpl->setCurrentBlock('image_heading');
102  $tpl->setVariable('ANSWER_IMAGE', $lng->txt('answer_image'));
103  $tpl->setVariable('TXT_MAX_SIZE', ilFileUtils::getFileSizeInfo());
104  $tpl->parseCurrentBlock();
105  }
106 
107  $tpl->setCurrentBlock('points_heading');
108  $tpl->setVariable('POINTS_TEXT', $lng->txt('points'));
109  $tpl->parseCurrentBlock();
110 
111  $tpl->setVariable('ELEMENT_ID', $this->getPostVar());
112  $tpl->setVariable('ANSWER_TEXT', $lng->txt('answer_text'));
113 
114  $a_tpl->setCurrentBlock('prop_generic');
115  $a_tpl->setVariable('PROP_GENERIC', $tpl->get());
116  $a_tpl->parseCurrentBlock();
117  }
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)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:544
global $DIC
Definition: shib_login.php:22
static getFileSizeInfo()
setCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
+ Here is the call graph for this function:

◆ setValue()

ilAssSingleChoiceCorrectionsInputGUI::setValue (   $a_value)

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

References ilTextInputGUI\$value.

34  : void
35  {
36  foreach ($this->forms_helper->transformPoints($a_value) as $index => $value) {
37  $this->values[$index]->setPoints($value);
38  }
39  }

Field Documentation

◆ $qstObject

ilAssSingleChoiceCorrectionsInputGUI::$qstObject
protected

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