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);
94 if (
$cmd !=
"insert") {
112 $this->selfassessmentmode = $a_selfassessmentmode;
122 return $this->selfassessmentmode;
139 include_once(
"./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php");
142 $all_types =
ilUtil::sortArray($all_types,
"question_type_id",
"asc",
true,
true);
144 foreach ($all_types as $k => $v)
146 $options[$v[
"type_tag"]] = $k;
150 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
152 $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
153 $this->form_gui->setTitle($lng->txt(
"cont_ed_insert_pcqst"));
156 $qtype_input =
new ilSelectInputGUI($lng->txt(
"cont_question_type"),
"q_type");
158 $qtype_input->setRequired(
true);
159 $this->form_gui->addItem($qtype_input);
185 if ($a_mode ==
"edit_empty")
187 $this->form_gui->addCommandButton(
"edit", $lng->txt(
"save"));
191 $this->form_gui->addCommandButton(
"create_pcqst", $lng->txt(
"save"));
192 $this->form_gui->addCommandButton(
"cancelCreate", $lng->txt(
"cancel"));
195 $this->tpl->setContent($this->form_gui->getHTML());
206 $ilTabs->setTabActive(
'question');
209 $this->content_obj->create($this->pg_obj, $this->hier_id);
211 $this->updated = $this->pg_obj->update();
225 $this->pg_obj->stripHierIDs();
226 $this->pg_obj->addHierIDs();
227 $hier_id = $this->content_obj->lookupHierId();
228 $ilCtrl->setParameter($this,
"q_type",
$_POST[
"q_type"]);
231 $ilCtrl->setParameter($this,
"hier_id", $this->content_obj->readHierId());
232 $ilCtrl->setParameter($this,
"pc_id", $this->content_obj->readPCId());
234 $ilCtrl->redirect($this,
"edit");
245 if ($a_par[
"new_id"] > 0)
247 $this->content_obj->setQuestionReference(
"il__qst_".$a_par[
"new_id"]);
248 $this->pg_obj->update();
259 $ilTabs->setTabActive(
'question');
264 $q_ref = $this->content_obj->getQuestionReference();
275 $q_type = (
$_POST[
"q_type"] !=
"")
278 $ilCtrl->setParameter($this,
"q_type", $q_type);
282 include_once(
"./Modules/TestQuestionPool/classes/class.ilQuestionEditGUI.php");
283 include_once(
"./Modules/TestQuestionPool/classes/class.assQuestion.php");
284 include_once(
"./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php");
286 $ilCtrl->setCmdClass(
"ilquestioneditgui");
287 $ilCtrl->setCmd(
"editQuestion");
292 $edit_gui->setQuestionId($q_id);
294 $edit_gui->setPoolObjId(0);
298 if (
$_GET[
"qpool_ref_id"] > 0)
300 $edit_gui->setPoolRefId(
$_GET[
"qpool_ref_id"]);
301 $edit_gui->setPoolRefId(0);
307 if ($q_id ==
"" && $q_type ==
"")
309 return $this->
insert(
"edit_empty");
312 $edit_gui->setQuestionType($q_type);
313 $edit_gui->setSelfAssessmentEditingMode(
true);
315 $ret = $ilCtrl->forwardCommand($edit_gui);
316 $this->tpl->setContent(
$ret);
321 require_once(
"./Modules/TestQuestionPool/classes/class.assQuestionGUI.php");
323 $this->ctrl->redirectByClass(array(
"ilobjquestionpoolgui", get_class($q_gui)),
"editQuestion");
333 include_once(
"./Modules/TestQuestionPool/classes/class.ilQuestionEditGUI.php");
334 include_once(
"./Modules/TestQuestionPool/classes/class.assQuestion.php");
336 $ilTabs->setTabActive(
'feedback');
338 $q_ref = $this->content_obj->getQuestionReference();
349 $ilCtrl->setCmdClass(
"ilquestioneditgui");
350 $ilCtrl->setCmd(
"feedback");
354 $edit_gui->setQuestionId($q_id);
357 $edit_gui->setSelfAssessmentEditingMode(
true);
359 $ret = $ilCtrl->forwardCommand($edit_gui);
360 $this->tpl->setContent(
$ret);
375 $parent_ref = $tree->getParentId(
$_GET[
"ref_id"]);
376 include_once
"./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php";
378 $qpl->setType(
"qpl");
379 $qpl->setTitle($name);
380 $qpl->setDescription(
"");
382 $qpl->createReference();
383 $qpl->putInTree($parent_ref);
384 $qpl->setPermissions($parent_ref);
387 return $qpl->getRefId();
396 include_once(
"./Modules/TestQuestionPool/classes/class.assQuestion.php");
398 if ($this->content_obj!=
"") {
399 $q_ref = $this->content_obj->getQuestionReference();
411 $ilTabs->addTarget(
"question",
412 $ilCtrl->getLinkTarget($this,
"edit"), array(
"editQuestion",
"save",
"cancel",
"addSuggestedSolution",
413 "cancelExplorer",
"linkChilds",
"removeSuggestedSolution",
414 "addPair",
"addTerm",
"delete",
"deleteTerms",
"editMode",
"upload",
415 "saveEdit",
"uploadingImage",
"uploadingImagemap",
"addArea",
416 "deletearea",
"saveShape",
"back",
"saveEdit",
"changeGapType",
"createGaps",
"addItem",
"addYesNo",
"addTrueFalse",
417 "toggleGraphicalAnswers",
"setMediaMode"),
423 if ($q_obj->_getQuestionType($q_id)!=
"assTextQuestion")
425 $ilTabs->addTarget(
"feedback",
426 $ilCtrl->getLinkTarget($this,
"feedback"), array(
"feedback",
"saveFeedback"),