ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilPCQuestionGUI Class Reference

Class ilPCQuestionGUI. More...

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

Public Member Functions

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

Additional Inherited Members

- Static Public Member Functions inherited from ilPageContentGUI
static _getCommonBBButtons ()
 Get common bb buttons. More...
 
- Data Fields inherited from ilPageContentGUI
 $content_obj
 
 $ilias
 
 $tpl
 
 $lng
 
 $ctrl
 
 $pg_obj
 
 $hier_id
 
 $dom
 
 $updated
 
 $target_script
 
 $return_location
 
 $page_config = null
 
- Static Public Attributes inherited from ilPageContentGUI
static $style_selector_reset = "margin-top:2px; margin-bottom:2px; text-indent:0px; position:static; float:none; width: auto;"
 
- Protected Member Functions inherited from ilPageContentGUI
 getCharacteristicsOfCurrentStyle ($a_type)
 Get characteristics of current style. More...
 
- Protected Attributes inherited from ilPageContentGUI
 $log
 
- 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 24 of file class.ilPCQuestionGUI.php.

References $ilCtrl, and array.

25  {
26  global $ilCtrl;
27  $this->scormlmid = $a_pg_obj->parent_id;
28  parent::__construct($a_pg_obj, $a_content_obj, $a_hier_id, $a_pc_id);
29  $ilCtrl->saveParameter($this, array("qpool_ref_id"));
30  }
global $ilCtrl
Definition: ilias.php:18
Create styles array
The data for the language used.

Member Function Documentation

◆ copyQuestion()

ilPCQuestionGUI::copyQuestion ( )

Copy question into page.

Parameters

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

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

567  {
568  global $ilCtrl;
569 
570  $this->content_obj = new ilPCQuestion($this->getPage());
571  $this->content_obj->create($this->pg_obj, $_GET["hier_id"]);
572 
573  $this->content_obj->copyPoolQuestionIntoPage(
574  (int) $_GET["q_id"], $_GET["hier_id"]);
575 
576  $this->updated = $this->pg_obj->update();
577 
578  $ilCtrl->returnToParent($this);
579  }
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
Class ilPCQuestion.
+ Here is the call graph for this function:

◆ create()

ilPCQuestionGUI::create ( )

Create new question.

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

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

219  {
220  global $lng, $ilCtrl, $ilTabs;
221 
222  $ilTabs->setTabActive('question');
223 
224  $this->content_obj = new ilPCQuestion($this->getPage());
225  $this->content_obj->create($this->pg_obj, $this->hier_id);
226 
227  $this->updated = $this->pg_obj->update();
228 
229  if ($this->updated)
230  {
231  // create question pool, if necessary
232 /* if ($_POST["qpool_ref_id"] <= 0)
233  {
234  $pool_ref_id = $this->createQuestionPool($_POST["qpool_title"]);
235  }
236  else
237  {
238  $pool_ref_id = $_POST["qpool_ref_id"];
239  }*/
240 
241  $this->pg_obj->stripHierIDs();
242  $this->pg_obj->addHierIDs();
243  $hier_id = $this->content_obj->lookupHierId();
244  $ilCtrl->setParameter($this, "q_type", $_POST["q_type"]);
245  $ilCtrl->setParameter($this, "add_quest_cont_edit_mode", $_POST["add_quest_cont_edit_mode"]);
246 // $ilCtrl->setParameter($this, "qpool_ref_id", $pool_ref_id);
247  //$ilCtrl->setParameter($this, "hier_id", $hier_id);
248  $ilCtrl->setParameter($this, "hier_id", $this->content_obj->readHierId());
249  $ilCtrl->setParameter($this, "pc_id", $this->content_obj->readPCId());
250 
251  $ilCtrl->redirect($this, "edit");
252  }
253 
254  $this->insert();
255  }
global $ilCtrl
Definition: ilias.php:18
Class ilPCQuestion.
insert($a_mode="create")
Insert new question form.
$_POST["username"]
+ Here is the call graph for this function:

◆ createQuestionPool()

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

Creates a new questionpool and returns the reference id.

Creates a new questionpool and returns the reference id

Returns
integer Reference id of the newly created questionpool public

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

References $_GET.

400  {
401  global $tree;
402  $parent_ref = $tree->getParentId($_GET["ref_id"]);
403  include_once "./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php";
404  $qpl = new ilObjQuestionPool();
405  $qpl->setType("qpl");
406  $qpl->setTitle($name);
407  $qpl->setDescription("");
408  $qpl->create();
409  $qpl->createReference();
410  $qpl->putInTree($parent_ref);
411  $qpl->setPermissions($parent_ref);
412  $qpl->setOnline(1); // must be online to be available
413  $qpl->saveToDb();
414  return $qpl->getRefId();
415  }
$_GET["client_id"]

◆ edit()

ilPCQuestionGUI::edit ( )

edit question

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

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

273  {
274  global $ilCtrl, $ilTabs;
275 
276  $ilTabs->setTabActive('question');
277 
278 
279  if ($this->getSelfAssessmentMode()) // behaviour in content pages, e.g. scorm
280  {
281  $q_ref = $this->content_obj->getQuestionReference();
282 
283  if ($q_ref != "")
284  {
285  $inst_id = ilInternalLink::_extractInstOfTarget($q_ref);
286  if (!($inst_id > 0))
287  {
289  }
290  }
291 
292  $q_type = ($_POST["q_type"] != "")
293  ? $_POST["q_type"]
294  : $_GET["q_type"];
295  $ilCtrl->setParameter($this, "q_type", $q_type);
296 
297  if ($q_id == "" && $q_type == "")
298  {
299  return $this->insert("edit_empty");
300  }
301 
302  include_once("./Modules/TestQuestionPool/classes/class.ilQuestionEditGUI.php");
303  include_once("./Modules/TestQuestionPool/classes/class.assQuestion.php");
304  include_once("./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php");
305 
306 /* $ilCtrl->setCmdClass("ilquestioneditgui");
307  $ilCtrl->setCmd("editQuestion");
308  $edit_gui = new ilQuestionEditGUI();*/
309 
310  // create question first-hand (needed for uploads)
311  if($q_id < 1 && $q_type)
312  {
313  include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
314  $q_gui = assQuestionGUI::_getQuestionGUI($q_type);
315 
316  // feedback editing mode
317  include_once("./Modules/Test/classes/class.ilObjAssessmentFolder.php");
319  && $_REQUEST['add_quest_cont_edit_mode'] != "")
320  {
321  $addContEditMode = $_GET['add_quest_cont_edit_mode'];
322  }
323  else
324  {
326  }
327  $q_gui->object->setAdditionalContentEditingMode($addContEditMode);
328 
329  //set default tries
330  $q_gui->object->setDefaultNrOfTries(ilObjSAHSLearningModule::_getTries($this->scormlmid));
331  $q_id = $q_gui->object->createNewQuestion(true);
332  $this->content_obj->setQuestionReference("il__qst_".$q_id);
333  $this->pg_obj->update();
334  unset($q_gui);
335  }
336  $ilCtrl->setParameterByClass("ilQuestionEditGUI", "q_id", $q_id);
337  $ilCtrl->redirectByClass(array(get_class($this->pg_obj)."GUI", "ilQuestionEditGUI"), "editQuestion");
338 
339 /* $edit_gui->setPoolObjId(0);
340  $edit_gui->setQuestionId($q_id);
341  $edit_gui->setQuestionType($q_type);
342  $edit_gui->setSelfAssessmentEditingMode(true);
343  $edit_gui->setPageConfig($this->getPageConfig());
344  $ret = $ilCtrl->forwardCommand($edit_gui);
345  $this->tpl->setContent($ret);*/
346  return $ret;
347  }
348  else // behaviour in question pool
349  {
350  require_once("./Modules/TestQuestionPool/classes/class.assQuestionGUI.php");
351  $q_gui = assQuestionGUI::_getQuestionGUI("", $_GET["q_id"]);
352  $this->ctrl->redirectByClass(array("ilobjquestionpoolgui", get_class($q_gui)), "editQuestion");
353  }
354  }
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
static _getQuestionGUI($question_type, $question_id=-1)
Creates a question gui representation and returns the alias to the question gui note: please do not u...
insert($a_mode="create")
Insert new question form.
Create styles array
The data for the language used.
const ADDITIONAL_CONTENT_EDITING_MODE_DEFAULT
constant for additional content editing mode "default"
getSelfAssessmentMode()
Get Self Assessment Mode.
$ret
Definition: parser.php:6
static isAdditionalQuestionContentEditingModePageObjectEnabled()
returns the fact wether content editing with ilias page editor is enabled for questions or not ...
$_POST["username"]
+ Here is the call graph for this function:

◆ executeCommand()

ilPCQuestionGUI::executeCommand ( )

execute command

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

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

36  {
37  global $ilCtrl, $ilAccess, $tpl, $ilTabs, $lng;
38 
39  // get current command
40  $cmd = $ilCtrl->getCmd();
41  $next_class = $ilCtrl->getNextClass($this);
42 
43  $q_type = ($_POST["q_type"] != "")
44  ? $_POST["q_type"]
45  : $_GET["q_type"];
46 
47  switch($next_class)
48  {
49  default:
50  //set tabs
51  if ($cmd != "insert")
52  {
53  $this->setTabs();
54  }
55  else if ($_GET["subCmd"] != "")
56  {
57  $cmd = $_GET["subCmd"];
58  }
59 
60  $ret = $this->$cmd();
61  }
62 
63 
64 
65  return $ret;
66  }
$_GET["client_id"]
$cmd
Definition: sahs_server.php:35
global $ilCtrl
Definition: ilias.php:18
$ret
Definition: parser.php:6
$_POST["username"]
+ Here is the call graph for this function:

◆ feedback()

ilPCQuestionGUI::feedback ( )

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

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

357  {
358  global $ilCtrl, $ilTabs;
359 
360  include_once("./Modules/TestQuestionPool/classes/class.ilQuestionEditGUI.php");
361  include_once("./Modules/TestQuestionPool/classes/class.assQuestion.php");
362 
363  $ilTabs->setTabActive('feedback');
364 
365  $q_ref = $this->content_obj->getQuestionReference();
366 
367  if ($q_ref != "")
368  {
369  $inst_id = ilInternalLink::_extractInstOfTarget($q_ref);
370  if (!($inst_id > 0))
371  {
373  }
374  }
375 
376  $ilCtrl->setCmdClass("ilquestioneditgui");
377  $ilCtrl->setCmd("feedback");
378  $edit_gui = new ilQuestionEditGUI();
379  if ($q_id > 0)
380  {
381  $edit_gui->setQuestionId($q_id);
382  }
383 // $edit_gui->setQuestionType("assSingleChoice");
384  $edit_gui->setSelfAssessmentEditingMode(true);
385  $edit_gui->setPageConfig($this->getPageConfig());
386  $ret = $ilCtrl->forwardCommand($edit_gui);
387  $this->tpl->setContent($ret);
388  return $ret;
389 
390  }
Class ilQuestionEditGUI.
getPageConfig()
Get Page Config.
global $ilCtrl
Definition: ilias.php:18
$ret
Definition: parser.php:6
+ Here is the call graph for this function:

◆ getSelfAssessmentMode()

ilPCQuestionGUI::getSelfAssessmentMode ( )

Get Self Assessment Mode.

Returns
boolean Self Assessment Mode

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

Referenced by edit(), and setTabs().

84  {
85  return $this->selfassessmentmode;
86  }
+ Here is the caller graph for this function:

◆ insert()

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

Insert new question form.

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

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

Referenced by create(), and edit().

117  {
118  global $ilUser, $lng, $ilCtrl;
119 
120  $this->setInsertTabs("new_question");
121 
122  $this->displayValidationError();
123 
124  // get all question types (@todo: we have to check, whether they are
125  // suitable for self assessment or not)
126  include_once("./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php");
128  $options = array();
129  $all_types = ilUtil::sortArray($all_types, "order", "asc", true, true);
130 
131  foreach ($all_types as $k => $v)
132  {
133  $options[$v["type_tag"]] = $k;
134  }
135 
136  // new table form (input of rows and columns)
137  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
138  $this->form_gui = new ilPropertyFormGUI();
139  $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
140  $this->form_gui->setTitle($lng->txt("cont_ed_insert_pcqst"));
141 
142  // Select Question Type
143  $qtype_input = new ilSelectInputGUI($lng->txt("cont_question_type"), "q_type");
144  $qtype_input->setOptions($options);
145  $qtype_input->setRequired(true);
146  $this->form_gui->addItem($qtype_input);
147 
148  // additional content editor
149  // assessment
150  include_once("./Modules/Test/classes/class.ilObjAssessmentFolder.php");
152  {
153  $ri = new ilRadioGroupInputGUI($this->lng->txt("tst_add_quest_cont_edit_mode"), "add_quest_cont_edit_mode");
154 
155  $ri->addOption(new ilRadioOption(
156  $this->lng->txt('tst_add_quest_cont_edit_mode_default'),
158  ));
159 
160  $ri->addOption(new ilRadioOption(
161  $this->lng->txt('tst_add_quest_cont_edit_mode_page_object'),
163  ));
164 
166 
167  $this->form_gui->addItem($ri, true);
168  }
169  else
170  {
171  $hi = new ilHiddenInputGUI("question_content_editing_type");
173  $this->form_gui->addItem($hi, true);
174  }
175 
176 
177  // Select Question Pool
178 /*
179  include_once("./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php");
180  $qpools = ilObjQuestionPool::_getAvailableQuestionpools(false, false, false, true, false, "write");
181 
182  if (count($qpools) > 0)
183  {
184  $pool_options = array();
185  foreach ($qpools as $key => $value)
186  {
187  $pool_options[$key] = $value["title"];
188  }
189  $pool_input = new ilSelectInputGUI($lng->txt("cont_question_pool"), "qpool_ref_id");
190  $pool_input->setOptions($pool_options);
191  $pool_input->setRequired(true);
192  $this->form_gui->addItem($pool_input);
193  }
194  else
195  {
196  $pool_input = new ilTextInputGUI($lng->txt("cont_question_pool"), "qpool_title");
197  $pool_input->setRequired(true);
198  $this->form_gui->addItem($pool_input);
199  }
200 */
201  if ($a_mode == "edit_empty")
202  {
203  $this->form_gui->addCommandButton("edit", $lng->txt("save"));
204  }
205  else
206  {
207  $this->form_gui->addCommandButton("create_pcqst", $lng->txt("save"));
208  $this->form_gui->addCommandButton("cancelCreate", $lng->txt("cancel"));
209  }
210 
211  $this->tpl->setContent($this->form_gui->getHTML());
212  }
This class represents an option in a radio group.
setInsertTabs($a_active)
Set insert tabs.
This class represents a selection list property in a property form.
This class represents a property form user interface.
const ADDITIONAL_CONTENT_EDITING_MODE_PAGE_OBJECT
constant for additional content editing mode "pageobject"
static sortArray($array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
global $ilCtrl
Definition: ilias.php:18
This class represents a hidden form property in a property form.
This class represents a property in a property form.
addOption($a_option)
Add Option.
if(!is_array($argv)) $options
displayValidationError()
display validation errors
$ilUser
Definition: imgupload.php:18
setOptions($a_options)
Set Options.
Create styles array
The data for the language used.
const ADDITIONAL_CONTENT_EDITING_MODE_DEFAULT
constant for additional content editing mode "default"
static & _getSelfAssessmentQuestionTypes($all_tags=FALSE)
Get all self assessment question types.
static isAdditionalQuestionContentEditingModePageObjectEnabled()
returns the fact wether content editing with ilias page editor is enabled for questions or not ...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ insertFromPool()

ilPCQuestionGUI::insertFromPool ( )

Insert question from ppol.

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

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

476  {
477  global $ilCtrl, $ilAccess, $ilTabs, $tpl, $lng, $ilToolbar;
478 //var_dump($_SESSION["cont_qst_pool"]);
479  if ($_SESSION["cont_qst_pool"] != "" &&
480  $ilAccess->checkAccess("write", "", $_SESSION["cont_qst_pool"])
481  && ilObject::_lookupType(ilObject::_lookupObjId($_SESSION["cont_qst_pool"])) == "qpl")
482  {
483  $this->listPoolQuestions();
484  }
485  else
486  {
487  $this->poolSelection();
488  }
489  }
$_SESSION["AccountId"]
poolSelection()
Pool selection.
global $ilCtrl
Definition: ilias.php:18
static _lookupObjId($a_id)
static _lookupType($a_id, $a_reference=false)
lookup object type
listPoolQuestions()
List questions of pool.
+ Here is the call graph for this function:

◆ listPoolQuestions()

ilPCQuestionGUI::listPoolQuestions ( )

List questions of pool.

Parameters

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

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

Referenced by insertFromPool().

538  {
539  global $ilToolbar, $tpl, $ilCtrl, $lng;
540 
541  ilUtil::sendInfo($lng->txt("cont_cp_question_diff_formats_info"));
542 
543  $ilCtrl->setParameter($this, "subCmd", "poolSelection");
544  $ilToolbar->addButton(
545  $lng->txt("cont_select_other_qpool"),
546  $ilCtrl->getLinkTarget($this, "insert"));
547  $ilCtrl->setParameter($this, "subCmd", "");
548 
549  $this->setInsertTabs("copy_question");
550 
551  include_once "./Services/COPage/classes/class.ilCopySelfAssQuestionTableGUI.php";
552 
553  $ilCtrl->setParameter($this, "subCmd", "listPoolQuestions");
554  $table_gui = new ilCopySelfAssQuestionTableGUI($this, 'insert',
555  $_SESSION["cont_qst_pool"]);
556 
557  $tpl->setContent($table_gui->getHTML());
558  }
setInsertTabs($a_active)
Set insert tabs.
$_SESSION["AccountId"]
global $ilCtrl
Definition: ilias.php:18
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
Table to select self assessment questions for copying into learning resources.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ poolSelection()

ilPCQuestionGUI::poolSelection ( )

Pool selection.

Parameters

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

References $ilCtrl, ilPageContentGUI\$tpl, array, and setInsertTabs().

Referenced by insertFromPool().

498  {
499  global $ilCtrl, $tree, $tpl, $ilTabs;
500 
501  $this->setInsertTabs("copy_question");
502 
503  include_once "./Services/COPage/classes/class.ilPoolSelectorGUI.php";
504 
505  $ilCtrl->setParameter($this, "subCmd", "poolSelection");
506  $exp = new ilPoolSelectorGUI($this, "insert");
507 
508  // filter
509  $exp->setTypeWhiteList(array("root", "cat", "grp", "fold", "crs", "qpl"));
510  $exp->setClickableTypes(array('qpl'));
511 
512  if (!$exp->handleCommand())
513  {
514  $tpl->setContent($exp->getHTML());
515  }
516 
517  }
setInsertTabs($a_active)
Set insert tabs.
global $ilCtrl
Definition: ilias.php:18
Create styles array
The data for the language used.
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 522 of file class.ilPCQuestionGUI.php.

References $_GET, $_SESSION, and $ilCtrl.

523  {
524  global $ilCtrl;
525 
526  $_SESSION["cont_qst_pool"] = $_GET["pool_ref_id"];
527  $ilCtrl->setParameter($this, "subCmd", "insertFromPool");
528  $ilCtrl->redirect($this, "insert");
529  }
$_SESSION["AccountId"]
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18

◆ setInsertTabs()

ilPCQuestionGUI::setInsertTabs (   $a_active)

Set insert tabs.

Parameters
string$a_activeactive tab id

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

References $ilCtrl, and ilPageContentGUI\$lng.

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

94  {
95  global $ilTabs, $ilCtrl, $lng;
96 
97  // new question
98  $ilTabs->addSubTab("new_question",
99  $lng->txt("cont_new_question"),
100  $ilCtrl->getLinkTarget($this, "insert"));
101 
102  // copy from pool
103  $ilCtrl->setParameter($this, "subCmd", "insertFromPool");
104  $ilTabs->addSubTab("copy_question",
105  $lng->txt("cont_copy_question_from_pool"),
106  $ilCtrl->getLinkTarget($this, "insert"));
107 
108  $ilTabs->activateSubTab($a_active);
109 
110  $ilCtrl->setParameter($this, "subCmd", "");
111  }
global $ilCtrl
Definition: ilias.php:18
+ Here is the caller graph for this function:

◆ setNewQuestionId()

ilPCQuestionGUI::setNewQuestionId (   $a_par)

Set new question id.

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

261  {
262  if ($a_par["new_id"] > 0)
263  {
264  $this->content_obj->setQuestionReference("il__qst_".$a_par["new_id"]);
265  $this->pg_obj->update();
266  }
267  }

◆ setSelfAssessmentMode()

ilPCQuestionGUI::setSelfAssessmentMode (   $a_selfassessmentmode)

Set Self Assessment Mode.

Parameters
boolean$a_selfassessmentmodeSelf Assessment Mode

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

74  {
75  $this->selfassessmentmode = $a_selfassessmentmode;
76  }

◆ setTabs()

ilPCQuestionGUI::setTabs ( )

Set tabs.

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

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

Referenced by executeCommand().

421  {
422  if ($this->getSelfAssessmentMode())
423  {
424  return;
425  }
426 
427  global $ilTabs, $ilCtrl, $lng;
428  include_once("./Modules/TestQuestionPool/classes/class.assQuestion.php");
429 
430  if ($this->content_obj!="") {
431  $q_ref = $this->content_obj->getQuestionReference();
432  }
433 
434  if ($q_ref != "")
435  {
436  $inst_id = ilInternalLink::_extractInstOfTarget($q_ref);
437  if (!($inst_id > 0))
438  {
440  }
441  }
442 
443  $ilTabs->addTarget("question",
444  $ilCtrl->getLinkTarget($this, "edit"), array("editQuestion", "save", "cancel", "addSuggestedSolution",
445  "cancelExplorer", "linkChilds", "removeSuggestedSolution",
446  "addPair", "addTerm", "delete", "deleteTerms", "editMode", "upload",
447  "saveEdit","uploadingImage", "uploadingImagemap", "addArea",
448  "deletearea", "saveShape", "back", "saveEdit", "changeGapType","createGaps","addItem","addYesNo", "addTrueFalse",
449  "toggleGraphicalAnswers", "setMediaMode"),
450  "");
451 
452  if ($q_id > 0)
453  {
454  if (assQuestion::_getQuestionType($q_id)!= "assTextQuestion")
455  {
456  require_once 'Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
457  require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionFeedbackEditingGUI.php';
458  $tabCommands = assQuestionGUI::getCommandsFromClassConstants('ilAssQuestionFeedbackEditingGUI');
460  $ilCtrl->getLinkTargetByClass('ilAssQuestionFeedbackEditingGUI', ilAssQuestionFeedbackEditingGUI::CMD_SHOW),
461  "q_id=".(int)$q_id
462  );
463  $ilTabs->addTarget('feedback', $tabLink, $tabCommands, $ilCtrl->getCmdClass(), '');
464  }
465  }
466  }
static _getQuestionType($question_id)
Returns the question type of a question with a given id.
global $ilCtrl
Definition: ilias.php:18
static getCommandsFromClassConstants($guiClassName, $cmdConstantNameBegin='CMD_')
extracts values of all constants of given class with given prefix as array can be used to get all pos...
static appendUrlParameterString($a_url, $a_par, $xml_style=false)
append URL parameter string ("par1=value1&par2=value2...") to given URL string
Create styles array
The data for the language used.
getSelfAssessmentMode()
Get Self Assessment Mode.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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