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