4 include_once
"./Services/COPage/classes/class.ilPageContentGUI.php";
5 include_once
"./Services/COPage/classes/class.ilPCQuestion.php";
28 $this->scormlmid = $a_pg_obj->parent_id;
30 $ilCtrl->saveParameter($this, array(
"qpool_ref_id"));
41 $cmd = $ilCtrl->getCmd();
42 $next_class = $ilCtrl->getNextClass($this);
44 $q_type = (
$_POST[
"q_type"] !=
"")
53 case "ilquestioneditgui":
54 include_once(
"./Modules/TestQuestionPool/classes/class.ilQuestionEditGUI.php");
59 $edit_gui->setQuestionType($q_type);
63 $edit_gui->addNewIdListener($this,
"setNewQuestionId");
64 $edit_gui->setSelfAssessmentEditingMode(
true);
65 $ret = $ilCtrl->forwardCommand($edit_gui);
66 $this->tpl->setContent(
$ret);
71 if (
$cmd !=
"insert") {
89 $this->selfassessmentmode = $a_selfassessmentmode;
99 return $this->selfassessmentmode;
116 include_once(
"./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php");
119 $all_types =
ilUtil::sortArray($all_types,
"question_type_id",
"asc",
true,
true);
121 foreach ($all_types as $k => $v)
123 $options[$v[
"type_tag"]] = $k;
127 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
129 $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
130 $this->form_gui->setTitle($lng->txt(
"cont_ed_insert_pcqst"));
133 $qtype_input =
new ilSelectInputGUI($lng->txt(
"cont_question_type"),
"q_type");
135 $qtype_input->setRequired(
true);
136 $this->form_gui->addItem($qtype_input);
162 if ($a_mode ==
"edit_empty")
164 $this->form_gui->addCommandButton(
"edit", $lng->txt(
"save"));
168 $this->form_gui->addCommandButton(
"create_pcqst", $lng->txt(
"save"));
169 $this->form_gui->addCommandButton(
"cancelCreate", $lng->txt(
"cancel"));
172 $this->tpl->setContent($this->form_gui->getHTML());
183 $ilTabs->setTabActive(
'question');
186 $this->content_obj->create($this->pg_obj, $this->hier_id);
188 $this->updated = $this->pg_obj->update();
202 $this->pg_obj->stripHierIDs();
203 $this->pg_obj->addHierIDs();
204 $hier_id = $this->content_obj->lookupHierId();
205 $ilCtrl->setParameter($this,
"q_type",
$_POST[
"q_type"]);
208 $ilCtrl->setParameter($this,
"hier_id", $this->content_obj->readHierId());
209 $ilCtrl->setParameter($this,
"pc_id", $this->content_obj->readPCId());
211 $ilCtrl->redirect($this,
"edit");
222 if ($a_par[
"new_id"] > 0)
224 $this->content_obj->setQuestionReference(
"il__qst_".$a_par[
"new_id"]);
225 $this->pg_obj->update();
236 $ilTabs->setTabActive(
'question');
241 $q_ref = $this->content_obj->getQuestionReference();
252 $q_type = (
$_POST[
"q_type"] !=
"")
255 $ilCtrl->setParameter($this,
"q_type", $q_type);
259 include_once(
"./Modules/TestQuestionPool/classes/class.ilQuestionEditGUI.php");
260 include_once(
"./Modules/TestQuestionPool/classes/class.assQuestion.php");
261 include_once(
"./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php");
263 $ilCtrl->setCmdClass(
"ilquestioneditgui");
264 $ilCtrl->setCmd(
"editQuestion");
269 $edit_gui->setQuestionId($q_id);
271 $edit_gui->setPoolObjId(0);
275 if (
$_GET[
"qpool_ref_id"] > 0)
277 $edit_gui->setPoolRefId(
$_GET[
"qpool_ref_id"]);
278 $edit_gui->setPoolRefId(0);
284 if ($q_id ==
"" && $q_type ==
"")
286 return $this->
insert(
"edit_empty");
289 $edit_gui->setQuestionType($q_type);
290 $edit_gui->setSelfAssessmentEditingMode(
true);
291 $ret = $ilCtrl->forwardCommand($edit_gui);
292 $this->tpl->setContent(
$ret);
297 require_once(
"./Modules/TestQuestionPool/classes/class.assQuestionGUI.php");
299 $this->ctrl->redirectByClass(array(
"ilobjquestionpoolgui", get_class($q_gui)),
"editQuestion");
309 include_once(
"./Modules/TestQuestionPool/classes/class.ilQuestionEditGUI.php");
310 include_once(
"./Modules/TestQuestionPool/classes/class.assQuestion.php");
312 $ilTabs->setTabActive(
'feedback');
314 $q_ref = $this->content_obj->getQuestionReference();
325 $ilCtrl->setCmdClass(
"ilquestioneditgui");
326 $ilCtrl->setCmd(
"feedback");
330 $edit_gui->setQuestionId($q_id);
333 $edit_gui->setSelfAssessmentEditingMode(
true);
334 $ret = $ilCtrl->forwardCommand($edit_gui);
335 $this->tpl->setContent(
$ret);
350 $parent_ref = $tree->getParentId(
$_GET[
"ref_id"]);
351 include_once
"./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php";
353 $qpl->setType(
"qpl");
354 $qpl->setTitle(
$name);
355 $qpl->setDescription(
"");
357 $qpl->createReference();
358 $qpl->putInTree($parent_ref);
359 $qpl->setPermissions($parent_ref);
362 return $qpl->getRefId();
371 include_once(
"./Modules/TestQuestionPool/classes/class.assQuestion.php");
373 if ($this->content_obj!=
"") {
374 $q_ref = $this->content_obj->getQuestionReference();
386 $ilTabs->addTarget(
"question",
387 $ilCtrl->getLinkTarget($this,
"edit"), array(
"editQuestion",
"save",
"cancel",
"addSuggestedSolution",
388 "cancelExplorer",
"linkChilds",
"removeSuggestedSolution",
389 "addPair",
"addTerm",
"delete",
"deleteTerms",
"editMode",
"upload",
390 "saveEdit",
"uploadingImage",
"uploadingImagemap",
"addArea",
391 "deletearea",
"saveShape",
"back",
"saveEdit",
"changeGapType",
"createGaps",
"addItem",
"addYesNo",
"addTrueFalse",
392 "toggleGraphicalAnswers",
"setMediaMode"),
398 if ($q_obj->_getQuestionType($q_id)!=
"assTextQuestion")
400 $ilTabs->addTarget(
"feedback",
401 $ilCtrl->getLinkTarget($this,
"feedback"), array(
"feedback",
"saveFeedback"),