ILIAS  trunk Revision v11.0_alpha-1811-gd2d5443e411
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator 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 ()
 
 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 Questions PublicInterface $questioninfo
 
ilPropertyFormGUI $form_gui
 
int $scormlmid
 
bool $selfassessmentmode
 
ilAccessHandler $access
 
ilTabsGUI $tabs
 
ilObjUser $user
 
ilTree $tree
 
ilToolbarGUI $toolbar
 
bool $ipe_for_questions_enabled
 
- 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
 
LOMServices $lom_services
 
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 26 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 39 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().

44  {
45  global $DIC;
46 
47  $this->ctrl = $DIC->ctrl();
48  $this->access = $DIC->access();
49  $this->tpl = $DIC["tpl"];
50  $this->tabs = $DIC->tabs();
51  $this->lng = $DIC->language();
52  $this->user = $DIC->user();
53  $this->tree = $DIC->repositoryTree();
54  $this->toolbar = $DIC->toolbar();
55  $ilCtrl = $DIC->ctrl();
56  $this->scormlmid = $a_pg_obj->parent_id;
57  $this->questioninfo = $DIC->testQuestion();
58  $this->ipe_for_questions_enabled = (bool) $DIC['ilSetting']->get('enable_tst_page_edit', false);
59  parent::__construct($a_pg_obj, $a_content_obj, $a_hier_id, $a_pc_id);
60  $ilCtrl->saveParameter($this, array("qpool_ref_id"));
61  }
global $DIC
Definition: shib_login.php:22
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ copyQuestion()

ilPCQuestionGUI::copyQuestion ( )

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

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

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

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

Referenced by executeCommand().

205  : void
206  {
207  global $ilCtrl, $ilTabs;
208 
209  $ilTabs->setTabActive('question');
210 
211  $this->content_obj = new ilPCQuestion($this->getPage());
212  $this->content_obj->create($this->pg_obj, $this->hier_id);
213 
214  $this->updated = $this->pg_obj->update();
215 
216  if ($this->updated) {
217  $this->pg_obj->stripHierIDs();
218  $this->pg_obj->addHierIDs();
219  $ilCtrl->setParameter(
220  $this,
221  "q_type",
222  $this->request->getString("q_type")
223  );
224  $ilCtrl->setParameter(
225  $this,
226  "add_quest_cont_edit_mode",
227  $this->request->getString("add_quest_cont_edit_mode")
228  );
229  // $ilCtrl->setParameter($this, "qpool_ref_id", $pool_ref_id);
230  //$ilCtrl->setParameter($this, "hier_id", $hier_id);
231  $ilCtrl->setParameter($this, "hier_id", $this->content_obj->readHierId());
232  $ilCtrl->setParameter($this, "pc_id", $this->content_obj->readPCId());
233 
234  $ilCtrl->redirect($this, "edit");
235  }
236 
237  $this->insert();
238  }
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:
+ Here is the caller 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 346 of file class.ilPCQuestionGUI.php.

References $tree, and ilTree\getParentId().

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

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

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

68  {
69  $ilCtrl = $this->ctrl;
70 
71  // get current command
72  $cmd = $ilCtrl->getCmd();
73  $next_class = $ilCtrl->getNextClass($this);
74 
75  switch ($next_class) {
76  default:
77  //set tabs
78  if ($cmd != "insert") {
79  $this->setTabs();
80  } elseif ($this->sub_command != "") {
81  $cmd = $this->sub_command;
82  }
83 
84  if ($cmd === 'create_pcqst') {
85  return $this->create();
86  }
87 
88  $ret = $this->$cmd();
89  }
90 
91  return $ret;
92  }
getCmd(?string $fallback_command=null)
create()
Create new question.
+ Here is the call graph for this function:

◆ feedback()

ilPCQuestionGUI::feedback ( )
Returns
mixed
Exceptions
ilCtrlException

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

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

314  {
315  $ilCtrl = $this->ctrl;
316  $ilTabs = $this->tabs;
317  $q_id = "";
318 
319  $ilTabs->setTabActive('feedback');
320 
321  $q_ref = $this->content_obj->getQuestionReference();
322 
323  if ($q_ref != "") {
324  $inst_id = ilInternalLink::_extractInstOfTarget($q_ref);
325  if (!($inst_id > 0)) {
327  }
328  }
329 
330  $edit_gui = new ilQuestionEditGUI();
331  if ($q_id > 0) {
332  $edit_gui->setQuestionId($q_id);
333  }
334  // $edit_gui->setQuestionType("assSingleChoice");
335  $edit_gui->setSelfAssessmentEditingMode(true);
336  $edit_gui->setPageConfig($this->getPageConfig());
337  $ret = $ilCtrl->forwardCommand($edit_gui);
338  $this->tpl->setContent($ret);
339  return $ret;
340  }
Class ilQuestionEditGUI.
setTabActive(string $a_id)
+ Here is the call graph for this function:

◆ getSelfAssessmentMode()

ilPCQuestionGUI::getSelfAssessmentMode ( )

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

References $selfassessmentmode.

Referenced by edit(), and setTabs().

99  : bool
100  {
102  }
+ Here is the caller graph for this function:

◆ insert()

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

Insert new question form.

Definition at line 133 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(), ILIAS\Repository\lng(), ilRadioOption\setInfo(), ilFormPropertyGUI\setInfo(), setInsertTabs(), ilSelectInputGUI\setOptions(), ilArrayUtil\sortArray(), and ilLanguage\txt().

Referenced by create(), and edit().

133  : void
134  {
135  $lng = $this->lng;
136  $ilCtrl = $this->ctrl;
137 
138  $this->setInsertTabs("new_question");
139 
140  $this->displayValidationError();
141 
142  // get all question types (@todo: we have to check, whether they are
143  // suitable for self assessment or not)
145  $options = array();
146  $all_types = ilArrayUtil::sortArray($all_types, "order", "asc", true, true);
147 
148  foreach ($all_types as $k => $v) {
149  $options[$v["type_tag"]] = $k;
150  }
151 
152  // new table form (input of rows and columns)
153  $this->form_gui = new ilPropertyFormGUI();
154  $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
155  $this->form_gui->setTitle($lng->txt("cont_ed_insert_pcqst"));
156 
157  // Select Question Type
158  $qtype_input = new ilSelectInputGUI($lng->txt("cont_question_type"), "q_type");
159  $qtype_input->setOptions($options);
160  $qtype_input->setRequired(true);
161  $this->form_gui->addItem($qtype_input);
162 
163  // additional content editor
164  // assessment
165  if ($this->ipe_for_questions_enabled) {
166  $ri = new ilRadioGroupInputGUI($this->lng->txt("tst_add_quest_cont_edit_mode"), "add_quest_cont_edit_mode");
167 
168  $option_rte = new ilRadioOption(
169  $this->lng->txt('tst_add_quest_cont_edit_mode_plain'),
171  );
172  $option_rte->setInfo($this->lng->txt('tst_add_quest_cont_edit_mode_plain_info'));
173  $ri->addOption($option_rte);
174 
175  $option_ipe = new ilRadioOption(
176  $this->lng->txt('tst_add_quest_cont_edit_mode_IPE'),
178  );
179  $option_ipe->setInfo($this->lng->txt('tst_add_quest_cont_edit_mode_IPE_info'));
180  $ri->addOption($option_ipe);
181 
183 
184  $this->form_gui->addItem($ri);
185  } else {
186  $hi = new ilHiddenInputGUI("question_content_editing_type");
188  $this->form_gui->addItem($hi);
189  }
190 
191  if ($a_mode == "edit_empty") {
192  $this->form_gui->addCommandButton("edit", $lng->txt("save"));
193  } else {
194  $this->form_gui->addCommandButton("create_pcqst", $lng->txt("save"));
195  $this->form_gui->addCommandButton("cancelCreate", $lng->txt("cancel"));
196  }
197 
198  $this->tpl->setContent($this->form_gui->getHTML());
199  }
const ADDITIONAL_CONTENT_EDITING_MODE_IPE
This class represents an option in a radio group.
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 class represents a hidden form property in a property form.
static & _getSelfAssessmentQuestionTypes($all_tags=false)
This class represents a property in a property form.
const ADDITIONAL_CONTENT_EDITING_MODE_RTE
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 417 of file class.ilPCQuestionGUI.php.

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

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

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

Referenced by insertFromPool().

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

References ilPageContentGUI\$ctrl, ilPageContentGUI\$tpl, ILIAS\UICore\GlobalTemplate\setContent(), and setInsertTabs().

Referenced by insertFromPool().

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

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

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

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

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

104  : void
105  {
106  $ilTabs = $this->tabs;
107  $ilCtrl = $this->ctrl;
108  $lng = $this->lng;
109 
110  // new question
111  $ilTabs->addSubTab(
112  "new_question",
113  $lng->txt("cont_new_question"),
114  $ilCtrl->getLinkTarget($this, "insert")
115  );
116 
117  // copy from pool
118  $ilCtrl->setParameter($this, "subCmd", "insertFromPool");
119  $ilTabs->addSubTab(
120  "copy_question",
121  $lng->txt("cont_copy_question_from_pool"),
122  $ilCtrl->getLinkTarget($this, "insert")
123  );
124 
125  $ilTabs->activateSubTab($a_active);
126 
127  $ilCtrl->setParameter($this, "subCmd", "");
128  }
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 243 of file class.ilPCQuestionGUI.php.

243  : void
244  {
245  if ($a_par["new_id"] > 0) {
246  $this->content_obj->setQuestionReference("il__qst_" . $a_par["new_id"]);
247  $this->pg_obj->update();
248  }
249  }

◆ setSelfAssessmentMode()

ilPCQuestionGUI::setSelfAssessmentMode ( bool  $a_selfassessmentmode)

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

94  : void
95  {
96  $this->selfassessmentmode = $a_selfassessmentmode;
97  }

◆ setTabs()

ilPCQuestionGUI::setTabs ( )

Definition at line 363 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().

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

Referenced by insertFromPool().

◆ $form_gui

ilPropertyFormGUI ilPCQuestionGUI::$form_gui
protected

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

◆ $ipe_for_questions_enabled

bool ilPCQuestionGUI::$ipe_for_questions_enabled
protected

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

◆ $questioninfo

ILIAS TestQuestionPool Questions PublicInterface ilPCQuestionGUI::$questioninfo
protected

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

◆ $scormlmid

int ilPCQuestionGUI::$scormlmid
protected

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

◆ $selfassessmentmode

bool ilPCQuestionGUI::$selfassessmentmode
protected

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

Referenced by getSelfAssessmentMode().

◆ $tabs

ilTabsGUI ilPCQuestionGUI::$tabs
protected

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

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

◆ $toolbar

ilToolbarGUI ilPCQuestionGUI::$toolbar
protected

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

Referenced by listPoolQuestions().

◆ $tree

ilTree ilPCQuestionGUI::$tree
protected

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

Referenced by createQuestionPool().

◆ $user

ilObjUser ilPCQuestionGUI::$user
protected

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


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