ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
class.ilSurveyEditorGUI.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2010 ILIAS open source, Extended GPL, see docs/LICENSE */
3
17{
18 protected $parent_gui; // [ilObjSurveyGUI]
19 protected $object; // [ilObjSurvey]
20
21 public function __construct(ilObjSurveyGUI $a_parent_gui)
22 {
23 global $ilCtrl, $lng, $tpl;
24
25 $this->parent_gui = $a_parent_gui;
26 $this->object = $this->parent_gui->object;
27
28 $this->ctrl = $ilCtrl;
29 $this->lng = $lng;
30 $this->tpl = $tpl;
31
32 $this->ctrl->saveParameter($this, array("pgov", "pgov_pos"));
33 }
34
35 public function executeCommand()
36 {
37 global $ilTabs;
38
39 $cmd = $this->ctrl->getCmd("questions");
40
41 if($_REQUEST["pgov"])
42 {
43 if($cmd == "questions")
44 {
45 $this->ctrl->setCmdClass("ilsurveypagegui");
46 $this->ctrl->setCmd("renderpage");
47 }
48 else if($cmd == "confirmRemoveQuestions")
49 {
50 // #14324
51 $this->ctrl->setCmdClass("ilsurveypagegui");
52 $this->ctrl->setCmd("confirmRemoveQuestions");
53 }
54 }
55
56 $next_class = $this->ctrl->getNextClass($this);
57 switch($next_class)
58 {
59 case 'ilsurveypagegui':
60 $this->questionsSubtabs("page");
61 include_once './Modules/Survey/classes/class.ilSurveyPageGUI.php';
62 $pg = new ilSurveyPageGUI($this->object, $this);
63 $this->ctrl->forwardCommand($pg);
64 break;
65
66 default:
67 // question gui
68 if(stristr($next_class, "questiongui"))
69 {
70 $ilTabs->clearTargets();
71 $this->ctrl->saveParameter($this, array("new_for_survey"));
72
73 include_once "./Modules/SurveyQuestionPool/classes/class.SurveyQuestionGUI.php";
74 $q_gui = SurveyQuestionGUI::_getQuestionGUI(null, $_REQUEST["q_id"]);
75 if (is_object($q_gui->object))
76 {
77 global $ilHelp;
78 $ilHelp->setScreenIdComponent("spl_qt".$q_gui->object->getQuestionTypeId());
79 }
80 // $q_gui->object->setObjId($this->object->getId());
81 $q_gui->setBackUrl($this->ctrl->getLinkTarget($this, "questions"));
82 $q_gui->setQuestionTabs();
83 $this->ctrl->forwardCommand($q_gui);
84
85 if(!(int)$_REQUEST["new_for_survey"])
86 {
87 // not on create
88 $this->tpl->setTitle($this->lng->txt("question").": ".$q_gui->object->getTitle());
89 }
90 }
91 else
92 {
93 $cmd .= "Object";
94 $this->$cmd();
95 }
96 break;
97 }
98 }
99
100 protected function questionsSubtabs($a_cmd)
101 {
102 global $ilTabs;
103
104 if($a_cmd == "questions" && $_REQUEST["pgov"])
105 {
106 $a_cmd = "page";
107 }
108
109 $hidden_tabs = array();
110 $template = $this->object->getTemplate();
111 if($template)
112 {
113 include_once "Services/Administration/classes/class.ilSettingsTemplate.php";
114 $template = new ilSettingsTemplate($template);
115 $hidden_tabs = $template->getHiddenTabs();
116 }
117
118 $ilTabs->addSubTab("page",
119 $this->lng->txt("survey_per_page_view"),
120 $this->ctrl->getLinkTargetByClass("ilsurveypagegui", "renderPage"));
121
122 if(!in_array("survey_question_editor", $hidden_tabs))
123 {
124 $this->ctrl->setParameter($this, "pgov", "");
125 $ilTabs->addSubTab("questions",
126 $this->lng->txt("survey_question_editor"),
127 $this->ctrl->getLinkTarget($this, "questions"));
128 $this->ctrl->setParameter($this, "pgov", $_REQUEST["pgov"]);
129 }
130
131 $ilTabs->addSubTab("print",
132 $this->lng->txt("print_view"),
133 $this->ctrl->getLinkTarget($this, "printView"));
134
135 if($this->object->getSurveyPages())
136 {
137 if($a_cmd == "page")
138 {
139 $this->ctrl->setParameterByClass("ilsurveyexecutiongui", "pgov", max(1, $_REQUEST["pg"]));
140 }
141 $this->ctrl->setParameterByClass("ilsurveyexecutiongui", "prvw", 1);
142 $ilTabs->addSubTab("preview",
143 $this->lng->txt("preview"),
144 $this->ctrl->getLinkTargetByClass(array("ilobjsurveygui", "ilsurveyexecutiongui"), "preview"));
145 }
146
147 $ilTabs->activateSubTab($a_cmd);
148 }
149
150
151 //
152 // QUESTIONS BROWSER INCL. MULTI-ACTIONS
153 //
154
155 public function questionsObject()
156 {
157 global $ilToolbar, $ilUser;
158
159
160 // insert new questions?
161 if ($_GET["new_id"] > 0)
162 {
163 // add a question to the survey previous created in a questionpool
164 $existing = $this->object->getExistingQuestions();
165 if (!in_array($_GET["new_id"], $existing))
166 {
167 $inserted = $this->object->insertQuestion($_GET["new_id"]);
168 if (!$inserted)
169 {
170 ilUtil::sendFailure($this->lng->txt("survey_error_insert_incomplete_question"));
171 }
172 }
173 }
174
175
176 $this->questionsSubtabs("questions");
177
178 $hasDatasets = $this->object->_hasDatasets($this->object->getSurveyId());
179 $read_only = $hasDatasets;
180
181
182 // toolbar
183
184 if (!$read_only)
185 {
186 $qtypes = array();
187 include_once "./Modules/SurveyQuestionPool/classes/class.ilObjSurveyQuestionPool.php";
188 foreach (ilObjSurveyQuestionPool::_getQuestiontypes() as $translation => $data)
189 {
190 $qtypes[$data["type_tag"]] = $translation;
191 }
192
193 $ilToolbar->setFormAction($this->ctrl->getFormAction($this));
194 include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
195 $types = new ilSelectInputGUI($this->lng->txt("create_new"), "sel_question_types");
196 $types->setOptions($qtypes);
197 $ilToolbar->addStickyItem($types, "");
198
199
200 include_once "Services/UIComponent/Button/classes/class.ilLinkButton.php";
201 include_once "Services/UIComponent/Button/classes/class.ilSubmitButton.php";
202
203 $button = ilSubmitButton::getInstance();
204 $button->setCaption("svy_create_question");
205 $button->setCommand("createQuestion");
206 $ilToolbar->addStickyItem($button);
207
208 if($this->object->isPoolActive())
209 {
210 $ilToolbar->addSeparator();
211
212 $cmd = ($ilUser->getPref('svy_insert_type') == 1 ||
213 strlen($ilUser->getPref('svy_insert_type')) == 0)
214 ? 'browseForQuestions'
215 : 'browseForQuestionblocks';
216
217 $button = ilLinkButton::getInstance();
218 $button->setCaption("browse_for_questions");
219 $button->setUrl($this->ctrl->getLinkTarget($this, $cmd));
220 $ilToolbar->addStickyItem($button);
221 }
222
223 $ilToolbar->addSeparator();
224
225 $button = ilLinkButton::getInstance();
226 $button->setCaption("add_heading");
227 $button->setUrl($this->ctrl->getLinkTarget($this, "addHeading"));
228 $ilToolbar->addInputItem($button);
229 }
230 if ($hasDatasets)
231 {
232 $link = $this->ctrl->getLinkTargetByClass("ilsurveyparticipantsgui", "maintenance");
233 $link = "<a href=\"".$link."\">".$this->lng->txt("survey_has_datasets_warning_page_view_link")."</a>";
234 ilUtil::sendInfo($this->lng->txt("survey_has_datasets_warning_page_view")." ".$link);
235 }
236
237
238 // table gui
239
240 include_once "Modules/Survey/classes/class.ilSurveyQuestionTableGUI.php";
241 $table = new ilSurveyQuestionTableGUI($this, "questions", $this->object,
242 $read_only);
243 $this->tpl->setContent($table->getHTML());
244 }
245
255 protected function gatherSelectedTableItems($allow_blocks = true, $allow_questions = true, $allow_headings = false, $allow_questions_in_blocks = false)
256 {
257 $block_map = array();
258 foreach($this->object->getSurveyQuestions() as $item)
259 {
260 $block_map[$item["question_id"]] = $item["questionblock_id"];
261 }
262
263 $questions = $blocks = $headings = array();
264 if($_POST["id"])
265 {
266 foreach ($_POST["id"] as $key)
267 {
268 // questions
269 if ($allow_questions && preg_match("/cb_(\d+)/", $key, $matches))
270 {
271 if(($allow_questions_in_blocks || !$block_map[$matches[1]]) &&
272 !in_array($block_map[$matches[1]], $blocks))
273 {
274 array_push($questions, $matches[1]);
275 }
276 }
277 // blocks
278 if ($allow_blocks && preg_match("/cb_qb_(\d+)/", $key, $matches))
279 {
280 array_push($blocks, $matches[1]);
281 }
282 // headings
283 if ($allow_headings && preg_match("/cb_tb_(\d+)/", $key, $matches))
284 {
285 array_push($headings, $matches[1]);
286 }
287 }
288 }
289
290 return array("questions" => $questions,
291 "blocks" => $blocks,
292 "headings" => $headings);
293 }
294
295 public function saveObligatoryObject()
296 {
297 if(isset($_POST["order"]))
298 {
299 $position = -1;
300 $order = array();
301 asort($_POST["order"]);
302 foreach(array_keys($_POST["order"]) as $id)
303 {
304 // block items
305 if(substr($id, 0, 3) == "qb_")
306 {
307 $block_id = substr($id, 3);
308 $block = $_POST["block_order"][$block_id];
309 asort($block);
310 foreach(array_keys($block) as $question_id)
311 {
312 $position++;
313 $order[$question_id] = $position;
314 }
315 }
316 else
317 {
318 $question_id = substr($id, 2);
319 $position++;
320 $order[$question_id] = $position;
321 }
322 }
323 $this->object->updateOrder($order);
324 }
325
326 $obligatory = array();
327 foreach ($_POST as $key => $value)
328 {
329 if (preg_match("/obligatory_(\d+)/", $key, $matches))
330 {
331 $obligatory[$matches[1]] = 1;
332 }
333 }
334 $this->object->setObligatoryStates($obligatory);
335 ilUtil::sendSuccess($this->lng->txt('msg_obj_modified'), true);
336 $this->ctrl->redirect($this, "questions");
337 }
338
340 {
341 $items = $this->gatherSelectedTableItems(true, false, false, false);
342 if (count($items["blocks"]))
343 {
344 ilUtil::sendSuccess($this->lng->txt('msg_obj_modified'), true);
345 $this->object->unfoldQuestionblocks($items["blocks"]);
346 }
347 else
348 {
349 ilUtil::sendInfo($this->lng->txt("qpl_unfold_select_none"), true);
350 }
351 $this->ctrl->redirect($this, "questions");
352 }
353
354 public function moveQuestionsObject()
355 {
356 $items = $this->gatherSelectedTableItems(true, true, false, false);
357
358 $move_questions = $items["questions"];
359 foreach ($items["blocks"] as $block_id)
360 {
361 foreach ($this->object->getQuestionblockQuestionIds($block_id) as $qid)
362 {
363 array_push($move_questions, $qid);
364 }
365 }
366 if (count($move_questions) == 0)
367 {
368 ilUtil::sendInfo($this->lng->txt("no_question_selected_for_move"), true);
369 $this->ctrl->redirect($this, "questions");
370 }
371 else
372 {
373 $_SESSION["move_questions"] = $move_questions;
374 ilUtil::sendInfo($this->lng->txt("select_target_position_for_move_question"));
375 $this->questionsObject();
376 }
377 }
378
380 {
381 $this->insertQuestions(0);
382 }
383
385 {
386 $this->insertQuestions(1);
387 }
388
389 protected function insertQuestions($insert_mode)
390 {
391 $insert_id = null;
392 if($_POST["id"])
393 {
394 $items = $this->gatherSelectedTableItems(true, true, false, false);
395
396 // we are using POST id for original order
397 while(!$insert_id && sizeof($_POST["id"]))
398 {
399 $target = array_shift($_POST["id"]);
400 if (preg_match("/^cb_(\d+)$/", $target, $matches))
401 {
402 // questions in blocks are not allowed
403 if(in_array($matches[1], $items["questions"]))
404 {
405 $insert_id = $matches[1];
406 }
407 }
408 if (!$insert_id && preg_match("/^cb_qb_(\d+)$/", $target, $matches))
409 {
410 $ids = $this->object->getQuestionblockQuestionIds($matches[1]);
411 if (count($ids))
412 {
413 if ($insert_mode == 0)
414 {
415 $insert_id = $ids[0];
416 }
417 else if ($insert_mode == 1)
418 {
419 $insert_id = $ids[count($ids)-1];
420 }
421 }
422 }
423 }
424 }
425
426 if(!$insert_id)
427 {
428 ilUtil::sendInfo($this->lng->txt("no_target_selected_for_move"), true);
429 }
430 else
431 {
432 ilUtil::sendSuccess($this->lng->txt('msg_obj_modified'), true);
433 $this->object->moveQuestions($_SESSION["move_questions"], $insert_id, $insert_mode);
434 unset($_SESSION["move_questions"]);
435 }
436
437 $this->ctrl->redirect($this, "questions");
438 }
439
440 public function removeQuestionsObject()
441 {
442 $items = $this->gatherSelectedTableItems(true, true, true, true);
443 if (count($items["blocks"]) + count($items["questions"]) + count($items["headings"]) > 0)
444 {
445 ilUtil::sendQuestion($this->lng->txt("remove_questions"));
446 $this->removeQuestionsForm($items["blocks"], $items["questions"], $items["headings"]);
447 return;
448 }
449 else
450 {
451 ilUtil::sendInfo($this->lng->txt("no_question_selected_for_removal"), true);
452 $this->ctrl->redirect($this, "questions");
453 }
454 }
455
456 public function removeQuestionsForm($checked_questionblocks, $checked_questions, $checked_headings)
457 {
458 include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
459 $cgui = new ilConfirmationGUI();
460 $cgui->setHeaderText($this->lng->txt("survey_sure_delete_questions"));
461
462 $cgui->setFormAction($this->ctrl->getFormAction($this, "confirmRemoveQuestions"));
463 $cgui->setCancel($this->lng->txt("cancel"), "questions");
464 $cgui->setConfirm($this->lng->txt("confirm"), "confirmRemoveQuestions");
465
466 $counter = 0;
467 $surveyquestions =& $this->object->getSurveyQuestions();
468 include_once "./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php";
469 foreach ($surveyquestions as $question_id => $data)
470 {
471 if (in_array($data["question_id"], $checked_questions))
472 {
473 $type = SurveyQuestion::_getQuestionTypeName($data["type_tag"]);
474
475 $cgui->addItem("id_".$data["question_id"], $data["question_id"],
476 $type.": ".$data["title"]);
477 }
478 else if((in_array($data["questionblock_id"], $checked_questionblocks)))
479 {
480 $type = SurveyQuestion::_getQuestionTypeName($data["type_tag"]);
481
482 $cgui->addItem("id_qb_".$data["questionblock_id"], $data["questionblock_id"],
483 $data["questionblock_title"]." - ".$type.": ".$data["title"]);
484 }
485 else if (in_array($data["question_id"], $checked_headings))
486 {
487 $cgui->addItem("id_tb_".$data["question_id"], $data["question_id"],
488 $data["heading"]);
489 }
490 }
491
492 $this->tpl->setContent($cgui->getHTML());
493 }
494
496 {
497 $checked_questions = array();
498 $checked_questionblocks = array();
499 $checked_headings = array();
500 foreach ($_POST as $key => $value)
501 {
502 if (preg_match("/id_(\d+)/", $key, $matches))
503 {
504 array_push($checked_questions, $matches[1]);
505 }
506 if (preg_match("/id_qb_(\d+)/", $key, $matches))
507 {
508 array_push($checked_questionblocks, $matches[1]);
509 }
510 if (preg_match("/id_tb_(\d+)/", $key, $matches))
511 {
512 array_push($checked_headings, $matches[1]);
513 }
514 }
515
516 if(sizeof($checked_questions) || sizeof($checked_questionblocks))
517 {
518 $this->object->removeQuestions($checked_questions, $checked_questionblocks);
519 }
520 if($checked_headings)
521 {
522 foreach($checked_headings as $q_id)
523 {
524 $this->object->saveHeading("", $q_id);
525 }
526 }
527 $this->object->saveCompletionStatus();
528 ilUtil::sendSuccess($this->lng->txt("questions_removed"), true);
529 $this->ctrl->redirect($this, "questions");
530 }
531
533 {
534 $items = $this->gatherSelectedTableItems(true, true, false, true);
535
536 // gather questions from blocks
537 $copy_questions = $items["questions"];
538 foreach ($items["blocks"] as $block_id)
539 {
540 foreach ($this->object->getQuestionblockQuestionIds($block_id) as $qid)
541 {
542 array_push($copy_questions, $qid);
543 }
544 }
545 $copy_questions = array_unique($copy_questions);
546
547 // only if not already in pool
548 if (count($copy_questions))
549 {
550 foreach($copy_questions as $idx => $question_id)
551 {
552 $question = ilObjSurvey::_instanciateQuestion($question_id);
553 if($question->getOriginalId())
554 {
555 unset($copy_questions[$idx]);
556 }
557 }
558
559 }
560 if (count($copy_questions) == 0)
561 {
562 ilUtil::sendInfo($this->lng->txt("no_question_selected_for_copy_to_pool"), true);
563 $this->ctrl->redirect($this, "questions");
564 }
565 else
566 {
567 $this->questionsSubtabs("questions");
568
569 include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
570 $form = new ilPropertyFormGUI();
571
572 $form->setFormAction($this->ctrl->getFormAction($this, "executeCreateQuestion"));
573
574 $ids = new ilHiddenInputGUI("question_ids");
575 $ids->setValue(implode(";", $copy_questions));
576 $form->addItem($ids);
577
578 $questionpools =& $this->object->getAvailableQuestionpools(false, false, true, "write");
579 $pools = new ilSelectInputGUI($this->lng->txt("survey_copy_select_questionpool"), "sel_spl");
580 $pools->setOptions($questionpools);
581 $form->addItem($pools);
582
583 $form->addCommandButton("executeCopyQuestionsToPool", $this->lng->txt("submit"));
584 $form->addCommandButton("questions", $this->lng->txt("cancel"));
585
586 return $this->tpl->setContent($form->getHTML());
587 }
588 }
589
591 {
592 $question_ids = explode(";", $_POST["question_ids"]);
593 $pool_id = ilObject::_lookupObjId($_POST["sel_spl"]);
594
595 foreach($question_ids as $qid)
596 {
597 // create copy (== pool "original")
598 $new_question = ilObjSurvey::_instanciateQuestion($qid);
599 $new_question->setId();
600 $new_question->setObjId($pool_id);
601 $new_question->saveToDb();
602
603 // link "source" (survey) to copy (pool)
604 SurveyQuestion::_changeOriginalId($qid, $new_question->getId(), $pool_id);
605 }
606
607 ilUtil::sendSuccess($this->lng->txt("survey_copy_to_questionpool_success"), true);
608 $this->ctrl->redirect($this, "questions");
609 }
610
611
612 //
613 // QUESTION CREATION
614 //
615
616 public function createQuestionObject(ilPropertyFormGUI $a_form = null)
617 {
618 if(!$this->object->isPoolActive())
619 {
620 $_POST["usage"] = 1;
621 $_GET["sel_question_types"] = $_POST["sel_question_types"];
622 return $this->executeCreateQuestionObject();
623 }
624
625 if(!$a_form)
626 {
627 $this->questionsSubtabs("questions");
628
629 include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
630 $form = new ilPropertyFormGUI();
631
632 $sel_question_types = (strlen($_POST["sel_question_types"])) ? $_POST["sel_question_types"] : $_GET["sel_question_types"];
633 $this->ctrl->setParameter($this, "sel_question_types", $sel_question_types);
634 $form->setFormAction($this->ctrl->getFormAction($this, "executeCreateQuestion"));
635 }
636 else
637 {
638 $form = $a_form;
639 }
640
641 $usage = new ilRadioGroupInputGUI($this->lng->txt("survey_pool_selection"), "usage");
642 $usage->setRequired(true);
643 $no_pool = new ilRadioOption($this->lng->txt("survey_no_pool"), 1);
644 $usage->addOption($no_pool);
645 $existing_pool = new ilRadioOption($this->lng->txt("survey_existing_pool"), 3);
646 $usage->addOption($existing_pool);
647 $new_pool = new ilRadioOption($this->lng->txt("survey_new_pool"), 2);
648 $usage->addOption($new_pool);
649 $form->addItem($usage);
650
651 if(isset($_SESSION["svy_qpool_choice"]))
652 {
653 $usage->setValue($_SESSION["svy_qpool_choice"]);
654 }
655 else
656 {
657 // default: no pool
658 $usage->setValue(1);
659 }
660
661 $questionpools =& $this->object->getAvailableQuestionpools(FALSE, TRUE, TRUE, "write");
662 $pools = new ilSelectInputGUI($this->lng->txt("select_questionpool"), "sel_spl");
663 $pools->setOptions($questionpools);
664 $existing_pool->addSubItem($pools);
665
666 $name = new ilTextInputGUI($this->lng->txt("spl_new"), "name_spl"); // #11740
667 $name->setSize(50);
668 $name->setMaxLength(50);
669 $new_pool->addSubItem($name);
670
671 if($a_form)
672 {
673 return $a_form;
674 }
675
676 $form->addCommandButton("executeCreateQuestion", $this->lng->txt("submit"));
677 $form->addCommandButton("questions", $this->lng->txt("cancel"));
678
679 return $this->tpl->setContent($form->getHTML());
680 }
681
683 {
684 $_SESSION["svy_qpool_choice"] = $_POST["usage"];
685
686 $q_type = $_GET["sel_question_types"];
687
688 // no pool
689 if ($_POST["usage"] == 1)
690 {
691 $obj_id = $this->object->getId();
692 }
693 // existing pool
694 else if ($_POST["usage"] == 3 && strlen($_POST["sel_spl"]))
695 {
696 $obj_id = ilObject::_lookupObjId($_POST["sel_spl"]);
697 }
698 // new pool
699 elseif ($_POST["usage"] == 2 && strlen($_POST["name_spl"]))
700 {
701 $obj_id = $this->createQuestionPool($_POST["name_spl"]);
702 }
703 else
704 {
705 if(!$_POST["usage"])
706 {
707 ilUtil::sendFailure($this->lng->txt("select_one"), true);
708 }
709 else
710 {
711 ilUtil::sendFailure($this->lng->txt("err_no_pool_name"), true);
712 }
713 $this->ctrl->setParameter($this, "sel_question_types", $q_type);
714 $this->ctrl->redirect($this, "createQuestion");
715 }
716
717
718 // create question and redirect to question form
719
720 include_once "./Modules/SurveyQuestionPool/classes/class.SurveyQuestionGUI.php";
721 $q_gui = SurveyQuestionGUI::_getQuestionGUI($q_type);
722 $q_gui->object->setObjId($obj_id); // survey/pool!
723 $q_gui->object->createNewQuestion();
724 $q_gui_class = get_class($q_gui);
725
726 if($_REQUEST["pgov"])
727 {
728 $this->ctrl->setParameterByClass($q_gui_class, "pgov", $_REQUEST["pgov"]);
729 $this->ctrl->setParameterByClass($q_gui_class, "pgov_pos",$_REQUEST["pgov_pos"]);
730 }
731
732 $this->ctrl->setParameterByClass($q_gui_class, "ref_id", $this->object->getRefId());
733 $this->ctrl->setParameterByClass($q_gui_class, "new_for_survey", $this->object->getRefId());
734 $this->ctrl->setParameterByClass($q_gui_class, "q_id", $q_gui->object->getId());
735 $this->ctrl->setParameterByClass($q_gui_class, "sel_question_types", $q_gui->getQuestionType());
736 $this->ctrl->redirectByClass($q_gui_class, "editQuestion");
737 }
738
739 protected function createQuestionPool($name = "dummy")
740 {
741 global $tree;
742
743 $parent_ref = $tree->getParentId($this->object->getRefId());
744
745 include_once "./Modules/SurveyQuestionPool/classes/class.ilObjSurveyQuestionPool.php";
746 $qpl = new ilObjSurveyQuestionPool();
747 $qpl->setType("spl");
748 $qpl->setTitle($name);
749 $qpl->setDescription("");
750 $qpl->create();
751 $qpl->createReference();
752 $qpl->putInTree($parent_ref);
753 $qpl->setPermissions($parent_ref);
754 $qpl->setOnline(1); // must be online to be available
755 $qpl->saveToDb();
756
757 return $qpl->getId();
758 }
759
760
761 //
762 // ADD FROM POOL
763 //
764
765 protected function setBrowseForQuestionsSubtabs()
766 {
767 global $ilTabs, $ilToolbar, $ilUser;
768
769 if(!isset($_REQUEST["pgov"]))
770 {
771 $link = $this->ctrl->getLinkTarget($this, "questions");
772 }
773 else
774 {
775 $link = $this->ctrl->getLinkTargetByClass("ilsurveypagegui", "renderpage");
776 }
777 $ilTabs->setBackTarget($this->lng->txt("menubacktosurvey"), $link);
778
779 // type selector
780 include_once "Services/Form/classes/class.ilSelectInputGUI.php";
781 $types = new ilSelectInputGUI($this->lng->txt("display_all_available"), "datatype");
782 $types->setOptions(array(
783 1 => $this->lng->txt("questions"),
784 2 => $this->lng->txt("questionblocks")
785 ));
786 $types->setValue($ilUser->getPref('svy_insert_type'));
787 $ilToolbar->addInputItem($types, true);
788 $ilToolbar->addFormButton($this->lng->txt("change"), "changeDatatype");
789 $ilToolbar->setFormAction( $this->ctrl->getFormAction($this, "changeDatatype"));
790 }
791
792 public function changeDatatypeObject()
793 {
794 global $ilUser;
795
796 $ilUser->writePref('svy_insert_type', $_POST['datatype']);
797
798 switch ($_POST["datatype"])
799 {
800 case 2:
801 $this->ctrl->redirect($this, 'browseForQuestionblocks');
802 break;
803
804 case 1:
805 default:
806 $this->ctrl->redirect($this, 'browseForQuestions');
807 break;
808 }
809 }
810
811 public function browseForQuestionsObject()
812 {
814
815 include_once "./Modules/Survey/classes/tables/class.ilSurveyQuestionbrowserTableGUI.php";
816 $table_gui = new ilSurveyQuestionbrowserTableGUI($this, 'browseForQuestions', $this->object, true);
817 $table_gui->setEditable(true);
818 $this->tpl->setContent($table_gui->getHTML());
819 }
820
822 {
823 include_once "./Modules/Survey/classes/tables/class.ilSurveyQuestionbrowserTableGUI.php";
824 $table_gui = new ilSurveyQuestionbrowserTableGUI($this, 'browseForQuestions', $this->object);
825 $table_gui->writeFilterToSession();
826 $this->ctrl->redirect($this, 'browseForQuestions');
827 }
828
830 {
831 include_once "./Modules/Survey/classes/tables/class.ilSurveyQuestionbrowserTableGUI.php";
832 $table_gui = new ilSurveyQuestionbrowserTableGUI($this, 'browseForQuestions', $this->object);
833 $table_gui->resetFilter();
834 $this->ctrl->redirect($this, 'browseForQuestions');
835 }
836
837 public function insertQuestionsObject()
838 {
839 $inserted_objects = 0;
840 if (is_array($_POST['q_id']))
841 {
842 if($_REQUEST["pgov"])
843 {
844 include_once "Modules/Survey/classes/class.ilSurveyPageGUI.php";
845 $page_gui = new ilSurveyPageGUI($this->object, $this);
846 $page_gui->determineCurrentPage();
847
848 // as target position is predefined, insert in reverse order
849 $_POST['q_id'] = array_reverse($_POST['q_id']);
850 }
851 foreach ($_POST['q_id'] as $question_id)
852 {
853 if(!$_REQUEST["pgov"])
854 {
855 $this->object->insertQuestion($question_id);
856 }
857 else
858 {
859 // target position (pgov pos) is processed there
860 $page_gui->insertNewQuestion($question_id);
861 }
862 $inserted_objects++;
863 }
864 }
865 if ($inserted_objects)
866 {
867 $this->object->saveCompletionStatus();
868 ilUtil::sendSuccess($this->lng->txt("questions_inserted"), true);
869 if(!$_REQUEST["pgov"])
870 {
871 $this->ctrl->redirect($this, "questions");
872 }
873 else
874 {
875 $target_page = $_REQUEST["pgov"];
876 if(substr($_REQUEST["pgov_pos"], -1) == "c")
877 {
878 // see ilSurveyPageGUI::insertNewQuestion()
879 if((int)$_REQUEST["pgov_pos"])
880 {
881 $target_page++;
882 }
883 else
884 {
885 $target_page = 1;
886 }
887 }
888 $this->ctrl->setParameterByClass("ilsurveypagegui", "pgov", $target_page);
889 $this->ctrl->redirectByClass("ilsurveypagegui", "renderpage");
890 }
891 }
892 else
893 {
894 ilUtil::sendInfo($this->lng->txt("insert_missing_question"), true);
895 $this->ctrl->redirect($this, 'browseForQuestions');
896 }
897 }
898
900 {
902
903 include_once "./Modules/Survey/classes/tables/class.ilSurveyQuestionblockbrowserTableGUI.php";
904 $table_gui = new ilSurveyQuestionblockbrowserTableGUI($this, 'browseForQuestionblocks', $this->object, true);
905 $table_gui->setEditable(true);
906 $this->tpl->setContent($table_gui->getHTML());
907 }
908
910 {
911 include_once "./Modules/Survey/classes/tables/class.ilSurveyQuestionblockbrowserTableGUI.php";
912 $table_gui = new ilSurveyQuestionblockbrowserTableGUI($this, 'browseForQuestionblocks', $this->object);
913 $table_gui->writeFilterToSession();
914 $this->ctrl->redirect($this, 'browseForQuestionblocks');
915 }
916
918 {
919 include_once "./Modules/Survey/classes/tables/class.ilSurveyQuestionblockbrowserTableGUI.php";
920 $table_gui = new ilSurveyQuestionblockbrowserTableGUI($this, 'browseForQuestionblocks', $this->object);
921 $table_gui->resetFilter();
922 $this->ctrl->redirect($this, 'browseForQuestionblocks');
923 }
924
926 {
927 $inserted_objects = 0;
928 if (is_array($_POST['cb']))
929 {
930 if($_REQUEST["pgov"])
931 {
932 include_once "Modules/Survey/classes/class.ilSurveyPageGUI.php";
933 $page_gui = new ilSurveyPageGUI($this->object, $this);
934 $page_gui->determineCurrentPage();
935
936 // as target position is predefined, insert in reverse order
937 $_POST['cb'] = array_reverse($_POST['cb']);
938 }
939 foreach ($_POST['cb'] as $questionblock_id)
940 {
941 if(!$_REQUEST["pgov"])
942 {
943 $this->object->insertQuestionblock($questionblock_id);
944 }
945 else
946 {
947 $page_gui->insertQuestionblock($questionblock_id);
948 }
949 $inserted_objects++;
950 }
951 }
952 if ($inserted_objects)
953 {
954 $this->object->saveCompletionStatus();
955 ilUtil::sendSuccess(($inserted_objects == 1) ? $this->lng->txt("questionblock_inserted") : $this->lng->txt("questionblocks_inserted"), true);
956 if(!$_REQUEST["pgov"])
957 {
958 $this->ctrl->redirect($this, "questions");
959 }
960 else
961 {
962 $target_page = $_REQUEST["pgov"];
963 if(substr($_REQUEST["pgov_pos"], -1) == "c")
964 {
965 $target_page++;
966 }
967 $this->ctrl->setParameterByClass("ilsurveypagegui", "pgov", $target_page);
968 $this->ctrl->redirectByClass("ilsurveypagegui", "renderpage");
969 }
970 }
971 else
972 {
973 ilUtil::sendInfo($this->lng->txt("insert_missing_questionblock"), true);
974 $this->ctrl->redirect($this, 'browseForQuestionblocks');
975 }
976 }
977
978
979 //
980 // BLOCKS
981 //
982
983 public function editQuestionblockObject(ilPropertyFormGUI $a_form = null)
984 {
985 $block_id = (int)$_REQUEST["bl_id"];
986 $this->ctrl->setParameter($this, "bl_id", $block_id);
987
988 if(!$a_form)
989 {
990 $a_form = $this->initQuestionblockForm($block_id);
991 }
992
993 $this->questionsSubtabs("questions");
994 $this->tpl->setContent($a_form->getHTML());
995 }
996
997 public function createQuestionblockObject(ilPropertyFormGUI $a_form = null)
998 {
999 if(!$a_form)
1000 {
1001 // gather questions from table selected
1002 $items = $this->gatherSelectedTableItems(false, true, false, false);
1003 if(sizeof($_POST["qids"]))
1004 {
1005 $items["questions"] = $_POST["qids"];
1006 }
1007 if (count($items["questions"]) < 2)
1008 {
1009 ilUtil::sendInfo($this->lng->txt("qpl_define_questionblock_select_missing"), true);
1010 $this->ctrl->redirect($this, "questions");
1011 }
1012
1013 $a_form = $this->initQuestionblockForm(null, $items["questions"]);
1014 }
1015
1016 $this->questionsSubtabs("questions");
1017 $this->tpl->setContent($a_form->getHTML());
1018 }
1019
1020 protected function initQuestionblockForm($a_block_id = null, $a_question_ids = null)
1021 {
1022 include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
1023 $form = new ilPropertyFormGUI();
1024 $form->setFormAction($this->ctrl->getFormAction($this, "saveDefineQuestionblock"));
1025 $form->setTitle($this->lng->txt("define_questionblock"));
1026
1027 $title = new ilTextInputGUI($this->lng->txt("title"), "title");
1028 $title->setRequired(true);
1029 $form->addItem($title);
1030
1031 $toggle_blocktitle = new ilCheckboxInputGUI($this->lng->txt("survey_show_blocktitle"), "show_blocktitle");
1032 $toggle_blocktitle->setInfo($this->lng->txt("survey_show_blocktitle_description"));
1033 $form->addItem($toggle_blocktitle);
1034
1035 $toggle_questiontitle = new ilCheckboxInputGUI($this->lng->txt("show_questiontext"), "show_questiontext");
1036 $toggle_questiontitle->setInfo($this->lng->txt("show_questiontext_description"));
1037 $form->addItem($toggle_questiontitle);
1038
1039 if($a_block_id)
1040 {
1041 $questionblock = $this->object->getQuestionblock($a_block_id);
1042 $title->setValue($questionblock["title"]);
1043 $toggle_blocktitle->setChecked($questionblock["show_blocktitle"]);
1044 $toggle_questiontitle->setChecked($questionblock["show_questiontext"]);
1045 }
1046 else
1047 {
1048 $toggle_blocktitle->setChecked(true);
1049 $toggle_questiontitle->setChecked(true);
1050 }
1051
1052 $form->addCommandButton("saveDefineQuestionblock", $this->lng->txt("save"));
1053 $form->addCommandButton("questions", $this->lng->txt("cancel"));
1054
1055 // reload?
1056 if(!$a_question_ids && $_POST["qids"])
1057 {
1058 $a_question_ids = $_POST["qids"];
1059 }
1060
1061 if ($a_question_ids)
1062 {
1063 foreach ($a_question_ids as $q_id)
1064 {
1065 $hidden = new ilHiddenInputGUI("qids[]");
1066 $hidden->setValue($q_id);
1067 $form->addItem($hidden);
1068 }
1069 }
1070
1071 return $form;
1072 }
1073
1075 {
1076 $block_id = (int)$_REQUEST["bl_id"];
1077 $q_ids = $_POST["qids"];
1078
1079 $this->ctrl->setParameter($this, "bl_id", $block_id);
1080
1081 if(!$block_id && !is_array($q_ids))
1082 {
1083 $this->ctrl->redirect($this, "questions");
1084 }
1085
1086 $form = $this->initQuestionblockForm($block_id);
1087 if($form->checkInput())
1088 {
1089 $title = $form->getInput("title");
1090 $show_questiontext = $form->getInput("show_questiontext");
1091 $show_blocktitle = $form->getInput("show_blocktitle") ;
1092 if ($block_id)
1093 {
1094
1095 $this->object->modifyQuestionblock($block_id, $title,
1096 $show_questiontext, $show_blocktitle);
1097 }
1098 else if($q_ids)
1099 {
1100 $this->object->createQuestionblock($title, $show_questiontext,
1101 $show_blocktitle, $q_ids);
1102 }
1103
1104 ilUtil::sendSuccess($this->lng->txt('msg_obj_modified'), true);
1105 $this->ctrl->redirect($this, "questions");
1106 }
1107
1108 $form->setValuesByPost();
1109 $this->editQuestionblockObject($form);
1110 }
1111
1112
1113 //
1114 // HEADING
1115 //
1116
1117 protected function initHeadingForm($a_question_id = null)
1118 {
1119 $survey_questions = $this->object->getSurveyQuestions();
1120
1121 include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
1122 $form = new ilPropertyFormGUI();
1123 $form->setFormAction($this->ctrl->getFormAction($this, ""));
1124
1125 // heading
1126 $heading = new ilTextAreaInputGUI($this->lng->txt("heading"), "heading");
1127 $heading->setRows(10);
1128 $heading->setCols(80);
1129 $heading->setUseRte(TRUE);
1130 include_once "./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
1131 $heading->setRteTags(ilObjAdvancedEditing::_getUsedHTMLTags("survey"));
1132 $heading->removePlugin(ilRTE::ILIAS_IMG_MANAGER_PLUGIN);
1133 $heading->setRTESupport($this->object->getId(), "svy", "survey");
1134 $heading->setRequired(true);
1135 $form->addItem($heading);
1136
1137 $insertbefore = new ilSelectInputGUI($this->lng->txt("insert"), "insertbefore");
1138 $options = array();
1139 foreach ($survey_questions as $key => $value)
1140 {
1141 $options[$key] = $this->lng->txt("before") . ": \"" . $value["title"] . "\"";
1142 }
1143 $insertbefore->setOptions($options);
1144 $insertbefore->setRequired(true);
1145 $form->addItem($insertbefore);
1146
1147 $form->addCommandButton("saveHeading", $this->lng->txt("save"));
1148 $form->addCommandButton("questions", $this->lng->txt("cancel"));
1149
1150 if ($a_question_id)
1151 {
1152 $form->setTitle($this->lng->txt("edit_heading"));
1153
1154 $heading->setValue($this->object->prepareTextareaOutput($survey_questions[$a_question_id]["heading"]));
1155 $insertbefore->setValue($a_question_id);
1156 $insertbefore->setDisabled(true);
1157 }
1158 else
1159 {
1160 $form->setTitle($this->lng->txt("add_heading"));
1161 }
1162
1163 return $form;
1164 }
1165
1166 public function addHeadingObject(ilPropertyFormGUI $a_form = null)
1167 {
1168 $q_id = $_REQUEST["q_id"];
1169 $this->ctrl->setParameter($this, "q_id", $q_id);
1170
1171 $this->questionsSubtabs("questions");
1172
1173 if(!$a_form)
1174 {
1175 $a_form = $this->initHeadingForm($q_id);
1176 }
1177
1178 $this->tpl->setContent($a_form->getHTML());
1179 }
1180
1181 public function editHeadingObject(ilPropertyFormGUI $a_form = null)
1182 {
1183 $q_id = $_REQUEST["q_id"];
1184 $this->ctrl->setParameter($this, "q_id", $q_id);
1185
1186 $this->questionsSubtabs("questions");
1187
1188 if(!$a_form)
1189 {
1190 $a_form = $this->initHeadingForm($q_id);
1191 }
1192
1193 $this->tpl->setContent($a_form->getHTML());
1194 }
1195
1196 public function saveHeadingObject()
1197 {
1198 // #15474
1199 $q_id = (int)$_REQUEST["q_id"];
1200 $this->ctrl->setParameter($this, "q_id", $q_id);
1201
1202 $form = $this->initHeadingForm($q_id);
1203 if ($form->checkInput())
1204 {
1205 include_once "./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
1206 $this->object->saveHeading(ilUtil::stripSlashes($form->getInput("heading"),
1208 $form->getInput("insertbefore"));
1209 $this->ctrl->redirect($this, "questions");
1210 }
1211
1212 $form->setValuesByPost();
1213 $this->addHeadingObject($form);
1214 }
1215
1216 public function removeHeadingObject()
1217 {
1218 $q_id = (int)$_REQUEST["q_id"];
1219 $this->ctrl->setParameter($this, "q_id", $q_id);
1220
1221 if(!$q_id)
1222 {
1223 $this->ctrl->redirect($this, "questions");
1224 }
1225
1226 $this->questionsSubtabs("questions");
1227
1228 include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
1229 $cgui = new ilConfirmationGUI();
1230 $cgui->setHeaderText($this->lng->txt("confirm_remove_heading"));
1231
1232 $cgui->setFormAction($this->ctrl->getFormAction($this, "confirmedRemoveHeading"));
1233 $cgui->setCancel($this->lng->txt("cancel"), "questions");
1234 $cgui->setConfirm($this->lng->txt("confirm"), "confirmedRemoveHeading");
1235
1236 $this->tpl->setContent($cgui->getHTML());
1237 }
1238
1239
1241 {
1242 $q_id = (int)$_REQUEST["q_id"];
1243 if(!$q_id)
1244 {
1245 $this->ctrl->redirect($this, "questions");
1246 }
1247
1248 $this->object->saveHeading("", $q_id);
1249 $this->ctrl->redirect($this, "questions");
1250 }
1251
1252
1253
1254
1255
1256
1257
1258
1265 {
1266 global $ilToolbar;
1267
1268 $this->questionsSubtabs("print");
1269
1270 if(!isset($_POST["export_label"]))
1271 {
1272 $_POST["export_label"] = $this->object->getShowQuestionTitles();
1273 }
1274 $current_title = (int)$_POST["export_label"];
1275
1276 include_once "Services/Form/classes/class.ilSelectInputGUI.php";
1277 $label = new ilSelectInputGUI($this->lng->txt("title")."/".$this->lng->txt("label"), "export_label");
1278 $label->setOptions(array(
1279 #19448 get rid of none option
1280 //0 => $this->lng->txt('none'),
1281 1 => $this->lng->txt('svy_print_title_only'),
1282 2 => $this->lng->txt('svy_print_label_only'),
1283 3 => $this->lng->txt('svy_print_title_label')
1284 ));
1285 $label->setValue($current_title);
1286 $ilToolbar->addStickyItem($label, true);
1287
1288 $ilToolbar->setFormAction($this->ctrl->getFormAction($this, "printView"));
1289
1290 include_once "Services/UIComponent/Button/classes/class.ilSubmitButton.php";
1291 $button = ilSubmitButton::getInstance();
1292 $button->setCaption("show");
1293 $button->setCommand("printView");
1294 $ilToolbar->addStickyItem($button);
1295
1296 $ilToolbar->addSeparator();
1297
1298 include_once "Services/UIComponent/Button/classes/class.ilLinkButton.php";
1299 $button = ilLinkButton::getInstance();
1300 $button->setCaption("print");
1301 $button->setOnClick("window.print(); return false;");
1302 $button->setOmitPreventDoubleSubmission(true);
1303 $ilToolbar->addButtonInstance($button);
1304
1305 include_once './Services/WebServices/RPC/classes/class.ilRPCServerSettings.php';
1306 if(ilRPCServerSettings::getInstance()->isEnabled())
1307 {
1308 $this->ctrl->setParameter($this, "export_label", $current_title);
1309 $this->ctrl->setParameter($this, "pdf", "1");
1310 $pdf_url = $this->ctrl->getLinkTarget($this, "printView");
1311 $this->ctrl->setParameter($this, "pdf", "");
1312 $this->ctrl->setParameter($this, "export_label", "");
1313
1314 $button = ilLinkButton::getInstance();
1315 $button->setCaption("pdf_export");
1316 $button->setUrl($pdf_url);
1317 $button->setOmitPreventDoubleSubmission(true);
1318 $ilToolbar->addButtonInstance($button);
1319 }
1320
1321
1322 $template = new ilTemplate("tpl.il_svy_svy_printview.html", TRUE, TRUE, "Modules/Survey");
1323
1324 $pages =& $this->object->getSurveyPages();
1325 $required = false;
1326 foreach ($pages as $page)
1327 {
1328 if (count($page) > 0)
1329 {
1330 foreach ($page as $question)
1331 {
1332 $questionGUI = $this->object->getQuestionGUI($question["type_tag"], $question["question_id"]);
1333 if (is_object($questionGUI))
1334 {
1335 if (strlen($question["heading"]))
1336 {
1337 $template->setCurrentBlock("textblock");
1338 $template->setVariable("TEXTBLOCK", $question["heading"]);
1339 $template->parseCurrentBlock();
1340 }
1341 $template->setCurrentBlock("question");
1342 $template->setVariable("QUESTION_DATA", $questionGUI->getPrintView($current_title, $question["questionblock_show_questiontext"], $this->object->getSurveyId()));
1343 $template->parseCurrentBlock();
1344
1345 if($question["obligatory"])
1346 {
1347 $required = true;
1348 }
1349 }
1350 }
1351 if (count($page) > 1 && $page[0]["questionblock_show_blocktitle"])
1352 {
1353 $template->setCurrentBlock("page");
1354 $template->setVariable("BLOCKTITLE", $page[0]["questionblock_title"]);
1355 $template->parseCurrentBlock();
1356 }
1357 else
1358 {
1359 $template->setCurrentBlock("page");
1360 $template->parseCurrentBlock();
1361 }
1362 }
1363 }
1364
1365 // #6412
1366 if($required)
1367 {
1368 $template->setVariable("TEXT_REQUIRED", $this->lng->txt("required_field"));
1369 }
1370
1371 $this->tpl->addCss("./Modules/Survey/templates/default/survey_print.css", "print");
1372 if (array_key_exists("pdf", $_GET) && ($_GET["pdf"] == 1))
1373 {
1374 $printbody = new ilTemplate("tpl.il_as_tst_print_body.html", TRUE, TRUE, "Modules/Test");
1375 $printbody->setVariable("TITLE", sprintf($this->lng->txt("tst_result_user_name"), $uname));
1376 $printbody->setVariable("ADM_CONTENT", $template->get());
1377 $printoutput = $printbody->get();
1378 $printoutput = preg_replace("/href=\".*?\"/", "", $printoutput);
1379 $fo = $this->object->processPrintoutput2FO($printoutput);
1380 // #11436
1381 if(!$fo || !$this->object->deliverPDFfromFO($fo))
1382 {
1383 ilUtil::sendFailure($this->lng->txt("msg_failed"), true);
1384 $this->ctrl->redirect($this, "printView");
1385 }
1386 }
1387 else
1388 {
1389 $this->tpl->setVariable("ADM_CONTENT", $template->get());
1390 }
1391 }
1392
1393}
1394
1395?>
global $tpl
Definition: ilias.php:8
$_GET["client_id"]
$_SESSION["AccountId"]
static & _getQuestionGUI($questiontype, $question_id=-1)
Creates a question gui representation.
static _getQuestionTypeName($type_tag)
Return the translation for a given question type tag.
static _changeOriginalId($a_question_id, $a_original_id, $a_object_id)
Change original id of existing question in db.
This class represents a checkbox property in a property form.
Confirmation screen class.
This class represents a hidden form property in a property form.
static getInstance()
Factory.
& _getUsedHTMLTags($a_module="")
Returns an array of all allowed HTML tags for text editing.
& _getUsedHTMLTagsAsString($a_module="")
Returns a string of all allowed HTML tags for text editing.
Class ilObjSurveyGUI.
& _getQuestiontypes()
Creates a list of all available question types.
& _instanciateQuestion($question_id)
Creates an instance of a question with a given question id.
static _lookupObjId($a_id)
This class represents a property form user interface.
static getInstance()
Get singelton instance.
const ILIAS_IMG_MANAGER_PLUGIN
Definition: class.ilRTE.php:36
This class represents a property in a property form.
This class represents an option in a radio group.
This class represents a selection list property in a property form.
Settings template application class.
static getInstance()
Factory.
Class ilSurveyEditorGUI.
editHeadingObject(ilPropertyFormGUI $a_form=null)
initHeadingForm($a_question_id=null)
removeQuestionsForm($checked_questionblocks, $checked_questions, $checked_headings)
addHeadingObject(ilPropertyFormGUI $a_form=null)
createQuestionblockObject(ilPropertyFormGUI $a_form=null)
__construct(ilObjSurveyGUI $a_parent_gui)
gatherSelectedTableItems($allow_blocks=true, $allow_questions=true, $allow_headings=false, $allow_questions_in_blocks=false)
Gather (and filter) selected items from table gui.
createQuestionPool($name="dummy")
initQuestionblockForm($a_block_id=null, $a_question_ids=null)
editQuestionblockObject(ilPropertyFormGUI $a_form=null)
createQuestionObject(ilPropertyFormGUI $a_form=null)
printViewObject()
Creates a print view of the survey questions.
Survey per page view.
Survey question table GUI class.
special template class to simplify handling of ITX/PEAR
This class represents a text area property in a property form.
This class represents a text property in a property form.
static sendQuestion($a_info="", $a_keep=false)
Send Question to Screen.
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
$_POST['username']
Definition: cron.php:12
$data
global $ilCtrl
Definition: ilias.php:18
global $lng
Definition: privfeed.php:40
$cmd
Definition: sahs_server.php:35
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
if(!is_array($argv)) $options
global $ilUser
Definition: imgupload.php:15