ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilAssNestedOrderingElementsInputGUI Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilAssNestedOrderingElementsInputGUI:
+ Collaboration diagram for ilAssNestedOrderingElementsInputGUI:

Public Member Functions

 __construct (ilAssOrderingFormValuesObjectsConverter $converter, $postVar)
 
 setInteractionEnabled (bool $interaction_enabled)
 
 setNestingEnabled (bool $nesting_enabled)
 
 setStylingDisabled (bool $styling_disabled)
 
 setElementList (ilAssOrderingElementList $elementList)
 
 getElementList (int $questionId)
 
 prepareReprintable (assQuestion $question)
 
 getContext ()
 
 setContext (string $context)
 
 getUniquePrefix ()
 
 setUniquePrefix (int $unique_prefix)
 
 setOrderingType (int $ordering_type)
 
 getOrderingType ()
 
 setElementImagePath (string $element_image_path)
 
 getElementImagePath ()
 
 setThumbPrefix (string $thumbnail_filename_prefix)
 
 getThumbPrefix ()
 
 setShowCorrectnessIconsEnabled (bool $show_correctness_icons_enabled)
 
 isShowCorrectnessIconsEnabled ()
 
 getCorrectnessTrueElementList ()
 
 setCorrectnessTrueElementList (ilAssOrderingElementList $correctness_true_element_list)
 
 isPostSubmit ($data)
 
 render (string $a_mode='')
 
 onCheckInput ()
 
 getHTML ()
 
- Public Member Functions inherited from ilIdentifiedMultiValuesInputGUI
 __construct ($a_title="", $a_postvar="")
 
 getElementAddCmd ()
 
 setElementAddCmd (string $element_add_cmd)
 
 getElementRemoveCmd ()
 
 setElementRemoveCmd (string $element_remove_cmd)
 
 getElementMoveUpCommand ()
 
 setElementMoveUpCommand (string $element_move_up_cmd)
 
 getElementMoveDownCommand ()
 
 setElementMoveDownCommand (string $element_move_down_cmd)
 
 setValues ($values)
 
 getValues ()
 
 setValue ($value)
 
 getValue ()
 
 setMultiValues (array $values)
 
 getMultiValues ()
 
 setIdentifiedMultiValues ($values)
 
 getIdentifiedMultiValues ()
 
 setValueByArray (array $a_values)
 
 getInput ()
 
 checkInput ()
 Check input, strip slashes etc. More...
 
 onCheckInput ()
 
 prepareReprintable (assQuestion $question)
 
- 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 ()
 Check input, strip slashes etc. More...
 
 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)
 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...
 
- 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...
 

Data Fields

const CONTEXT_QUESTION_PREVIEW = 'QuestionPreview'
 
const CONTEXT_CORRECT_SOLUTION_PRESENTATION = 'CorrectSolutionPresent'
 
const CONTEXT_USER_SOLUTION_PRESENTATION = 'UserSolutionPresent'
 
const CONTEXT_USER_SOLUTION_SUBMISSION = 'UserSolutionSubmit'
 
- Data Fields inherited from ilIdentifiedMultiValuesInputGUI
const ELEMENT_DEFAULT_ADD_CMD = 'addElement'
 
const ELEMENT_DEFAULT_REMOVE_CMD = 'removeElement'
 
const ELEMENT_DEFAULT_MOVE_UP_CMD = 'moveUpElement'
 
const ELEMENT_DEFAULT_MOVE_DOWN_CMD = 'moveDownElement'
 

Private Member Functions

 getGlobalTpl ()
 
 initListTemplate ()
 
 getCorrectness (int $identifier)
 
 getCorrectnessIcon ($correctness)
 
 getItemTemplate ()
 
 getThumbnailFilename ($element)
 
 getThumbnailSource ($element)
 
 getItemHtml (array $element, string $identifier, string $content_post_var, string $position_post_var, string $indentation_post_var)
 
 renderListItem (array $value, string $identifier, string $children)
 
 renderMainList ()
 
 addIdentifierToValues (array $values)
 
 buildHierarchicalTreeFromDBValues (array $values)
 
 buildHTMLView (array $array, \Closure $sort_closure)
 
 initializePlayerJS ()
 

Private Attributes

const POSTVAR_CONTENT = 'content'
 
const POSTVAR_POSITION = 'position'
 
const POSTVAR_INDENTATION = 'indentation'
 
const DEFAULT_THUMBNAIL_PREFIX = 'thumb.'
 
string $context = null
 
int $unique_prefix = null
 
int $ordering_type = null
 
string $thumbnail_filename_prefix = self::DEFAULT_THUMBNAIL_PREFIX
 
string $element_image_path = null
 
bool $show_correctness_icons_enabled = false
 
ilAssOrderingElementList $correctness_true_element_list = null
 
bool $interaction_enabled = true
 
bool $nesting_enabled = true
 
bool $styling_disabled = false
 
ilTemplate $list_tpl = null
 
UIFactory $ui_factory
 
UIRenderer $ui_renderer
 

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 ilIdentifiedMultiValuesInputGUI
 getMultiValueSubFieldId ($identifier, $sub_field_index)
 
 getMultiValuePosIndexedFieldId ($identifier, $position_index)
 
 getMultiValuePosIndexedSubFieldId ($identifier, $sub_field_index, $position_index)
 
 getFieldIdFromPostVar ($temp_post_var)
 
 getPostVarSubField ($sub_field_index)
 
 getMultiValuePostVarSubField ($identifier, $sub_field_index)
 
 getMultiValuePostVarSubFieldPosIndexed ($identifier, $sub_field_index, $position_index)
 
 getMultiValuePostVarPosIndexed ($identifier, $positionIndex)
 
 getMultiValuePostVar ($identifier)
 
 buildMultiValueSubmitVar ($identifier, $position_index, $submit_cmd)
 
 setIdentifiedMultiValuesByArray ($a_values)
 
 prepareMultiValuesInput ($values)
 
 prepareMultiValuesSubmit ($values)
 
 getFormValuesManipulators ()
 
 addFormValuesManipulator (ilFormValuesManipulator $manipulator)
 
 getSubFieldCompletedPostVar ($subFieldIndex, $elem_post_var)
 
- 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 ilIdentifiedMultiValuesInputGUI
string $element_add_cmd = self::ELEMENT_DEFAULT_ADD_CMD
 
string $element_remove_cmd = self::ELEMENT_DEFAULT_REMOVE_CMD
 
string $element_move_up_cmd = self::ELEMENT_DEFAULT_MOVE_UP_CMD
 
string $element_move_down_cmd = self::ELEMENT_DEFAULT_MOVE_DOWN_CMD
 
 $identified_multi_values = []
 
 $formValuesManipulationChain = []
 
- 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

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning

Definition at line 22 of file class.ilAssNestedOrderingElementsInputGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilAssNestedOrderingElementsInputGUI::__construct ( ilAssOrderingFormValuesObjectsConverter  $converter,
  $postVar 
)

Definition at line 50 of file class.ilAssNestedOrderingElementsInputGUI.php.

51 {
52 global $DIC;
53 $this->ui_factory = $DIC['ui.factory'];
54 $this->ui_renderer = $DIC['ui.renderer'];
55 $manipulator = new ilAssOrderingDefaultElementFallback();
56 $this->addFormValuesManipulator($manipulator);
57
58 parent::__construct('', $postVar);
59
60 $this->addFormValuesManipulator($converter);
61 }
addFormValuesManipulator(ilFormValuesManipulator $manipulator)
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), and ilIdentifiedMultiValuesInputGUI\addFormValuesManipulator().

+ Here is the call graph for this function:

Member Function Documentation

◆ addIdentifierToValues()

ilAssNestedOrderingElementsInputGUI::addIdentifierToValues ( array  $values)
private

Definition at line 326 of file class.ilAssNestedOrderingElementsInputGUI.php.

326 : array
327 {
328 foreach (array_keys($values) as $k) {
329 $values[$k]['identifier'] = str_replace(assOrderingQuestionGUI::F_NESTED_IDENTIFIER_PREFIX, '', $k);
330 }
331 return $values;
332 }

References assOrderingQuestionGUI\F_NESTED_IDENTIFIER_PREFIX.

◆ buildHierarchicalTreeFromDBValues()

ilAssNestedOrderingElementsInputGUI::buildHierarchicalTreeFromDBValues ( array  $values)
private

Definition at line 334 of file class.ilAssNestedOrderingElementsInputGUI.php.

334 : array
335 {
336 $values_with_parent = [];
337 $levels_array = [];
338 foreach ($values as $k => $v) {
339 $v['parent'] = null;
340 $v['children'] = [];
341
342 if ($v['ordering_indentation'] > 0) {
343 $v['parent'] = $levels_array[$v['ordering_indentation'] - 1];
344 }
345 $levels_array[$v['ordering_indentation']] = $k;
346 $values_with_parent[$k] = $v;
347 }
348
349 uasort(
350 $values_with_parent,
351 static fn(array $a, array $b): int => $b['ordering_indentation'] - $a['ordering_indentation']
352 );
353
354 foreach (array_keys($values_with_parent) as $k) {
355 $v = $values_with_parent[$k];
356 if ($v['parent'] !== null) {
357 $values_with_parent[$v['parent']]['children'][$k] = $v;
358 }
359 }
360
361 return array_filter(
362 $values_with_parent,
363 static fn(array $v): bool => $v['ordering_indentation'] === 0
364 );
365 }
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples

References Vendor\Package\$a, and Vendor\Package\$b.

◆ buildHTMLView()

ilAssNestedOrderingElementsInputGUI::buildHTMLView ( array  $array,
\Closure  $sort_closure 
)
private

Definition at line 367 of file class.ilAssNestedOrderingElementsInputGUI.php.

367 : string
368 {
369 usort($array, $sort_closure);
370 return array_reduce(
371 $array,
372 function (string $c, array $v) use ($sort_closure): string {
373 $children = '';
374 if ($this->nesting_enabled && $v['children'] !== []) {
375 $children = $this->buildHTMLView($v['children'], $sort_closure);
376 }
377 $c .= $this->renderListItem($v, $v['identifier'], $children);
378 return $c;
379 },
380 ''
381 );
382 }
renderListItem(array $value, string $identifier, string $children)
$c
Definition: deliver.php:25

References $c.

◆ getContext()

ilAssNestedOrderingElementsInputGUI::getContext ( )

Definition at line 109 of file class.ilAssNestedOrderingElementsInputGUI.php.

References $context.

◆ getCorrectness()

ilAssNestedOrderingElementsInputGUI::getCorrectness ( int  $identifier)
private

Definition at line 179 of file class.ilAssNestedOrderingElementsInputGUI.php.

179 : bool
180 {
181 return $this->getCorrectnessTrueElementList()->elementExistByRandomIdentifier($identifier);
182 }

References getCorrectnessTrueElementList().

+ Here is the call graph for this function:

◆ getCorrectnessIcon()

ilAssNestedOrderingElementsInputGUI::getCorrectnessIcon (   $correctness)
private

Definition at line 184 of file class.ilAssNestedOrderingElementsInputGUI.php.

184 : string
185 {
186 $icon_name = 'standard/icon_not_ok.svg';
187 $label = $this->lng->txt("answer_is_wrong");
188 if ($correctness === 'correct') {
189 $icon_name = 'standard/icon_ok.svg';
190 $label = $this->lng->txt("answer_is_right");
191 }
192 $path = ilUtil::getImagePath($icon_name);
193 $icon = $this->ui_factory->symbol()->icon()->custom(
194 $path,
195 $label
196 );
197 return $this->ui_renderer->render($icon);
198 }
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
$path
Definition: ltiservices.php:30

References $path, ilUtil\getImagePath(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getCorrectnessTrueElementList()

ilAssNestedOrderingElementsInputGUI::getCorrectnessTrueElementList ( )

◆ getElementImagePath()

ilAssNestedOrderingElementsInputGUI::getElementImagePath ( )

Definition at line 144 of file class.ilAssNestedOrderingElementsInputGUI.php.

References $element_image_path.

Referenced by getThumbnailSource().

+ Here is the caller graph for this function:

◆ getElementList()

ilAssNestedOrderingElementsInputGUI::getElementList ( int  $questionId)

Definition at line 93 of file class.ilAssNestedOrderingElementsInputGUI.php.

References ilAssOrderingElementList\buildInstance(), and ilIdentifiedMultiValuesInputGUI\getIdentifiedMultiValues().

Referenced by prepareReprintable().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getGlobalTpl()

ilAssNestedOrderingElementsInputGUI::getGlobalTpl ( )
private

Definition at line 78 of file class.ilAssNestedOrderingElementsInputGUI.php.

79 {
80 return isset($GLOBALS['DIC']) ? $GLOBALS['DIC']['tpl'] : $GLOBALS['tpl'];
81 }
$GLOBALS["DIC"]
Definition: wac.php:54

References $GLOBALS.

◆ getHTML()

ilAssNestedOrderingElementsInputGUI::getHTML ( )

Definition at line 402 of file class.ilAssNestedOrderingElementsInputGUI.php.

402 : string
403 {
404 return $this->render();
405 }

◆ getItemHtml()

ilAssNestedOrderingElementsInputGUI::getItemHtml ( array  $element,
string  $identifier,
string  $content_post_var,
string  $position_post_var,
string  $indentation_post_var 
)
private

Definition at line 215 of file class.ilAssNestedOrderingElementsInputGUI.php.

221 : string {
222 $tpl = $this->getItemTemplate();
223
224 switch ($this->getOrderingType()) {
227
228 $tpl->setCurrentBlock('item_text');
229 $tpl->setVariable('ITEM_CONTENT', ilLegacyFormElementsUtil::prepareFormOutput($element['content']));
230 $tpl->parseCurrentBlock();
231 break;
232
235
236 $tpl->setCurrentBlock('item_image');
237 $tpl->setVariable('ITEM_SOURCE', $this->getThumbnailSource($element));
238 $tpl->setVariable('ITEM_CONTENT', $this->getThumbnailFilename($element));
239 $tpl->parseCurrentBlock();
240 break;
241 }
242
243 if ($this->isShowCorrectnessIconsEnabled()) {
244 $correctness = 'not_correct';
245 if ($this->getCorrectness($identifier)) {
246 $correctness = 'correct';
247 }
248 $tpl->setCurrentBlock('correctness_icon');
249
250 $tpl->setVariable('ICON_OK', $this->getCorrectnessIcon($correctness));
251 $tpl->parseCurrentBlock();
252 }
253
254 $tpl->setCurrentBlock('item');
255 $tpl->setVariable('ITEM_CONTENT_POSTVAR', $content_post_var);
256 $tpl->setVariable('ITEM_CONTENT', ilLegacyFormElementsUtil::prepareFormOutput($element['content']));
257 $tpl->setVariable('ITEM_POSITION_POSTVAR', $position_post_var);
258 $tpl->setVariable('ITEM_POSITION', $element['ordering_position']);
259 $tpl->setVariable('ITEM_INDENTATION_POSTVAR', $indentation_post_var);
260 $tpl->setVariable('ITEM_INDENTATION', $element['ordering_indentation']);
261 $tpl->parseCurrentBlock();
262
263 return $tpl->get();
264 }
static prepareFormOutput($a_str, bool $a_strip=false)

References getThumbnailFilename(), getThumbnailSource(), assOrderingQuestion\OQ_NESTED_PICTURES, assOrderingQuestion\OQ_NESTED_TERMS, assOrderingQuestion\OQ_PICTURES, assOrderingQuestion\OQ_TERMS, and ilLegacyFormElementsUtil\prepareFormOutput().

+ Here is the call graph for this function:

◆ getItemTemplate()

ilAssNestedOrderingElementsInputGUI::getItemTemplate ( )
private

Definition at line 200 of file class.ilAssNestedOrderingElementsInputGUI.php.

200 : ilTemplate
201 {
202 return new ilTemplate('tpl.prop_ass_nested_order_elem.html', true, true, 'components/ILIAS/TestQuestionPool');
203 }
special template class to simplify handling of ITX/PEAR

◆ getOrderingType()

ilAssNestedOrderingElementsInputGUI::getOrderingType ( )

◆ getThumbnailFilename()

ilAssNestedOrderingElementsInputGUI::getThumbnailFilename (   $element)
private

Definition at line 205 of file class.ilAssNestedOrderingElementsInputGUI.php.

205 : string
206 {
207 return $this->getThumbPrefix() . $element['content'];
208 }

References getThumbPrefix().

Referenced by getItemHtml(), and getThumbnailSource().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getThumbnailSource()

ilAssNestedOrderingElementsInputGUI::getThumbnailSource (   $element)
private

Definition at line 210 of file class.ilAssNestedOrderingElementsInputGUI.php.

210 : string
211 {
212 return $this->getElementImagePath() . $this->getThumbnailFilename($element);
213 }

References getElementImagePath(), and getThumbnailFilename().

Referenced by getItemHtml().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getThumbPrefix()

ilAssNestedOrderingElementsInputGUI::getThumbPrefix ( )

Definition at line 154 of file class.ilAssNestedOrderingElementsInputGUI.php.

References $thumbnail_filename_prefix.

Referenced by getThumbnailFilename().

+ Here is the caller graph for this function:

◆ getUniquePrefix()

ilAssNestedOrderingElementsInputGUI::getUniquePrefix ( )

◆ initializePlayerJS()

ilAssNestedOrderingElementsInputGUI::initializePlayerJS ( )
private

Definition at line 407 of file class.ilAssNestedOrderingElementsInputGUI.php.

407 : void
408 {
409 $this->getGlobalTpl()->addJavascript('assets/js/orderingvertical.js');
410 $this->getGlobalTpl()->addOnLoadCode(
411 'il.test.orderingvertical.init(document.querySelector("#nestable_ordering"));'
412 );
413 }

◆ initListTemplate()

ilAssNestedOrderingElementsInputGUI::initListTemplate ( )
private

Definition at line 83 of file class.ilAssNestedOrderingElementsInputGUI.php.

83 : void
84 {
85 $this->list_tpl = new ilTemplate('tpl.prop_nested_ordering_list.html', true, true, 'components/ILIAS/TestQuestionPool');
86 }

◆ isPostSubmit()

ilAssNestedOrderingElementsInputGUI::isPostSubmit (   $data)

Definition at line 266 of file class.ilAssNestedOrderingElementsInputGUI.php.

266 : bool
267 {
268 if (!is_array($data)) {
269 return false;
270 }
271
272 if (!isset($data[$this->getPostVar()])) {
273 return false;
274 }
275
276 if (!count($data[$this->getPostVar()])) {
277 return false;
278 }
279
280 return true;
281 }

References $data.

◆ isShowCorrectnessIconsEnabled()

ilAssNestedOrderingElementsInputGUI::isShowCorrectnessIconsEnabled ( )

◆ onCheckInput()

ilAssNestedOrderingElementsInputGUI::onCheckInput ( )

Reimplemented from ilIdentifiedMultiValuesInputGUI.

Definition at line 397 of file class.ilAssNestedOrderingElementsInputGUI.php.

397 : bool
398 {
399 return true;
400 }

◆ prepareReprintable()

ilAssNestedOrderingElementsInputGUI::prepareReprintable ( assQuestion  $question)

Reimplemented from ilIdentifiedMultiValuesInputGUI.

Definition at line 98 of file class.ilAssNestedOrderingElementsInputGUI.php.

98 : void
99 {
100 $elementList = $this->getElementList($question->getId());
101
102 $elementList->completeContentsFromElementList(
103 $question->getOrderingElementList()
104 );
105
106 $this->setElementList($elementList);
107 }

References getElementList(), assQuestion\getId(), and setElementList().

+ Here is the call graph for this function:

◆ render()

ilAssNestedOrderingElementsInputGUI::render ( string  $a_mode = '')

Reimplemented from ilTextInputGUI.

Definition at line 384 of file class.ilAssNestedOrderingElementsInputGUI.php.

384 : string
385 {
386 if (!$this->styling_disabled) {
387 $this->getGlobalTpl()->addCss('assets/css/content.css');
388 }
389
390 if ($this->interaction_enabled) {
391 $this->initializePlayerJS();
392 }
393
394 return $this->renderMainList();
395 }

◆ renderListItem()

ilAssNestedOrderingElementsInputGUI::renderListItem ( array  $value,
string  $identifier,
string  $children 
)
private

Definition at line 283 of file class.ilAssNestedOrderingElementsInputGUI.php.

283 : string
284 {
285 $list_item_tpl = new ilTemplate('tpl.prop_nested_ordering_list_item.html', true, true, 'components/ILIAS/TestQuestionPool');
286 $content_post_var = $this->getMultiValuePostVarSubField($identifier, self::POSTVAR_CONTENT);
287 $position_post_var = $this->getMultiValuePostVarSubField($identifier, self::POSTVAR_POSITION);
288 $indentation_post_var = $this->getMultiValuePostVarSubField($identifier, self::POSTVAR_INDENTATION);
289
290 $list_item_tpl->setVariable('LIST_ITEM_VALUE', $this->getItemHtml(
291 $value,
292 $identifier,
293 $content_post_var,
294 $position_post_var,
295 $indentation_post_var
296 ));
297
298 if ($this->nesting_enabled) {
299 $list_item_tpl->setCurrentBlock('nested_list');
300 $list_item_tpl->setVariable('SUB_LIST', $children);
301 $list_item_tpl->parseCurrentBlock();
302 }
303 return $list_item_tpl->get();
304 }
getItemHtml(array $element, string $identifier, string $content_post_var, string $position_post_var, string $indentation_post_var)
getMultiValuePostVarSubField($identifier, $sub_field_index)

◆ renderMainList()

ilAssNestedOrderingElementsInputGUI::renderMainList ( )
private

Definition at line 306 of file class.ilAssNestedOrderingElementsInputGUI.php.

306 : string
307 {
308 $this->initListTemplate();
309
310 $values = $this->addIdentifierToValues($this->getIdentifiedMultiValues());
311 if ($this->nesting_enabled) {
312 $values = $this->buildHierarchicalTreeFromDBValues($values);
313 }
314
315 $this->list_tpl->setVariable(
316 'LIST_ITEMS',
317 $this->buildHTMLView(
318 $values,
319 static fn(array $a, array $b): int => $a['ordering_position'] - $b['ordering_position']
320 )
321 );
322
323 return $this->list_tpl->get();
324 }

References Vendor\Package\$a, and Vendor\Package\$b.

◆ setContext()

ilAssNestedOrderingElementsInputGUI::setContext ( string  $context)

Definition at line 114 of file class.ilAssNestedOrderingElementsInputGUI.php.

114 : void
115 {
116 $this->context = $context;
117 }

References $context.

◆ setCorrectnessTrueElementList()

ilAssNestedOrderingElementsInputGUI::setCorrectnessTrueElementList ( ilAssOrderingElementList  $correctness_true_element_list)

Definition at line 174 of file class.ilAssNestedOrderingElementsInputGUI.php.

174 : void
175 {
176 $this->correctness_true_element_list = $correctness_true_element_list;
177 }

References $correctness_true_element_list.

◆ setElementImagePath()

ilAssNestedOrderingElementsInputGUI::setElementImagePath ( string  $element_image_path)

Definition at line 139 of file class.ilAssNestedOrderingElementsInputGUI.php.

139 : void
140 {
141 $this->element_image_path = $element_image_path;
142 }

References $element_image_path.

◆ setElementList()

ilAssNestedOrderingElementsInputGUI::setElementList ( ilAssOrderingElementList  $elementList)

Definition at line 88 of file class.ilAssNestedOrderingElementsInputGUI.php.

References ilAssOrderingElementList\getRandomIdentifierIndexedElements(), and ilIdentifiedMultiValuesInputGUI\setIdentifiedMultiValues().

Referenced by prepareReprintable().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setInteractionEnabled()

ilAssNestedOrderingElementsInputGUI::setInteractionEnabled ( bool  $interaction_enabled)

Definition at line 63 of file class.ilAssNestedOrderingElementsInputGUI.php.

63 : void
64 {
65 $this->interaction_enabled = $interaction_enabled;
66 }

References $interaction_enabled.

◆ setNestingEnabled()

ilAssNestedOrderingElementsInputGUI::setNestingEnabled ( bool  $nesting_enabled)

Definition at line 68 of file class.ilAssNestedOrderingElementsInputGUI.php.

68 : void
69 {
70 $this->nesting_enabled = $nesting_enabled;
71 }

References $nesting_enabled.

◆ setOrderingType()

ilAssNestedOrderingElementsInputGUI::setOrderingType ( int  $ordering_type)

Definition at line 129 of file class.ilAssNestedOrderingElementsInputGUI.php.

129 : void
130 {
131 $this->ordering_type = $ordering_type;
132 }

References $ordering_type.

◆ setShowCorrectnessIconsEnabled()

ilAssNestedOrderingElementsInputGUI::setShowCorrectnessIconsEnabled ( bool  $show_correctness_icons_enabled)

Definition at line 159 of file class.ilAssNestedOrderingElementsInputGUI.php.

159 : void
160 {
161 $this->show_correctness_icons_enabled = $show_correctness_icons_enabled;
162 }

References $show_correctness_icons_enabled.

◆ setStylingDisabled()

ilAssNestedOrderingElementsInputGUI::setStylingDisabled ( bool  $styling_disabled)

Definition at line 73 of file class.ilAssNestedOrderingElementsInputGUI.php.

73 : void
74 {
75 $this->styling_disabled = $styling_disabled;
76 }

References $styling_disabled.

◆ setThumbPrefix()

ilAssNestedOrderingElementsInputGUI::setThumbPrefix ( string  $thumbnail_filename_prefix)

Definition at line 149 of file class.ilAssNestedOrderingElementsInputGUI.php.

149 : void
150 {
151 $this->thumbnail_filename_prefix = $thumbnail_filename_prefix;
152 }

References $thumbnail_filename_prefix.

◆ setUniquePrefix()

ilAssNestedOrderingElementsInputGUI::setUniquePrefix ( int  $unique_prefix)

Definition at line 124 of file class.ilAssNestedOrderingElementsInputGUI.php.

124 : void
125 {
126 $this->unique_prefix = $unique_prefix;
127 }

References $unique_prefix.

Field Documentation

◆ $context

string ilAssNestedOrderingElementsInputGUI::$context = null
private

Definition at line 35 of file class.ilAssNestedOrderingElementsInputGUI.php.

Referenced by getContext(), and setContext().

◆ $correctness_true_element_list

ilAssOrderingElementList ilAssNestedOrderingElementsInputGUI::$correctness_true_element_list = null
private

◆ $element_image_path

string ilAssNestedOrderingElementsInputGUI::$element_image_path = null
private

◆ $interaction_enabled

bool ilAssNestedOrderingElementsInputGUI::$interaction_enabled = true
private

Definition at line 42 of file class.ilAssNestedOrderingElementsInputGUI.php.

Referenced by setInteractionEnabled().

◆ $list_tpl

ilTemplate ilAssNestedOrderingElementsInputGUI::$list_tpl = null
private

◆ $nesting_enabled

bool ilAssNestedOrderingElementsInputGUI::$nesting_enabled = true
private

Definition at line 43 of file class.ilAssNestedOrderingElementsInputGUI.php.

Referenced by setNestingEnabled().

◆ $ordering_type

int ilAssNestedOrderingElementsInputGUI::$ordering_type = null
private

◆ $show_correctness_icons_enabled

bool ilAssNestedOrderingElementsInputGUI::$show_correctness_icons_enabled = false
private

◆ $styling_disabled

bool ilAssNestedOrderingElementsInputGUI::$styling_disabled = false
private

Definition at line 44 of file class.ilAssNestedOrderingElementsInputGUI.php.

Referenced by setStylingDisabled().

◆ $thumbnail_filename_prefix

string ilAssNestedOrderingElementsInputGUI::$thumbnail_filename_prefix = self::DEFAULT_THUMBNAIL_PREFIX
private

Definition at line 38 of file class.ilAssNestedOrderingElementsInputGUI.php.

Referenced by getThumbPrefix(), and setThumbPrefix().

◆ $ui_factory

UIFactory ilAssNestedOrderingElementsInputGUI::$ui_factory
private

◆ $ui_renderer

UIRenderer ilAssNestedOrderingElementsInputGUI::$ui_renderer
private

◆ $unique_prefix

int ilAssNestedOrderingElementsInputGUI::$unique_prefix = null
private

◆ CONTEXT_CORRECT_SOLUTION_PRESENTATION

const ilAssNestedOrderingElementsInputGUI::CONTEXT_CORRECT_SOLUTION_PRESENTATION = 'CorrectSolutionPresent'

◆ CONTEXT_QUESTION_PREVIEW

const ilAssNestedOrderingElementsInputGUI::CONTEXT_QUESTION_PREVIEW = 'QuestionPreview'

◆ CONTEXT_USER_SOLUTION_PRESENTATION

const ilAssNestedOrderingElementsInputGUI::CONTEXT_USER_SOLUTION_PRESENTATION = 'UserSolutionPresent'

◆ CONTEXT_USER_SOLUTION_SUBMISSION

const ilAssNestedOrderingElementsInputGUI::CONTEXT_USER_SOLUTION_SUBMISSION = 'UserSolutionSubmit'

◆ DEFAULT_THUMBNAIL_PREFIX

const ilAssNestedOrderingElementsInputGUI::DEFAULT_THUMBNAIL_PREFIX = 'thumb.'
private

◆ POSTVAR_CONTENT

const ilAssNestedOrderingElementsInputGUI::POSTVAR_CONTENT = 'content'
private

◆ POSTVAR_INDENTATION

const ilAssNestedOrderingElementsInputGUI::POSTVAR_INDENTATION = 'indentation'
private

◆ POSTVAR_POSITION

const ilAssNestedOrderingElementsInputGUI::POSTVAR_POSITION = 'position'
private

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