ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
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...
 
 getCharacteristicsOfCurrentStyle ($a_type)
 Get characteristics of current style. 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
 redirectToParent ($hier_id="")
 Redirect to parent. More...
 
 getParentReturn ($hier_id="")
 
- 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, ILIAS\GlobalScreen\Provider\__construct(), 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  }
user()
Definition: user.php:4
global $DIC
Definition: goto.php:24
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ copyQuestion()

ilPCQuestionGUI::copyQuestion ( )

Copy question into page.

Parameters

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

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

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

◆ create()

ilPCQuestionGUI::create ( )

Create new question.

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

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

259  {
260  global $lng, $ilCtrl, $ilTabs;
261 
262  $ilTabs->setTabActive('question');
263 
264  $this->content_obj = new ilPCQuestion($this->getPage());
265  $this->content_obj->create($this->pg_obj, $this->hier_id);
266 
267  $this->updated = $this->pg_obj->update();
268 
269  if ($this->updated) {
270  // create question pool, if necessary
271  /* if ($_POST["qpool_ref_id"] <= 0)
272  {
273  $pool_ref_id = $this->createQuestionPool($_POST["qpool_title"]);
274  }
275  else
276  {
277  $pool_ref_id = $_POST["qpool_ref_id"];
278  }*/
279 
280  $this->pg_obj->stripHierIDs();
281  $this->pg_obj->addHierIDs();
282  $hier_id = $this->content_obj->lookupHierId();
283  $ilCtrl->setParameter($this, "q_type", $_POST["q_type"]);
284  $ilCtrl->setParameter($this, "add_quest_cont_edit_mode", $_POST["add_quest_cont_edit_mode"]);
285  // $ilCtrl->setParameter($this, "qpool_ref_id", $pool_ref_id);
286  //$ilCtrl->setParameter($this, "hier_id", $hier_id);
287  $ilCtrl->setParameter($this, "hier_id", $this->content_obj->readHierId());
288  $ilCtrl->setParameter($this, "pc_id", $this->content_obj->readPCId());
289 
290  $ilCtrl->redirect($this, "edit");
291  }
292 
293  $this->insert();
294  }
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 425 of file class.ilPCQuestionGUI.php.

References $_GET, $name, and $tree.

426  {
427  $tree = $this->tree;
428  $parent_ref = $tree->getParentId($_GET["ref_id"]);
429  include_once "./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php";
430  $qpl = new ilObjQuestionPool();
431  $qpl->setType("qpl");
432  $qpl->setTitle($name);
433  $qpl->setDescription("");
434  $qpl->create();
435  $qpl->createReference();
436  $qpl->putInTree($parent_ref);
437  $qpl->setPermissions($parent_ref);
438  $qpl->setOnline(1); // must be online to be available
439  $qpl->saveToDb();
440  return $qpl->getRefId();
441  }
$_GET["client_id"]
if($format !==null) $name
Definition: metadata.php:230

◆ edit()

ilPCQuestionGUI::edit ( )

edit question

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

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

311  {
312  $ilCtrl = $this->ctrl;
313  $ilTabs = $this->tabs;
314 
315  $ilTabs->setTabActive('question');
316 
317 
318  if ($this->getSelfAssessmentMode()) { // behaviour in content pages, e.g. scorm
319  $q_ref = $this->content_obj->getQuestionReference();
320 
321  if ($q_ref != "") {
322  $inst_id = ilInternalLink::_extractInstOfTarget($q_ref);
323  if (!($inst_id > 0)) {
325  }
326  }
327 
328  $q_type = ($_POST["q_type"] != "")
329  ? $_POST["q_type"]
330  : $_GET["q_type"];
331  $ilCtrl->setParameter($this, "q_type", $q_type);
332 
333  if ($q_id == "" && $q_type == "") {
334  return $this->insert("edit_empty");
335  }
336 
337  include_once("./Modules/TestQuestionPool/classes/class.ilQuestionEditGUI.php");
338  include_once("./Modules/TestQuestionPool/classes/class.assQuestion.php");
339  include_once("./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php");
340 
341  /* $ilCtrl->setCmdClass("ilquestioneditgui");
342  $ilCtrl->setCmd("editQuestion");
343  $edit_gui = new ilQuestionEditGUI();*/
344 
345  // create question first-hand (needed for uploads)
346  if ($q_id < 1 && $q_type) {
347  include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
348  $q_gui = assQuestionGUI::_getQuestionGUI($q_type);
349 
350  // feedback editing mode
351  include_once("./Modules/Test/classes/class.ilObjAssessmentFolder.php");
353  && $_REQUEST['add_quest_cont_edit_mode'] != "") {
354  $addContEditMode = $_GET['add_quest_cont_edit_mode'];
355  } else {
357  }
358  $q_gui->object->setAdditionalContentEditingMode($addContEditMode);
359 
360  //set default tries
361  $q_gui->object->setDefaultNrOfTries(ilObjSAHSLearningModule::_getTries($this->scormlmid));
362  $q_id = $q_gui->object->createNewQuestion(true);
363  $this->content_obj->setQuestionReference("il__qst_" . $q_id);
364  $this->pg_obj->update();
365  unset($q_gui);
366  }
367  $ilCtrl->setParameterByClass("ilQuestionEditGUI", "q_id", $q_id);
368  $ilCtrl->redirectByClass(array(get_class($this->pg_obj) . "GUI", "ilQuestionEditGUI"), "editQuestion");
369 
370  /* $edit_gui->setPoolObjId(0);
371  $edit_gui->setQuestionId($q_id);
372  $edit_gui->setQuestionType($q_type);
373  $edit_gui->setSelfAssessmentEditingMode(true);
374  $edit_gui->setPageConfig($this->getPageConfig());
375  $ret = $ilCtrl->forwardCommand($edit_gui);
376  $this->tpl->setContent($ret);*/
377  return $ret;
378  } else { // behaviour in question pool
379  require_once("./Modules/TestQuestionPool/classes/class.assQuestionGUI.php");
380  $q_gui = assQuestionGUI::_getQuestionGUI("", $_GET["q_id"]);
381  $this->ctrl->redirectByClass(array("ilobjquestionpoolgui", get_class($q_gui)), "editQuestion");
382  }
383  }
$_GET["client_id"]
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.
getSelfAssessmentMode()
Get Self Assessment Mode.
const ADDITIONAL_CONTENT_EDITING_MODE_RTE
constant for additional content editing mode "default"
$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, ilPageContentGUI\$lng, $ret, $tabs, ilPageContentGUI\$tpl, and setTabs().

71  {
72  $ilCtrl = $this->ctrl;
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"]
$ret
Definition: parser.php:6
$_POST["username"]
+ Here is the call graph for this function:

◆ feedback()

ilPCQuestionGUI::feedback ( )

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

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

386  {
387  $ilCtrl = $this->ctrl;
388  $ilTabs = $this->tabs;
389 
390  include_once("./Modules/TestQuestionPool/classes/class.ilQuestionEditGUI.php");
391  include_once("./Modules/TestQuestionPool/classes/class.assQuestion.php");
392 
393  $ilTabs->setTabActive('feedback');
394 
395  $q_ref = $this->content_obj->getQuestionReference();
396 
397  if ($q_ref != "") {
398  $inst_id = ilInternalLink::_extractInstOfTarget($q_ref);
399  if (!($inst_id > 0)) {
401  }
402  }
403 
404  $ilCtrl->setCmdClass("ilquestioneditgui");
405  $ilCtrl->setCmd("feedback");
406  $edit_gui = new ilQuestionEditGUI();
407  if ($q_id > 0) {
408  $edit_gui->setQuestionId($q_id);
409  }
410  // $edit_gui->setQuestionType("assSingleChoice");
411  $edit_gui->setSelfAssessmentEditingMode(true);
412  $edit_gui->setPageConfig($this->getPageConfig());
413  $ret = $ilCtrl->forwardCommand($edit_gui);
414  $this->tpl->setContent($ret);
415  return $ret;
416  }
Class ilQuestionEditGUI.
getPageConfig()
Get Page Config.
$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, $ilUser, ilPageContentGUI\$lng, $user, ilObjQuestionPool\_getSelfAssessmentQuestionTypes(), assQuestion\ADDITIONAL_CONTENT_EDITING_MODE_IPE, assQuestion\ADDITIONAL_CONTENT_EDITING_MODE_RTE, ilPageContentGUI\displayValidationError(), ilObjAssessmentFolder\isAdditionalQuestionContentEditingModePageObjectEnabled(), ilRadioOption\setInfo(), ilFormPropertyGUI\setInfo(), setInsertTabs(), and ilUtil\sortArray().

Referenced by create(), and edit().

158  {
160  $lng = $this->lng;
161  $ilCtrl = $this->ctrl;
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  $option_rte = new ilRadioOption(
197  $this->lng->txt('tst_add_quest_cont_edit_mode_RTE'),
199  );
200  $option_rte->setInfo($this->lng->txt('tst_add_quest_cont_edit_mode_RTE_info'));
201  $ri->addOption($option_rte);
202 
203  $option_ipe = new ilRadioOption(
204  $this->lng->txt('tst_add_quest_cont_edit_mode_IPE'),
206  );
207  $option_ipe->setInfo($this->lng->txt('tst_add_quest_cont_edit_mode_IPE_info'));
208  $ri->addOption($option_ipe);
209 
211 
212  $this->form_gui->addItem($ri, true);
213  } else {
214  $hi = new ilHiddenInputGUI("question_content_editing_type");
216  $this->form_gui->addItem($hi);
217  }
218 
219 
220  // Select Question Pool
221  /*
222  include_once("./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php");
223  $qpools = ilObjQuestionPool::_getAvailableQuestionpools(false, false, false, true, false, "write");
224 
225  if (count($qpools) > 0)
226  {
227  $pool_options = array();
228  foreach ($qpools as $key => $value)
229  {
230  $pool_options[$key] = $value["title"];
231  }
232  $pool_input = new ilSelectInputGUI($lng->txt("cont_question_pool"), "qpool_ref_id");
233  $pool_input->setOptions($pool_options);
234  $pool_input->setRequired(true);
235  $this->form_gui->addItem($pool_input);
236  }
237  else
238  {
239  $pool_input = new ilTextInputGUI($lng->txt("cont_question_pool"), "qpool_title");
240  $pool_input->setRequired(true);
241  $this->form_gui->addItem($pool_input);
242  }
243  */
244  if ($a_mode == "edit_empty") {
245  $this->form_gui->addCommandButton("edit", $lng->txt("save"));
246  } else {
247  $this->form_gui->addCommandButton("create_pcqst", $lng->txt("save"));
248  $this->form_gui->addCommandButton("cancelCreate", $lng->txt("cancel"));
249  }
250 
251  $this->tpl->setContent($this->form_gui->getHTML());
252  }
const ADDITIONAL_CONTENT_EDITING_MODE_IPE
constant for additional content editing mode "pageobject"
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 property form user interface.
setInfo($a_info)
Set Info.
setInfo($a_info)
Set Information Text.
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.
displayValidationError()
display validation errors
const ADDITIONAL_CONTENT_EDITING_MODE_RTE
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 ...
$ilUser
Definition: imgupload.php:18
+ 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 501 of file class.ilPCQuestionGUI.php.

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

502  {
503  $ilCtrl = $this->ctrl;
504  $ilAccess = $this->access;
505  $ilTabs = $this->tabs;
506  $tpl = $this->tpl;
507  $lng = $this->lng;
508  $ilToolbar = $this->toolbar;
509  //var_dump($_SESSION["cont_qst_pool"]);
510  if ($_SESSION["cont_qst_pool"] != "" &&
511  $ilAccess->checkAccess("write", "", $_SESSION["cont_qst_pool"])
512  && ilObject::_lookupType(ilObject::_lookupObjId($_SESSION["cont_qst_pool"])) == "qpl") {
513  $this->listPoolQuestions();
514  } else {
515  $this->poolSelection();
516  }
517  }
$_SESSION["AccountId"]
poolSelection()
Pool selection.
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 566 of file class.ilPCQuestionGUI.php.

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

Referenced by insertFromPool().

567  {
568  $ilToolbar = $this->toolbar;
569  $tpl = $this->tpl;
570  $ilCtrl = $this->ctrl;
571  $lng = $this->lng;
572 
573  ilUtil::sendInfo($lng->txt("cont_cp_question_diff_formats_info"));
574 
575  $ilCtrl->setParameter($this, "subCmd", "poolSelection");
576  $ilToolbar->addButton(
577  $lng->txt("cont_select_other_qpool"),
578  $ilCtrl->getLinkTarget($this, "insert")
579  );
580  $ilCtrl->setParameter($this, "subCmd", "");
581 
582  $this->setInsertTabs("copy_question");
583 
584  include_once "./Services/COPage/classes/class.ilCopySelfAssQuestionTableGUI.php";
585 
586  $ilCtrl->setParameter($this, "subCmd", "listPoolQuestions");
587  $table_gui = new ilCopySelfAssQuestionTableGUI(
588  $this,
589  'insert',
590  $_SESSION["cont_qst_pool"]
591  );
592 
593  $tpl->setContent($table_gui->getHTML());
594  }
setInsertTabs($a_active)
Set insert tabs.
$_SESSION["AccountId"]
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 525 of file class.ilPCQuestionGUI.php.

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

Referenced by insertFromPool().

526  {
527  $ilCtrl = $this->ctrl;
528  $tree = $this->tree;
529  $tpl = $this->tpl;
530  $ilTabs = $this->tabs;
531 
532  $this->setInsertTabs("copy_question");
533 
534  include_once "./Services/COPage/classes/class.ilPoolSelectorGUI.php";
535 
536  $ilCtrl->setParameter($this, "subCmd", "poolSelection");
537  $exp = new ilPoolSelectorGUI($this, "insert");
538 
539  // filter
540  $exp->setTypeWhiteList(array("root", "cat", "grp", "fold", "crs", "qpl"));
541  $exp->setClickableTypes(array('qpl'));
542 
543  if (!$exp->handleCommand()) {
544  $tpl->setContent($exp->getHTML());
545  }
546  }
setInsertTabs($a_active)
Set insert tabs.
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 551 of file class.ilPCQuestionGUI.php.

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

552  {
553  $ilCtrl = $this->ctrl;
554 
555  $_SESSION["cont_qst_pool"] = $_GET["pool_ref_id"];
556  $ilCtrl->setParameter($this, "subCmd", "insertFromPool");
557  $ilCtrl->redirect($this, "insert");
558  }
$_SESSION["AccountId"]
$_GET["client_id"]

◆ 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, ilPageContentGUI\$lng, and $tabs.

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

129  {
130  $ilTabs = $this->tabs;
131  $ilCtrl = $this->ctrl;
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  }
+ Here is the caller graph for this function:

◆ setNewQuestionId()

ilPCQuestionGUI::setNewQuestionId (   $a_par)

Set new question id.

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

300  {
301  if ($a_par["new_id"] > 0) {
302  $this->content_obj->setQuestionReference("il__qst_" . $a_par["new_id"]);
303  $this->pg_obj->update();
304  }
305  }

◆ 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 446 of file class.ilPCQuestionGUI.php.

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

Referenced by executeCommand().

447  {
448  if ($this->getSelfAssessmentMode()) {
449  return;
450  }
451 
452  $ilTabs = $this->tabs;
453  $ilCtrl = $this->ctrl;
454  $lng = $this->lng;
455  include_once("./Modules/TestQuestionPool/classes/class.assQuestion.php");
456 
457  if ($this->content_obj != "") {
458  $q_ref = $this->content_obj->getQuestionReference();
459  }
460 
461  if ($q_ref != "") {
462  $inst_id = ilInternalLink::_extractInstOfTarget($q_ref);
463  if (!($inst_id > 0)) {
465  }
466  }
467 
468  $ilTabs->addTarget(
469  "question",
470  $ilCtrl->getLinkTarget($this, "edit"),
471  array("editQuestion", "save", "cancel", "addSuggestedSolution",
472  "cancelExplorer", "linkChilds", "removeSuggestedSolution",
473  "addPair", "addTerm", "delete", "deleteTerms", "editMode", "upload",
474  "saveEdit","uploadingImage", "uploadingImagemap", "addArea",
475  "deletearea", "saveShape", "back", "saveEdit", "changeGapType","createGaps","addItem","addYesNo", "addTrueFalse",
476  "toggleGraphicalAnswers", "setMediaMode"),
477  ""
478  );
479 
480  if ($q_id > 0) {
481  if (assQuestion::_getQuestionType($q_id) != "assTextQuestion") {
482  require_once 'Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
483  require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionFeedbackEditingGUI.php';
484  $tabCommands = assQuestionGUI::getCommandsFromClassConstants('ilAssQuestionFeedbackEditingGUI');
486  $ilCtrl->getLinkTargetByClass('ilAssQuestionFeedbackEditingGUI', ilAssQuestionFeedbackEditingGUI::CMD_SHOW),
487  "q_id=" . (int) $q_id
488  );
489  $ilTabs->addTarget('feedback', $tabLink, $tabCommands, $ilCtrl->getCmdClass(), '');
490  }
491  }
492  }
static _getQuestionType($question_id)
Returns the question type of a question with a given id.
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: