ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
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 ()
 
 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

ILIAS TestQuestionPool QuestionInfoService $questioninfo
 
ilPropertyFormGUI $form_gui
 
int $scormlmid
 
bool $selfassessmentmode
 
ilAccessHandler $access
 
ilTabsGUI $tabs
 
ilObjUser $user
 
ilTree $tree
 
ilToolbarGUI $toolbar
 
- Protected Attributes inherited from ilPageContentGUI
ILIAS COPage Editor GUIService $editor_gui
 
ILIAS COPage InternalGUIService $gui
 
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
 
ILIAS GlobalScreen ScreenContext ContextServices $tool_context
 
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 = ""
 
DOMDocument $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 ()
 
 setEditorToolContext ()
 
 initEditor ()
 
 getEditorScriptTag (string $form_pc_id="", string $form_cname="")
 
- 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 36 of file class.ilPCQuestionGUI.php.

References $DIC, ILIAS\MetaData\Repository\Validation\Data\__construct(), ILIAS\Repository\access(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ILIAS\Repository\tabs(), ILIAS\Repository\toolbar(), and ILIAS\Repository\user().

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

Member Function Documentation

◆ copyQuestion()

ilPCQuestionGUI::copyQuestion ( )

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

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

482  : void
483  {
484  $ilCtrl = $this->ctrl;
485 
486  $this->content_obj = new ilPCQuestion($this->getPage());
487  $this->content_obj->create(
488  $this->pg_obj,
489  $this->request->getHierId()
490  );
491 
492  $this->content_obj->copyPoolQuestionIntoPage(
493  $this->request->getInt("q_id"),
494  $this->request->getHierId()
495  );
496 
497  $this->updated = $this->pg_obj->update();
498 
499  $ilCtrl->returnToParent($this);
500  }
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 197 of file class.ilPCQuestionGUI.php.

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

197  : void
198  {
199  global $ilCtrl, $ilTabs;
200 
201  $ilTabs->setTabActive('question');
202 
203  $this->content_obj = new ilPCQuestion($this->getPage());
204  $this->content_obj->create($this->pg_obj, $this->hier_id);
205 
206  $this->updated = $this->pg_obj->update();
207 
208  if ($this->updated) {
209  $this->pg_obj->stripHierIDs();
210  $this->pg_obj->addHierIDs();
211  $ilCtrl->setParameter(
212  $this,
213  "q_type",
214  $this->request->getString("q_type")
215  );
216  $ilCtrl->setParameter(
217  $this,
218  "add_quest_cont_edit_mode",
219  $this->request->getString("add_quest_cont_edit_mode")
220  );
221  // $ilCtrl->setParameter($this, "qpool_ref_id", $pool_ref_id);
222  //$ilCtrl->setParameter($this, "hier_id", $hier_id);
223  $ilCtrl->setParameter($this, "hier_id", $this->content_obj->readHierId());
224  $ilCtrl->setParameter($this, "pc_id", $this->content_obj->readPCId());
225 
226  $ilCtrl->redirect($this, "edit");
227  }
228 
229  $this->insert();
230  }
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 343 of file class.ilPCQuestionGUI.php.

References $tree, and ilTree\getParentId().

343  : int
344  {
345  $tree = $this->tree;
346  $parent_ref = $tree->getParentId($this->requested_ref_id);
347  $qpl = new ilObjQuestionPool();
348  $qpl->setType("qpl");
349  $qpl->setTitle($name);
350  $qpl->setDescription("");
351  $qpl->create();
352  $qpl->createReference();
353  $qpl->putInTree($parent_ref);
354  $qpl->setPermissions($parent_ref);
355  $qpl->setOnline(1); // must be online to be available
356  $qpl->saveToDb();
357  return $qpl->getRefId();
358  }
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 246 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().

246  : void
247  {
248  $ilCtrl = $this->ctrl;
249  $ilTabs = $this->tabs;
250  $q_id = "";
251 
252  $ilTabs->setTabActive('question');
253 
254  if ($this->getSelfAssessmentMode()) { // behaviour in content pages, e.g. scorm
255  $q_ref = $this->content_obj->getQuestionReference();
256 
257  if ($q_ref != "") {
258  $inst_id = ilInternalLink::_extractInstOfTarget($q_ref);
259  if (!($inst_id > 0)) {
261  }
262  }
263 
264  $q_type = $this->request->getString("q_type");
265  $ilCtrl->setParameter($this, "q_type", $q_type);
266 
267  if ($q_id == "" && $q_type == "") {
268  $this->insert("edit_empty");
269  return;
270  }
271 
272  // create question first-hand (needed for uploads)
273  if ($q_id < 1 && $q_type) {
274  $q_gui = assQuestionGUI::_getQuestionGUI($q_type);
275 
276  // feedback editing mode
277  $add_quest_cont_edit_mode = $this->request->getString("add_quest_cont_edit_mode");
279  && $add_quest_cont_edit_mode != "") {
280  $addContEditMode = $add_quest_cont_edit_mode;
281  } else {
283  }
284  $q_gui->object->setAdditionalContentEditingMode($addContEditMode);
285 
286  //set default tries
287  $q_gui->object->setObjId(0);
288  $q_id = $q_gui->object->createNewQuestion(true);
289  $this->content_obj->setQuestionReference("il__qst_" . $q_id);
290  $this->pg_obj->update();
291  unset($q_gui);
292  }
293  $ilCtrl->setParameterByClass("ilQuestionEditGUI", "q_id", $q_id);
294  $ilCtrl->redirectByClass(array(get_class($this->pg_obj) . "GUI", "ilQuestionEditGUI"), "editQuestion");
295  } else { // behaviour in question pool
297  "",
298  $this->request->getInt("q_id")
299  );
300  $this->ctrl->redirectByClass(array("ilobjquestionpoolgui", get_class($q_gui)), "editQuestion");
301  }
302  }
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 63 of file class.ilPCQuestionGUI.php.

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

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

◆ feedback()

ilPCQuestionGUI::feedback ( )
Returns
mixed
Exceptions
ilCtrlException

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

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

309  {
310  $ilCtrl = $this->ctrl;
311  $ilTabs = $this->tabs;
312  $q_id = "";
313 
314  $ilTabs->setTabActive('feedback');
315 
316  $q_ref = $this->content_obj->getQuestionReference();
317 
318  if ($q_ref != "") {
319  $inst_id = ilInternalLink::_extractInstOfTarget($q_ref);
320  if (!($inst_id > 0)) {
322  }
323  }
324 
325  $ilCtrl->setCmdClass("ilquestioneditgui");
326  $ilCtrl->setCmd("feedback");
327  $edit_gui = new ilQuestionEditGUI();
328  if ($q_id > 0) {
329  $edit_gui->setQuestionId($q_id);
330  }
331  // $edit_gui->setQuestionType("assSingleChoice");
332  $edit_gui->setSelfAssessmentEditingMode(true);
333  $edit_gui->setPageConfig($this->getPageConfig());
334  $ret = $ilCtrl->forwardCommand($edit_gui);
335  $this->tpl->setContent($ret);
336  return $ret;
337  }
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 91 of file class.ilPCQuestionGUI.php.

References $selfassessmentmode.

Referenced by edit(), and setTabs().

91  : bool
92  {
94  }
+ Here is the caller graph for this function:

◆ insert()

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

Insert new question form.

Definition at line 125 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(), ilSelectInputGUI\setOptions(), ilArrayUtil\sortArray(), and ilLanguage\txt().

Referenced by create(), and edit().

125  : void
126  {
127  $lng = $this->lng;
128  $ilCtrl = $this->ctrl;
129 
130  $this->setInsertTabs("new_question");
131 
132  $this->displayValidationError();
133 
134  // get all question types (@todo: we have to check, whether they are
135  // suitable for self assessment or not)
137  $options = array();
138  $all_types = ilArrayUtil::sortArray($all_types, "order", "asc", true, true);
139 
140  foreach ($all_types as $k => $v) {
141  $options[$v["type_tag"]] = $k;
142  }
143 
144  // new table form (input of rows and columns)
145  $this->form_gui = new ilPropertyFormGUI();
146  $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
147  $this->form_gui->setTitle($lng->txt("cont_ed_insert_pcqst"));
148 
149  // Select Question Type
150  $qtype_input = new ilSelectInputGUI($lng->txt("cont_question_type"), "q_type");
151  $qtype_input->setOptions($options);
152  $qtype_input->setRequired(true);
153  $this->form_gui->addItem($qtype_input);
154 
155  // additional content editor
156  // assessment
158  $ri = new ilRadioGroupInputGUI($this->lng->txt("tst_add_quest_cont_edit_mode"), "add_quest_cont_edit_mode");
159 
160  $option_rte = new ilRadioOption(
161  $this->lng->txt('tst_add_quest_cont_edit_mode_plain'),
163  );
164  $option_rte->setInfo($this->lng->txt('tst_add_quest_cont_edit_mode_plain_info'));
165  $ri->addOption($option_rte);
166 
167  $option_ipe = new ilRadioOption(
168  $this->lng->txt('tst_add_quest_cont_edit_mode_IPE'),
170  );
171  $option_ipe->setInfo($this->lng->txt('tst_add_quest_cont_edit_mode_IPE_info'));
172  $ri->addOption($option_ipe);
173 
175 
176  $this->form_gui->addItem($ri);
177  } else {
178  $hi = new ilHiddenInputGUI("question_content_editing_type");
180  $this->form_gui->addItem($hi);
181  }
182 
183  if ($a_mode == "edit_empty") {
184  $this->form_gui->addCommandButton("edit", $lng->txt("save"));
185  } else {
186  $this->form_gui->addCommandButton("create_pcqst", $lng->txt("save"));
187  $this->form_gui->addCommandButton("cancelCreate", $lng->txt("cancel"));
188  }
189 
190  $this->tpl->setContent($this->form_gui->getHTML());
191  }
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)
This class represents a selection list property in a property form.
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)
setOptions(array $a_options)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static & _getSelfAssessmentQuestionTypes($all_tags=false)
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 414 of file class.ilPCQuestionGUI.php.

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

414  : void
415  {
416  $ilAccess = $this->access;
417  if ($this->edit_repo->getQuestionPool() > 0 &&
418  $ilAccess->checkAccess("write", "", $this->edit_repo->getQuestionPool())
419  && ilObject::_lookupType(ilObject::_lookupObjId($this->edit_repo->getQuestionPool())) == "qpl") {
420  $this->listPoolQuestions();
421  } else {
422  $this->poolSelection();
423  }
424  }
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 454 of file class.ilPCQuestionGUI.php.

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

Referenced by insertFromPool().

454  : void
455  {
456  $ilToolbar = $this->toolbar;
457  $tpl = $this->tpl;
458  $ilCtrl = $this->ctrl;
459  $lng = $this->lng;
460 
461  $this->tpl->setOnScreenMessage('info', $lng->txt("cont_cp_question_diff_formats_info"));
462 
463  $ilCtrl->setParameter($this, "subCmd", "poolSelection");
464  $ilToolbar->addButton(
465  $lng->txt("cont_select_other_qpool"),
466  $ilCtrl->getLinkTarget($this, "insert")
467  );
468  $ilCtrl->setParameter($this, "subCmd", "");
469 
470  $this->setInsertTabs("copy_question");
471 
472  $ilCtrl->setParameter($this, "subCmd", "listPoolQuestions");
473  $table_gui = new ilCopySelfAssQuestionTableGUI(
474  $this,
475  'insert',
476  $this->edit_repo->getQuestionPool()
477  );
478 
479  $tpl->setContent($table_gui->getHTML());
480  }
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
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 ( )

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

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

Referenced by insertFromPool().

426  : void
427  {
428  $ilCtrl = $this->ctrl;
429  $tpl = $this->tpl;
430 
431  $this->setInsertTabs("copy_question");
432 
433  $ilCtrl->setParameter($this, "subCmd", "poolSelection");
434  $exp = new ilPoolSelectorGUI($this, "insert");
435 
436  // filter
437  $exp->setTypeWhiteList(array("root", "cat", "grp", "fold", "crs", "qpl"));
438  $exp->setClickableTypes(array('qpl'));
439 
440  if (!$exp->handleCommand()) {
441  $tpl->setContent($exp->getHTML());
442  }
443  }
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 445 of file class.ilPCQuestionGUI.php.

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

445  : void
446  {
447  $ilCtrl = $this->ctrl;
448 
449  $this->edit_repo->setQuestionPool($this->request->getInt("pool_ref_id"));
450  $ilCtrl->setParameter($this, "subCmd", "insertFromPool");
451  $ilCtrl->redirect($this, "insert");
452  }
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 96 of file class.ilPCQuestionGUI.php.

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

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

96  : void
97  {
98  $ilTabs = $this->tabs;
99  $ilCtrl = $this->ctrl;
100  $lng = $this->lng;
101 
102  // new question
103  $ilTabs->addSubTab(
104  "new_question",
105  $lng->txt("cont_new_question"),
106  $ilCtrl->getLinkTarget($this, "insert")
107  );
108 
109  // copy from pool
110  $ilCtrl->setParameter($this, "subCmd", "insertFromPool");
111  $ilTabs->addSubTab(
112  "copy_question",
113  $lng->txt("cont_copy_question_from_pool"),
114  $ilCtrl->getLinkTarget($this, "insert")
115  );
116 
117  $ilTabs->activateSubTab($a_active);
118 
119  $ilCtrl->setParameter($this, "subCmd", "");
120  }
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 235 of file class.ilPCQuestionGUI.php.

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

◆ setSelfAssessmentMode()

ilPCQuestionGUI::setSelfAssessmentMode ( bool  $a_selfassessmentmode)

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

86  : void
87  {
88  $this->selfassessmentmode = $a_selfassessmentmode;
89  }

◆ setTabs()

ilPCQuestionGUI::setTabs ( )

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

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

Referenced by executeCommand().

360  : void
361  {
362  $q_ref = "";
363  $q_id = 0;
364 
365  if ($this->getSelfAssessmentMode()) {
366  return;
367  }
368 
369  $ilTabs = $this->tabs;
370  $ilCtrl = $this->ctrl;
371 
372  if (!is_null($this->content_obj)) {
373  $q_ref = $this->content_obj->getQuestionReference();
374  }
375 
376  if ($q_ref != "") {
377  $inst_id = ilInternalLink::_extractInstOfTarget($q_ref);
378  if (!($inst_id > 0)) {
380  }
381  }
382 
383  $ilTabs->addTarget(
384  "question",
385  $ilCtrl->getLinkTarget($this, "edit"),
386  array("editQuestion", "save", "cancel", "addSuggestedSolution",
387  "cancelExplorer", "linkChilds", "removeSuggestedSolution",
388  "addPair", "addTerm", "delete", "deleteTerms", "editMode", "upload",
389  "saveEdit","uploadingImage", "uploadingImagemap", "addArea",
390  "deletearea", "saveShape", "back", "saveEdit", "changeGapType","createGaps","addItem","addYesNo", "addTrueFalse",
391  "toggleGraphicalAnswers", "setMediaMode"),
392  ""
393  );
394 
395  if ($q_id > 0) {
396  if ($this->questioninfo->getQuestionType($q_id) != "assTextQuestion") {
397  $tabCommands = assQuestionGUI::getCommandsFromClassConstants('ilAssQuestionFeedbackEditingGUI');
399  $ilCtrl->getLinkTargetByClass('ilAssQuestionFeedbackEditingGUI', ilAssQuestionFeedbackEditingGUI::CMD_SHOW),
400  "q_id=" . $q_id
401  );
402  $ilTabs->addTarget('feedback', $tabLink, $tabCommands, $ilCtrl->getCmdClass(), '');
403  }
404  }
405  }
static appendUrlParameterString(string $a_url, string $a_par, bool $xml_style=false)
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 30 of file class.ilPCQuestionGUI.php.

Referenced by insertFromPool().

◆ $form_gui

ilPropertyFormGUI ilPCQuestionGUI::$form_gui
protected

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

◆ $questioninfo

ILIAS TestQuestionPool QuestionInfoService ilPCQuestionGUI::$questioninfo
protected

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

◆ $scormlmid

int ilPCQuestionGUI::$scormlmid
protected

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

◆ $selfassessmentmode

bool ilPCQuestionGUI::$selfassessmentmode
protected

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

Referenced by getSelfAssessmentMode().

◆ $tabs

ilTabsGUI ilPCQuestionGUI::$tabs
protected

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

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

◆ $toolbar

ilToolbarGUI ilPCQuestionGUI::$toolbar
protected

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

Referenced by listPoolQuestions().

◆ $tree

ilTree ilPCQuestionGUI::$tree
protected

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

Referenced by createQuestionPool().

◆ $user

ilObjUser ilPCQuestionGUI::$user
protected

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


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