4 include_once
"./Services/COPage/classes/class.ilPageContentGUI.php";
5 include_once
"./Services/COPage/classes/class.ilPCQuestion.php";
30 $this->scormlmid = $a_pg_obj->parent_id;
32 $ilCtrl->saveParameter($this, array(
"qpool_ref_id"));
42 $this->page_config = $a_val;
63 $cmd = $ilCtrl->getCmd();
64 $next_class = $ilCtrl->getNextClass($this);
66 $q_type = (
$_POST[
"q_type"] !=
"")
75 case "ilquestioneditgui":
76 include_once(
"./Modules/TestQuestionPool/classes/class.ilQuestionEditGUI.php");
81 $edit_gui->setQuestionType($q_type);
86 $edit_gui->addNewIdListener($this,
"setNewQuestionId");
87 $edit_gui->setSelfAssessmentEditingMode(
true);
88 $ret = $ilCtrl->forwardCommand($edit_gui);
89 $this->tpl->setContent(
$ret);
98 else if (
$_GET[
"subCmd"] !=
"")
118 $this->selfassessmentmode = $a_selfassessmentmode;
128 return $this->selfassessmentmode;
141 $ilTabs->addSubTab(
"new_question",
142 $lng->txt(
"cont_new_question"),
143 $ilCtrl->getLinkTarget($this,
"insert"));
146 $ilCtrl->setParameter($this,
"subCmd",
"insertFromPool");
147 $ilTabs->addSubTab(
"copy_question",
148 $lng->txt(
"cont_copy_question_from_pool"),
149 $ilCtrl->getLinkTarget($this,
"insert"));
151 $ilTabs->activateSubTab($a_active);
153 $ilCtrl->setParameter($this,
"subCmd",
"");
169 include_once(
"./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php");
174 foreach ($all_types as $k => $v)
176 $options[$v[
"type_tag"]] = $k;
180 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
182 $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
183 $this->form_gui->setTitle($lng->txt(
"cont_ed_insert_pcqst"));
186 $qtype_input =
new ilSelectInputGUI($lng->txt(
"cont_question_type"),
"q_type");
188 $qtype_input->setRequired(
true);
189 $this->form_gui->addItem($qtype_input);
215 if ($a_mode ==
"edit_empty")
217 $this->form_gui->addCommandButton(
"edit", $lng->txt(
"save"));
221 $this->form_gui->addCommandButton(
"create_pcqst", $lng->txt(
"save"));
222 $this->form_gui->addCommandButton(
"cancelCreate", $lng->txt(
"cancel"));
225 $this->tpl->setContent($this->form_gui->getHTML());
236 $ilTabs->setTabActive(
'question');
239 $this->content_obj->create($this->pg_obj, $this->hier_id);
241 $this->updated = $this->pg_obj->update();
255 $this->pg_obj->stripHierIDs();
256 $this->pg_obj->addHierIDs();
257 $hier_id = $this->content_obj->lookupHierId();
258 $ilCtrl->setParameter($this,
"q_type",
$_POST[
"q_type"]);
261 $ilCtrl->setParameter($this,
"hier_id", $this->content_obj->readHierId());
262 $ilCtrl->setParameter($this,
"pc_id", $this->content_obj->readPCId());
264 $ilCtrl->redirect($this,
"edit");
275 if ($a_par[
"new_id"] > 0)
277 $this->content_obj->setQuestionReference(
"il__qst_".$a_par[
"new_id"]);
278 $this->pg_obj->update();
289 $ilTabs->setTabActive(
'question');
294 $q_ref = $this->content_obj->getQuestionReference();
305 $q_type = (
$_POST[
"q_type"] !=
"")
308 $ilCtrl->setParameter($this,
"q_type", $q_type);
310 if ($q_id ==
"" && $q_type ==
"")
312 return $this->
insert(
"edit_empty");
315 include_once(
"./Modules/TestQuestionPool/classes/class.ilQuestionEditGUI.php");
316 include_once(
"./Modules/TestQuestionPool/classes/class.assQuestion.php");
317 include_once(
"./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php");
319 $ilCtrl->setCmdClass(
"ilquestioneditgui");
320 $ilCtrl->setCmd(
"editQuestion");
324 if($q_id < 1 && $q_type)
326 include_once
"./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
328 $q_id = $q_gui->object->createNewQuestion(
true);
331 if (
$_GET[
"qpool_ref_id"] > 0)
333 $edit_gui->setPoolRefId(
$_GET[
"qpool_ref_id"]);
334 $edit_gui->setPoolRefId(0);
340 $edit_gui->setPoolObjId(0);
341 $edit_gui->setQuestionId($q_id);
342 $edit_gui->setQuestionType($q_type);
343 $edit_gui->setSelfAssessmentEditingMode(
true);
345 $ret = $ilCtrl->forwardCommand($edit_gui);
346 $this->tpl->setContent(
$ret);
351 require_once(
"./Modules/TestQuestionPool/classes/class.assQuestionGUI.php");
353 $this->ctrl->redirectByClass(array(
"ilobjquestionpoolgui", get_class($q_gui)),
"editQuestion");
363 include_once(
"./Modules/TestQuestionPool/classes/class.ilQuestionEditGUI.php");
364 include_once(
"./Modules/TestQuestionPool/classes/class.assQuestion.php");
366 $ilTabs->setTabActive(
'feedback');
368 $q_ref = $this->content_obj->getQuestionReference();
379 $ilCtrl->setCmdClass(
"ilquestioneditgui");
380 $ilCtrl->setCmd(
"feedback");
384 $edit_gui->setQuestionId($q_id);
387 $edit_gui->setSelfAssessmentEditingMode(
true);
389 $ret = $ilCtrl->forwardCommand($edit_gui);
390 $this->tpl->setContent(
$ret);
405 $parent_ref = $tree->getParentId(
$_GET[
"ref_id"]);
406 include_once
"./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php";
408 $qpl->setType(
"qpl");
409 $qpl->setTitle($name);
410 $qpl->setDescription(
"");
412 $qpl->createReference();
413 $qpl->putInTree($parent_ref);
414 $qpl->setPermissions($parent_ref);
417 return $qpl->getRefId();
426 include_once(
"./Modules/TestQuestionPool/classes/class.assQuestion.php");
428 if ($this->content_obj!=
"") {
429 $q_ref = $this->content_obj->getQuestionReference();
441 $ilTabs->addTarget(
"question",
442 $ilCtrl->getLinkTarget($this,
"edit"), array(
"editQuestion",
"save",
"cancel",
"addSuggestedSolution",
443 "cancelExplorer",
"linkChilds",
"removeSuggestedSolution",
444 "addPair",
"addTerm",
"delete",
"deleteTerms",
"editMode",
"upload",
445 "saveEdit",
"uploadingImage",
"uploadingImagemap",
"addArea",
446 "deletearea",
"saveShape",
"back",
"saveEdit",
"changeGapType",
"createGaps",
"addItem",
"addYesNo",
"addTrueFalse",
447 "toggleGraphicalAnswers",
"setMediaMode"),
454 $ilTabs->addTarget(
"feedback",
455 $ilCtrl->getLinkTarget($this,
"feedback"), array(
"feedback",
"saveFeedback"),
473 $ilAccess->checkAccess(
"write",
"",
$_SESSION[
"cont_qst_pool"])
496 include_once
"./Services/COPage/classes/class.ilPoolSelectorGUI.php";
500 if (
$_GET[
"expand"] ==
"")
502 $expanded = $tree->readRootId();
506 $expanded =
$_GET[
"expand"];
508 $exp->setExpand($expanded);
510 $exp->setTargetGet(
"sel_id");
511 $ilCtrl->setParameter($this,
"target_type", $a_type);
512 $ilCtrl->setParameter($this,
"subCmd",
"poolSelection");
513 $exp->setParamsGet($this->ctrl->getParameterArray($this,
"insert"));
516 $exp->setFiltered(
true);
518 $exp->addFilter(
"root");
519 $exp->addFilter(
"cat");
520 $exp->addFilter(
"grp");
521 $exp->addFilter(
"fold");
522 $exp->addFilter(
"crs");
523 $exp->addFilter(
"qpl");
524 $exp->setContentGUIClass(
"ilpcquestiongui");
525 $exp->setSelectableTypes(array(
'qpl'));
529 $tpl->setContent($exp->getOutput());
540 $ilCtrl->setParameter($this,
"subCmd",
"insertFromPool");
541 $ilCtrl->redirect($this,
"insert");
556 $ilCtrl->setParameter($this,
"subCmd",
"poolSelection");
557 $ilToolbar->addButton(
558 $lng->txt(
"cont_select_other_qpool"),
559 $ilCtrl->getLinkTarget($this,
"insert"));
560 $ilCtrl->setParameter($this,
"subCmd",
"");
564 include_once
"./Services/COPage/classes/class.ilCopySelfAssQuestionTableGUI.php";
566 $ilCtrl->setParameter($this,
"subCmd",
"listPoolQuestions");
570 $tpl->setContent($table_gui->getHTML());
584 $this->content_obj->create($this->pg_obj,
$_GET[
"hier_id"]);
586 $this->content_obj->copyPoolQuestionIntoPage(
587 (
int)
$_GET[
"q_id"], $_GET[
"hier_id"]);
589 $this->updated = $this->pg_obj->update();
591 $ilCtrl->returnToParent($this);