ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.SurveyQuestionGUI.php
Go to the documentation of this file.
1 <?php
2  /*
3  +----------------------------------------------------------------------------+
4  | ILIAS open source |
5  +----------------------------------------------------------------------------+
6  | Copyright (c) 1998-2001 ILIAS open source, University of Cologne |
7  | |
8  | This program is free software; you can redistribute it and/or |
9  | modify it under the terms of the GNU General Public License |
10  | as published by the Free Software Foundation; either version 2 |
11  | of the License, or (at your option) any later version. |
12  | |
13  | This program is distributed in the hope that it will be useful, |
14  | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15  | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16  | GNU General Public License for more details. |
17  | |
18  | You should have received a copy of the GNU General Public License |
19  | along with this program; if not, write to the Free Software |
20  | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
21  +----------------------------------------------------------------------------+
22 */
23 
24 include_once "./Modules/Survey/classes/inc.SurveyConstants.php";
25 
37 {
45  var $object;
46  var $tpl;
47  var $lng;
48  private $errormessages;
49 
54 
66  function SurveyQuestionGUI()
67  {
68  global $lng, $tpl, $ilCtrl;
69 
70  $this->lng =& $lng;
71  $this->tpl =& $tpl;
72  $this->ctrl =& $ilCtrl;
73  $this->ctrl->saveParameter($this, "q_id");
74  $this->ctrl->setParameterByClass($_GET["cmdClass"], "sel_question_types", $_GET["sel_question_types"]);
75  $this->cumulated = array();
76  $this->errormessages = array();
77  }
78 
79  function addErrorMessage($errormessage)
80  {
81  if (strlen($errormessage)) array_push($this->errormessages, $errormessage);
82  }
83 
84  function outErrorMessages()
85  {
86  if (count($this->errormessages))
87  {
88  $out = implode("<br />", $this->errormessages);
90  }
91  }
92 
96  function &executeCommand()
97  {
98  $cmd = $this->ctrl->getCmd();
99  $next_class = $this->ctrl->getNextClass($this);
100 
101  $cmd = $this->getCommand($cmd);
102  switch($next_class)
103  {
104  default:
105  $ret =& $this->$cmd();
106  break;
107  }
108  return $ret;
109  }
110 
111  function getCommand($cmd)
112  {
113  return $cmd;
114  }
115 
127  static function &_getQuestionGUI($questiontype, $question_id = -1)
128  {
129  include_once "./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php";
130  if ((!$questiontype) and ($question_id > 0))
131  {
132  $questiontype = SurveyQuestion::_getQuestiontype($question_id);
133  }
134  SurveyQuestion::_includeClass($questiontype, 1);
135  $question_type_gui = $questiontype . "GUI";
136  $question = new $question_type_gui($question_id);
137  return $question;
138  }
139 
140  function _getGUIClassNameForId($a_q_id)
141  {
142  include_once "./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php";
143  include_once "./Modules/SurveyQuestionPool/classes/class.SurveyQuestionGUI.php";
144  $q_type = SurveyQuestion::_getQuestiontype($a_q_id);
145  $class_name = SurveyQuestionGUI::_getClassNameForQType($q_type);
146  return $class_name;
147  }
148 
149  function _getClassNameForQType($q_type)
150  {
151  return $q_type;
152  }
153 
154  function originalSyncForm()
155  {
156  ilUtil::sendQuestion($this->lng->txt("confirm_sync_questions"));
157  $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_svy_qpl_sync_original.html", "Modules/SurveyQuestionPool");
158  $this->tpl->setCurrentBlock("adm_content");
159  $this->tpl->setVariable("BUTTON_YES", $this->lng->txt("yes"));
160  $this->tpl->setVariable("BUTTON_NO", $this->lng->txt("no"));
161  $this->tpl->setVariable("FORM_ACTION", $this->ctrl->getFormAction($this));
162  $this->tpl->parseCurrentBlock();
163  }
164 
165  function sync()
166  {
167  $original_id = $this->object->original_id;
168  if ($original_id)
169  {
170  $this->object->syncWithOriginal();
171  }
172  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
173  $this->ctrl->redirect($this, "editQuestion");
174  }
175 
176  function cancelSync()
177  {
178  ilUtil::sendInfo($this->lng->txt("question_changed_in_survey_only"), true);
179  $this->ctrl->redirect($this, "editQuestion");
180  }
181 
185  function save()
186  {
187  global $ilUser;
188 
189  $old_id = $_GET["q_id"];
190  $result = $this->writePostData();
191  if ($result == 0)
192  {
193  $ilUser->setPref("svy_lastquestiontype", $this->object->getQuestionType());
194  $ilUser->writePref("svy_lastquestiontype", $this->object->getQuestionType());
195  $this->object->saveToDb();
196  $originalexists = $this->object->_questionExists($this->object->original_id);
197  $this->ctrl->setParameter($this, "q_id", $this->object->getId());
198  include_once "./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php";
199  if ($_GET["calling_survey"] && $originalexists && SurveyQuestion::_isWriteable($this->object->original_id, $ilUser->getId()))
200  {
201  $this->ctrl->redirect($this, 'originalSyncForm');
202  }
203  elseif ($_GET["calling_survey"])
204  {
205  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
206  $_GET["ref_id"] = $_GET["calling_survey"];
207  include_once "./Services/Utilities/classes/class.ilUtil.php";
208  ilUtil::redirect("ilias.php?baseClass=ilObjSurveyGUI&ref_id=" . $_GET["calling_survey"] . "&cmd=questions");
209  return;
210  }
211  elseif ($_GET["new_for_survey"] > 0)
212  {
213  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
214  $this->ctrl->setParameterByClass($_GET["cmdClass"], "q_id", $this->object->getId());
215  $this->ctrl->setParameterByClass($_GET["cmdClass"], "sel_question_types", $_GET["sel_question_types"]);
216  $this->ctrl->setParameterByClass($_GET["cmdClass"], "new_for_survey", $_GET["new_for_survey"]);
217  $this->ctrl->redirectByClass($_GET["cmdClass"], "editQuestion");
218  return;
219  }
220  else
221  {
222  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
223  $this->ctrl->setParameterByClass($_GET["cmdClass"], "q_id", $this->object->getId());
224  $this->ctrl->setParameterByClass($_GET["cmdClass"], "sel_question_types", $_GET["sel_question_types"]);
225  $this->ctrl->setParameterByClass($_GET["cmdClass"], "new_for_survey", $_GET["new_for_survey"]);
226  $this->ctrl->redirectByClass($_GET["cmdClass"], "editQuestion");
227  }
228  }
229  }
230 
231  function cancel()
232  {
233  if ($_GET["calling_survey"])
234  {
235  $_GET["ref_id"] = $_GET["calling_survey"];
236  include_once "./Services/Utilities/classes/class.ilUtil.php";
237  ilUtil::redirect("ilias.php?baseClass=ilObjSurveyGUI&cmd=questions&ref_id=".$_GET["calling_survey"]);
238  }
239  elseif ($_GET["new_for_survey"])
240  {
241  $_GET["ref_id"] = $_GET["new_for_survey"];
242  include_once "./Services/Utilities/classes/class.ilUtil.php";
243  ilUtil::redirect("ilias.php?baseClass=ilObjSurveyGUI&cmd=questions&ref_id=".$_GET["new_for_survey"]);
244  }
245  else
246  {
247  $this->ctrl->redirectByClass("ilobjsurveyquestionpoolgui", "questions");
248  }
249  }
250 
257  {
258  $this->ctrl->redirect($this, "editQuestion");
259  }
260 
264  protected function getMaterialOutput()
265  {
266  if (count($this->object->getMaterial()))
267  {
268  $template = new ilTemplate("tpl.il_svy_qpl_material.html", TRUE, TRUE, "Modules/SurveyQuestionPool");
269  foreach ($this->object->getMaterial() as $material)
270  {
271  $template->setCurrentBlock('material');
272  switch ($material->type)
273  {
274  case 0:
275  $href = SurveyQuestion::_getInternalLinkHref($material->internal_link);
276  $template->setVariable('MATERIAL_TYPE', 'internallink');
277  $template->setVariable('MATERIAL_HREF', $href);
278  break;
279  }
280  $template->setVariable('MATERIAL_TITLE', (strlen($material->title)) ? ilUtil::prepareFormOutput($material->title) : $this->lng->txt('material'));
281  $template->setVariable('TEXT_AVAILABLE_MATERIALS', $this->lng->txt('material'));
282  $template->parseCurrentBlock();
283  }
284  return $template->get();
285  }
286  return "";
287  }
288 
289 
293  public function material($checkonly = FALSE)
294  {
295  global $rbacsystem;
296 
297  $add_html = '';
298  if ($rbacsystem->checkAccess('write', $_GET['ref_id']))
299  {
300  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
301  $form = new ilPropertyFormGUI();
302  $form->setFormAction($this->ctrl->getFormAction($this));
303  $form->setTitle($this->lng->txt('add_material'));
304  $form->setMultipart(FALSE);
305  $form->setTableWidth("100%");
306  $form->setId("material");
307 
308  // material
309  $material = new ilRadioGroupInputGUI($this->lng->txt("material"), "internalLinkType");
310  $material->setRequired(true);
311  $material->addOption(new ilRadioOption($this->lng->txt('obj_lm'), "lm"));
312  $material->addOption(new ilRadioOption($this->lng->txt('obj_st'), "st"));
313  $material->addOption(new ilRadioOption($this->lng->txt('obj_pg'), "pg"));
314  $material->addOption(new ilRadioOption($this->lng->txt('glossary_term'), "glo"));
315  $form->addItem($material);
316 
317  $form->addCommandButton("addMaterial", $this->lng->txt("add"));
318 
319  $errors = false;
320 
321  if ($checkonly)
322  {
323  $form->setValuesByPost();
324  $errors = !$form->checkInput();
325  if ($errors) $checkonly = false;
326  }
327  $add_html = $form->getHTML();
328  }
329 
330 
331  $mat_html = "";
332  if (count($this->object->getMaterial()))
333  {
334  include_once "./Modules/SurveyQuestionPool/classes/tables/class.ilSurveyMaterialsTableGUI.php";
335  $table_gui = new ilSurveyMaterialsTableGUI($this, 'material', (($rbacsystem->checkAccess('write', $_GET['ref_id']) ? true : false)));
336  $data = array();
337  foreach ($this->object->getMaterial() as $material)
338  {
339  switch ($material->type)
340  {
341  case 0:
342  $href = SurveyQuestion::_getInternalLinkHref($material->internal_link);
343  $type = $this->lng->txt('internal_link');
344  break;
345  }
346  $title = (strlen($material->title)) ? ilUtil::prepareFormOutput($material->title) : $this->lng->txt('material');
347  array_push($data, array('href' => $href, 'title' => $title, 'type' => $type));
348  }
349  $table_gui->setData($data);
350  $mat_html = $table_gui->getHTML();
351  }
352 
353  if (!$checkonly) $this->tpl->setVariable("ADM_CONTENT", $add_html . $mat_html);
354  return $errors;
355  }
356 
357  public function deleteMaterial()
358  {
359  if (is_array($_POST['idx']))
360  {
361  $this->object->deleteMaterials($_POST['idx']);
362  ilUtil::sendSuccess($this->lng->txt('materials_deleted'), true);
363  }
364  else
365  {
366  ilUtil::sendFailure($this->lng->txt('no_checkbox'), true);
367  }
368  $this->ctrl->redirect($this, 'material');
369  }
370 
374  public function addMaterial()
375  {
376  global $tree;
377 
378  if (strlen($_SESSION["link_new_type"]) || !$this->material(true))
379  {
380  include_once("./Modules/SurveyQuestionPool/classes/class.ilMaterialExplorer.php");
381  switch ($_POST["internalLinkType"])
382  {
383  case "lm":
384  $_SESSION["link_new_type"] = "lm";
385  $_SESSION["search_link_type"] = "lm";
386  break;
387  case "glo":
388  $_SESSION["link_new_type"] = "glo";
389  $_SESSION["search_link_type"] = "glo";
390  break;
391  case "st":
392  $_SESSION["link_new_type"] = "lm";
393  $_SESSION["search_link_type"] = "st";
394  break;
395  case "pg":
396  $_SESSION["link_new_type"] = "lm";
397  $_SESSION["search_link_type"] = "pg";
398  break;
399  }
400 
401  ilUtil::sendInfo($this->lng->txt("select_object_to_link"));
402 
403  $exp = new ilMaterialExplorer($this->ctrl->getLinkTarget($this, 'addMaterial'), get_class($this));
404 
405  // expand current path (if no specific node given)
406  if(!$_GET["expand"])
407  {
408  $path = $tree->getPathId($_GET["ref_id"]);
409  $exp->setForceOpenPath($path);
410  }
411  else
412  {
413  $exp->setExpand($_GET["expand"]);
414  }
415  $exp->setExpandTarget($this->ctrl->getLinkTarget($this,'addMaterial'));
416  $exp->setTargetGet("ref_id");
417  $exp->setRefId($_GET["ref_id"]);
418  $exp->addFilter($_SESSION["link_new_type"]);
419  $exp->setSelectableType($_SESSION["link_new_type"]);
420 
421  // build html-output
422  $exp->setOutput(0);
423 
424  $this->tpl->addBlockFile("ADM_CONTENT", "explorer", "tpl.il_svy_qpl_explorer.html", "Modules/SurveyQuestionPool");
425  $this->tpl->setVariable("EXPLORER_TREE",$exp->getOutput());
426  $this->tpl->setVariable("BUTTON_CANCEL",$this->lng->txt("cancel"));
427  $this->tpl->setVariable("FORMACTION",$this->ctrl->getFormAction($this));
428  }
429  }
430 
431  function removeMaterial()
432  {
433  $this->object->material = array();
434  $this->object->saveToDb();
435  $this->editQuestion();
436  }
437 
438  function cancelExplorer()
439  {
440  unset($_SESSION["link_new_type"]);
441  ilUtil::sendInfo($this->lng->txt("msg_cancel"), true);
442  $this->ctrl->redirect($this, 'material');
443  }
444 
445  function addPG()
446  {
447  $this->object->addInternalLink("il__pg_" . $_GET["pg"]);
448  unset($_SESSION["link_new_type"]);
449  unset($_SESSION["search_link_type"]);
450  ilUtil::sendSuccess($this->lng->txt("material_added_successfully"), true);
451  $this->ctrl->redirect($this, "material");
452  }
453 
454  function addST()
455  {
456  $this->object->addInternalLink("il__st_" . $_GET["st"]);
457  unset($_SESSION["link_new_type"]);
458  unset($_SESSION["search_link_type"]);
459  ilUtil::sendSuccess($this->lng->txt("material_added_successfully"), true);
460  $this->ctrl->redirect($this, "material");
461  }
462 
463  function addGIT()
464  {
465  $this->object->addInternalLink("il__git_" . $_GET["git"]);
466  unset($_SESSION["link_new_type"]);
467  unset($_SESSION["search_link_type"]);
468  ilUtil::sendSuccess($this->lng->txt("material_added_successfully"), true);
469  $this->ctrl->redirect($this, "material");
470  }
471 
472  function linkChilds()
473  {
474  switch ($_SESSION["search_link_type"])
475  {
476  case "pg":
477  include_once "./Modules/LearningModule/classes/class.ilLMPageObject.php";
478  include_once("./Modules/LearningModule/classes/class.ilObjContentObjectGUI.php");
479  $cont_obj_gui =& new ilObjContentObjectGUI("", $_GET["source_id"], true);
480  $cont_obj = $cont_obj_gui->object;
481  $pages = ilLMPageObject::getPageList($cont_obj->getId());
482  $this->ctrl->setParameter($this, "q_id", $this->object->getId());
483  $color_class = array("tblrow1", "tblrow2");
484  $counter = 0;
485  $this->tpl->addBlockFile("ADM_CONTENT", "link_selection", "tpl.il_svy_qpl_internallink_selection.html", "Modules/SurveyQuestionPool");
486  foreach($pages as $page)
487  {
488  if($page["type"] == $_SESSION["search_link_type"])
489  {
490  $this->tpl->setCurrentBlock("linktable_row");
491  $this->tpl->setVariable("TEXT_LINK", $page["title"]);
492  $this->tpl->setVariable("TEXT_ADD", $this->lng->txt("add"));
493  $this->tpl->setVariable("LINK_HREF", $this->ctrl->getLinkTargetByClass(get_class($this), "add" . strtoupper($page["type"])) . "&" . $page["type"] . "=" . $page["obj_id"]);
494  $this->tpl->setVariable("COLOR_CLASS", $color_class[$counter % 2]);
495  $this->tpl->parseCurrentBlock();
496  $counter++;
497  }
498  }
499  $this->tpl->setCurrentBlock("link_selection");
500  $this->tpl->setVariable("BUTTON_CANCEL",$this->lng->txt("cancel"));
501  $this->tpl->setVariable("TEXT_LINK_TYPE", $this->lng->txt("obj_" . $_SESSION["search_link_type"]));
502  $this->tpl->setVariable("FORMACTION",$this->ctrl->getFormAction($this));
503  $this->tpl->parseCurrentBlock();
504  break;
505  case "st":
506  $this->ctrl->setParameter($this, "q_id", $this->object->getId());
507  $color_class = array("tblrow1", "tblrow2");
508  $counter = 0;
509  include_once("./Modules/LearningModule/classes/class.ilObjContentObjectGUI.php");
510  $cont_obj_gui =& new ilObjContentObjectGUI("", $_GET["source_id"], true);
511  $cont_obj = $cont_obj_gui->object;
512  // get all chapters
513  $ctree =& $cont_obj->getLMTree();
514  $nodes = $ctree->getSubtree($ctree->getNodeData($ctree->getRootId()));
515  $this->tpl->addBlockFile("ADM_CONTENT", "link_selection", "tpl.il_svy_qpl_internallink_selection.html", "Modules/SurveyQuestionPool");
516  foreach($nodes as $node)
517  {
518  if($node["type"] == $_SESSION["search_link_type"])
519  {
520  $this->tpl->setCurrentBlock("linktable_row");
521  $this->tpl->setVariable("TEXT_LINK", $node["title"]);
522  $this->tpl->setVariable("TEXT_ADD", $this->lng->txt("add"));
523  $this->tpl->setVariable("LINK_HREF", $this->ctrl->getLinkTargetByClass(get_class($this), "add" . strtoupper($node["type"])) . "&" . $node["type"] . "=" . $node["obj_id"]);
524  $this->tpl->setVariable("COLOR_CLASS", $color_class[$counter % 2]);
525  $this->tpl->parseCurrentBlock();
526  $counter++;
527  }
528  }
529  $this->tpl->setCurrentBlock("link_selection");
530  $this->tpl->setVariable("BUTTON_CANCEL",$this->lng->txt("cancel"));
531  $this->tpl->setVariable("TEXT_LINK_TYPE", $this->lng->txt("obj_" . $_SESSION["search_link_type"]));
532  $this->tpl->setVariable("FORMACTION",$this->ctrl->getFormAction($this));
533  $this->tpl->parseCurrentBlock();
534  break;
535  case "glo":
536  $this->ctrl->setParameter($this, "q_id", $this->object->getId());
537  $color_class = array("tblrow1", "tblrow2");
538  $counter = 0;
539  $this->tpl->addBlockFile("ADM_CONTENT", "link_selection", "tpl.il_svy_qpl_internallink_selection.html", "Modules/SurveyQuestionPool");
540  include_once "./Modules/Glossary/classes/class.ilObjGlossary.php";
541  $glossary =& new ilObjGlossary($_GET["source_id"], true);
542  // get all glossary items
543  $terms = $glossary->getTermList();
544  foreach($terms as $term)
545  {
546  $this->tpl->setCurrentBlock("linktable_row");
547  $this->tpl->setVariable("TEXT_LINK", $term["term"]);
548  $this->tpl->setVariable("TEXT_ADD", $this->lng->txt("add"));
549  $this->tpl->setVariable("LINK_HREF", $this->ctrl->getLinkTargetByClass(get_class($this), "addGIT") . "&git=" . $term["id"]);
550  $this->tpl->setVariable("COLOR_CLASS", $color_class[$counter % 2]);
551  $this->tpl->parseCurrentBlock();
552  $counter++;
553  }
554  $this->tpl->setCurrentBlock("link_selection");
555  $this->tpl->setVariable("BUTTON_CANCEL",$this->lng->txt("cancel"));
556  $this->tpl->setVariable("TEXT_LINK_TYPE", $this->lng->txt("glossary_term"));
557  $this->tpl->setVariable("FORMACTION",$this->ctrl->getFormAction($this));
558  $this->tpl->parseCurrentBlock();
559  break;
560  case "lm":
561  $this->object->addInternalLink("il__lm_" . $_GET["source_id"]);
562  unset($_SESSION["link_new_type"]);
563  unset($_SESSION["search_link_type"]);
564  ilUtil::sendSuccess($this->lng->txt("material_added_successfully"), true);
565  $this->ctrl->redirect($this, "material");
566  break;
567  }
568  }
569 
575  function getPrintView($question_title = 1, $show_questiontext = 1)
576  {
577  return "";
578  }
579 
580  function setQuestionTabsForClass($guiclass)
581  {
582  global $rbacsystem,$ilTabs;
583  $this->ctrl->setParameterByClass("$guiclass", "sel_question_types", $this->getQuestionType());
584  $this->ctrl->setParameterByClass("$guiclass", "q_id", $_GET["q_id"]);
585 
586  if (($_GET["calling_survey"] > 0) || ($_GET["new_for_survey"] > 0))
587  {
588  $ref_id = $_GET["calling_survey"];
589  if (!strlen($ref_id)) $ref_id = $_GET["new_for_survey"];
590  $addurl = "";
591  if (strlen($_GET["new_for_survey"]))
592  {
593  $addurl = "&new_id=" . $_GET["q_id"];
594  }
595  $ilTabs->setBackTarget($this->lng->txt("menubacktosurvey"), "ilias.php?baseClass=ilObjSurveyGUI&ref_id=$ref_id&cmd=questions" . $addurl);
596  }
597  else
598  {
599  $this->ctrl->setParameterByClass("ilObjSurveyQuestionPoolGUI", "q_id_table_nav", $_SESSION['q_id_table_nav']);
600  $ilTabs->setBackTarget($this->lng->txt("spl"), $this->ctrl->getLinkTargetByClass("ilObjSurveyQuestionPoolGUI", "questions"));
601  }
602  if ($_GET["q_id"])
603  {
604  $ilTabs->addTarget("preview",
605  $this->ctrl->getLinkTargetByClass("$guiclass", "preview"), "preview",
606  "$guiclass");
607  }
608  if ($rbacsystem->checkAccess('edit', $_GET["ref_id"])) {
609  $ilTabs->addTarget("edit_properties",
610  $this->ctrl->getLinkTargetByClass("$guiclass", "editQuestion"),
611  array("editQuestion", "save", "cancel", "originalSyncForm"),
612  "$guiclass");
613  }
614  if ($_GET["q_id"])
615  {
616  $ilTabs->addTarget("material",
617  $this->ctrl->getLinkTargetByClass("$guiclass", "material"),
618  array("material", "cancelExplorer", "linkChilds", "addGIT", "addST",
619  "addPG", "addMaterial", "removeMaterial"),
620  "$guiclass");
621  }
622 
623  if ($this->object->getId() > 0)
624  {
625  $title = $this->lng->txt("edit") . " &quot;" . $this->object->getTitle() . "&quot";
626  }
627  else
628  {
629  $title = $this->lng->txt("create_new") . " " . $this->lng->txt($this->getQuestionType());
630  }
631 
632  $this->tpl->setVariable("HEADER", $title);
633  }
634 
641  function getQuestionType()
642  {
643  return $this->object->getQuestionType();
644  }
645 
652  function getCumulatedResultRow($counter, $css_class, $survey_id)
653  {
654  // overwrite in parent classes
655  return "";
656  }
657 
658  function editQuestion()
659  {
660  $this->outErrorMessages();
661  }
662 
663  protected function outQuestionText($template)
664  {
665  $questiontext = $this->object->getQuestiontext();
666  if (preg_match("/^<.[\\>]?>(.*?)<\\/.[\\>]*?>$/", $questiontext, $matches))
667  {
668  $questiontext = $matches[1];
669  }
670  $template->setVariable("QUESTIONTEXT", $this->object->prepareTextareaOutput($questiontext, TRUE));
671  if ($this->object->getObligatory($survey_id))
672  {
673  $template->setVariable("OBLIGATORY_TEXT", ' *');
674  }
675  }
676 }
677 ?>