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;
28 parent::ilPageContentGUI($a_pg_obj, $a_content_obj, $a_hier_id, $a_pc_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);
This class represents an option in a radio group.
setInsertTabs($a_active)
Set insert tabs.
& executeCommand()
execute command
ilPCQuestionGUI(&$a_pg_obj, &$a_content_obj, $a_hier_id, $a_pc_id="")
Constructor public.
const ADDITIONAL_CONTENT_EDITING_MODE_PAGE_OBJECT
constant for additional content editing mode "pageobject"
setSelfAssessmentMode($a_selfassessmentmode)
Set Self Assessment Mode.
create()
Create new question.
getPageConfig()
Get Page Config.
static sortArray($array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
setNewQuestionId($a_par)
Set new question id.
_extractObjIdOfTarget($a_target)
Extract object id out of target.
const CMD_SHOW
command constants
poolSelection()
Pool selection.
_getQuestionType($question_id)
Returns the question type of a question with a given id.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
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...
User Interface for Editing of Page Content Objects (Paragraphs, Tables, ...)
static appendUrlParameterString($a_url, $a_par, $xml_style=false)
append URL parameter string ("par1=value1&par2=value2...") to given URL string
createQuestionPool($name="Dummy")
Creates a new questionpool and returns the reference id.
if(!is_array($argv)) $options
_extractInstOfTarget($a_target)
Extract installation id out of target.
static _lookupObjId($a_id)
& _getQuestionGUI($question_type, $question_id=-1)
Creates a question gui representation and returns the alias to the question gui note: please do not u...
displayValidationError()
display validation errors
insert($a_mode="create")
Insert new question form.
selectPool()
Select concrete question pool.
Table to select self assessment questions for copying into learning resources.
static _lookupType($a_id, $a_reference=false)
lookup object type
const ADDITIONAL_CONTENT_EDITING_MODE_DEFAULT
constant for additional content editing mode "default"
listPoolQuestions()
List questions of pool.
insertFromPool()
Insert question from ppol.
getSelfAssessmentMode()
Get Self Assessment Mode.
Select media pool for adding objects into pages.
static & _getSelfAssessmentQuestionTypes($all_tags=FALSE)
Get all self assessment question types.
static isAdditionalQuestionContentEditingModePageObjectEnabled()
returns the fact wether content editing with ilias page editor is enabled for questions or not ...
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
copyQuestion()
Copy question into page.