4include_once
"./Services/COPage/classes/class.ilPageContentGUI.php";
5include_once
"./Services/COPage/classes/class.ilPCQuestion.php";
49 public function __construct(&$a_pg_obj, &$a_content_obj, $a_hier_id, $a_pc_id =
"")
53 $this->ctrl =
$DIC->ctrl();
54 $this->access =
$DIC->access();
55 $this->tpl =
$DIC[
"tpl"];
56 $this->tabs =
$DIC->tabs();
57 $this->lng =
$DIC->language();
58 $this->
user = $DIC->user();
59 $this->tree =
$DIC->repositoryTree();
60 $this->toolbar =
$DIC->toolbar();
62 $this->scormlmid = $a_pg_obj->parent_id;
63 parent::__construct($a_pg_obj, $a_content_obj, $a_hier_id, $a_pc_id);
64 $ilCtrl->saveParameter($this, array(
"qpool_ref_id"));
80 $next_class =
$ilCtrl->getNextClass($this);
82 $q_type = (
$_POST[
"q_type"] !=
"")
86 switch ($next_class) {
89 if ($cmd !=
"insert") {
91 } elseif (
$_GET[
"subCmd"] !=
"") {
92 $cmd =
$_GET[
"subCmd"];
110 $this->selfassessmentmode = $a_selfassessmentmode;
120 return $this->selfassessmentmode;
137 $lng->txt(
"cont_new_question"),
138 $ilCtrl->getLinkTarget($this,
"insert")
142 $ilCtrl->setParameter($this,
"subCmd",
"insertFromPool");
145 $lng->txt(
"cont_copy_question_from_pool"),
146 $ilCtrl->getLinkTarget($this,
"insert")
149 $ilTabs->activateSubTab($a_active);
151 $ilCtrl->setParameter($this,
"subCmd",
"");
157 public function insert($a_mode =
"create")
169 include_once(
"./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php");
174 foreach ($all_types as $k => $v) {
179 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
181 $this->form_gui->setFormAction(
$ilCtrl->getFormAction($this));
182 $this->form_gui->setTitle(
$lng->txt(
"cont_ed_insert_pcqst"));
187 $qtype_input->setRequired(
true);
188 $this->form_gui->addItem($qtype_input);
192 include_once(
"./Modules/Test/classes/class.ilObjAssessmentFolder.php");
194 $ri =
new ilRadioGroupInputGUI($this->lng->txt(
"tst_add_quest_cont_edit_mode"),
"add_quest_cont_edit_mode");
197 $this->lng->txt(
'tst_add_quest_cont_edit_mode_default'),
202 $this->lng->txt(
'tst_add_quest_cont_edit_mode_page_object'),
208 $this->form_gui->addItem($ri,
true);
212 $this->form_gui->addItem($hi,
true);
240 if ($a_mode ==
"edit_empty") {
241 $this->form_gui->addCommandButton(
"edit",
$lng->txt(
"save"));
243 $this->form_gui->addCommandButton(
"create_pcqst",
$lng->txt(
"save"));
244 $this->form_gui->addCommandButton(
"cancelCreate",
$lng->txt(
"cancel"));
247 $this->tpl->setContent($this->form_gui->getHTML());
258 $ilTabs->setTabActive(
'question');
261 $this->content_obj->create($this->pg_obj, $this->hier_id);
263 $this->updated = $this->pg_obj->update();
265 if ($this->updated) {
276 $this->pg_obj->stripHierIDs();
277 $this->pg_obj->addHierIDs();
278 $hier_id = $this->content_obj->lookupHierId();
280 $ilCtrl->setParameter($this,
"add_quest_cont_edit_mode",
$_POST[
"add_quest_cont_edit_mode"]);
283 $ilCtrl->setParameter($this,
"hier_id", $this->content_obj->readHierId());
284 $ilCtrl->setParameter($this,
"pc_id", $this->content_obj->readPCId());
286 $ilCtrl->redirect($this,
"edit");
297 if ($a_par[
"new_id"] > 0) {
298 $this->content_obj->setQuestionReference(
"il__qst_" . $a_par[
"new_id"]);
299 $this->pg_obj->update();
311 $ilTabs->setTabActive(
'question');
315 $q_ref = $this->content_obj->getQuestionReference();
319 if (!($inst_id > 0)) {
324 $q_type = (
$_POST[
"q_type"] !=
"")
327 $ilCtrl->setParameter($this,
"q_type", $q_type);
329 if ($q_id ==
"" && $q_type ==
"") {
330 return $this->
insert(
"edit_empty");
333 include_once(
"./Modules/TestQuestionPool/classes/class.ilQuestionEditGUI.php");
334 include_once(
"./Modules/TestQuestionPool/classes/class.assQuestion.php");
335 include_once(
"./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php");
342 if ($q_id < 1 && $q_type) {
343 include_once
"./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
347 include_once(
"./Modules/Test/classes/class.ilObjAssessmentFolder.php");
349 && $_REQUEST[
'add_quest_cont_edit_mode'] !=
"") {
350 $addContEditMode =
$_GET[
'add_quest_cont_edit_mode'];
354 $q_gui->object->setAdditionalContentEditingMode($addContEditMode);
358 $q_id = $q_gui->object->createNewQuestion(
true);
359 $this->content_obj->setQuestionReference(
"il__qst_" . $q_id);
360 $this->pg_obj->update();
363 $ilCtrl->setParameterByClass(
"ilQuestionEditGUI",
"q_id", $q_id);
364 $ilCtrl->redirectByClass(array(get_class($this->pg_obj) .
"GUI",
"ilQuestionEditGUI"),
"editQuestion");
375 require_once(
"./Modules/TestQuestionPool/classes/class.assQuestionGUI.php");
377 $this->ctrl->redirectByClass(array(
"ilobjquestionpoolgui", get_class($q_gui)),
"editQuestion");
386 include_once(
"./Modules/TestQuestionPool/classes/class.ilQuestionEditGUI.php");
387 include_once(
"./Modules/TestQuestionPool/classes/class.assQuestion.php");
389 $ilTabs->setTabActive(
'feedback');
391 $q_ref = $this->content_obj->getQuestionReference();
395 if (!($inst_id > 0)) {
400 $ilCtrl->setCmdClass(
"ilquestioneditgui");
404 $edit_gui->setQuestionId($q_id);
407 $edit_gui->setSelfAssessmentEditingMode(
true);
410 $this->tpl->setContent(
$ret);
424 $parent_ref =
$tree->getParentId(
$_GET[
"ref_id"]);
425 include_once
"./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php";
427 $qpl->setType(
"qpl");
428 $qpl->setTitle(
$name);
429 $qpl->setDescription(
"");
431 $qpl->createReference();
432 $qpl->putInTree($parent_ref);
433 $qpl->setPermissions($parent_ref);
436 return $qpl->getRefId();
451 include_once(
"./Modules/TestQuestionPool/classes/class.assQuestion.php");
453 if ($this->content_obj !=
"") {
454 $q_ref = $this->content_obj->getQuestionReference();
459 if (!($inst_id > 0)) {
466 $ilCtrl->getLinkTarget($this,
"edit"),
467 array(
"editQuestion",
"save",
"cancel",
"addSuggestedSolution",
468 "cancelExplorer",
"linkChilds",
"removeSuggestedSolution",
469 "addPair",
"addTerm",
"delete",
"deleteTerms",
"editMode",
"upload",
470 "saveEdit",
"uploadingImage",
"uploadingImagemap",
"addArea",
471 "deletearea",
"saveShape",
"back",
"saveEdit",
"changeGapType",
"createGaps",
"addItem",
"addYesNo",
"addTrueFalse",
472 "toggleGraphicalAnswers",
"setMediaMode"),
478 require_once
'Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
479 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionFeedbackEditingGUI.php';
483 "q_id=" . (
int) $q_id
485 $ilTabs->addTarget(
'feedback', $tabLink, $tabCommands,
$ilCtrl->getCmdClass(),
'');
507 $ilAccess->checkAccess(
"write",
"",
$_SESSION[
"cont_qst_pool"])
530 include_once
"./Services/COPage/classes/class.ilPoolSelectorGUI.php";
532 $ilCtrl->setParameter($this,
"subCmd",
"poolSelection");
536 $exp->setTypeWhiteList(array(
"root",
"cat",
"grp",
"fold",
"crs",
"qpl"));
537 $exp->setClickableTypes(array(
'qpl'));
539 if (!$exp->handleCommand()) {
540 $tpl->setContent($exp->getHTML());
552 $ilCtrl->setParameter($this,
"subCmd",
"insertFromPool");
553 $ilCtrl->redirect($this,
"insert");
571 $ilCtrl->setParameter($this,
"subCmd",
"poolSelection");
572 $ilToolbar->addButton(
573 $lng->txt(
"cont_select_other_qpool"),
574 $ilCtrl->getLinkTarget($this,
"insert")
576 $ilCtrl->setParameter($this,
"subCmd",
"");
580 include_once
"./Services/COPage/classes/class.ilCopySelfAssQuestionTableGUI.php";
582 $ilCtrl->setParameter($this,
"subCmd",
"listPoolQuestions");
589 $tpl->setContent($table_gui->getHTML());
603 $this->content_obj->create($this->pg_obj,
$_GET[
"hier_id"]);
605 $this->content_obj->copyPoolQuestionIntoPage(
610 $this->updated = $this->pg_obj->update();
612 $ilCtrl->returnToParent($this);
An exception for terminatinating execution or to throw for unit testing.
static _getQuestionGUI($question_type, $question_id=-1)
Creates a question gui representation and returns the alias to the question gui note: please do not u...
static getCommandsFromClassConstants($guiClassName, $cmdConstantNameBegin='CMD_')
extracts values of all constants of given class with given prefix as array can be used to get all pos...
const ADDITIONAL_CONTENT_EDITING_MODE_DEFAULT
constant for additional content editing mode "default"
const ADDITIONAL_CONTENT_EDITING_MODE_PAGE_OBJECT
constant for additional content editing mode "pageobject"
static _getQuestionType($question_id)
Returns the question type of a question with a given id.
const CMD_SHOW
command constants
Table to select self assessment questions for copying into learning resources.
static _extractObjIdOfTarget($a_target)
Extract object id out of target.
static _extractInstOfTarget($a_target)
Extract installation id out of target.
static isAdditionalQuestionContentEditingModePageObjectEnabled()
returns the fact wether content editing with ilias page editor is enabled for questions or not
static & _getSelfAssessmentQuestionTypes($all_tags=false)
Get all self assessment question types.
static _lookupObjId($a_id)
static _lookupType($a_id, $a_reference=false)
lookup object type
setSelfAssessmentMode($a_selfassessmentmode)
Set Self Assessment Mode.
create()
Create new question.
listPoolQuestions()
List questions of pool.
copyQuestion()
Copy question into page.
setInsertTabs($a_active)
Set insert tabs.
executeCommand()
execute command
insertFromPool()
Insert question from ppol.
createQuestionPool($name="Dummy")
Creates a new questionpool and returns the reference id.
getSelfAssessmentMode()
Get Self Assessment Mode.
setNewQuestionId($a_par)
Set new question id.
selectPool()
Select concrete question pool.
poolSelection()
Pool selection.
insert($a_mode="create")
Insert new question form.
__construct(&$a_pg_obj, &$a_content_obj, $a_hier_id, $a_pc_id="")
Constructor @access public.
User Interface for Editing of Page Content Objects (Paragraphs, Tables, ...)
getPageConfig()
Get Page Config.
displayValidationError()
display validation errors
Select media pool for adding objects into pages.
This class represents an option in a radio group.
static appendUrlParameterString($a_url, $a_par, $xml_style=false)
append URL parameter string ("par1=value1&par2=value2...") to given URL string
static sortArray( $array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.