ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilPCQuestionGUI Class Reference

Class ilPCQuestionGUI. More...

+ Inheritance diagram for ilPCQuestionGUI:
+ Collaboration diagram for ilPCQuestionGUI:

Public Member Functions

 __construct (&$a_pg_obj, &$a_content_obj, $a_hier_id, $a_pc_id="")
 Constructor public. More...
 
 executeCommand ()
 execute command More...
 
 setSelfAssessmentMode ($a_selfassessmentmode)
 Set Self Assessment Mode. More...
 
 getSelfAssessmentMode ()
 Get Self Assessment Mode. More...
 
 setInsertTabs ($a_active)
 Set insert tabs. More...
 
 insert ($a_mode="create")
 Insert new question form. More...
 
 create ()
 Create new question. More...
 
 setNewQuestionId ($a_par)
 Set new question id. More...
 
 edit ()
 edit question More...
 
 feedback ()
 
 createQuestionPool ($name="Dummy")
 Creates a new questionpool and returns the reference id. More...
 
 setTabs ()
 Set tabs. More...
 
 insertFromPool ()
 Insert question from ppol. More...
 
 poolSelection ()
 Pool selection. More...
 
 selectPool ()
 Select concrete question pool. More...
 
 listPoolQuestions ()
 List questions of pool. More...
 
 copyQuestion ()
 Copy question into page. More...
 
- Public Member Functions inherited from ilPageContentGUI
 __construct ($a_pg_obj, $a_content_obj, $a_hier_id=0, $a_pc_id="")
 Constructor public. More...
 
 setContentObject ($a_val)
 Set content object. More...
 
 getContentObject ()
 Get content object. More...
 
 setPage ($a_val)
 Set page. More...
 
 getPage ()
 Get page. More...
 
 setPageConfig ($a_val)
 Set Page Config. More...
 
 getPageConfig ()
 Get Page Config. More...
 
 setStyleId ($a_styleid)
 Set Style Id. More...
 
 getStyleId ()
 Get Style Id. More...
 
 getStyle ()
 Get style object. More...
 
 setCharacteristics ($a_chars)
 Set Characteristics. More...
 
 getCharacteristics ()
 Get characteristics. More...
 
 getHierId ()
 get hierarchical id in dom object More...
 
 setHierId ($a_hier_id)
 get hierarchical id in dom object More...
 
 getBBMenu ($a_ta_name="par_content")
 Get the bb menu incl. More...
 
 delete ()
 delete content element More...
 
 moveAfter ()
 move content element after another element More...
 
 moveBefore ()
 move content element before another element More...
 
 splitPage ()
 split page to new page at specified position More...
 
 splitPageNext ()
 split page to next page at specified position More...
 
 displayValidationError ()
 display validation errors More...
 
 cancelCreate ()
 cancel creating page content More...
 
 cancelUpdate ()
 cancel update More...
 
 cancel ()
 Cancel. More...
 
 deactivate ()
 gui function set enabled if is not enabled and vice versa More...
 
 cut ()
 Cut single element. More...
 
 copy ()
 Copy single element. More...
 
 getTemplateOptions ($a_type)
 Get table templates. More...
 

Protected Attributes

 $access
 
 $tabs
 
 $user
 
 $tree
 
 $toolbar
 
- Protected Attributes inherited from ilPageContentGUI
 $error
 
 $log
 

Additional Inherited Members

- Static Public Member Functions inherited from ilPageContentGUI
static _getCommonBBButtons ()
 Get common bb buttons. More...
 
- Data Fields inherited from ilPageContentGUI
 $content_obj
 
 $tpl
 
 $lng
 
 $ctrl
 
 $pg_obj
 
 $hier_id
 
 $dom
 
 $updated
 
 $target_script
 
 $return_location
 
 $page_config = null
 
- Static Public Attributes inherited from ilPageContentGUI
static $style_selector_reset = "margin-top:2px; margin-bottom:2px; text-indent:0px; position:static; float:none; width: auto;"
 
- Protected Member Functions inherited from ilPageContentGUI
 getCharacteristicsOfCurrentStyle ($a_type)
 Get characteristics of current style. More...
 
- Static Protected Attributes inherited from ilPageContentGUI
static $common_bb_buttons
 

Detailed Description

Class ilPCQuestionGUI.

Adapter User Interface class for assessment questions

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 18 of file class.ilPCQuestionGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilPCQuestionGUI::__construct ( $a_pg_obj,
$a_content_obj,
  $a_hier_id,
  $a_pc_id = "" 
)

Constructor public.

Definition at line 49 of file class.ilPCQuestionGUI.php.

References $DIC, $ilCtrl, and user().

50  {
51  global $DIC;
52 
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();
61  $ilCtrl = $DIC->ctrl();
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"));
65  }
global $DIC
Definition: saml.php:7
user()
Definition: user.php:4
global $ilCtrl
Definition: ilias.php:18
+ Here is the call graph for this function:

Member Function Documentation

◆ copyQuestion()

ilPCQuestionGUI::copyQuestion ( )

Copy question into page.

Parameters

Definition at line 598 of file class.ilPCQuestionGUI.php.

References $_GET, ilPageContentGUI\$ctrl, $ilCtrl, and ilPageContentGUI\getPage().

599  {
601 
602  $this->content_obj = new ilPCQuestion($this->getPage());
603  $this->content_obj->create($this->pg_obj, $_GET["hier_id"]);
604 
605  $this->content_obj->copyPoolQuestionIntoPage(
606  (int) $_GET["q_id"],
607  $_GET["hier_id"]
608  );
609 
610  $this->updated = $this->pg_obj->update();
611 
612  $ilCtrl->returnToParent($this);
613  }
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
Class ilPCQuestion.
+ Here is the call graph for this function:

◆ create()

ilPCQuestionGUI::create ( )

Create new question.

Definition at line 254 of file class.ilPCQuestionGUI.php.

References $_POST, ilPageContentGUI\$hier_id, $ilCtrl, ilPageContentGUI\$lng, ilPageContentGUI\getPage(), and insert().

255  {
256  global $lng, $ilCtrl, $ilTabs;
257 
258  $ilTabs->setTabActive('question');
259 
260  $this->content_obj = new ilPCQuestion($this->getPage());
261  $this->content_obj->create($this->pg_obj, $this->hier_id);
262 
263  $this->updated = $this->pg_obj->update();
264 
265  if ($this->updated) {
266  // create question pool, if necessary
267  /* if ($_POST["qpool_ref_id"] <= 0)
268  {
269  $pool_ref_id = $this->createQuestionPool($_POST["qpool_title"]);
270  }
271  else
272  {
273  $pool_ref_id = $_POST["qpool_ref_id"];
274  }*/
275 
276  $this->pg_obj->stripHierIDs();
277  $this->pg_obj->addHierIDs();
278  $hier_id = $this->content_obj->lookupHierId();
279  $ilCtrl->setParameter($this, "q_type", $_POST["q_type"]);
280  $ilCtrl->setParameter($this, "add_quest_cont_edit_mode", $_POST["add_quest_cont_edit_mode"]);
281  // $ilCtrl->setParameter($this, "qpool_ref_id", $pool_ref_id);
282  //$ilCtrl->setParameter($this, "hier_id", $hier_id);
283  $ilCtrl->setParameter($this, "hier_id", $this->content_obj->readHierId());
284  $ilCtrl->setParameter($this, "pc_id", $this->content_obj->readPCId());
285 
286  $ilCtrl->redirect($this, "edit");
287  }
288 
289  $this->insert();
290  }
global $ilCtrl
Definition: ilias.php:18
Class ilPCQuestion.
insert($a_mode="create")
Insert new question form.
$_POST["username"]
+ Here is the call graph for this function:

◆ createQuestionPool()

ilPCQuestionGUI::createQuestionPool (   $name = "Dummy")

Creates a new questionpool and returns the reference id.

Creates a new questionpool and returns the reference id

Returns
integer Reference id of the newly created questionpool public

Definition at line 421 of file class.ilPCQuestionGUI.php.

References $_GET, $name, and $tree.

422  {
423  $tree = $this->tree;
424  $parent_ref = $tree->getParentId($_GET["ref_id"]);
425  include_once "./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php";
426  $qpl = new ilObjQuestionPool();
427  $qpl->setType("qpl");
428  $qpl->setTitle($name);
429  $qpl->setDescription("");
430  $qpl->create();
431  $qpl->createReference();
432  $qpl->putInTree($parent_ref);
433  $qpl->setPermissions($parent_ref);
434  $qpl->setOnline(1); // must be online to be available
435  $qpl->saveToDb();
436  return $qpl->getRefId();
437  }
$_GET["client_id"]

◆ edit()

ilPCQuestionGUI::edit ( )

edit question

Definition at line 306 of file class.ilPCQuestionGUI.php.

References $_GET, $_POST, ilPageContentGUI\$ctrl, $ilCtrl, $ret, $tabs, ilInternalLink\_extractInstOfTarget(), ilInternalLink\_extractObjIdOfTarget(), assQuestionGUI\_getQuestionGUI(), ilObjSAHSLearningModule\_getTries(), assQuestion\ADDITIONAL_CONTENT_EDITING_MODE_DEFAULT, getSelfAssessmentMode(), insert(), and ilObjAssessmentFolder\isAdditionalQuestionContentEditingModePageObjectEnabled().

307  {
309  $ilTabs = $this->tabs;
310 
311  $ilTabs->setTabActive('question');
312 
313 
314  if ($this->getSelfAssessmentMode()) { // behaviour in content pages, e.g. scorm
315  $q_ref = $this->content_obj->getQuestionReference();
316 
317  if ($q_ref != "") {
318  $inst_id = ilInternalLink::_extractInstOfTarget($q_ref);
319  if (!($inst_id > 0)) {
321  }
322  }
323 
324  $q_type = ($_POST["q_type"] != "")
325  ? $_POST["q_type"]
326  : $_GET["q_type"];
327  $ilCtrl->setParameter($this, "q_type", $q_type);
328 
329  if ($q_id == "" && $q_type == "") {
330  return $this->insert("edit_empty");
331  }
332 
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");
336 
337  /* $ilCtrl->setCmdClass("ilquestioneditgui");
338  $ilCtrl->setCmd("editQuestion");
339  $edit_gui = new ilQuestionEditGUI();*/
340 
341  // create question first-hand (needed for uploads)
342  if ($q_id < 1 && $q_type) {
343  include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
344  $q_gui = assQuestionGUI::_getQuestionGUI($q_type);
345 
346  // feedback editing mode
347  include_once("./Modules/Test/classes/class.ilObjAssessmentFolder.php");
349  && $_REQUEST['add_quest_cont_edit_mode'] != "") {
350  $addContEditMode = $_GET['add_quest_cont_edit_mode'];
351  } else {
353  }
354  $q_gui->object->setAdditionalContentEditingMode($addContEditMode);
355 
356  //set default tries
357  $q_gui->object->setDefaultNrOfTries(ilObjSAHSLearningModule::_getTries($this->scormlmid));
358  $q_id = $q_gui->object->createNewQuestion(true);
359  $this->content_obj->setQuestionReference("il__qst_" . $q_id);
360  $this->pg_obj->update();
361  unset($q_gui);
362  }
363  $ilCtrl->setParameterByClass("ilQuestionEditGUI", "q_id", $q_id);
364  $ilCtrl->redirectByClass(array(get_class($this->pg_obj) . "GUI", "ilQuestionEditGUI"), "editQuestion");
365 
366  /* $edit_gui->setPoolObjId(0);
367  $edit_gui->setQuestionId($q_id);
368  $edit_gui->setQuestionType($q_type);
369  $edit_gui->setSelfAssessmentEditingMode(true);
370  $edit_gui->setPageConfig($this->getPageConfig());
371  $ret = $ilCtrl->forwardCommand($edit_gui);
372  $this->tpl->setContent($ret);*/
373  return $ret;
374  } else { // behaviour in question pool
375  require_once("./Modules/TestQuestionPool/classes/class.assQuestionGUI.php");
376  $q_gui = assQuestionGUI::_getQuestionGUI("", $_GET["q_id"]);
377  $this->ctrl->redirectByClass(array("ilobjquestionpoolgui", get_class($q_gui)), "editQuestion");
378  }
379  }
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
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...
insert($a_mode="create")
Insert new question form.
const ADDITIONAL_CONTENT_EDITING_MODE_DEFAULT
constant for additional content editing mode "default"
getSelfAssessmentMode()
Get Self Assessment Mode.
$ret
Definition: parser.php:6
static isAdditionalQuestionContentEditingModePageObjectEnabled()
returns the fact wether content editing with ilias page editor is enabled for questions or not ...
$_POST["username"]
+ Here is the call graph for this function:

◆ executeCommand()

ilPCQuestionGUI::executeCommand ( )

execute command

Definition at line 70 of file class.ilPCQuestionGUI.php.

References $_GET, $_POST, $access, ilPageContentGUI\$ctrl, $ilCtrl, ilPageContentGUI\$lng, $ret, $tabs, ilPageContentGUI\$tpl, and setTabs().

71  {
73  $ilAccess = $this->access;
74  $tpl = $this->tpl;
75  $ilTabs = $this->tabs;
76  $lng = $this->lng;
77 
78  // get current command
79  $cmd = $ilCtrl->getCmd();
80  $next_class = $ilCtrl->getNextClass($this);
81 
82  $q_type = ($_POST["q_type"] != "")
83  ? $_POST["q_type"]
84  : $_GET["q_type"];
85 
86  switch ($next_class) {
87  default:
88  //set tabs
89  if ($cmd != "insert") {
90  $this->setTabs();
91  } elseif ($_GET["subCmd"] != "") {
92  $cmd = $_GET["subCmd"];
93  }
94 
95  $ret = $this->$cmd();
96  }
97 
98 
99 
100  return $ret;
101  }
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
$ret
Definition: parser.php:6
$_POST["username"]
+ Here is the call graph for this function:

◆ feedback()

ilPCQuestionGUI::feedback ( )

Definition at line 381 of file class.ilPCQuestionGUI.php.

References ilPageContentGUI\$ctrl, $ilCtrl, $ret, $tabs, ilInternalLink\_extractInstOfTarget(), ilInternalLink\_extractObjIdOfTarget(), and ilPageContentGUI\getPageConfig().

382  {
384  $ilTabs = $this->tabs;
385 
386  include_once("./Modules/TestQuestionPool/classes/class.ilQuestionEditGUI.php");
387  include_once("./Modules/TestQuestionPool/classes/class.assQuestion.php");
388 
389  $ilTabs->setTabActive('feedback');
390 
391  $q_ref = $this->content_obj->getQuestionReference();
392 
393  if ($q_ref != "") {
394  $inst_id = ilInternalLink::_extractInstOfTarget($q_ref);
395  if (!($inst_id > 0)) {
397  }
398  }
399 
400  $ilCtrl->setCmdClass("ilquestioneditgui");
401  $ilCtrl->setCmd("feedback");
402  $edit_gui = new ilQuestionEditGUI();
403  if ($q_id > 0) {
404  $edit_gui->setQuestionId($q_id);
405  }
406  // $edit_gui->setQuestionType("assSingleChoice");
407  $edit_gui->setSelfAssessmentEditingMode(true);
408  $edit_gui->setPageConfig($this->getPageConfig());
409  $ret = $ilCtrl->forwardCommand($edit_gui);
410  $this->tpl->setContent($ret);
411  return $ret;
412  }
Class ilQuestionEditGUI.
getPageConfig()
Get Page Config.
global $ilCtrl
Definition: ilias.php:18
$ret
Definition: parser.php:6
+ Here is the call graph for this function:

◆ getSelfAssessmentMode()

ilPCQuestionGUI::getSelfAssessmentMode ( )

Get Self Assessment Mode.

Returns
boolean Self Assessment Mode

Definition at line 118 of file class.ilPCQuestionGUI.php.

Referenced by edit(), and setTabs().

119  {
120  return $this->selfassessmentmode;
121  }
+ Here is the caller graph for this function:

◆ insert()

ilPCQuestionGUI::insert (   $a_mode = "create")

Insert new question form.

Definition at line 157 of file class.ilPCQuestionGUI.php.

References ilPageContentGUI\$ctrl, $ilCtrl, $ilUser, ilPageContentGUI\$lng, PHPMailer\PHPMailer\$options, $user, ilObjQuestionPool\_getSelfAssessmentQuestionTypes(), assQuestion\ADDITIONAL_CONTENT_EDITING_MODE_DEFAULT, assQuestion\ADDITIONAL_CONTENT_EDITING_MODE_PAGE_OBJECT, ilRadioGroupInputGUI\addOption(), ilPageContentGUI\displayValidationError(), ilObjAssessmentFolder\isAdditionalQuestionContentEditingModePageObjectEnabled(), setInsertTabs(), ilSelectInputGUI\setOptions(), and ilUtil\sortArray().

Referenced by create(), and edit().

158  {
160  $lng = $this->lng;
162 
163  $this->setInsertTabs("new_question");
164 
165  $this->displayValidationError();
166 
167  // get all question types (@todo: we have to check, whether they are
168  // suitable for self assessment or not)
169  include_once("./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php");
171  $options = array();
172  $all_types = ilUtil::sortArray($all_types, "order", "asc", true, true);
173 
174  foreach ($all_types as $k => $v) {
175  $options[$v["type_tag"]] = $k;
176  }
177 
178  // new table form (input of rows and columns)
179  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
180  $this->form_gui = new ilPropertyFormGUI();
181  $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
182  $this->form_gui->setTitle($lng->txt("cont_ed_insert_pcqst"));
183 
184  // Select Question Type
185  $qtype_input = new ilSelectInputGUI($lng->txt("cont_question_type"), "q_type");
186  $qtype_input->setOptions($options);
187  $qtype_input->setRequired(true);
188  $this->form_gui->addItem($qtype_input);
189 
190  // additional content editor
191  // assessment
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");
195 
196  $ri->addOption(new ilRadioOption(
197  $this->lng->txt('tst_add_quest_cont_edit_mode_default'),
199  ));
200 
201  $ri->addOption(new ilRadioOption(
202  $this->lng->txt('tst_add_quest_cont_edit_mode_page_object'),
204  ));
205 
207 
208  $this->form_gui->addItem($ri, true);
209  } else {
210  $hi = new ilHiddenInputGUI("question_content_editing_type");
212  $this->form_gui->addItem($hi, true);
213  }
214 
215 
216  // Select Question Pool
217  /*
218  include_once("./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php");
219  $qpools = ilObjQuestionPool::_getAvailableQuestionpools(false, false, false, true, false, "write");
220 
221  if (count($qpools) > 0)
222  {
223  $pool_options = array();
224  foreach ($qpools as $key => $value)
225  {
226  $pool_options[$key] = $value["title"];
227  }
228  $pool_input = new ilSelectInputGUI($lng->txt("cont_question_pool"), "qpool_ref_id");
229  $pool_input->setOptions($pool_options);
230  $pool_input->setRequired(true);
231  $this->form_gui->addItem($pool_input);
232  }
233  else
234  {
235  $pool_input = new ilTextInputGUI($lng->txt("cont_question_pool"), "qpool_title");
236  $pool_input->setRequired(true);
237  $this->form_gui->addItem($pool_input);
238  }
239  */
240  if ($a_mode == "edit_empty") {
241  $this->form_gui->addCommandButton("edit", $lng->txt("save"));
242  } else {
243  $this->form_gui->addCommandButton("create_pcqst", $lng->txt("save"));
244  $this->form_gui->addCommandButton("cancelCreate", $lng->txt("cancel"));
245  }
246 
247  $this->tpl->setContent($this->form_gui->getHTML());
248  }
static sortArray( $array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
This class represents an option in a radio group.
setInsertTabs($a_active)
Set insert tabs.
This class represents a selection list property in a property form.
This class represents a property form user interface.
const ADDITIONAL_CONTENT_EDITING_MODE_PAGE_OBJECT
constant for additional content editing mode "pageobject"
global $ilCtrl
Definition: ilias.php:18
This class represents a hidden form property in a property form.
static & _getSelfAssessmentQuestionTypes($all_tags=false)
Get all self assessment question types.
This class represents a property in a property form.
addOption($a_option)
Add Option.
displayValidationError()
display validation errors
$ilUser
Definition: imgupload.php:18
setOptions($a_options)
Set Options.
const ADDITIONAL_CONTENT_EDITING_MODE_DEFAULT
constant for additional content editing mode "default"
static isAdditionalQuestionContentEditingModePageObjectEnabled()
returns the fact wether content editing with ilias page editor is enabled for questions or not ...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ insertFromPool()

ilPCQuestionGUI::insertFromPool ( )

Insert question from ppol.

Definition at line 497 of file class.ilPCQuestionGUI.php.

References $_SESSION, $access, ilPageContentGUI\$ctrl, $ilCtrl, ilPageContentGUI\$lng, $tabs, $toolbar, ilPageContentGUI\$tpl, ilObject\_lookupObjId(), ilObject\_lookupType(), listPoolQuestions(), and poolSelection().

498  {
500  $ilAccess = $this->access;
501  $ilTabs = $this->tabs;
502  $tpl = $this->tpl;
503  $lng = $this->lng;
504  $ilToolbar = $this->toolbar;
505  //var_dump($_SESSION["cont_qst_pool"]);
506  if ($_SESSION["cont_qst_pool"] != "" &&
507  $ilAccess->checkAccess("write", "", $_SESSION["cont_qst_pool"])
508  && ilObject::_lookupType(ilObject::_lookupObjId($_SESSION["cont_qst_pool"])) == "qpl") {
509  $this->listPoolQuestions();
510  } else {
511  $this->poolSelection();
512  }
513  }
$_SESSION["AccountId"]
poolSelection()
Pool selection.
global $ilCtrl
Definition: ilias.php:18
static _lookupObjId($a_id)
static _lookupType($a_id, $a_reference=false)
lookup object type
listPoolQuestions()
List questions of pool.
+ Here is the call graph for this function:

◆ listPoolQuestions()

ilPCQuestionGUI::listPoolQuestions ( )

List questions of pool.

Parameters

Definition at line 562 of file class.ilPCQuestionGUI.php.

References $_SESSION, ilPageContentGUI\$ctrl, $ilCtrl, ilPageContentGUI\$lng, $toolbar, ilPageContentGUI\$tpl, ilUtil\sendInfo(), and setInsertTabs().

Referenced by insertFromPool().

563  {
564  $ilToolbar = $this->toolbar;
565  $tpl = $this->tpl;
567  $lng = $this->lng;
568 
569  ilUtil::sendInfo($lng->txt("cont_cp_question_diff_formats_info"));
570 
571  $ilCtrl->setParameter($this, "subCmd", "poolSelection");
572  $ilToolbar->addButton(
573  $lng->txt("cont_select_other_qpool"),
574  $ilCtrl->getLinkTarget($this, "insert")
575  );
576  $ilCtrl->setParameter($this, "subCmd", "");
577 
578  $this->setInsertTabs("copy_question");
579 
580  include_once "./Services/COPage/classes/class.ilCopySelfAssQuestionTableGUI.php";
581 
582  $ilCtrl->setParameter($this, "subCmd", "listPoolQuestions");
583  $table_gui = new ilCopySelfAssQuestionTableGUI(
584  $this,
585  'insert',
586  $_SESSION["cont_qst_pool"]
587  );
588 
589  $tpl->setContent($table_gui->getHTML());
590  }
setInsertTabs($a_active)
Set insert tabs.
$_SESSION["AccountId"]
global $ilCtrl
Definition: ilias.php:18
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
Table to select self assessment questions for copying into learning resources.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ poolSelection()

ilPCQuestionGUI::poolSelection ( )

Pool selection.

Parameters

Definition at line 521 of file class.ilPCQuestionGUI.php.

References ilPageContentGUI\$ctrl, $ilCtrl, $tabs, ilPageContentGUI\$tpl, $tree, and setInsertTabs().

Referenced by insertFromPool().

522  {
524  $tree = $this->tree;
525  $tpl = $this->tpl;
526  $ilTabs = $this->tabs;
527 
528  $this->setInsertTabs("copy_question");
529 
530  include_once "./Services/COPage/classes/class.ilPoolSelectorGUI.php";
531 
532  $ilCtrl->setParameter($this, "subCmd", "poolSelection");
533  $exp = new ilPoolSelectorGUI($this, "insert");
534 
535  // filter
536  $exp->setTypeWhiteList(array("root", "cat", "grp", "fold", "crs", "qpl"));
537  $exp->setClickableTypes(array('qpl'));
538 
539  if (!$exp->handleCommand()) {
540  $tpl->setContent($exp->getHTML());
541  }
542  }
setInsertTabs($a_active)
Set insert tabs.
global $ilCtrl
Definition: ilias.php:18
Select media pool for adding objects into pages.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ selectPool()

ilPCQuestionGUI::selectPool ( )

Select concrete question pool.

Definition at line 547 of file class.ilPCQuestionGUI.php.

References $_GET, $_SESSION, ilPageContentGUI\$ctrl, and $ilCtrl.

548  {
550 
551  $_SESSION["cont_qst_pool"] = $_GET["pool_ref_id"];
552  $ilCtrl->setParameter($this, "subCmd", "insertFromPool");
553  $ilCtrl->redirect($this, "insert");
554  }
$_SESSION["AccountId"]
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18

◆ setInsertTabs()

ilPCQuestionGUI::setInsertTabs (   $a_active)

Set insert tabs.

Parameters
string$a_activeactive tab id

Definition at line 128 of file class.ilPCQuestionGUI.php.

References ilPageContentGUI\$ctrl, $ilCtrl, ilPageContentGUI\$lng, and $tabs.

Referenced by insert(), listPoolQuestions(), and poolSelection().

129  {
130  $ilTabs = $this->tabs;
132  $lng = $this->lng;
133 
134  // new question
135  $ilTabs->addSubTab(
136  "new_question",
137  $lng->txt("cont_new_question"),
138  $ilCtrl->getLinkTarget($this, "insert")
139  );
140 
141  // copy from pool
142  $ilCtrl->setParameter($this, "subCmd", "insertFromPool");
143  $ilTabs->addSubTab(
144  "copy_question",
145  $lng->txt("cont_copy_question_from_pool"),
146  $ilCtrl->getLinkTarget($this, "insert")
147  );
148 
149  $ilTabs->activateSubTab($a_active);
150 
151  $ilCtrl->setParameter($this, "subCmd", "");
152  }
global $ilCtrl
Definition: ilias.php:18
+ Here is the caller graph for this function:

◆ setNewQuestionId()

ilPCQuestionGUI::setNewQuestionId (   $a_par)

Set new question id.

Definition at line 295 of file class.ilPCQuestionGUI.php.

296  {
297  if ($a_par["new_id"] > 0) {
298  $this->content_obj->setQuestionReference("il__qst_" . $a_par["new_id"]);
299  $this->pg_obj->update();
300  }
301  }

◆ setSelfAssessmentMode()

ilPCQuestionGUI::setSelfAssessmentMode (   $a_selfassessmentmode)

Set Self Assessment Mode.

Parameters
boolean$a_selfassessmentmodeSelf Assessment Mode

Definition at line 108 of file class.ilPCQuestionGUI.php.

109  {
110  $this->selfassessmentmode = $a_selfassessmentmode;
111  }

◆ setTabs()

ilPCQuestionGUI::setTabs ( )

Set tabs.

Definition at line 442 of file class.ilPCQuestionGUI.php.

References ilPageContentGUI\$ctrl, $ilCtrl, ilPageContentGUI\$lng, $tabs, ilInternalLink\_extractInstOfTarget(), ilInternalLink\_extractObjIdOfTarget(), assQuestion\_getQuestionType(), ilUtil\appendUrlParameterString(), ilAssQuestionFeedbackEditingGUI\CMD_SHOW, assQuestionGUI\getCommandsFromClassConstants(), and getSelfAssessmentMode().

Referenced by executeCommand().

443  {
444  if ($this->getSelfAssessmentMode()) {
445  return;
446  }
447 
448  $ilTabs = $this->tabs;
450  $lng = $this->lng;
451  include_once("./Modules/TestQuestionPool/classes/class.assQuestion.php");
452 
453  if ($this->content_obj != "") {
454  $q_ref = $this->content_obj->getQuestionReference();
455  }
456 
457  if ($q_ref != "") {
458  $inst_id = ilInternalLink::_extractInstOfTarget($q_ref);
459  if (!($inst_id > 0)) {
461  }
462  }
463 
464  $ilTabs->addTarget(
465  "question",
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"),
473  ""
474  );
475 
476  if ($q_id > 0) {
477  if (assQuestion::_getQuestionType($q_id) != "assTextQuestion") {
478  require_once 'Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
479  require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionFeedbackEditingGUI.php';
480  $tabCommands = assQuestionGUI::getCommandsFromClassConstants('ilAssQuestionFeedbackEditingGUI');
482  $ilCtrl->getLinkTargetByClass('ilAssQuestionFeedbackEditingGUI', ilAssQuestionFeedbackEditingGUI::CMD_SHOW),
483  "q_id=" . (int) $q_id
484  );
485  $ilTabs->addTarget('feedback', $tabLink, $tabCommands, $ilCtrl->getCmdClass(), '');
486  }
487  }
488  }
static _getQuestionType($question_id)
Returns the question type of a question with a given id.
global $ilCtrl
Definition: ilias.php:18
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...
static appendUrlParameterString($a_url, $a_par, $xml_style=false)
append URL parameter string ("par1=value1&par2=value2...") to given URL string
getSelfAssessmentMode()
Get Self Assessment Mode.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $access

ilPCQuestionGUI::$access
protected

Definition at line 23 of file class.ilPCQuestionGUI.php.

Referenced by executeCommand(), and insertFromPool().

◆ $tabs

ilPCQuestionGUI::$tabs
protected

◆ $toolbar

ilPCQuestionGUI::$toolbar
protected

Definition at line 43 of file class.ilPCQuestionGUI.php.

Referenced by insertFromPool(), and listPoolQuestions().

◆ $tree

ilPCQuestionGUI::$tree
protected

Definition at line 38 of file class.ilPCQuestionGUI.php.

Referenced by createQuestionPool(), and poolSelection().

◆ $user

ilPCQuestionGUI::$user
protected

Definition at line 33 of file class.ilPCQuestionGUI.php.

Referenced by insert().


The documentation for this class was generated from the following file: