ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilObjQuestionPoolGUI.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 "./Services/Object/classes/class.ilObjectGUI.php";
25 include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
26 include_once "./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php";
27 include_once "./Modules/Test/classes/inc.AssessmentConstants.php";
28 include_once "./Modules/Test/classes/class.ilObjTest.php";
29 
52 {
56  public $object;
57 
63  {
64  global $lng, $ilCtrl, $rbacsystem;
65  $lng->loadLanguageModule("assessment");
66  $this->type = "qpl";
67  $this->ctrl =& $ilCtrl;
68  $this->ctrl->saveParameter($this, array("ref_id", "test_ref_id", "calling_test", "test_express_mode", "q_id"));
69 
70  $this->ilObjectGUI("",$_GET["ref_id"], true, false);
71  }
72 
83  function executeCommand()
84  {
85  global $ilLocator, $ilAccess, $ilNavigationHistory, $tpl, $ilCtrl, $ilErr;
86 
87  if ((!$ilAccess->checkAccess("read", "", $_GET["ref_id"])) && (!$ilAccess->checkAccess("visible", "", $_GET["ref_id"])))
88  {
89  global $ilias;
90  $ilias->raiseError($this->lng->txt("permission_denied"), $ilias->error_obj->MESSAGE);
91  }
92 
93  // add entry to navigation history
94  if (!$this->getCreationMode() &&
95  $ilAccess->checkAccess("read", "", $_GET["ref_id"]))
96  {
97  if('qpl' == $this->object->getType())
98  {
99  $ilNavigationHistory->addItem($_GET["ref_id"],
100  "ilias.php?baseClass=ilObjQuestionPoolGUI&cmd=questions&ref_id=" . $_GET["ref_id"], "qpl");
101  }
102  }
103 
104  $cmd = $this->ctrl->getCmd("questions");
105  $next_class = $this->ctrl->getNextClass($this);
106 
107  if( in_array($next_class, array('', 'ilobjquestionpoolgui')) && $cmd == 'questions' )
108  {
109  $_GET['q_id'] = '';
110  }
111 
112  $this->prepareOutput();
113 
114  $this->ctrl->setReturn($this, "questions");
115 
116  $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "test_print.css", "Modules/Test"), "print");
117  $this->tpl->addCss(ilUtil::getStyleSheetLocation("output", "ta.css", "Modules/Test"), "screen");
118 
119  if ($_GET["q_id"] < 1)
120  {
121  $q_type = ($_POST["sel_question_types"] != "")
122  ? $_POST["sel_question_types"]
123  : $_GET["sel_question_types"];
124  }
125  if ($cmd != "createQuestion" && $cmd != "createQuestionForTest"
126  && $next_class != "ilpageobjectgui")
127  {
128  if (($_GET["test_ref_id"] != "") or ($_GET["calling_test"]))
129  {
130  $ref_id = $_GET["test_ref_id"];
131  if (!$ref_id)
132  {
133  $ref_id = $_GET["calling_test"];
134  }
135  }
136  }
137  switch($next_class)
138  {
139  case "ilcommonactiondispatchergui":
140  include_once("Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
142  $this->ctrl->forwardCommand($gui);
143  break;
144 
145  case 'ilmdeditorgui':
146  if(!$ilAccess->checkAccess('write','',$this->object->getRefId()))
147  {
148  $ilErr->raiseError($this->lng->txt('permission_denied'),$ilErr->WARNING);
149  }
150 
151  include_once 'Services/MetaData/classes/class.ilMDEditorGUI.php';
152 
153  $md_gui = new ilMDEditorGUI($this->object->getId(), 0, $this->object->getType());
154  $md_gui->addObserver($this->object,'MDUpdateListener','General');
155  $this->ctrl->forwardCommand($md_gui);
156  break;
157  case "ilpageobjectgui":
158  include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
159  $this->tpl->setCurrentBlock("ContentStyle");
160  $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET",
162  $this->tpl->parseCurrentBlock();
163 
164  // syntax style
165  $this->tpl->setCurrentBlock("SyntaxStyle");
166  $this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET",
168  $this->tpl->parseCurrentBlock();
169  include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
170  $q_gui = assQuestionGUI::_getQuestionGUI("", $_GET["q_id"]);
171  $q_gui->setQuestionTabs();
172  $q_gui->outAdditionalOutput();
173  $q_gui->object->setObjId($this->object->getId());
174  $question = $q_gui->object;
175  $this->ctrl->saveParameter($this, "q_id");
176  include_once("./Services/COPage/classes/class.ilPageObject.php");
177  include_once("./Services/COPage/classes/class.ilPageObjectGUI.php");
178  $this->lng->loadLanguageModule("content");
179  $this->ctrl->setReturnByClass("ilPageObjectGUI", "view");
180  $this->ctrl->setReturn($this, "questions");
181  //$page =& new ilPageObject("qpl", $_GET["q_id"]);
182  $page_gui = new ilPageObjectGUI("qpl", $_GET["q_id"]);
183  $page_gui->setEditPreview(true);
184  $page_gui->setEnabledTabs(false);
185  $page_gui->setEnabledInternalLinks(false);
186  if (strlen($this->ctrl->getCmd()) == 0 && !isset($_POST["editImagemapForward_x"])) // workaround for page edit imagemaps, keep in mind
187  {
188  $this->ctrl->setCmdClass(get_class($page_gui));
189  $this->ctrl->setCmd("preview");
190  }
191  //$page_gui->setQuestionXML($question->toXML(false, false, true));
192  $page_gui->setQuestionHTML(array($q_gui->object->getId() => $q_gui->getPreview(TRUE)));
193  $page_gui->setTemplateTargetVar("ADM_CONTENT");
194  $page_gui->setOutputMode("edit");
195  $page_gui->setHeader($question->getTitle());
196  $page_gui->setFileDownloadLink($this->ctrl->getLinkTarget($this, "downloadFile"));
197  $page_gui->setFullscreenLink($this->ctrl->getLinkTarget($this, "fullscreen"));
198  $page_gui->setSourcecodeDownloadScript($this->ctrl->getLinkTarget($this));
199  $page_gui->setPresentationTitle($question->getTitle());
200  $ret = $this->ctrl->forwardCommand($page_gui);
201  $tpl->setContent($ret);
202  break;
203 
204  case 'ilpermissiongui':
205  include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
206  $perm_gui = new ilPermissionGUI($this);
207  $ret = $this->ctrl->forwardCommand($perm_gui);
208  break;
209 
210  case 'ilobjectcopygui':
211  include_once './Services/Object/classes/class.ilObjectCopyGUI.php';
212  $cp = new ilObjectCopyGUI($this);
213  $cp->setType('qpl');
214  $this->ctrl->forwardCommand($cp);
215  break;
216 
217  case "ilexportgui":
218  include_once("./Services/Export/classes/class.ilExportGUI.php");
219  $exp_gui = new ilExportGUI($this);
220  $exp_gui->addFormat("zip", $this->lng->txt('qpl_export_xml'), $this, "createExportQTI");
221  $exp_gui->addFormat("xls", $this->lng->txt('qpl_export_excel'), $this, "createExportExcel");
222  // $exp_gui->addCustomColumn($lng->txt("cont_public_access"), $this, "getPublicAccessColValue");
223  // $exp_gui->addCustomMultiCommand($lng->txt("cont_public_access"), $this, "publishExportFile");
224  $ret = $this->ctrl->forwardCommand($exp_gui);
225  break;
226 
227  case "ilinfoscreengui":
228  $this->infoScreenForward();
229  break;
230 
231  case 'ilassquestionhintsgui':
232 
233  // set return target
234  $this->ctrl->setReturn($this, "questions");
235 
236  // set context tabs
237  require_once 'Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
238  $questionGUI = assQuestionGUI::_getQuestionGUI($q_type, $_GET['q_id']);
239  $questionGUI->object->setObjId($this->object->getId());
240  $questionGUI->setQuestionTabs();
241 
242  // forward to ilAssQuestionHintsGUI
243  require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionHintsGUI.php';
244  $gui = new ilAssQuestionHintsGUI($questionGUI);
245  $ilCtrl->forwardCommand($gui);
246 
247  break;
248 
249  case "ilobjquestionpoolgui":
250  case "":
251 
252  if( $cmd == 'questions' )
253  {
254  $this->ctrl->setParameter($this, 'q_id', '');
255  }
256 
257  $cmd.= "Object";
258  $ret = $this->$cmd();
259  break;
260 
261  default:
262  $this->ctrl->setReturn($this, "questions");
263  include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
264  $q_gui = assQuestionGUI::_getQuestionGUI($q_type, $_GET["q_id"]);
265  $q_gui->object->setObjId($this->object->getId());
266  $q_gui->setQuestionTabs();
267  $ret = $this->ctrl->forwardCommand($q_gui);
268  break;
269  }
270 
271  if (strtolower($_GET["baseClass"]) != "iladministrationgui" &&
272  $this->getCreationMode() != true)
273  {
274  $this->tpl->show();
275  }
276  }
277 
281  function propertiesObject()
282  {
283  $save = ((strcmp($this->ctrl->getCmd(), "save") == 0)) ? true : false;
284 
285  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
286  $form = new ilPropertyFormGUI();
287  $form->setFormAction($this->ctrl->getFormAction($this, 'properties'));
288  $form->setTitle($this->lng->txt("properties"));
289  $form->setMultipart(false);
290 // $form->setTableWidth("100%");
291  $form->setId("properties");
292 
293  // online
294  $online = new ilCheckboxInputGUI($this->lng->txt("qpl_online_property"), "online");
295  $online->setInfo($this->lng->txt("qpl_online_property_description"));
296  $online->setChecked($this->object->getOnline());
297  $form->addItem($online);
298 
299  $form->addCommandButton("saveProperties", $this->lng->txt("save"));
300 
301  if ($save)
302  {
303  $form->checkInput();
304  }
305  $this->tpl->setVariable("ADM_CONTENT", $form->getHTML());
306  }
307 
312  {
313  $qpl_online = $_POST["online"];
314  if (strlen($qpl_online) == 0) $qpl_online = "0";
315  $this->object->setOnline($qpl_online);
316  $this->object->saveToDb();
317  ilUtil::sendSuccess($this->lng->txt("saved_successfully"), true);
318  $this->ctrl->redirect($this, "properties");
319  }
320 
325  {
326  $file = explode("_", $_GET["file_id"]);
327  include_once("./Modules/File/classes/class.ilObjFile.php");
328  $fileObj =& new ilObjFile($file[count($file) - 1], false);
329  $fileObj->sendFile();
330  exit;
331  }
332 
336  function fullscreenObject()
337  {
338  include_once("./Services/COPage/classes/class.ilPageObject.php");
339  include_once("./Services/COPage/classes/class.ilPageObjectGUI.php");
340  //$page =& new ilPageObject("qpl", $_GET["pg_id"]);
341  $page_gui =& new ilPageObjectGUI("qpl", $_GET["pg_id"]);
342  $page_gui->showMediaFullscreen();
343 
344  }
345 
346 
350  function filterObject()
351  {
352  $this->questionsObject();
353  }
354 
358  function resetFilterObject()
359  {
360  $_POST["filter_text"] = "";
361  $_POST["sel_filter_type"] = "";
362  $this->questionsObject();
363  }
364 
369  {
370  include_once("./Services/COPage/classes/class.ilPageObject.php");
371  $pg_obj =& new ilPageObject("qpl", $_GET["pg_id"]);
372  $pg_obj->send_paragraph ($_GET["par_id"], $_GET["downloadtitle"]);
373  exit;
374  }
375 
379  function uploadQplObject($questions_only = false)
380  {
381  $this->ctrl->setParameter($this, 'new_type', $_REQUEST['new_type']);
382  if ($_FILES["xmldoc"]["error"] > UPLOAD_ERR_OK)
383  {
384  ilUtil::sendFailure($this->lng->txt("error_upload"), true);
385  $this->ctrl->redirect($this, 'create');
386  return;
387  }
388  // create import directory
389  include_once "./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php";
391 
392  // copy uploaded file to import directory
393  $file = pathinfo($_FILES["xmldoc"]["name"]);
394  $full_path = $basedir."/".$_FILES["xmldoc"]["name"];
395  $GLOBALS['ilLog']->write(__METHOD__.": full path " . $full_path);
396  include_once "./Services/Utilities/classes/class.ilUtil.php";
397  ilUtil::moveUploadedFile($_FILES["xmldoc"]["tmp_name"], $_FILES["xmldoc"]["name"], $full_path);
398  $GLOBALS['ilLog']->write(__METHOD__.": full path " . $full_path);
399  if (strcmp($_FILES["xmldoc"]["type"], "text/xml") == 0)
400  {
401  $qti_file = $full_path;
403  }
404  else
405  {
406  // unzip file
407  ilUtil::unzip($full_path);
408 
409  // determine filenames of xml files
410  $subdir = basename($file["basename"],".".$file["extension"]);
412  $xml_file = ilObjQuestionPool::_getImportDirectory().'/'.$subdir.'/'.$subdir.".xml";
413  $qti_file = ilObjQuestionPool::_getImportDirectory().'/'.$subdir.'/'. str_replace("qpl", "qti", $subdir).".xml";
414  }
415 
416  // start verification of QTI files
417  include_once "./Services/QTI/classes/class.ilQTIParser.php";
418  $qtiParser = new ilQTIParser($qti_file, IL_MO_VERIFY_QTI, 0, "");
419  $result = $qtiParser->startParsing();
420  $founditems =& $qtiParser->getFoundItems();
421  if (count($founditems) == 0)
422  {
423  // nothing found
424 
425  // delete import directory
426  ilUtil::delDir($basedir);
427 
428  ilUtil::sendFailure($this->lng->txt("qpl_import_no_items"), true);
429  $this->ctrl->redirect($this, 'create');
430  return;
431  }
432 
433  $complete = 0;
434  $incomplete = 0;
435  foreach ($founditems as $item)
436  {
437  if (strlen($item["type"]))
438  {
439  $complete++;
440  }
441  else
442  {
443  $incomplete++;
444  }
445  }
446 
447  if ($complete == 0)
448  {
449  // delete import directory
450  ilUtil::delDir($basedir);
451 
452  ilUtil::sendFailure($this->lng->txt("qpl_import_non_ilias_files"), true);
453  $this->ctrl->redirect($this, 'create');
454  return;
455  }
456 
457  $_SESSION["qpl_import_xml_file"] = $xml_file;
458  $_SESSION["qpl_import_qti_file"] = $qti_file;
459  $_SESSION["qpl_import_subdir"] = $subdir;
460  // display of found questions
461  $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.qpl_import_verification.html",
462  "Modules/TestQuestionPool");
463  $row_class = array("tblrow1", "tblrow2");
464  $counter = 0;
465  foreach ($founditems as $item)
466  {
467  $this->tpl->setCurrentBlock("verification_row");
468  $this->tpl->setVariable("ROW_CLASS", $row_class[$counter++ % 2]);
469  $this->tpl->setVariable("QUESTION_TITLE", $item["title"]);
470  $this->tpl->setVariable("QUESTION_IDENT", $item["ident"]);
471  include_once "./Services/QTI/classes/class.ilQTIItem.php";
472  switch ($item["type"])
473  {
475  $type = $this->lng->txt("assClozeTest");
476  break;
478  $type = $this->lng->txt("assImagemapQuestion");
479  break;
481  $type = $this->lng->txt("assJavaApplet");
482  break;
484  $type = $this->lng->txt("assMatchingQuestion");
485  break;
487  $type = $this->lng->txt("assMultipleChoice");
488  break;
490  $type = $this->lng->txt("assSingleChoice");
491  break;
493  $type = $this->lng->txt("assOrderingQuestion");
494  break;
496  $type = $this->lng->txt("assTextQuestion");
497  break;
499  $type = $this->lng->txt("assNumeric");
500  break;
502  $type = $this->lng->txt("assTextSubset");
503  break;
504  default:
505  $type = $this->lng->txt($item["type"]);
506  break;
507  }
508 
509  if (strcmp($type, "-" . $item["type"] . "-") == 0)
510  {
511  global $ilPluginAdmin;
512  $pl_names = $ilPluginAdmin->getActivePluginsForSlot(IL_COMP_MODULE, "TestQuestionPool", "qst");
513  foreach ($pl_names as $pl_name)
514  {
515  $pl = ilPlugin::getPluginObject(IL_COMP_MODULE, "TestQuestionPool", "qst", $pl_name);
516  if (strcmp($pl->getQuestionType(), $item["type"]) == 0)
517  {
518  $type = $pl->getQuestionTypeTranslation();
519  }
520  }
521  }
522  $this->tpl->setVariable("QUESTION_TYPE", $type);
523  $this->tpl->parseCurrentBlock();
524  }
525 
526  $this->tpl->setCurrentBlock("import_qpl");
527  if (is_file($xml_file))
528  {
529  // read file into a string
530  $fh = @fopen($xml_file, "r") or die("");
531  $xml = @fread($fh, filesize($xml_file));
532  @fclose($fh);
533  if (preg_match("/<ContentObject.*?MetaData.*?General.*?Title[^>]*?>([^<]*?)</", $xml, $matches))
534  {
535  $this->tpl->setVariable("VALUE_NEW_QUESTIONPOOL", $matches[1]);
536  }
537  }
538  $this->tpl->setVariable("TEXT_CREATE_NEW_QUESTIONPOOL", $this->lng->txt("qpl_import_create_new_qpl"));
539  $this->tpl->parseCurrentBlock();
540 
541  $this->tpl->setCurrentBlock("adm_content");
542  $this->tpl->setVariable("TEXT_TYPE", $this->lng->txt("question_type"));
543  $this->tpl->setVariable("TEXT_TITLE", $this->lng->txt("question_title"));
544  $this->tpl->setVariable("FOUND_QUESTIONS_INTRODUCTION", $this->lng->txt("qpl_import_verify_found_questions"));
545  if ($questions_only)
546  {
547  $this->tpl->setVariable("VERIFICATION_HEADING", $this->lng->txt("import_questions_into_qpl"));
548  $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
549  }
550  else
551  {
552  $this->tpl->setVariable("VERIFICATION_HEADING", $this->lng->txt("import_qpl"));
553 
554  $this->ctrl->setParameter($this, "new_type", $this->type);
555  $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
556 
557  //$this->tpl->setVariable("FORMACTION", $this->getFormAction("save","adm_object.php?cmd=gateway&ref_id=".$_GET["ref_id"]."&new_type=".$this->type));
558  }
559  $this->tpl->setVariable("ARROW", ilUtil::getImagePath("arrow_downright.png"));
560  $this->tpl->setVariable("VALUE_IMPORT", $this->lng->txt("import"));
561  $this->tpl->setVariable("VALUE_CANCEL", $this->lng->txt("cancel"));
562  $value_questions_only = 0;
563  if ($questions_only) $value_questions_only = 1;
564  $this->tpl->setVariable("VALUE_QUESTIONS_ONLY", $value_questions_only);
565 
566  $this->tpl->parseCurrentBlock();
567  }
568 
573  {
574  if ($_POST["questions_only"] == 1)
575  {
576  $newObj =& $this->object;
577  }
578  else
579  {
580  include_once("./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php");
581  // create new questionpool object
582  $newObj = new ilObjQuestionPool(0, true);
583  // set type of questionpool object
584  $newObj->setType($_GET["new_type"]);
585  // set title of questionpool object to "dummy"
586  $newObj->setTitle("dummy");
587  // set description of questionpool object
588  $newObj->setDescription("questionpool import");
589  // create the questionpool class in the ILIAS database (object_data table)
590  $newObj->create(true);
591  // create a reference for the questionpool object in the ILIAS database (object_reference table)
592  $newObj->createReference();
593  // put the questionpool object in the administration tree
594  $newObj->putInTree($_GET["ref_id"]);
595  // get default permissions and set the permissions for the questionpool object
596  $newObj->setPermissions($_GET["ref_id"]);
597  // notify the questionpool object and all its parent objects that a "new" object was created
598  $newObj->notify("new",$_GET["ref_id"],$_GET["parent_non_rbac_id"],$_GET["ref_id"],$newObj->getRefId());
599  }
600 
601  // start parsing of QTI files
602  include_once "./Services/QTI/classes/class.ilQTIParser.php";
603  $qtiParser = new ilQTIParser($_SESSION["qpl_import_qti_file"], IL_MO_PARSE_QTI, $newObj->getId(), $_POST["ident"]);
604  $result = $qtiParser->startParsing();
605 
606  // import page data
607  if (strlen($_SESSION["qpl_import_xml_file"]))
608  {
609  include_once ("./Modules/LearningModule/classes/class.ilContObjParser.php");
610  $contParser = new ilContObjParser($newObj, $_SESSION["qpl_import_xml_file"], $_SESSION["qpl_import_subdir"]);
611  $contParser->setQuestionMapping($qtiParser->getImportMapping());
612  $contParser->startParsing();
613  }
614 
615  // set another question pool name (if possible)
616  $qpl_name = $_POST["qpl_new"];
617  if ((strcmp($qpl_name, $newObj->getTitle()) != 0) && (strlen($qpl_name) > 0))
618  {
619  $newObj->setTitle($qpl_name);
620  $newObj->update();
621  }
622 
623  // delete import directory
624  include_once "./Services/Utilities/classes/class.ilUtil.php";
626 
627  if ($_POST["questions_only"] == 1)
628  {
629  $this->ctrl->redirect($this, "questions");
630  }
631  else
632  {
633  ilUtil::sendSuccess($this->lng->txt("object_imported"),true);
634  ilUtil::redirect("ilias.php?ref_id=".$newObj->getRefId().
635  "&baseClass=ilObjQuestionPoolGUI");
636  }
637  }
638 
640  {
641  if ($_POST["questions_only"] == 1)
642  {
643  $this->ctrl->redirect($this, "questions");
644  }
645  else
646  {
647  $this->ctrl->redirect($this, "cancel");
648  }
649  }
650 
654  function uploadObject()
655  {
656  $this->uploadQplObject(true);
657  }
658 
663  {
664  $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_as_import_question.html", "Modules/TestQuestionPool");
665  $this->tpl->setCurrentBlock("adm_content");
666  $this->tpl->setVariable("TEXT_IMPORT_QUESTION", $this->lng->txt("import_question"));
667  $this->tpl->setVariable("TEXT_SELECT_FILE", $this->lng->txt("select_file"));
668  $this->tpl->setVariable("TEXT_UPLOAD", $this->lng->txt("upload"));
669  $this->tpl->setVariable("FORM_ACTION", $this->ctrl->getFormAction($this));
670  $this->tpl->parseCurrentBlock();
671  }
672 
677  {
678  include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
679  $q_gui =& assQuestionGUI::_getQuestionGUI($_POST["sel_question_types"]);
680  $q_gui->object->setObjId($this->object->getId());
681  $q_gui->object->createNewQuestion();
682  $this->ctrl->setParameterByClass(get_class($q_gui), "q_id", $q_gui->object->getId());
683  $this->ctrl->setParameterByClass(get_class($q_gui), "sel_question_types", $_POST["sel_question_types"]);
684  $this->ctrl->redirectByClass(get_class($q_gui), "editQuestion");
685  }
686 
691  {
692  if (!$_REQUEST['q_id']) {
693  include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
694  $q_gui =& assQuestionGUI::_getQuestionGUI($_GET["sel_question_types"]);
695  $q_gui->object->setObjId($this->object->getId());
696  $q_gui->object->createNewQuestion();
697  $this->ctrl->setParameterByClass(get_class($q_gui), "q_id", $q_gui->object->getId());
698  $this->ctrl->setParameterByClass(get_class($q_gui), "sel_question_types", $_REQUEST["sel_question_types"]);
699  $this->ctrl->setParameterByClass(get_class($q_gui), "prev_qid", $_REQUEST["prev_qid"]);
700  $this->ctrl->redirectByClass(get_class($q_gui), "editQuestion");
701  }
702  else {
703  $class = $_GET["sel_question_types"] . 'gui';
704  $this->ctrl->setParameterByClass($class, "q_id", $_REQUEST['q_id']);
705  $this->ctrl->setParameterByClass($class, "sel_question_types", $_REQUEST["sel_question_types"]);
706  $this->ctrl->setParameterByClass($class, "prev_qid", $_REQUEST["prev_qid"]);
707  $this->ctrl->redirectByClass($class, "editQuestion");
708  }
709  }
710 
715  function afterSave(ilObject $a_new_object)
716  {
717  // always send a message
718  ilUtil::sendSuccess($this->lng->txt("object_added"),true);
719 
720  ilUtil::redirect("ilias.php?ref_id=".$a_new_object->getRefId().
721  "&baseClass=ilObjQuestionPoolGUI");
722  }
723 
727  function assessmentObject()
728  {
729  $this->tpl->addBlockFile("CONTENT", "content", "tpl.il_as_qpl_content.html", "Modules/TestQuestionPool");
730  $this->tpl->addBlockFile("STATUSLINE", "statusline", "tpl.statusline.html");
731 
732  // catch feedback message
734 
735  include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
736  $question_title = assQuestion::_getTitle($_GET["q_id"]);
737  $title = $this->lng->txt("statistics") . " - $question_title";
738  if (!empty($title))
739  {
740  $this->tpl->setVariable("HEADER", $title);
741  }
742  include_once("./Modules/TestQuestionPool/classes/class.assQuestion.php");
743  $total_of_answers = assQuestion::_getTotalAnswers($_GET["q_id"]);
744  $counter = 0;
745  $color_class = array("tblrow1", "tblrow2");
746  $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_as_qpl_assessment_of_questions.html", "Modules/TestQuestionPool");
747  if (!$total_of_answers)
748  {
749  $this->tpl->setCurrentBlock("emptyrow");
750  $this->tpl->setVariable("TXT_NO_ASSESSMENT", $this->lng->txt("qpl_assessment_no_assessment_of_questions"));
751  $this->tpl->setVariable("COLOR_CLASS", $color_class[$counter % 2]);
752  $this->tpl->parseCurrentBlock();
753  }
754  else
755  {
756  $this->tpl->setCurrentBlock("row");
757  $this->tpl->setVariable("TXT_RESULT", $this->lng->txt("qpl_assessment_total_of_answers"));
758  $this->tpl->setVariable("TXT_VALUE", $total_of_answers);
759  $this->tpl->setVariable("COLOR_CLASS", $color_class[$counter % 2]);
760  $counter++;
761  $this->tpl->parseCurrentBlock();
762  $this->tpl->setCurrentBlock("row");
763  $this->tpl->setVariable("TXT_RESULT", $this->lng->txt("qpl_assessment_total_of_right_answers"));
764  $this->tpl->setVariable("TXT_VALUE", sprintf("%2.2f", assQuestion::_getTotalRightAnswers($_GET["edit"]) * 100.0) . " %");
765  $this->tpl->setVariable("COLOR_CLASS", $color_class[$counter % 2]);
766  $this->tpl->parseCurrentBlock();
767  }
768  $this->tpl->setCurrentBlock("adm_content");
769  $this->tpl->setVariable("TXT_QUESTION_TITLE", $question_title);
770  $this->tpl->setVariable("TXT_RESULT", $this->lng->txt("result"));
771  $this->tpl->setVariable("TXT_VALUE", $this->lng->txt("value"));
772  $this->tpl->parseCurrentBlock();
773  }
774 
775  function questionObject()
776  {
777 //echo "<br>ilObjQuestionPoolGUI->questionObject()";
778  $type = $_GET["sel_question_types"];
779  $this->editQuestionForm($type);
780  }
781 
786  {
787  global $rbacsystem;
788 
789  if (count($_POST["q_id"]) < 1)
790  {
791  ilUtil::sendInfo($this->lng->txt("qpl_delete_select_none"), true);
792  $this->ctrl->redirect($this, "questions");
793  }
794 
795  ilUtil::sendQuestion($this->lng->txt("qpl_confirm_delete_questions"));
796  $deleteable_questions =& $this->object->getDeleteableQuestionDetails($_POST["q_id"]);
797  include_once "./Modules/TestQuestionPool/classes/tables/class.ilQuestionBrowserTableGUI.php";
798  $table_gui = new ilQuestionBrowserTableGUI($this, 'questions', (($rbacsystem->checkAccess('write', $_GET['ref_id']) ? true : false)), true);
799  $table_gui->setEditable($rbacsystem->checkAccess('write', $_GET['ref_id']));
800  $table_gui->setData($deleteable_questions);
801  $this->tpl->setVariable('ADM_CONTENT', $table_gui->getHTML());
802  }
803 
804 
809  {
810  // delete questions after confirmation
811  foreach ($_POST["q_id"] as $key => $value)
812  {
813  $this->object->deleteQuestion($value);
814  $this->object->cleanupClipboard($value);
815  }
816  if (count($_POST["q_id"])) ilUtil::sendSuccess($this->lng->txt("qpl_questions_deleted"), true);
817 
818  $this->ctrl->setParameter($this, 'q_id', '');
819 
820  $this->ctrl->redirect($this, "questions");
821  }
822 
827  {
828  $this->ctrl->redirect($this, "questions");
829  }
830 
835  {
836  // export button was pressed
837  if (count($_POST["q_id"]) > 0)
838  {
839  include_once("./Modules/TestQuestionPool/classes/class.ilQuestionpoolExport.php");
840  $qpl_exp = new ilQuestionpoolExport($this->object, "xml", $_POST["q_id"]);
841  $export_file = $qpl_exp->buildExportFile();
842  $filename = $export_file;
843  $filename = preg_replace("/.*\//", "", $filename);
844  include_once "./Services/Utilities/classes/class.ilUtil.php";
845  ilUtil::deliverFile($export_file, $filename);
846  exit();
847  }
848  else
849  {
850  ilUtil::sendInfo($this->lng->txt("qpl_export_select_none"), true);
851  }
852  $this->ctrl->redirect($this, "questions");
853  }
854 
856  {
857  include_once "./Modules/TestQuestionPool/classes/tables/class.ilQuestionBrowserTableGUI.php";
858  $table_gui = new ilQuestionBrowserTableGUI($this, 'questions');
859  $table_gui->resetOffset();
860  $table_gui->writeFilterToSession();
861  $this->questionsObject();
862  }
863 
865  {
866  include_once "./Modules/TestQuestionPool/classes/tables/class.ilQuestionBrowserTableGUI.php";
867  $table_gui = new ilQuestionBrowserTableGUI($this, 'questions');
868  $table_gui->resetOffset();
869  $table_gui->resetFilter();
870  $this->questionsObject();
871  }
872 
876  function questionsObject($arrFilter = null)
877  {
878  global $rbacsystem;
879  global $ilUser;
880 
881  if(get_class($this->object) == "ilObjTest")
882  {
883  if ($_GET["calling_test"] > 0)
884  {
885  $ref_id = $_GET["calling_test"];
886  $q_id = $_GET["q_id"];
887 
888  if ($_REQUEST['test_express_mode']) {
889  if ($q_id)
890  ilUtil::redirect("ilias.php?ref_id=".$ref_id."&q_id=".$q_id."&test_express_mode=1&cmd=showPage&cmdClass=iltestexpresspageobjectgui&baseClass=ilObjTestGUI");
891  else
892  ilUtil::redirect("ilias.php?ref_id=".$ref_id."&test_express_mode=1&cmd=showPage&cmdClass=iltestexpresspageobjectgui&baseClass=ilObjTestGUI");
893  }
894  else
895  ilUtil::redirect("ilias.php?baseClass=ilObjTestGUI&ref_id=".$ref_id."&cmd=questions");
896 
897  }
898  }
899  if($this->object instanceof ilObjQuestionPool)
900  {
901  $this->object->purgeQuestions();
902  }
903  // reset test_id SESSION variable
904  $_SESSION["test_id"] = "";
905 
906  $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_as_qpl_questionbrowser.html", "Modules/TestQuestionPool");
907  include_once "./Modules/TestQuestionPool/classes/tables/class.ilQuestionBrowserTableGUI.php";
908  $table_gui = new ilQuestionBrowserTableGUI($this, 'questions', (($rbacsystem->checkAccess('write', $_GET['ref_id']) ? true : false)));
909  $table_gui->setEditable($rbacsystem->checkAccess('write', $_GET['ref_id']));
910  $arrFilter = array();
911  foreach ($table_gui->getFilterItems() as $item)
912  {
913  if ($item->getValue() !== false)
914  {
915  $arrFilter[$item->getPostVar()] = $item->getValue();
916  }
917  }
918  $data = $this->object->getQuestionBrowserData($arrFilter);
919  $table_gui->setData($data);
920  $this->tpl->setVariable('TABLE', $table_gui->getHTML());
921 
922  if ($rbacsystem->checkAccess('write', $_GET['ref_id']))
923  {
924  $this->tpl->setCurrentBlock("QTypes");
925  $types =& $this->object->getQuestionTypes(false, true);
926  //$lastquestiontype = $ilUser->getPref("tst_lastquestiontype");
927  foreach ($types as $translation => $data)
928  {
929  /*if ($data["type_tag"] == $lastquestiontype)
930  {
931  $this->tpl->setVariable("QUESTION_TYPE_SELECTED", " selected=\"selected\"");
932  }*/
933  $this->tpl->setVariable("QUESTION_TYPE_ID", $data["type_tag"]);
934  $this->tpl->setVariable("QUESTION_TYPE", $translation);
935  $this->tpl->parseCurrentBlock();
936  }
937  $this->tpl->setVariable("QUESTION_ADD", $this->lng->txt("create"));
938  $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this, 'questions'));
939  $this->tpl->parseCurrentBlock();
940  }
941  }
942 
946  public function printObject()
947  {
951  global $ilToolbar;
952 
953  $ilToolbar->setFormAction($this->ctrl->getFormAction($this, 'print'));
954  require_once 'Services/Form/classes/class.ilSelectInputGUI.php';
955  $mode = new ilSelectInputGUI($this->lng->txt('output_mode'), 'output');
956  $mode->setOptions(array(
957  'overview' => $this->lng->txt('overview'),
958  'detailed' => $this->lng->txt('detailed_output_solutions'),
959  'detailed_printview' => $this->lng->txt('detailed_output_printview')
960  ));
961  $mode->setValue(ilUtil::stripSlashes($_POST['output']));
962 
963  $ilToolbar->setFormName('printviewOptions');
964  $ilToolbar->addInputItem($mode, true);
965  $ilToolbar->addFormButton($this->lng->txt('submit'), 'print');
966 
967  include_once "./Modules/TestQuestionPool/classes/tables/class.ilQuestionPoolPrintViewTableGUI.php";
968  $table_gui = new ilQuestionPoolPrintViewTableGUI($this, 'print', $_POST['output']);
969  $data = $this->object->getPrintviewQuestions();
970  $table_gui->setData($data);
971  $this->tpl->setContent($table_gui->getHTML());
972  }
973 
974  function updateObject()
975  {
976 // $this->update = $this->object->updateMetaData();
977  $this->update = $this->object->update();
978  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
979  }
980 
984  function pasteObject()
985  {
986  if (array_key_exists("qpl_clipboard", $_SESSION))
987  {
988  $this->object->pasteFromClipboard();
989  ilUtil::sendSuccess($this->lng->txt("qpl_paste_success"), true);
990  }
991  else
992  {
993  ilUtil::sendInfo($this->lng->txt("qpl_paste_no_objects"), true);
994  }
995  $this->ctrl->redirect($this, "questions");
996  }
997 
1001  public function copyObject()
1002  {
1003  if (count($_POST["q_id"]) > 0)
1004  {
1005  foreach ($_POST["q_id"] as $key => $value)
1006  {
1007  $this->object->copyToClipboard($value);
1008  }
1009  ilUtil::sendInfo($this->lng->txt("qpl_copy_insert_clipboard"), true);
1010  }
1011  else
1012  {
1013  ilUtil::sendInfo($this->lng->txt("qpl_copy_select_none"), true);
1014  }
1015  $this->ctrl->redirect($this, "questions");
1016  }
1017 
1021  function moveObject()
1022  {
1023  if (count($_POST["q_id"]) > 0)
1024  {
1025  foreach ($_POST["q_id"] as $key => $value)
1026  {
1027  $this->object->moveToClipboard($value);
1028  }
1029  ilUtil::sendInfo($this->lng->txt("qpl_move_insert_clipboard"), true);
1030  }
1031  else
1032  {
1033  ilUtil::sendInfo($this->lng->txt("qpl_move_select_none"), true);
1034  }
1035  $this->ctrl->redirect($this, "questions");
1036  }
1037 
1041  function createExportQTI()
1042  {
1043  global $rbacsystem;
1044  if ($rbacsystem->checkAccess("write", $_GET['ref_id']))
1045  {
1046  include_once("./Modules/TestQuestionPool/classes/class.ilQuestionpoolExport.php");
1047  $question_ids =& $this->object->getAllQuestionIds();
1048  $qpl_exp = new ilQuestionpoolExport($this->object, 'xml', $question_ids);
1049  $qpl_exp->buildExportFile();
1050  $this->ctrl->redirectByClass("ilexportgui", "");
1051  }
1052  }
1053 
1055  {
1056  global $rbacsystem;
1057  if ($rbacsystem->checkAccess("write", $_GET['ref_id']))
1058  {
1059  include_once("./Modules/TestQuestionPool/classes/class.ilQuestionpoolExport.php");
1060  $question_ids =& $this->object->getAllQuestionIds();
1061  $qpl_exp = new ilQuestionpoolExport($this->object, 'xls', $question_ids);
1062  $qpl_exp->buildExportFile();
1063  $this->ctrl->redirectByClass("ilexportgui", "");
1064  }
1065  }
1066 
1071  {
1072  include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
1073  $q_gui =& assQuestionGUI::_getQuestionGUI("", $_GET["q_id"]);
1074  $this->ctrl->redirectByClass(get_class($q_gui), "editQuestion");
1075  }
1076 
1077  protected function initImportForm($a_new_type)
1078  {
1079  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
1080  $form = new ilPropertyFormGUI();
1081  $form->setTarget("_top");
1082  $form->setFormAction($this->ctrl->getFormAction($this));
1083  $form->setTitle($this->lng->txt("import_qpl"));
1084 
1085  include_once("./Services/Form/classes/class.ilFileInputGUI.php");
1086  $fi = new ilFileInputGUI($this->lng->txt("import_file"), "xmldoc");
1087  $fi->setSuffixes(array("zip"));
1088  $fi->setRequired(true);
1089  $form->addItem($fi);
1090 
1091  $form->addCommandButton("importFile", $this->lng->txt("import"));
1092  $form->addCommandButton("cancel", $this->lng->txt("cancel"));
1093 
1094  return $form;
1095  }
1096 
1100  function importFileObject()
1101  {
1102  $form = $this->initImportForm($_REQUEST["new_type"]);
1103  if($form->checkInput())
1104  {
1105  $this->uploadQplObject();
1106  }
1107 
1108  // display form to correct errors
1109  $this->tpl->setContent($form->getHTML());
1110  }
1111 
1112  function addLocatorItems()
1113  {
1114  global $ilLocator;
1115  switch ($this->ctrl->getCmd())
1116  {
1117  case "create":
1118  case "importFile":
1119  case "cancel":
1120  break;
1121  default:
1122  $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this, ""), "", $_GET["ref_id"]);
1123  break;
1124  }
1125  if ($_GET["q_id"] > 0)
1126  {
1127  include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
1128  $q_gui = assQuestionGUI::_getQuestionGUI("", $_GET["q_id"]);
1129  if($q_gui->object instanceof assQuestion)
1130  {
1131  $q_gui->object->setObjId($this->object->getId());
1132  $title = $q_gui->object->getTitle();
1133  if(!$title)
1134  {
1135  $title = $this->lng->txt('new').': '.assQuestion::_getQuestionTypeName($q_gui->object->getQuestionType());
1136  }
1137  $ilLocator->addItem($title, $this->ctrl->getLinkTargetByClass(get_class($q_gui), "editQuestion"));
1138  }
1139  else
1140  {
1141  // Workaround for context issues: If no object was found, redirect without q_id parameter
1142  $this->ctrl->setParameter($this, 'q_id', '');
1143  $this->ctrl->redirect($this);
1144  }
1145  }
1146  }
1147 
1152  {
1154  if ($_GET["q_id"] > 0)
1155  {
1156  include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
1157  $q_gui = assQuestionGUI::_getQuestionGUI("", $_GET["q_id"]);
1158  if($q_gui->object instanceof assQuestion)
1159  {
1160  $q_gui->object->setObjId($this->object->getId());
1161  $title = $q_gui->object->getTitle();
1162  if (strcmp($this->ctrl->getCmd(), "assessment") == 0)
1163  {
1164  $title .= " - " . $this->lng->txt("statistics");
1165  }
1166  if(!$title)
1167  {
1168  $title = $this->lng->txt('new').': '.assQuestion::_getQuestionTypeName($q_gui->object->getQuestionType());
1169  }
1170  $this->tpl->setTitle($title);
1171  $this->tpl->setDescription($q_gui->object->getComment());
1172  $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_".$this->object->getType()."_b.png"), $this->lng->txt("obj_qpl"));
1173  }
1174  else
1175  {
1176  // Workaround for context issues: If no object was found, redirect without q_id parameter
1177  $this->ctrl->setParameter($this, 'q_id', '');
1178  $this->ctrl->redirect($this);
1179  }
1180  }
1181  else
1182  {
1183  $this->tpl->setTitle($this->object->getTitle());
1184  $this->tpl->setDescription($this->object->getLongDescription());
1185  $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_".$this->object->getType()."_b.png"), $this->lng->txt("obj_qpl"));
1186  }
1187  }
1188 
1194  function getTabs(&$tabs_gui)
1195  {
1196  global $ilAccess, $ilHelp;
1197 
1198 
1199  $ilHelp->setScreenIdComponent("qpl");
1200 
1201  $next_class = strtolower($this->ctrl->getNextClass());
1202  switch ($next_class)
1203  {
1204  case "":
1205  case "ilpermissiongui":
1206  case "ilmdeditorgui":
1207  case "ilexportgui":
1208  break;
1209  default:
1210  return;
1211  break;
1212  }
1213  // questions
1214  $force_active = false;
1215  $commands = $_POST["cmd"];
1216  if (is_array($commands))
1217  {
1218  foreach ($commands as $key => $value)
1219  {
1220  if (preg_match("/^delete_.*/", $key, $matches) ||
1221  preg_match("/^addSelectGap_.*/", $key, $matches) ||
1222  preg_match("/^addTextGap_.*/", $key, $matches) ||
1223  preg_match("/^deleteImage_.*/", $key, $matches) ||
1224  preg_match("/^upload_.*/", $key, $matches) ||
1225  preg_match("/^addSuggestedSolution_.*/", $key, $matches)
1226  )
1227  {
1228  $force_active = true;
1229  }
1230  }
1231  }
1232  if (array_key_exists("imagemap_x", $_POST))
1233  {
1234  $force_active = true;
1235  }
1236  if (!$force_active)
1237  {
1238  $force_active = ((strtolower($this->ctrl->getCmdClass()) == strtolower(get_class($this)) || strlen($this->ctrl->getCmdClass()) == 0) &&
1239  $this->ctrl->getCmd() == "")
1240  ? true
1241  : false;
1242  }
1243  $tabs_gui->addTarget("assQuestions",
1244  $this->ctrl->getLinkTarget($this, "questions"),
1245  array("questions", "filter", "resetFilter", "createQuestion",
1246  "importQuestions", "deleteQuestions", "filterQuestionBrowser",
1247  "view", "preview", "editQuestion", "exec_pg",
1248  "addItem", "upload", "save", "cancel", "addSuggestedSolution",
1249  "cancelExplorer", "linkChilds", "removeSuggestedSolution",
1250  "add", "addYesNo", "addTrueFalse", "createGaps", "saveEdit",
1251  "setMediaMode", "uploadingImage", "uploadingImagemap", "addArea",
1252  "deletearea", "saveShape", "back", "addPair", "uploadingJavaapplet",
1253  "addParameter", "assessment", "addGIT", "addST", "addPG", "delete",
1254  "toggleGraphicalAnswers", "deleteAnswer", "deleteImage", "removeJavaapplet"),
1255  "", "", $force_active);
1256 
1257  if ($ilAccess->checkAccess("visible", "", $this->ref_id))
1258  {
1259  $tabs_gui->addTarget("info_short",
1260  $this->ctrl->getLinkTarget($this, "infoScreen"),
1261  array("infoScreen", "showSummary"));
1262  }
1263 
1264  if ($ilAccess->checkAccess("write", "", $_GET['ref_id']))
1265  {
1266  // properties
1267  $tabs_gui->addTarget("settings",
1268  $this->ctrl->getLinkTarget($this,'properties'),
1269  "properties", "",
1270  "");
1271  }
1272 
1273  // print view
1274  $tabs_gui->addTarget("print_view",
1275  $this->ctrl->getLinkTarget($this,'print'),
1276  array("print"),
1277  "", "");
1278 
1279  if ($ilAccess->checkAccess("write", "", $this->object->getRefId()))
1280  {
1281  // meta data
1282  $tabs_gui->addTarget("meta_data",
1283  $this->ctrl->getLinkTargetByClass('ilmdeditorgui','listSection'),
1284  "", "ilmdeditorgui");
1285 
1286 // $tabs_gui->addTarget("export",
1287 // $this->ctrl->getLinkTarget($this,'export'),
1288 // array("export", "createExportFile", "confirmDeleteExportFile", "downloadExportFile"),
1289 // "", "");
1290  }
1291 
1292  if ($ilAccess->checkAccess("write", "", $this->object->getRefId()))
1293  {
1294  $tabs_gui->addTarget("export",
1295  $this->ctrl->getLinkTargetByClass("ilexportgui", ""),
1296  "", "ilexportgui");
1297  }
1298 
1299  if ($ilAccess->checkAccess("edit_permission", "", $this->object->getRefId()))
1300  {
1301  $tabs_gui->addTarget("perm_settings",
1302  $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm"), array("perm","info","owner"), 'ilpermissiongui');
1303  }
1304  }
1305 
1311  function infoScreenObject()
1312  {
1313  $this->ctrl->setCmd("showSummary");
1314  $this->ctrl->setCmdClass("ilinfoscreengui");
1315  $this->infoScreenForward();
1316  }
1317 
1322  {
1323  global $ilErr, $ilAccess;
1324 
1325  if(!$ilAccess->checkAccess("visible", "", $this->ref_id))
1326  {
1327  $ilErr->raiseError($this->lng->txt("msg_no_perm_read"));
1328  }
1329 
1330  include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
1331  $info = new ilInfoScreenGUI($this);
1332  $info->enablePrivateNotes();
1333 
1334  // standard meta data
1335  $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
1336 
1337  $this->ctrl->forwardCommand($info);
1338  }
1339 
1348  function _goto($a_target)
1349  {
1350  global $ilAccess, $ilErr, $lng;
1351 
1352  if ($ilAccess->checkAccess("write", "", $a_target))
1353  {
1354  $_GET["baseClass"] = "ilObjQuestionPoolGUI";
1355  $_GET["cmd"] = "questions";
1356  $_GET["ref_id"] = $a_target;
1357  include_once("ilias.php");
1358  exit;
1359  }
1360  else if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID))
1361  {
1362  ilUtil::sendInfo(sprintf($lng->txt("msg_no_perm_read_item"),
1363  ilObject::_lookupTitle(ilObject::_lookupObjId($a_target))), true);
1365  }
1366  $ilErr->raiseError($lng->txt("msg_no_perm_read_lm"), $ilErr->FATAL);
1367  }
1368 
1369 } // END class.ilObjQuestionPoolGUI
1370 ?>