4 include_once
"./Services/COPage/classes/class.ilPageContentGUI.php";
5 include_once
"./Services/COPage/classes/class.ilPCQuestion.php";
27 $this->scormlmid = $a_pg_obj->parent_id;
29 $ilCtrl->saveParameter($this, array(
"qpool_ref_id"));
40 $cmd = $ilCtrl->getCmd();
41 $next_class = $ilCtrl->getNextClass($this);
43 $q_type = (
$_POST[
"q_type"] !=
"")
55 else if (
$_GET[
"subCmd"] !=
"")
75 $this->selfassessmentmode = $a_selfassessmentmode;
85 return $this->selfassessmentmode;
98 $ilTabs->addSubTab(
"new_question",
99 $lng->txt(
"cont_new_question"),
100 $ilCtrl->getLinkTarget($this,
"insert"));
103 $ilCtrl->setParameter($this,
"subCmd",
"insertFromPool");
104 $ilTabs->addSubTab(
"copy_question",
105 $lng->txt(
"cont_copy_question_from_pool"),
106 $ilCtrl->getLinkTarget($this,
"insert"));
108 $ilTabs->activateSubTab($a_active);
110 $ilCtrl->setParameter($this,
"subCmd",
"");
126 include_once(
"./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php");
131 foreach ($all_types as $k => $v)
137 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
139 $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
140 $this->form_gui->setTitle($lng->txt(
"cont_ed_insert_pcqst"));
143 $qtype_input =
new ilSelectInputGUI($lng->txt(
"cont_question_type"),
"q_type");
145 $qtype_input->setRequired(
true);
146 $this->form_gui->addItem($qtype_input);
150 include_once(
"./Modules/Test/classes/class.ilObjAssessmentFolder.php");
153 $ri =
new ilRadioGroupInputGUI($this->lng->txt(
"tst_add_quest_cont_edit_mode"),
"add_quest_cont_edit_mode");
156 $this->lng->txt(
'tst_add_quest_cont_edit_mode_default'),
161 $this->lng->txt(
'tst_add_quest_cont_edit_mode_page_object'),
167 $this->form_gui->addItem($ri,
true);
173 $this->form_gui->addItem($hi,
true);
201 if ($a_mode ==
"edit_empty")
203 $this->form_gui->addCommandButton(
"edit", $lng->txt(
"save"));
207 $this->form_gui->addCommandButton(
"create_pcqst", $lng->txt(
"save"));
208 $this->form_gui->addCommandButton(
"cancelCreate", $lng->txt(
"cancel"));
211 $this->tpl->setContent($this->form_gui->getHTML());
222 $ilTabs->setTabActive(
'question');
225 $this->content_obj->create($this->pg_obj, $this->hier_id);
227 $this->updated = $this->pg_obj->update();
241 $this->pg_obj->stripHierIDs();
242 $this->pg_obj->addHierIDs();
243 $hier_id = $this->content_obj->lookupHierId();
244 $ilCtrl->setParameter($this,
"q_type",
$_POST[
"q_type"]);
245 $ilCtrl->setParameter($this,
"add_quest_cont_edit_mode",
$_POST[
"add_quest_cont_edit_mode"]);
248 $ilCtrl->setParameter($this,
"hier_id", $this->content_obj->readHierId());
249 $ilCtrl->setParameter($this,
"pc_id", $this->content_obj->readPCId());
251 $ilCtrl->redirect($this,
"edit");
262 if ($a_par[
"new_id"] > 0)
264 $this->content_obj->setQuestionReference(
"il__qst_".$a_par[
"new_id"]);
265 $this->pg_obj->update();
276 $ilTabs->setTabActive(
'question');
281 $q_ref = $this->content_obj->getQuestionReference();
292 $q_type = (
$_POST[
"q_type"] !=
"")
295 $ilCtrl->setParameter($this,
"q_type", $q_type);
297 if ($q_id ==
"" && $q_type ==
"")
299 return $this->
insert(
"edit_empty");
302 include_once(
"./Modules/TestQuestionPool/classes/class.ilQuestionEditGUI.php");
303 include_once(
"./Modules/TestQuestionPool/classes/class.assQuestion.php");
304 include_once(
"./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php");
311 if($q_id < 1 && $q_type)
313 include_once
"./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
317 include_once(
"./Modules/Test/classes/class.ilObjAssessmentFolder.php");
319 &&
$_REQUEST[
'add_quest_cont_edit_mode'] !=
"")
321 $addContEditMode =
$_GET[
'add_quest_cont_edit_mode'];
327 $q_gui->object->setAdditionalContentEditingMode($addContEditMode);
331 $q_id = $q_gui->object->createNewQuestion(
true);
332 $this->content_obj->setQuestionReference(
"il__qst_".$q_id);
333 $this->pg_obj->update();
336 $ilCtrl->setParameterByClass(
"ilQuestionEditGUI",
"q_id", $q_id);
337 $ilCtrl->redirectByClass(array(get_class($this->pg_obj).
"GUI",
"ilQuestionEditGUI"),
"editQuestion");
350 require_once(
"./Modules/TestQuestionPool/classes/class.assQuestionGUI.php");
352 $this->ctrl->redirectByClass(array(
"ilobjquestionpoolgui", get_class($q_gui)),
"editQuestion");
360 include_once(
"./Modules/TestQuestionPool/classes/class.ilQuestionEditGUI.php");
361 include_once(
"./Modules/TestQuestionPool/classes/class.assQuestion.php");
363 $ilTabs->setTabActive(
'feedback');
365 $q_ref = $this->content_obj->getQuestionReference();
376 $ilCtrl->setCmdClass(
"ilquestioneditgui");
377 $ilCtrl->setCmd(
"feedback");
381 $edit_gui->setQuestionId($q_id);
384 $edit_gui->setSelfAssessmentEditingMode(
true);
386 $ret = $ilCtrl->forwardCommand($edit_gui);
387 $this->tpl->setContent(
$ret);
402 $parent_ref = $tree->getParentId(
$_GET[
"ref_id"]);
403 include_once
"./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php";
405 $qpl->setType(
"qpl");
406 $qpl->setTitle($name);
407 $qpl->setDescription(
"");
409 $qpl->createReference();
410 $qpl->putInTree($parent_ref);
411 $qpl->setPermissions($parent_ref);
414 return $qpl->getRefId();
428 include_once(
"./Modules/TestQuestionPool/classes/class.assQuestion.php");
430 if ($this->content_obj!=
"") {
431 $q_ref = $this->content_obj->getQuestionReference();
443 $ilTabs->addTarget(
"question",
444 $ilCtrl->getLinkTarget($this,
"edit"), array(
"editQuestion",
"save",
"cancel",
"addSuggestedSolution",
445 "cancelExplorer",
"linkChilds",
"removeSuggestedSolution",
446 "addPair",
"addTerm",
"delete",
"deleteTerms",
"editMode",
"upload",
447 "saveEdit",
"uploadingImage",
"uploadingImagemap",
"addArea",
448 "deletearea",
"saveShape",
"back",
"saveEdit",
"changeGapType",
"createGaps",
"addItem",
"addYesNo",
"addTrueFalse",
449 "toggleGraphicalAnswers",
"setMediaMode"),
456 require_once
'Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
457 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionFeedbackEditingGUI.php';
463 $ilTabs->addTarget(
'feedback', $tabLink, $tabCommands, $ilCtrl->getCmdClass(),
'');
480 $ilAccess->checkAccess(
"write",
"",
$_SESSION[
"cont_qst_pool"])
503 include_once
"./Services/COPage/classes/class.ilPoolSelectorGUI.php";
507 if (
$_GET[
"expand"] ==
"")
509 $expanded = $tree->readRootId();
513 $expanded =
$_GET[
"expand"];
515 $exp->setExpand($expanded);
517 $exp->setTargetGet(
"sel_id");
518 $ilCtrl->setParameter($this,
"target_type", $a_type);
519 $ilCtrl->setParameter($this,
"subCmd",
"poolSelection");
520 $exp->setParamsGet($this->ctrl->getParameterArray($this,
"insert"));
523 $exp->setFiltered(
true);
525 $exp->addFilter(
"root");
526 $exp->addFilter(
"cat");
527 $exp->addFilter(
"grp");
528 $exp->addFilter(
"fold");
529 $exp->addFilter(
"crs");
530 $exp->addFilter(
"qpl");
531 $exp->setContentGUIClass(
"ilpcquestiongui");
532 $exp->setSelectableTypes(array(
'qpl'));
536 $tpl->setContent($exp->getOutput());
547 $ilCtrl->setParameter($this,
"subCmd",
"insertFromPool");
548 $ilCtrl->redirect($this,
"insert");
563 $ilCtrl->setParameter($this,
"subCmd",
"poolSelection");
564 $ilToolbar->addButton(
565 $lng->txt(
"cont_select_other_qpool"),
566 $ilCtrl->getLinkTarget($this,
"insert"));
567 $ilCtrl->setParameter($this,
"subCmd",
"");
571 include_once
"./Services/COPage/classes/class.ilCopySelfAssQuestionTableGUI.php";
573 $ilCtrl->setParameter($this,
"subCmd",
"listPoolQuestions");
577 $tpl->setContent($table_gui->getHTML());
591 $this->content_obj->create($this->pg_obj,
$_GET[
"hier_id"]);
593 $this->content_obj->copyPoolQuestionIntoPage(
594 (
int)
$_GET[
"q_id"], $_GET[
"hier_id"]);
596 $this->updated = $this->pg_obj->update();
598 $ilCtrl->returnToParent($this);