ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilPCQuestionGUI Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

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

Public Member Functions

 __construct (ilPageObject $a_pg_obj, ?ilPageContent $a_content_obj, string $a_hier_id, string $a_pc_id="")
 
 executeCommand ()
 
 setSelfAssessmentMode (bool $a_selfassessmentmode)
 
 getSelfAssessmentMode ()
 
 setInsertTabs (string $a_active)
 
 insert (string $a_mode="create")
 Insert new question form. More...
 
 create ()
 Create new question. More...
 
 setNewQuestionId (array $a_par)
 Set new question id. More...
 
 edit ()
 edit question More...
 
 feedback ()
 
 createQuestionPool (string $name="Dummy")
 Creates a new questionpool and returns the reference id. More...
 
 setTabs ()
 
 insertFromPool ()
 Insert question from ppol. More...
 
 poolSelection ()
 
 selectPool ()
 
 listPoolQuestions ()
 
 copyQuestion ()
 
- Public Member Functions inherited from ilPageContentGUI
 __construct (ilPageObject $a_pg_obj, ?ilPageContent $a_content_obj, string $a_hier_id="", string $a_pc_id="0")
 
 setContentObject (ilPageContent $a_val)
 
 getContentObject ()
 
 setPage (ilPageObject $a_val)
 
 getPage ()
 
 setPageConfig (ilPageConfig $a_val)
 
 getPageConfig ()
 
 setStyleId (int $a_styleid)
 
 getStyleId ()
 
 getStyle ()
 
 getCharacteristicsOfCurrentStyle (array $a_type)
 Get characteristics of current style and call setCharacteristics, if style is given. More...
 
 setCharacteristics (array $a_chars)
 
 getCharacteristics ()
 
 getHierId ()
 
 setHierId (string $a_hier_id)
 set hierarchical id in dom object More...
 
 delete ()
 
 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 ()
 
 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 (string $a_type="")
 Get table templates. More...
 

Protected Attributes

ilPropertyFormGUI $form_gui
 
int $scormlmid
 
bool $selfassessmentmode
 
ilAccessHandler $access
 
ilTabsGUI $tabs
 
ilObjUser $user
 
ilTree $tree
 
ilToolbarGUI $toolbar
 
- Protected Attributes inherited from ilPageContentGUI
EditSessionRepository $edit_repo
 
string $pc_id = ""
 
array $chars
 
ilObjStyleSheet $style = null
 
ilLogger $log
 
int $styleid = 0
 
EditGUIRequest $request
 
string $sub_command = ""
 
int $requested_ref_id = 0
 
Style Content CharacteristicManager $char_manager
 

Additional Inherited Members

- Static Public Member Functions inherited from ilPageContentGUI
static _getCommonBBButtons ()
 
- Data Fields inherited from ilPageContentGUI
ilPageContent $content_obj
 
ilGlobalTemplateInterface $tpl
 
ilLanguage $lng
 
ilCtrl $ctrl
 
ilPageObject $pg_obj
 
string $hier_id = ""
 
php4DOMDocument $dom
 
 $updated
 
string $target_script = ""
 
string $return_location = ""
 
ilPageConfig $page_config = null
 
- Static Public Attributes inherited from ilPageContentGUI
static string $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 (string $hier_id="")
 
 getParentReturn (string $hier_id="")
 
 updateAndReturn ()
 
 setCurrentTextLang (string $lang_key)
 
 getCurrentTextLang ()
 
- Static Protected Attributes inherited from ilPageContentGUI
static array $common_bb_buttons
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Class ilPCQuestionGUI Adapter User Interface class for assessment questions

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

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

Constructor & Destructor Documentation

◆ __construct()

ilPCQuestionGUI::__construct ( ilPageObject  $a_pg_obj,
?ilPageContent  $a_content_obj,
string  $a_hier_id,
string  $a_pc_id = "" 
)

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

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), ILIAS\Repository\access(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ILIAS\Repository\tabs(), ILIAS\Repository\toolbar(), and ILIAS\Repository\user().

40  {
41  global $DIC;
42 
43  $this->ctrl = $DIC->ctrl();
44  $this->access = $DIC->access();
45  $this->tpl = $DIC["tpl"];
46  $this->tabs = $DIC->tabs();
47  $this->lng = $DIC->language();
48  $this->user = $DIC->user();
49  $this->tree = $DIC->repositoryTree();
50  $this->toolbar = $DIC->toolbar();
51  $ilCtrl = $DIC->ctrl();
52  $this->scormlmid = $a_pg_obj->parent_id;
53  parent::__construct($a_pg_obj, $a_content_obj, $a_hier_id, $a_pc_id);
54  $ilCtrl->saveParameter($this, array("qpool_ref_id"));
55  }
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ copyQuestion()

ilPCQuestionGUI::copyQuestion ( )

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

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

480  : void
481  {
482  $ilCtrl = $this->ctrl;
483 
484  $this->content_obj = new ilPCQuestion($this->getPage());
485  $this->content_obj->create(
486  $this->pg_obj,
487  $this->request->getHierId()
488  );
489 
490  $this->content_obj->copyPoolQuestionIntoPage(
491  $this->request->getInt("q_id"),
492  $this->request->getHierId()
493  );
494 
495  $this->updated = $this->pg_obj->update();
496 
497  $ilCtrl->returnToParent($this);
498  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ create()

ilPCQuestionGUI::create ( )

Create new question.

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

References ilPageContentGUI\getPage(), and insert().

195  : void
196  {
197  global $ilCtrl, $ilTabs;
198 
199  $ilTabs->setTabActive('question');
200 
201  $this->content_obj = new ilPCQuestion($this->getPage());
202  $this->content_obj->create($this->pg_obj, $this->hier_id);
203 
204  $this->updated = $this->pg_obj->update();
205 
206  if ($this->updated) {
207  $this->pg_obj->stripHierIDs();
208  $this->pg_obj->addHierIDs();
209  $ilCtrl->setParameter(
210  $this,
211  "q_type",
212  $this->request->getString("q_type")
213  );
214  $ilCtrl->setParameter(
215  $this,
216  "add_quest_cont_edit_mode",
217  $this->request->getString("add_quest_cont_edit_mode")
218  );
219  // $ilCtrl->setParameter($this, "qpool_ref_id", $pool_ref_id);
220  //$ilCtrl->setParameter($this, "hier_id", $hier_id);
221  $ilCtrl->setParameter($this, "hier_id", $this->content_obj->readHierId());
222  $ilCtrl->setParameter($this, "pc_id", $this->content_obj->readPCId());
223 
224  $ilCtrl->redirect($this, "edit");
225  }
226 
227  $this->insert();
228  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
insert(string $a_mode="create")
Insert new question form.
+ Here is the call graph for this function:

◆ createQuestionPool()

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

Creates a new questionpool and returns the reference id.

Returns
int Reference id of the newly created questionpool

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

References $name, $tree, and ilTree\getParentId().

341  : int
342  {
343  $tree = $this->tree;
344  $parent_ref = $tree->getParentId($this->requested_ref_id);
345  $qpl = new ilObjQuestionPool();
346  $qpl->setType("qpl");
347  $qpl->setTitle($name);
348  $qpl->setDescription("");
349  $qpl->create();
350  $qpl->createReference();
351  $qpl->putInTree($parent_ref);
352  $qpl->setPermissions($parent_ref);
353  $qpl->setOnline(1); // must be online to be available
354  $qpl->saveToDb();
355  return $qpl->getRefId();
356  }
if($format !==null) $name
Definition: metadata.php:247
getParentId(int $a_node_id)
get parent id of given node
+ Here is the call graph for this function:

◆ edit()

ilPCQuestionGUI::edit ( )

edit question

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

References ilPageContentGUI\$ctrl, $tabs, ilInternalLink\_extractInstOfTarget(), ilInternalLink\_extractObjIdOfTarget(), assQuestionGUI\_getQuestionGUI(), assQuestion\ADDITIONAL_CONTENT_EDITING_MODE_RTE, ILIAS\Repository\ctrl(), getSelfAssessmentMode(), insert(), ilObjAssessmentFolder\isAdditionalQuestionContentEditingModePageObjectEnabled(), and ilTabsGUI\setTabActive().

244  : void
245  {
246  $ilCtrl = $this->ctrl;
247  $ilTabs = $this->tabs;
248  $q_id = "";
249 
250  $ilTabs->setTabActive('question');
251 
252  if ($this->getSelfAssessmentMode()) { // behaviour in content pages, e.g. scorm
253  $q_ref = $this->content_obj->getQuestionReference();
254 
255  if ($q_ref != "") {
256  $inst_id = ilInternalLink::_extractInstOfTarget($q_ref);
257  if (!($inst_id > 0)) {
259  }
260  }
261 
262  $q_type = $this->request->getString("q_type");
263  $ilCtrl->setParameter($this, "q_type", $q_type);
264 
265  if ($q_id == "" && $q_type == "") {
266  $this->insert("edit_empty");
267  return;
268  }
269 
270  // create question first-hand (needed for uploads)
271  if ($q_id < 1 && $q_type) {
272  $q_gui = assQuestionGUI::_getQuestionGUI($q_type);
273 
274  // feedback editing mode
275  $add_quest_cont_edit_mode = $this->request->getString("add_quest_cont_edit_mode");
277  && $add_quest_cont_edit_mode != "") {
278  $addContEditMode = $add_quest_cont_edit_mode;
279  } else {
281  }
282  $q_gui->object->setAdditionalContentEditingMode($addContEditMode);
283 
284  //set default tries
285  $q_gui->object->setObjId(0);
286  $q_id = $q_gui->object->createNewQuestion(true);
287  $this->content_obj->setQuestionReference("il__qst_" . $q_id);
288  $this->pg_obj->update();
289  unset($q_gui);
290  }
291  $ilCtrl->setParameterByClass("ilQuestionEditGUI", "q_id", $q_id);
292  $ilCtrl->redirectByClass(array(get_class($this->pg_obj) . "GUI", "ilQuestionEditGUI"), "editQuestion");
293  } else { // behaviour in question pool
295  "",
296  $this->request->getInt("q_id")
297  );
298  $this->ctrl->redirectByClass(array("ilobjquestionpoolgui", get_class($q_gui)), "editQuestion");
299  }
300  }
static _getQuestionGUI(string $question_type='', int $question_id=-1)
Creates a question gui representation and returns the alias to the question gui.
setTabActive(string $a_id)
const ADDITIONAL_CONTENT_EDITING_MODE_RTE
static isAdditionalQuestionContentEditingModePageObjectEnabled()
Returns the fact wether content editing with ilias page editor is enabled for questions or not...
insert(string $a_mode="create")
Insert new question form.
+ Here is the call graph for this function:

◆ executeCommand()

ilPCQuestionGUI::executeCommand ( )
Returns
mixed
Exceptions
ilCtrlException

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

References ilPageContentGUI\$ctrl, ilPageContentGUI\$sub_command, ilCtrl\getCmd(), and setTabs().

62  {
63  $ilCtrl = $this->ctrl;
64 
65  // get current command
66  $cmd = $ilCtrl->getCmd();
67  $next_class = $ilCtrl->getNextClass($this);
68 
69  switch ($next_class) {
70  default:
71  //set tabs
72  if ($cmd != "insert") {
73  $this->setTabs();
74  } elseif ($this->sub_command != "") {
75  $cmd = $this->sub_command;
76  }
77 
78  $ret = $this->$cmd();
79  }
80 
81  return $ret;
82  }
getCmd(string $fallback_command=null)
+ Here is the call graph for this function:

◆ feedback()

ilPCQuestionGUI::feedback ( )
Returns
mixed
Exceptions
ilCtrlException

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

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

307  {
308  $ilCtrl = $this->ctrl;
309  $ilTabs = $this->tabs;
310  $q_id = "";
311 
312  $ilTabs->setTabActive('feedback');
313 
314  $q_ref = $this->content_obj->getQuestionReference();
315 
316  if ($q_ref != "") {
317  $inst_id = ilInternalLink::_extractInstOfTarget($q_ref);
318  if (!($inst_id > 0)) {
320  }
321  }
322 
323  $ilCtrl->setCmdClass("ilquestioneditgui");
324  $ilCtrl->setCmd("feedback");
325  $edit_gui = new ilQuestionEditGUI();
326  if ($q_id > 0) {
327  $edit_gui->setQuestionId($q_id);
328  }
329  // $edit_gui->setQuestionType("assSingleChoice");
330  $edit_gui->setSelfAssessmentEditingMode(true);
331  $edit_gui->setPageConfig($this->getPageConfig());
332  $ret = $ilCtrl->forwardCommand($edit_gui);
333  $this->tpl->setContent($ret);
334  return $ret;
335  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setTabActive(string $a_id)
+ Here is the call graph for this function:

◆ getSelfAssessmentMode()

ilPCQuestionGUI::getSelfAssessmentMode ( )

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

References $selfassessmentmode.

Referenced by edit(), and setTabs().

89  : bool
90  {
92  }
+ Here is the caller graph for this function:

◆ insert()

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

Insert new question form.

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

References ilPageContentGUI\$ctrl, ilPageContentGUI\$lng, ilObjQuestionPool\_getSelfAssessmentQuestionTypes(), assQuestion\ADDITIONAL_CONTENT_EDITING_MODE_IPE, assQuestion\ADDITIONAL_CONTENT_EDITING_MODE_RTE, ilPageContentGUI\displayValidationError(), ilObjAssessmentFolder\isAdditionalQuestionContentEditingModePageObjectEnabled(), ILIAS\Repository\lng(), ilRadioOption\setInfo(), ilFormPropertyGUI\setInfo(), setInsertTabs(), ilArrayUtil\sortArray(), and ilLanguage\txt().

Referenced by create(), and edit().

123  : void
124  {
125  $lng = $this->lng;
126  $ilCtrl = $this->ctrl;
127 
128  $this->setInsertTabs("new_question");
129 
130  $this->displayValidationError();
131 
132  // get all question types (@todo: we have to check, whether they are
133  // suitable for self assessment or not)
135  $options = array();
136  $all_types = ilArrayUtil::sortArray($all_types, "order", "asc", true, true);
137 
138  foreach ($all_types as $k => $v) {
139  $options[$v["type_tag"]] = $k;
140  }
141 
142  // new table form (input of rows and columns)
143  $this->form_gui = new ilPropertyFormGUI();
144  $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
145  $this->form_gui->setTitle($lng->txt("cont_ed_insert_pcqst"));
146 
147  // Select Question Type
148  $qtype_input = new ilSelectInputGUI($lng->txt("cont_question_type"), "q_type");
149  $qtype_input->setOptions($options);
150  $qtype_input->setRequired(true);
151  $this->form_gui->addItem($qtype_input);
152 
153  // additional content editor
154  // assessment
156  $ri = new ilRadioGroupInputGUI($this->lng->txt("tst_add_quest_cont_edit_mode"), "add_quest_cont_edit_mode");
157 
158  $option_rte = new ilRadioOption(
159  $this->lng->txt('tst_add_quest_cont_edit_mode_plain'),
161  );
162  $option_rte->setInfo($this->lng->txt('tst_add_quest_cont_edit_mode_plain_info'));
163  $ri->addOption($option_rte);
164 
165  $option_ipe = new ilRadioOption(
166  $this->lng->txt('tst_add_quest_cont_edit_mode_IPE'),
168  );
169  $option_ipe->setInfo($this->lng->txt('tst_add_quest_cont_edit_mode_IPE_info'));
170  $ri->addOption($option_ipe);
171 
173 
174  $this->form_gui->addItem($ri);
175  } else {
176  $hi = new ilHiddenInputGUI("question_content_editing_type");
178  $this->form_gui->addItem($hi);
179  }
180 
181  if ($a_mode == "edit_empty") {
182  $this->form_gui->addCommandButton("edit", $lng->txt("save"));
183  } else {
184  $this->form_gui->addCommandButton("create_pcqst", $lng->txt("save"));
185  $this->form_gui->addCommandButton("cancelCreate", $lng->txt("cancel"));
186  }
187 
188  $this->tpl->setContent($this->form_gui->getHTML());
189  }
const ADDITIONAL_CONTENT_EDITING_MODE_IPE
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setInsertTabs(string $a_active)
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
setInfo(string $a_info)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static & _getSelfAssessmentQuestionTypes($all_tags=false)
Get all self assessment question types.
This class represents a property in a property form.
const ADDITIONAL_CONTENT_EDITING_MODE_RTE
static isAdditionalQuestionContentEditingModePageObjectEnabled()
Returns the fact wether content editing with ilias page editor is enabled for questions or not...
static sortArray(array $array, string $a_array_sortby_key, string $a_array_sortorder="asc", bool $a_numeric=false, bool $a_keep_keys=false)
+ 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 412 of file class.ilPCQuestionGUI.php.

References $access, ilObject\_lookupObjId(), ilObject\_lookupType(), listPoolQuestions(), and poolSelection().

412  : void
413  {
414  $ilAccess = $this->access;
415  if ($this->edit_repo->getQuestionPool() > 0 &&
416  $ilAccess->checkAccess("write", "", $this->edit_repo->getQuestionPool())
417  && ilObject::_lookupType(ilObject::_lookupObjId($this->edit_repo->getQuestionPool())) == "qpl") {
418  $this->listPoolQuestions();
419  } else {
420  $this->poolSelection();
421  }
422  }
static _lookupObjId(int $ref_id)
ilAccessHandler $access
static _lookupType(int $id, bool $reference=false)
+ Here is the call graph for this function:

◆ listPoolQuestions()

ilPCQuestionGUI::listPoolQuestions ( )

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

References ilPageContentGUI\$ctrl, ilPageContentGUI\$lng, $toolbar, ilPageContentGUI\$tpl, ilGlobalTemplateInterface\setContent(), setInsertTabs(), and ilLanguage\txt().

Referenced by insertFromPool().

452  : void
453  {
454  $ilToolbar = $this->toolbar;
455  $tpl = $this->tpl;
456  $ilCtrl = $this->ctrl;
457  $lng = $this->lng;
458 
459  $this->tpl->setOnScreenMessage('info', $lng->txt("cont_cp_question_diff_formats_info"));
460 
461  $ilCtrl->setParameter($this, "subCmd", "poolSelection");
462  $ilToolbar->addButton(
463  $lng->txt("cont_select_other_qpool"),
464  $ilCtrl->getLinkTarget($this, "insert")
465  );
466  $ilCtrl->setParameter($this, "subCmd", "");
467 
468  $this->setInsertTabs("copy_question");
469 
470  $ilCtrl->setParameter($this, "subCmd", "listPoolQuestions");
471  $table_gui = new ilCopySelfAssQuestionTableGUI(
472  $this,
473  'insert',
474  $this->edit_repo->getQuestionPool()
475  );
476 
477  $tpl->setContent($table_gui->getHTML());
478  }
setInsertTabs(string $a_active)
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
setContent(string $a_html)
Sets content for standard template.
ilGlobalTemplateInterface $tpl
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ poolSelection()

ilPCQuestionGUI::poolSelection ( )

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

References ilPageContentGUI\$ctrl, ilPageContentGUI\$tpl, ilGlobalTemplateInterface\setContent(), and setInsertTabs().

Referenced by insertFromPool().

424  : void
425  {
426  $ilCtrl = $this->ctrl;
427  $tpl = $this->tpl;
428 
429  $this->setInsertTabs("copy_question");
430 
431  $ilCtrl->setParameter($this, "subCmd", "poolSelection");
432  $exp = new ilPoolSelectorGUI($this, "insert");
433 
434  // filter
435  $exp->setTypeWhiteList(array("root", "cat", "grp", "fold", "crs", "qpl"));
436  $exp->setClickableTypes(array('qpl'));
437 
438  if (!$exp->handleCommand()) {
439  $tpl->setContent($exp->getHTML());
440  }
441  }
setInsertTabs(string $a_active)
setContent(string $a_html)
Sets content for standard template.
ilGlobalTemplateInterface $tpl
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ selectPool()

ilPCQuestionGUI::selectPool ( )

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

References ilPageContentGUI\$ctrl, and ilCtrl\setParameter().

443  : void
444  {
445  $ilCtrl = $this->ctrl;
446 
447  $this->edit_repo->setQuestionPool($this->request->getInt("pool_ref_id"));
448  $ilCtrl->setParameter($this, "subCmd", "insertFromPool");
449  $ilCtrl->redirect($this, "insert");
450  }
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
+ Here is the call graph for this function:

◆ setInsertTabs()

ilPCQuestionGUI::setInsertTabs ( string  $a_active)

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

References ilPageContentGUI\$ctrl, ilPageContentGUI\$lng, $tabs, and ilLanguage\txt().

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

94  : void
95  {
96  $ilTabs = $this->tabs;
97  $ilCtrl = $this->ctrl;
98  $lng = $this->lng;
99 
100  // new question
101  $ilTabs->addSubTab(
102  "new_question",
103  $lng->txt("cont_new_question"),
104  $ilCtrl->getLinkTarget($this, "insert")
105  );
106 
107  // copy from pool
108  $ilCtrl->setParameter($this, "subCmd", "insertFromPool");
109  $ilTabs->addSubTab(
110  "copy_question",
111  $lng->txt("cont_copy_question_from_pool"),
112  $ilCtrl->getLinkTarget($this, "insert")
113  );
114 
115  $ilTabs->activateSubTab($a_active);
116 
117  $ilCtrl->setParameter($this, "subCmd", "");
118  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setNewQuestionId()

ilPCQuestionGUI::setNewQuestionId ( array  $a_par)

Set new question id.

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

233  : void
234  {
235  if ($a_par["new_id"] > 0) {
236  $this->content_obj->setQuestionReference("il__qst_" . $a_par["new_id"]);
237  $this->pg_obj->update();
238  }
239  }

◆ setSelfAssessmentMode()

ilPCQuestionGUI::setSelfAssessmentMode ( bool  $a_selfassessmentmode)

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

84  : void
85  {
86  $this->selfassessmentmode = $a_selfassessmentmode;
87  }

◆ setTabs()

ilPCQuestionGUI::setTabs ( )

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

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

Referenced by executeCommand().

358  : void
359  {
360  $q_ref = "";
361  $q_id = 0;
362 
363  if ($this->getSelfAssessmentMode()) {
364  return;
365  }
366 
367  $ilTabs = $this->tabs;
368  $ilCtrl = $this->ctrl;
369 
370  if (!is_null($this->content_obj)) {
371  $q_ref = $this->content_obj->getQuestionReference();
372  }
373 
374  if ($q_ref != "") {
375  $inst_id = ilInternalLink::_extractInstOfTarget($q_ref);
376  if (!($inst_id > 0)) {
378  }
379  }
380 
381  $ilTabs->addTarget(
382  "question",
383  $ilCtrl->getLinkTarget($this, "edit"),
384  array("editQuestion", "save", "cancel", "addSuggestedSolution",
385  "cancelExplorer", "linkChilds", "removeSuggestedSolution",
386  "addPair", "addTerm", "delete", "deleteTerms", "editMode", "upload",
387  "saveEdit","uploadingImage", "uploadingImagemap", "addArea",
388  "deletearea", "saveShape", "back", "saveEdit", "changeGapType","createGaps","addItem","addYesNo", "addTrueFalse",
389  "toggleGraphicalAnswers", "setMediaMode"),
390  ""
391  );
392 
393  if ($q_id > 0) {
394  if (assQuestion::_getQuestionType($q_id) != "assTextQuestion") {
395  $tabCommands = assQuestionGUI::getCommandsFromClassConstants('ilAssQuestionFeedbackEditingGUI');
397  $ilCtrl->getLinkTargetByClass('ilAssQuestionFeedbackEditingGUI', ilAssQuestionFeedbackEditingGUI::CMD_SHOW),
398  "q_id=" . $q_id
399  );
400  $ilTabs->addTarget('feedback', $tabLink, $tabCommands, $ilCtrl->getCmdClass(), '');
401  }
402  }
403  }
static appendUrlParameterString(string $a_url, string $a_par, bool $xml_style=false)
static _getQuestionType(int $question_id)
static getCommandsFromClassConstants(string $guiClassName, string $cmdConstantNameBegin='CMD_')
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $access

ilAccessHandler ilPCQuestionGUI::$access
protected

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

Referenced by insertFromPool().

◆ $form_gui

ilPropertyFormGUI ilPCQuestionGUI::$form_gui
protected

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

◆ $scormlmid

int ilPCQuestionGUI::$scormlmid
protected

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

◆ $selfassessmentmode

bool ilPCQuestionGUI::$selfassessmentmode
protected

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

Referenced by getSelfAssessmentMode().

◆ $tabs

ilTabsGUI ilPCQuestionGUI::$tabs
protected

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

Referenced by edit(), feedback(), setInsertTabs(), and setTabs().

◆ $toolbar

ilToolbarGUI ilPCQuestionGUI::$toolbar
protected

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

Referenced by listPoolQuestions().

◆ $tree

ilTree ilPCQuestionGUI::$tree
protected

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

Referenced by createQuestionPool().

◆ $user

ilObjUser ilPCQuestionGUI::$user
protected

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


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