ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f87
ilNestedOrderingGUI Class Reference
+ Inheritance diagram for ilNestedOrderingGUI:
+ Collaboration diagram for ilNestedOrderingGUI:

Public Member Functions

 __construct ($a_title="", $a_postvar="", $graphical_output=false)
 
 setInstanceId ($instanceId)
 
 getInstanceId ()
 
 setOrderingType ($a_ordering_type)
 
 getOrderingType ()
 
 setImagePath ($a_image_path)
 
 getImagePath ()
 
 setImagePathWeb ($a_image_path_web)
 
 getImagePathWeb ()
 
 setThumbPrefix ($a_thumb_prefix)
 
 getThumbPrefix ()
 
 setGraphicalOutput ($graphical_output)
 
 getGraphicalOutput ()
 
 setObjAnswersArray ($a_answers_array, $shuffle=false)
 
 renderBeginSortableContainer ()
 
 renderEndSortableContainer ()
 
 renderListItem ($cur_answer, $i)
 
 renderEndListItem ()
 
 renderBeginSubList ()
 
 renderEndSubList ()
 
 renderAnswerOutput ($text_value, $i)
 
 checkInput ()
 
 getHtml ($shuffle_depth=0)
 
 getSolutionHTML ($a_solution_array)
 
 setPerformJavascript ($a_bool)
 
 getPerformJavascript ()
 
- Public Member Functions inherited from ilNonEditableValueGUI
 __construct ($a_title="", $a_id="", $a_disable_escaping=false)
 Constructor. More...
 
 checkInput ()
 
 setType ($a_type)
 Set Type. More...
 
 getType ()
 Get Type. More...
 
 setTitle ($a_title)
 Set Title. More...
 
 getTitle ()
 Get Title. More...
 
 setInfo ($a_info)
 Set Information Text. More...
 
 getInfo ()
 Get Information Text. More...
 
 setValue ($a_value)
 Set Value. More...
 
 getValue ()
 Get Value. More...
 
 render ()
 render More...
 
 insert (&$a_tpl)
 Insert property html. More...
 
 setValueByArray ($a_values)
 Set value by array. More...
 
 getTableFilterHTML ()
 Get HTML for table filter. 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...
 
 removeProhibitedCharacters ($a_text)
 Remove prohibited characters see #19159. More...
 

Data Fields

 $answers = array()
 
 $ordering_type = NULL
 
 $image_path = null
 
 $image_path_web = null
 
 $thumb_prefix = 'thumb.'
 

Protected Attributes

 $instanceId = 'default'
 
- Protected Attributes inherited from ilNonEditableValueGUI
 $type
 
 $value
 
 $title
 
 $info
 
 $section_icon
 
 $disable_escaping
 
- Protected Attributes inherited from ilSubEnabledFormPropertyGUI
 $sub_items = array()
 
- Protected Attributes inherited from ilFormPropertyGUI
 $type
 
 $title
 
 $postvar
 
 $info
 
 $alert
 
 $required = false
 
 $parentgui
 
 $parentform
 
 $hidden_title = ""
 
 $multi = false
 
 $multi_sortable = false
 
 $multi_addremove = true
 
 $multi_values
 

Private Attributes

 $perform_js = 1
 
 $graphical_output = FALSE
 

Additional Inherited Members

- Protected Member Functions inherited from ilFormPropertyGUI
 setType ($a_type)
 Set Type. More...
 
 getMultiIconsHTML ()
 Get HTML for multiple value icons. More...
 

Detailed Description

Author
Nadia Ahmad nahma.nosp@m.d@da.nosp@m.tabay.nosp@m..de
Version
Id

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

Constructor & Destructor Documentation

◆ __construct()

ilNestedOrderingGUI::__construct (   $a_title = "",
  $a_postvar = "",
  $graphical_output = false 
)

Definition at line 27 of file class.ilNestedOrderingGUI.php.

References $graphical_output.

28  {
29  parent::__construct($a_title, $a_postvar);
30  $this->graphical_output = (bool)$graphical_output;
31  }

Member Function Documentation

◆ checkInput()

ilNestedOrderingGUI::checkInput ( )

Definition at line 247 of file class.ilNestedOrderingGUI.php.

248  {
249  return true;
250  }

◆ getGraphicalOutput()

ilNestedOrderingGUI::getGraphicalOutput ( )

Definition at line 100 of file class.ilNestedOrderingGUI.php.

References $graphical_output.

Referenced by renderListItem().

+ Here is the caller graph for this function:

◆ getHtml()

ilNestedOrderingGUI::getHtml (   $shuffle_depth = 0)

Definition at line 252 of file class.ilNestedOrderingGUI.php.

References $_GET, $answers, $tpl, getInstanceId(), getPerformJavascript(), iljQueryUtil\initjQuery(), iljQueryUtil\initjQueryUI(), renderBeginSortableContainer(), renderBeginSubList(), renderEndListItem(), renderEndSortableContainer(), renderEndSubList(), and renderListItem().

Referenced by getInstanceId().

253  {
254  $html_output = '';
255  $html_output .= $this->renderBeginSortableContainer();
256  $html_output .= $this->renderBeginSubList();
257 
258  $i = 0;
259 
260  if($shuffle_depth == 1)
261  {
262  // this is for output in test
263  foreach($this->answers as $cur_answer)
264  {
265  $html_output .= $this->renderListItem($cur_answer,$cur_answer['random_id']);
266  $html_output .= $this->renderEndListItem();
267  }
268  }
269  else
270  {
271  $previous_depth = 0;
272 
273  $tmp_array = $this->answers;
274  $tmp_array[count($tmp_array)]['ordering_depth'] = 'END_OF_LIST';
275 
276  foreach($this->answers as $cur_answer)
277  {
278  $current_depth = $cur_answer['ordering_depth'];
279  $next_depth = $tmp_array[$i+1]['ordering_depth'];
280 
281  if($next_depth == 'END_OF_LIST')
282  {
283  $next_depth = 0;
284  }
285 
286  if($previous_depth == $current_depth)
287  {
288  // pcn = Previous, Current, Next -> Depth
289  // pcn: 000, 001, 110, 220
290  if($current_depth == $next_depth)
291  {
292  // (1) pcn: 000
293 // echo"(1)";
294  $html_output .= $this->renderListItem($cur_answer, $cur_answer['random_id']);
295  $html_output .= $this->renderEndListItem();
296  }
297  else if($current_depth > $next_depth)
298  {
299  if($previous_depth == $next_depth)
300  {
301  // (8) pcn: 110
302 // echo"(8)";
303  $html_output .= $this->renderListItem($cur_answer, $cur_answer['random_id']);
304  $html_output .= $this->renderEndListItem();
305  $html_output .= $this->renderEndSubList();
306  $html_output .= $this->renderEndListItem();
307  }
308  else if($previous_depth > $next_depth)
309  {
310  // (12) pcn: 220
311 // echo"(12)";
312  $html_output .= $this->renderListItem($cur_answer, $cur_answer['random_id']);
313 
314  for($openlists = $next_depth; $openlists < $current_depth; $openlists++)
315  {
316  $html_output .= $this->renderEndListItem();
317  $html_output .= $this->renderEndSubList();
318  $html_output .= $this->renderEndListItem();
319  }
320  }
321  }
322  else if($current_depth < $next_depth)
323  {
324  // (2) pcn: 001
325 // echo"(2)";
326  $html_output .= $this->renderListItem($cur_answer, $cur_answer['random_id']);
327  $html_output .= $this->renderBeginSubList();
328  }
329  }
330  else if($previous_depth > $current_depth)
331  {
332  if($current_depth == $next_depth)
333  {
334  // (6) pcn: 100
335 // echo"(6)";
336  $html_output .= $this->renderListItem($cur_answer, $cur_answer['random_id']);
337  $html_output .= $this->renderEndListItem();
338  }
339  else if($current_depth > $next_depth)
340  {
341  // (11) pcn: 210
342 // echo"(11)";
343  $html_output .= $this->renderListItem($cur_answer, $cur_answer['random_id']);
344  $html_output .= $this->renderEndListItem();
345  $html_output .= $this->renderEndSubList();
346  }
347  else if($current_depth < $next_depth)
348  {
349  if($previous_depth == $next_depth)
350  {
351  // (7) pcn: 101
352 // echo"(7)";
353  $html_output .= $this->renderListItem($cur_answer, $cur_answer['random_id']);
354  $html_output .= $this->renderBeginSubList();
355  }
356  else if($previous_depth > $next_depth)
357  {
358  // (10) pcn: 201
359 // echo"(10)";
360  $html_output .= $this->renderListItem($cur_answer, $cur_answer['random_id']);
361  for($openlists = $next_depth; $openlists < $current_depth; $openlists++)
362  {
363  $html_output .= $this->renderEndSubList();
364  }
365  $html_output .= $this->renderBeginSubList();
366  }
367  }
368  }
369  else if($previous_depth < $current_depth)
370  {
371  if($current_depth == $next_depth)
372  {
373  // (4) pcn: 011
374 // echo"(4)";
375  $html_output .= $this->renderListItem($cur_answer, $cur_answer['random_id']);
376  $html_output .= $this->renderEndListItem();
377  }
378  else if($current_depth > $next_depth)
379  {
380  if($previous_depth == $next_depth)
381  {
382  // (3) pcn: 010,
383 // echo"(3)";
384  $html_output .= $this->renderListItem($cur_answer, $cur_answer['random_id']);
385  $html_output .= $this->renderEndListItem();
386  $html_output .= $this->renderEndSubList();
387  $html_output .= $this->renderEndListItem();
388 
389  }
390  else if($previous_depth > $next_depth)
391  {
392  // (9) pcn: 120
393 // echo"(9)";
394  $html_output .= $this->renderListItem($cur_answer, $cur_answer['random_id']);
395  for($openlists = $next_depth; $openlists < $current_depth; $openlists++)
396  {
397  $html_output .= $this->renderEndListItem();
398  $html_output .= $this->renderEndSubList();
399  }
400  }
401  }
402  else if($current_depth < $next_depth)
403  {
404  // (5) pcn: 012
405 // echo"(5)";
406  $html_output .= $this->renderListItem($cur_answer, $cur_answer['random_id']);
407  $html_output .= $this->renderBeginSubList();
408  }
409  }
410  $previous_depth = $current_depth;
411  $i++;
412  }
413  }
414  $html_output .= $this->renderEndSubList();
415  $html_output .= $this->renderEndSortableContainer();
416 
417  include_once "Services/jQuery/classes/class.iljQueryUtil.php";
418  global $tpl;
419 
420  $tpl->addJavaScript("./Services/jQuery/js/jquery.nestable.js");
423  $js_output = '';
424 
425  $js_include_tpl = new ilTemplate("tpl.il_as_qpl_nested_ordering_output_javascript.html", TRUE, TRUE, "Modules/TestQuestionPool");
426  if(!array_key_exists("pdf", $_GET) || $_GET["pdf"] != 1) // #14199
427  {
428  $js_include_tpl->touchBlock("css_include");
429  }
430  $js_include_tpl->setCurrentBlock('js_include');
431  $js_include_tpl->setVariable('PERFORM_JAVASCRIPT', $this->getPerformJavascript());
432  $js_include_tpl->setVariable('INSTANCE_ID', $this->getInstanceId());
433  $js_include_tpl->setVariable('HTML_OUTPUT', $html_output);
434  $js_include_tpl->parseCurrentBlock();
435 
436  return $js_include_tpl->get();
437  }
static initjQueryUI()
Init jQuery UI (see included_components.txt for included components)
$_GET["client_id"]
global $tpl
Definition: ilias.php:8
special template class to simplify handling of ITX/PEAR
static initjQuery($a_tpl=null)
Init jQuery.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getImagePath()

ilNestedOrderingGUI::getImagePath ( )

Definition at line 71 of file class.ilNestedOrderingGUI.php.

References $image_path.

◆ getImagePathWeb()

ilNestedOrderingGUI::getImagePathWeb ( )

Definition at line 79 of file class.ilNestedOrderingGUI.php.

References $image_path_web.

Referenced by renderAnswerOutput().

+ Here is the caller graph for this function:

◆ getInstanceId()

ilNestedOrderingGUI::getInstanceId ( )

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

References $instanceId, getHtml(), and ilNonEditableValueGUI\insert().

Referenced by getHtml(), and renderBeginSortableContainer().

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

◆ getOrderingType()

ilNestedOrderingGUI::getOrderingType ( )

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

References $ordering_type.

Referenced by renderAnswerOutput().

+ Here is the caller graph for this function:

◆ getPerformJavascript()

ilNestedOrderingGUI::getPerformJavascript ( )

Definition at line 628 of file class.ilNestedOrderingGUI.php.

References $perform_js.

Referenced by getHtml(), and getSolutionHTML().

629  {
630  return (int)$this->perform_js;
631  }
+ Here is the caller graph for this function:

◆ getSolutionHTML()

ilNestedOrderingGUI::getSolutionHTML (   $a_solution_array)

Definition at line 443 of file class.ilNestedOrderingGUI.php.

References $_GET, $tpl, getPerformJavascript(), iljQueryUtil\initjQuery(), iljQueryUtil\initjQueryUI(), renderBeginSortableContainer(), renderBeginSubList(), renderEndListItem(), renderEndSortableContainer(), renderEndSubList(), and renderListItem().

444  {
445  $html_output = '';
446  $html_output .= $this->renderBeginSortableContainer();
447  $html_output .= $this->renderBeginSubList();
448 
449  $i = 0;
450  $previous_depth = 0;
451 
452  $tmp_array = $a_solution_array;
453  $tmp_array[count($tmp_array)]['depth'] = 'END_OF_LIST';
454 
455  foreach($a_solution_array as $cur_answer)
456  {
457  $current_depth = $cur_answer['depth'];
458  $next_depth = $tmp_array[$i+1]['depth'];
459  if($next_depth == 'END_OF_LIST')
460  {
461  $next_depth = 0;
462  }
463 
464  if($previous_depth == $current_depth)
465  {
466  // pcn = Previous, Current, Next -> Depth
467  // pcn: 000, 001, 110, 220
468  if($current_depth == $next_depth)
469  {
470  // (1) pcn: 000
471  // echo"(1)";
472  $html_output .= $this->renderListItem($cur_answer, $i);
473  $html_output .= $this->renderEndListItem();
474  }
475  else if($current_depth > $next_depth)
476  {
477  if($previous_depth == $next_depth)
478  {
479  // (8) pcn: 110
480  // echo"(8)";
481  $html_output .= $this->renderListItem($cur_answer, $i);
482  $html_output .= $this->renderEndListItem();
483  $html_output .= $this->renderEndSubList();
484  $html_output .= $this->renderEndListItem();
485  }
486  else if($previous_depth > $next_depth)
487  {
488  // (12) pcn: 220
489  // echo"(12)";
490  $html_output .= $this->renderListItem($cur_answer, $i);
491 
492  for($openlists = $next_depth; $openlists < $current_depth; $openlists++)
493  {
494  $html_output .= $this->renderEndListItem();
495  $html_output .= $this->renderEndSubList();
496  $html_output .= $this->renderEndListItem();
497  }
498  }
499  }
500  else if($current_depth < $next_depth)
501  {
502  // (2) pcn: 001
503  // echo"(2)";
504  $html_output .= $this->renderListItem($cur_answer, $i);
505  $html_output .= $this->renderBeginSubList();
506 
507  }
508  }
509  else if($previous_depth > $current_depth)
510  {
511  if($current_depth == $next_depth)
512  {
513  // (6) pcn: 100
514  // echo"(6)";
515  $html_output .= $this->renderListItem($cur_answer, $i);
516  $html_output .= $this->renderEndListItem();
517  }
518  else if($current_depth > $next_depth)
519  {
520  // (11) pcn: 210
521  // echo"(11)";
522  $html_output .= $this->renderListItem($cur_answer, $i);
523  $html_output .= $this->renderEndListItem();
524  $html_output .= $this->renderEndSubList();
525  }
526  else if($current_depth < $next_depth)
527  {
528  if($previous_depth == $next_depth)
529  {
530  // (7) pcn: 101
531  // echo"(7)";
532  $html_output .= $this->renderListItem($cur_answer, $i);
533  $html_output .= $this->renderBeginSubList();
534  }
535  else if($previous_depth > $next_depth)
536  {
537  // (10) pcn: 201
538  // echo"(10)";
539  $html_output .= $this->renderListItem($cur_answer, $i);
540  for($openlists = $next_depth; $openlists < $current_depth; $openlists++)
541  {
542  $html_output .= $this->renderEndSubList();
543  }
544  $html_output .= $this->renderBeginSubList();
545  }
546  }
547  }
548  else if($previous_depth < $current_depth)
549  {
550  if($current_depth == $next_depth)
551  {
552  // (4) pcn: 011
553  // echo"(4)";
554  $html_output .= $this->renderListItem($cur_answer, $i);
555  $html_output .= $this->renderEndListItem();
556  }
557  else if($current_depth > $next_depth)
558  {
559  if($previous_depth == $next_depth)
560  {
561  // (3) pcn: 010,
562  // echo"(3)";
563  $html_output .= $this->renderListItem($cur_answer, $i);
564  $html_output .= $this->renderEndListItem();
565  $html_output .= $this->renderEndSubList();
566  $html_output .= $this->renderEndListItem();
567 
568  }
569  else if($previous_depth > $next_depth)
570  {
571  // (9) pcn: 120
572  // echo"(9)";
573  $html_output .= $this->renderListItem($cur_answer, $i);
574  for($openlists = $next_depth; $openlists < $current_depth; $openlists++)
575  {
576  $html_output .= $this->renderEndListItem();
577  $html_output .= $this->renderEndSubList();
578  }
579  }
580  }
581  else if($current_depth < $next_depth)
582  {
583  // (5) pcn: 012
584  // echo"(5)";
585  $html_output .= $this->renderListItem($cur_answer, $i);
586  $html_output .= $this->renderBeginSubList();
587  }
588  }
589  $previous_depth = $current_depth;
590  $i++;
591  }
592 
593  $html_output .= $this->renderEndSubList();
594  $html_output .= $this->renderEndSortableContainer();
595 
596 // $js_include_tpl = new ilTemplate("tpl.il_as_qpl_nested_ordering_output_solution.html", TRUE, TRUE, "Modules/TestQuestionPool");
597 
598  include_once "Services/jQuery/classes/class.iljQueryUtil.php";
599  global $tpl;
600 
601  $tpl->addJavaScript("./Services/jQuery/js/jquery.nestable.js");
604  $js_output = '';
605 
606  $js_include_tpl = new ilTemplate("tpl.il_as_qpl_nested_ordering_output_javascript.html", TRUE, TRUE, "Modules/TestQuestionPool");
607  if(!array_key_exists("pdf", $_GET) || $_GET["pdf"] != 1) // #14199
608  {
609  $js_include_tpl->touchBlock("css_include");
610  }
611  $js_include_tpl->setCurrentBlock('js_include');
612  $js_include_tpl->setVariable('PERFORM_JAVASCRIPT', $this->getPerformJavascript());
613 
615 
616  $js_include_tpl->setVariable('HTML_OUTPUT', $html_output);
617 
618  $js_include_tpl->parseCurrentBlock();
619 
620  return $js_include_tpl->get();
621  }
static initjQueryUI()
Init jQuery UI (see included_components.txt for included components)
$_GET["client_id"]
global $tpl
Definition: ilias.php:8
special template class to simplify handling of ITX/PEAR
static initjQuery($a_tpl=null)
Init jQuery.
+ Here is the call graph for this function:

◆ getThumbPrefix()

ilNestedOrderingGUI::getThumbPrefix ( )

Definition at line 87 of file class.ilNestedOrderingGUI.php.

Referenced by renderAnswerOutput().

88  {
89  return 'thumb.';
90  }
+ Here is the caller graph for this function:

◆ renderAnswerOutput()

ilNestedOrderingGUI::renderAnswerOutput (   $text_value,
  $i 
)
Parameters
string$text_value
integer$i
Returns
string

Definition at line 209 of file class.ilNestedOrderingGUI.php.

References $lng, ilFormPropertyGUI\getFieldId(), getImagePathWeb(), getOrderingType(), ilFormPropertyGUI\getPostVar(), getThumbPrefix(), OQ_NESTED_PICTURES, OQ_NESTED_TERMS, and ilUtil\prepareFormOutput().

Referenced by renderListItem().

210  {
211  global $lng;
212  $input_tpl = new ilTemplate("tpl.prop_nestable_value.html", true, true, "Modules/TestQuestionPool");
213 
214  if(strlen($text_value))
215  {
216  if($this->getOrderingType() == OQ_NESTED_TERMS)
217  {
218  $input_tpl->setCurrentBlock('nested_terms');
219  $input_tpl->setVariable("VALUE", ilUtil::prepareFormOutput($text_value));
220  $input_tpl->setVariable("INPUT_POST_VAR", $this->getPostVar() . "[$i]");
221  $input_tpl->setVariable("NON_EDITABLE_ID", $this->getPostVar() . "[$i]");
222  $input_tpl->setVariable("HVALUE", ilUtil::prepareFormOutput($text_value));
223 
224  $input_tpl->setVariable("ID", $this->getFieldId() . "[$i]");
225  }
226  else if($this->getOrderingType() == OQ_NESTED_PICTURES)
227  {
228  $input_tpl->setCurrentBlock('nested_pictures');
229 
230  $thumbweb = $this->getImagePathWeb() . $this->getThumbPrefix() .$text_value;
231 
232  $input_tpl->setVariable("PICTURE_HREF",$thumbweb);
233  $input_tpl->setVariable("THUMB_ALT", $lng->txt("thumbnail"));
234  $input_tpl->setVariable("THUMB_TITLE", $lng->txt("thumbnail"));
235  $input_tpl->setVariable("NON_EDITABLE_ID", $this->getPostVar() . "[$i]");
236  $input_tpl->setVariable("HVALUE", $text_value);
237  $input_tpl->setVariable("ID", $this->getFieldId() . "[$i]");
238  }
239  }
240 
241 
242  $input_tpl->parseCurrentBlock();
243 
244  return $input_tpl->get();
245  }
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
getPostVar()
Get Post Variable.
const OQ_NESTED_TERMS
getFieldId()
Get Post Variable.
special template class to simplify handling of ITX/PEAR
const OQ_NESTED_PICTURES
global $lng
Definition: privfeed.php:40
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderBeginSortableContainer()

ilNestedOrderingGUI::renderBeginSortableContainer ( )

Definition at line 130 of file class.ilNestedOrderingGUI.php.

References getInstanceId().

Referenced by getHtml(), and getSolutionHTML().

131  {
132  $js_include_tpl = new ilTemplate("tpl.il_as_qpl_nested_ordering_output_html.html", TRUE, TRUE, "Modules/TestQuestionPool");
133  $js_include_tpl->setCurrentBlock('begin_sortablecontainer');
134  $js_include_tpl->setVariable('INSTANCE_ID', $this->getInstanceId());
135  $js_include_tpl->parseCurrentBlock();
136 
137  return $js_include_tpl->get();
138  }
special template class to simplify handling of ITX/PEAR
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderBeginSubList()

ilNestedOrderingGUI::renderBeginSubList ( )

Definition at line 188 of file class.ilNestedOrderingGUI.php.

Referenced by getHtml(), and getSolutionHTML().

189  {
190  $js_include_tpl = new ilTemplate("tpl.il_as_qpl_nested_ordering_output_html.html", TRUE, TRUE, "Modules/TestQuestionPool");
191  $js_include_tpl->touchBlock('begin_sublist');
192 
193  return $js_include_tpl->get();
194  }
special template class to simplify handling of ITX/PEAR
+ Here is the caller graph for this function:

◆ renderEndListItem()

ilNestedOrderingGUI::renderEndListItem ( )

Definition at line 180 of file class.ilNestedOrderingGUI.php.

Referenced by getHtml(), and getSolutionHTML().

181  {
182  $js_include_tpl = new ilTemplate("tpl.il_as_qpl_nested_ordering_output_html.html", TRUE, TRUE, "Modules/TestQuestionPool");
183  $js_include_tpl->touchBlock('end_list_item');
184 
185  return $js_include_tpl->get();
186  }
special template class to simplify handling of ITX/PEAR
+ Here is the caller graph for this function:

◆ renderEndSortableContainer()

ilNestedOrderingGUI::renderEndSortableContainer ( )

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

Referenced by getHtml(), and getSolutionHTML().

140  {
141  $js_include_tpl = new ilTemplate("tpl.il_as_qpl_nested_ordering_output_html.html", TRUE, TRUE, "Modules/TestQuestionPool");
142  $js_include_tpl->touchBlock('end_sortablecontainer');
143 
144  return $js_include_tpl->get();
145  }
special template class to simplify handling of ITX/PEAR
+ Here is the caller graph for this function:

◆ renderEndSubList()

ilNestedOrderingGUI::renderEndSubList ( )

Definition at line 196 of file class.ilNestedOrderingGUI.php.

Referenced by getHtml(), and getSolutionHTML().

197  {
198  $js_include_tpl = new ilTemplate("tpl.il_as_qpl_nested_ordering_output_html.html", TRUE, TRUE, "Modules/TestQuestionPool");
199  $js_include_tpl->touchBlock('end_sublist');
200 
201  return $js_include_tpl->get();
202  }
special template class to simplify handling of ITX/PEAR
+ Here is the caller graph for this function:

◆ renderListItem()

ilNestedOrderingGUI::renderListItem (   $cur_answer,
  $i 
)

Definition at line 147 of file class.ilNestedOrderingGUI.php.

References $lng, getGraphicalOutput(), ilUtil\getImagePath(), and renderAnswerOutput().

Referenced by getHtml(), and getSolutionHTML().

148  {
149  $js_include_tpl = new ilTemplate("tpl.il_as_qpl_nested_ordering_output_html.html", TRUE, TRUE, "Modules/TestQuestionPool");
150  $js_include_tpl->touchBlock('begin_list_item');
151 
152  $js_include_tpl->setCurrentBlock('item_value');
153  $js_include_tpl->setVariable('LIST_ITEM_VALUE', $this->renderAnswerOutput($cur_answer['answertext'], $i));
154  $js_include_tpl->setVariable('LIST_ITEM_ID', $i);
155 
156  if(isset($cur_answer['ok']) && $this->getGraphicalOutput() == true)
157  {
158  global $lng;
159 
160  if($cur_answer['ok'] === true)
161  {
162  $icon_ok = ilUtil::getImagePath("icon_ok.svg");
163  $text_ok = $lng->txt("answer_is_right");
164  }
165  else
166  {
167  $icon_ok = ilUtil::getImagePath("icon_not_ok.svg");
168  $text_ok = $lng->txt("answer_is_wrong");
169  }
170 
171  $js_include_tpl->setVariable('ICON_OK', $icon_ok);
172  $js_include_tpl->setVariable('TEXT_OK', $text_ok);
173  }
174 
175  $js_include_tpl->parseCurrentBlock();
176 
177  return $js_include_tpl->get();
178  }
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
special template class to simplify handling of ITX/PEAR
global $lng
Definition: privfeed.php:40
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setGraphicalOutput()

ilNestedOrderingGUI::setGraphicalOutput (   $graphical_output)
Parameters
bool$graphical_output

Definition at line 95 of file class.ilNestedOrderingGUI.php.

References $graphical_output.

96  {
97  $this->graphical_output = $graphical_output;
98  }

◆ setImagePath()

ilNestedOrderingGUI::setImagePath (   $a_image_path)

Definition at line 67 of file class.ilNestedOrderingGUI.php.

68  {
69  $this->image_path = $a_image_path;
70  }

◆ setImagePathWeb()

ilNestedOrderingGUI::setImagePathWeb (   $a_image_path_web)

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

76  {
77  $this->image_path_web = $a_image_path_web;
78  }

◆ setInstanceId()

ilNestedOrderingGUI::setInstanceId (   $instanceId)

Definition at line 33 of file class.ilNestedOrderingGUI.php.

References $instanceId.

Referenced by assOrderingQuestionGUI\getTestOutput().

34  {
35  $this->instanceId = $instanceId;
36  }
+ Here is the caller graph for this function:

◆ setObjAnswersArray()

ilNestedOrderingGUI::setObjAnswersArray (   $a_answers_array,
  $shuffle = false 
)

Definition at line 111 of file class.ilNestedOrderingGUI.php.

112  {
113  if($shuffle == true)
114  {
115  shuffle($a_answers_array);
116  }
117 
118  $i = 0;
119  foreach($a_answers_array as $obj_answer)
120  {
121  $this->answers[$i]['random_id'] = $obj_answer->getRandomId();
122  $this->answers[$i]['answertext'] = (string)$obj_answer->getAnswertext();
123  $this->answers[$i]['answer_id'] = $obj_answer->getAnswerId();
124  $this->answers[$i]['ordering_depth'] = $obj_answer->getOrderingDepth();
125 
126  $i++;
127  }
128  }

◆ setOrderingType()

ilNestedOrderingGUI::setOrderingType (   $a_ordering_type)

Definition at line 58 of file class.ilNestedOrderingGUI.php.

Referenced by assOrderingQuestionGUI\getPreview(), and assOrderingQuestionGUI\populateAnswerSpecificFormPart().

59  {
60  $this->ordering_type = $a_ordering_type;
61  }
+ Here is the caller graph for this function:

◆ setPerformJavascript()

ilNestedOrderingGUI::setPerformJavascript (   $a_bool)

Definition at line 623 of file class.ilNestedOrderingGUI.php.

624  {
625  $this->perform_js = $a_bool;
626  }

◆ setThumbPrefix()

ilNestedOrderingGUI::setThumbPrefix (   $a_thumb_prefix)

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

84  {
85  $this->thumb_prefix = $a_thumb_prefix;
86  }

Field Documentation

◆ $answers

ilNestedOrderingGUI::$answers = array()

Definition at line 17 of file class.ilNestedOrderingGUI.php.

Referenced by getHtml().

◆ $graphical_output

ilNestedOrderingGUI::$graphical_output = FALSE
private

◆ $image_path

ilNestedOrderingGUI::$image_path = null

Definition at line 19 of file class.ilNestedOrderingGUI.php.

Referenced by getImagePath().

◆ $image_path_web

ilNestedOrderingGUI::$image_path_web = null

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

Referenced by getImagePathWeb().

◆ $instanceId

ilNestedOrderingGUI::$instanceId = 'default'
protected

Definition at line 15 of file class.ilNestedOrderingGUI.php.

Referenced by getInstanceId(), and setInstanceId().

◆ $ordering_type

ilNestedOrderingGUI::$ordering_type = NULL

Definition at line 18 of file class.ilNestedOrderingGUI.php.

Referenced by getOrderingType().

◆ $perform_js

ilNestedOrderingGUI::$perform_js = 1
private

Definition at line 23 of file class.ilNestedOrderingGUI.php.

Referenced by getPerformJavascript().

◆ $thumb_prefix

ilNestedOrderingGUI::$thumb_prefix = 'thumb.'

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


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