ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
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...
 

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 $answers, $tpl, ilFormPropertyGUI\getDisabled(), 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  if(!$this->getDisabled())
420  {
421  $tpl->addJavaScript( "./Services/jQuery/js/jquery.nestable.js" );
422  }
425  $js_output = '';
426 
427  $js_include_tpl = new ilTemplate("tpl.il_as_qpl_nested_ordering_output_javascript.html", TRUE, TRUE, "Modules/TestQuestionPool");
428  $js_include_tpl->setCurrentBlock('js_include');
429 
430  if(!$this->getDisabled())
431  {
432  $js_include_tpl->setVariable( 'PERFORM_JAVASCRIPT', $this->getPerformJavascript() );
433  }
434  else
435  {
436  $js_include_tpl->setVariable( 'PERFORM_JAVASCRIPT', false );
437  }
438 
439  $js_include_tpl->setVariable( 'INSTANCE_ID', $this->getInstanceId() );
440 
441  $js_include_tpl->setVariable('HTML_OUTPUT', $html_output);
442 
443  $js_include_tpl->parseCurrentBlock();
444 
445  return $js_include_tpl->get();
446  }
static initjQueryUI()
Init jQuery UI (see included_components.txt for included components)
special template class to simplify handling of ITX/PEAR
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
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 634 of file class.ilNestedOrderingGUI.php.

References $perform_js.

Referenced by getHtml(), and getSolutionHTML().

635  {
636  return (int)$this->perform_js;
637  }
+ Here is the caller graph for this function:

◆ getSolutionHTML()

ilNestedOrderingGUI::getSolutionHTML (   $a_solution_array)

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

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

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

630  {
631  $this->perform_js = $a_bool;
632  }

◆ 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: