ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
ilTestExpressPageObjectGUI Class Reference

ilTestExpressPageObjectGUI: assMultipleChoiceGUI, assClozeTestGUI, assMatchingQuestionGUI ilTestExpressPageObjectGUI: assOrderingQuestionGUI, assImagemapQuestionGUI, assJavaAppletGUI ilTestExpressPageObjectGUI: assNumericGUI ilTestExpressPageObjectGUI: assTextSubsetGUI ilTestExpressPageObjectGUI: assSingleChoiceGUI ilTestExpressPageObjectGUI: assTextQuestionGUI, assFormulaQuestionGUI ilTestExpressPageObjectGUI: ilPageEditorGUI, ilEditClipboardGUI, ilMediaPoolTargetSelector ilTestExpressPageObjectGUI: ilRatingGUI, ilPublicUserProfileGUI, ilAssQuestionPageGUI, ilNoteGUI ilTestExpressPageObjectGUI: ilObjQuestionPoolGUI ilTestExpressPageObjectGUI: assMultipleChoiceGUI, assClozeTestGUI, assMatchingQuestionGUI ilTestExpressPageObjectGUI: assOrderingQuestionGUI, assImagemapQuestionGUI, assJavaAppletGUI ilTestExpressPageObjectGUI: assNumericGUI ilTestExpressPageObjectGUI: assTextSubsetGUI ilTestExpressPageObjectGUI: assSingleChoiceGUI ilTestExpressPageObjectGUI: assTextQuestionGUI, assFormulaQuestionGUI More...

+ Inheritance diagram for ilTestExpressPageObjectGUI:
+ Collaboration diagram for ilTestExpressPageObjectGUI:

Public Member Functions

 nextQuestion ()
 
 prevQuestion ()
 
 __construct ($a_id=0, $a_old_nr=0)
 
 executeCommand ()
 
 addPageOfQuestions ($type='')
 
 handleToolbarCommand ()
 
 addQuestion ()
 
 questions ()
 
 insertQuestions ()
 
- Public Member Functions inherited from ilAssQuestionPageGUI
 __construct ($a_id=0, $a_old_nr=0)
 Constructor. More...
 
 getOriginalPresentationTitle ()
 
 setOriginalPresentationTitle ($originalPresentationTitle)
 
 showPage ()
 
 finishEditing ()
 
 postOutputProcessing ($output)
 
 setQuestionInfoHTML ($a_html)
 Set the HTML of a question info block below the title (number, status, ...) More...
 
 setQuestionActionsHTML ($a_html)
 Set the HTML of a question actions block below the title. More...
 
 insertPageToc ($a_output)
 Replace page toc placeholder with question info and actions. More...
 
- Public Member Functions inherited from ilPageObjectGUI
 __construct ( $a_parent_type, $a_id, $a_old_nr=0, $a_prevent_get_id=false, $a_lang="", $concrete_lang="")
 Constructor. More...
 
 afterConstructor ()
 After constructor. More...
 
 setParentType ($a_val)
 Set parent type. More...
 
 getParentType ()
 Get parent type. More...
 
 setId ($a_val)
 Set ID. More...
 
 getId ()
 Get ID. More...
 
 setOldNr ($a_val)
 Set old nr (historic page) More...
 
 getOldNr ()
 Get old nr (historic page) More...
 
 setLanguage ($a_val)
 Set language. More...
 
 getLanguage ()
 Get language. More...
 
 setEnablePCType ($a_pc_type, $a_val)
 Set enable pc type. More...
 
 getEnablePCType ($a_pc_type)
 Get enable pc type. More...
 
 setPageConfig ($a_val)
 Set page config object. More...
 
 getPageConfig ()
 Get page config object. More...
 
 setPageObject (ilPageObject $a_pg_obj)
 Set Page Object. More...
 
 getPageObject ()
 Get Page Object. More...
 
 setOutputMode ($a_mode=self::PRESENTATION)
 Set Output Mode. More...
 
 getOutputMode ()
 
 setTemplateOutput ($a_output=true)
 
 outputToTemplate ()
 
 setPresentationTitle ($a_title="")
 
 getPresentationTitle ()
 
 setHeader ($a_title="")
 
 getHeader ()
 
 setLinkParams ($l_params="")
 
 getLinkParams ()
 
 setLinkFrame ($l_frame="")
 
 getLinkFrame ()
 
 setPageLinker ($page_linker)
 
 getLinkXML ()
 
 setQuestionXML ($question_xml)
 
 setQuestionHTML ($question_html)
 
 getQuestionXML ()
 
 getQuestionHTML ()
 
 setTemplateTargetVar ($a_variable)
 
 getTemplateTargetVar ()
 
 setTemplateOutputVar ($a_value)
 
 getTemplateOutputVar ()
 
 setSourcecodeDownloadScript ($script_name)
 Set sourcecode download script. More...
 
 getSourcecodeDownloadScript ()
 Get sourcecode download script. More...
 
 setLocator (&$a_locator)
 
 setTabs ($a_tabs)
 
 setPageBackTitle ($a_title)
 
 setFileDownloadLink ($a_download_link)
 Set file download link. More...
 
 getFileDownloadLink ()
 Get file download link. More...
 
 setFullscreenLink ($a_fullscreen_link)
 Set fullscreen link. More...
 
 getFullscreenLink ()
 Get fullscreen link. More...
 
 setIntLinkReturn ($a_return)
 
 enableChangeComments ($a_enabled)
 
 isEnabledChangeComments ()
 
 enableNotes ($a_enabled, $a_parent_id)
 
 isEnabledNotes ()
 
 setOfflineDirectory ($offdir)
 set offline directory to offdir More...
 
 getOfflineDirectory ()
 get offline directory More...
 
 setViewPageLink ($a_link, $a_target="")
 set link for "view page" button More...
 
 getViewPageLink ()
 get view page link More...
 
 getViewPageTarget ()
 get view page target frame More...
 
 getViewPageText ()
 get view page text More...
 
 setActivationListener (&$a_obj, $a_meth)
 
 setEnabledNews ($a_enabled, $a_news_obj_id=0, $a_news_obj_type=0)
 Set enabled news. More...
 
 getEnabledNews ()
 Get enabled news. More...
 
 setTabHook ($a_object, $a_function)
 Set tab hook. More...
 
 setEditPreview ($a_editpreview)
 Set Display first Edit tab, then Preview tab, instead of Page and Edit. More...
 
 getEditPreview ()
 Get Display first Edit tab, then Preview tab, instead of Page and Edit. More...
 
 setEnabledTabs ($a_enabledtabs)
 Set Output tabs. More...
 
 getEnabledTabs ()
 Get Output tabs. More...
 
 setEnabledPageFocus ($a_enabledpagefocus)
 Set Enable page focus. More...
 
 setOpenPlaceHolder ($a_val)
 Set open placeholder. More...
 
 getOpenPlaceHolder ()
 Get open placeholder. More...
 
 getEnabledPageFocus ()
 Get Enable page focus. More...
 
 setExplorerUpdater ($a_exp_frame, $a_exp_id, $a_exp_target_script)
 Set Explorer Updater. More...
 
 setPrependingHtml ($a_prependinghtml)
 Set Prepending HTML. More...
 
 getPrependingHtml ()
 Get Prepending HTML. More...
 
 setEnableEditing ($a_enableediting)
 Set Enable Editing. More...
 
 getEnableEditing ()
 Get Enable Editing. More...
 
 setRawPageContent ($a_rawpagecontent)
 Set Get raw page content only. More...
 
 getRawPageContent ()
 Get Get raw page content only. More...
 
 setStyleId ($a_styleid)
 Set Style Id. More...
 
 getStyleId ()
 Get Style Id. More...
 
 setCompareMode ($a_val)
 Set compare mode. More...
 
 getCompareMode ()
 Get compare mode. More...
 
 setAbstractOnly ($a_val, $pcid="")
 Set abstract only. More...
 
 getAbstractOnly ()
 Get abstract only. More...
 
 setRenderPageContainer ($a_val)
 Set render page container. More...
 
 getRenderPageContainer ()
 Get render page container. More...
 
 getDisabledText ()
 Get disabled text. More...
 
 getEnabledHref ()
 
 setEnabledHref (bool $enable)
 
 activateMetaDataEditor ( $a_rep_obj, $a_type, $a_sub_obj_id, $a_observer_obj=null, $a_observer_func="")
 Activate meda data editor. More...
 
 determineFileDownloadLink ()
 Determine file download link. More...
 
 determineFullscreenLink ()
 Determine fullscreen link. More...
 
 determineSourcecodeDownloadScript ()
 Determine source code download script. More...
 
 getComponentPluginsXML ()
 Put information about activated plugins into XML. More...
 
 executeCommand ()
 execute command More...
 
 setQEditTabs ($a_active)
 Set question editing tabs. More...
 
 onFeedbackEditingForwarding ()
 On feedback editing forwarding. More...
 
 deactivatePage ()
 
 activatePage ()
 
 showPage ()
 display content of page More...
 
 replaceCurlyBrackets ($output)
 Replace curly brackets. More...
 
 getActivationCaptions ()
 Get captions for activation action menu entries. More...
 
 setEditMode ()
 Set edit mode. More...
 
 setDefaultLinkXml ()
 Set standard link xml. More...
 
 setLinkXml ($xml)
 Set linkXML. More...
 
 getProfileBackUrl ()
 Get profile back url. More...
 
 setProfileBackUrl ($url)
 Get profile back url. More...
 
 downloadFile ()
 Download file of file lists. More...
 
 displayMediaFullscreen ()
 Show media in fullscreen mode. More...
 
 displayMedia ($a_fullscreen=false)
 Display media. More...
 
 download_paragraph ()
 download source code paragraph More...
 
 insertPageToc ($a_output)
 Insert page toc. More...
 
 insertResources ($a_output)
 Insert resources. More...
 
 insertAdvTrigger ($a_output)
 Insert adv content trigger. More...
 
 postOutputProcessing ($a_output)
 Finalizing output processing. More...
 
 previewHistory ()
 Preview history. More...
 
 preview ()
 preview More...
 
 edit ()
 edit ("view" before) More...
 
 getBlockingInfoMessage ()
 Get block info message. More...
 
 insertJSAtPlaceholder ()
 InsertJS at placeholder. More...
 
 initCaptchaForm ()
 Init captcha form. More...
 
 presentation ($a_mode=self::PRESENTATION)
 
 getHTML ()
 
 showMediaFullscreen ($a_style_id=0)
 show fullscreen view of media object More...
 
 displayValidationError ($a_error)
 display validation error More...
 
 history ()
 Get history table as HTML. More...
 
 rollbackConfirmation ()
 Rollback confirmation. More...
 
 rollback ()
 Rollback to a previous version. More...
 
 setScreenIdComponent ()
 Set screen id component. More...
 
 getTabs ($a_activate="")
 adds tabs to tab gui object More...
 
 compareVersion ()
 Compares two revisions of the page. More...
 
 replaceDiffTags ($a_html)
 
 editActivation ()
 Edit activation (only, if scheduled page activation is activated in administration) More...
 
 initActivationForm ()
 Init activation form. More...
 
 getActivationFormValues ()
 Get values for activation form. More...
 
 saveActivation ()
 Save Activation. More...
 
 getNotesHTML ($a_content_object=null, $a_enable_private_notes=true, $a_enable_public_notes=false, $a_enable_notes_deletion=false, $a_callback=null, $export=false)
 Get html for public and/or private notes. More...
 
 processAnswer ()
 Process answer. More...
 
 initialOpenedContent ()
 Initially opened content. More...
 
 initOpenedContentForm ()
 Init form for initially opened content. More...
 
 saveInitialOpenedContent ()
 Save initial opened content. More...
 
 switchToLanguage ()
 Switch to language. More...
 
 confirmPageTranslationCreation ()
 Confirm page translation creation. More...
 
 editMasterLanguage ()
 Edit master language. More...
 
 createPageTranslation ()
 Create page translation. More...
 
 releasePageLock ()
 Release page lock. More...
 
 finishEditing ()
 
 getPagePermaLink ()
 Get page perma link. More...
 
 getAdditionalPageActions ()
 Get additional page actions. More...
 

Private Member Functions

 redirectToQuestionEditPage ($questionType, $qid, $prev_qid)
 
 redirectToQuestionPoolSelectionPage ($questionType, $qid, $prev_qid)
 

Additional Inherited Members

- Static Public Member Functions inherited from ilPageObjectGUI
static getTinyMenu ( $a_par_type, $a_int_links=false, $a_wiki_links=false, $a_keywords=false, $a_style_id=0, $a_paragraph_styles=true, $a_save_return=true, $a_anchors=false, $a_save_new=true, $a_user_links=false, \ILIAS\COPage\Editor\Server\UIWrapper $ui_wrapper=null)
 Get Tiny Menu. More...
 
- Data Fields inherited from ilAssQuestionPageGUI
const TEMP_PRESENTATION_TITLE_PLACEHOLDER = '___TEMP_PRESENTATION_TITLE_PLACEHOLDER___'
 
- Data Fields inherited from ilPageObjectGUI
const PRESENTATION = "presentation"
 
const EDIT = "edit"
 
const PREVIEW = "preview"
 
const OFFLINE = "offline"
 
const PRINTING = "print"
 
 $obj
 
 $presentation_title
 
 $target_script
 
 $return_location
 
 $target_var
 
 $template_output_var
 
 $output2template
 
 $link_params
 
 $sourcecode_download_script
 
 $change_comments
 
 $question_html
 
 $activation = false
 
 $activated = true
 
 $editpreview = false
 
 $use_meta_data = false
 
 $link_xml_set = false
 
 $enableediting = true
 
 $rawpagecontent = false
 
 $enabledcontentincludes = false
 
 $compare_mode = false
 
 $page_config = null
 
 $tabs_enabled = true
 
 $render_page_container = false
 
 $pl_start = "{{{{{"
 
 $pl_end = "}}}}}"
 
- Protected Member Functions inherited from ilAssQuestionPageGUI
 isPageContainerToBeRendered ()
 
- Protected Member Functions inherited from ilPageObjectGUI
 initPageObject ()
 Init page object. More...
 
 showEditToolbar ()
 Show edit toolbar. More...
 
 setEditorToolContext ()
 Set editor tool context. More...
 
 initEditing ()
 Init editing. More...
 
 showEditLockInfo ()
 
 setBackToEditTabs ()
 
 isPageContainerToBeRendered ()
 
 addResourcesToTemplate (ilGlobalTemplateInterface $tpl)
 Add resources to template. More...
 
- Protected Attributes inherited from ilPageObjectGUI
 $profile_back_url = ""
 
 $enabled_href = true
 
 $tpl
 
 $lng
 
 $ctrl
 
 $tabs_gui
 
 $access
 
 $plugin_admin
 
 $log
 
 $user
 
 $help
 
 $output_mode
 
 $parent_type = ""
 
 $tool_context
 
 $ui
 
 $page_linker
 
 $abstract_pcid = ""
 
 $toolbar
 
 $open_place_holder
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilTestExpressPageObjectGUI::__construct (   $a_id = 0,
  $a_old_nr = 0 
)

Definition at line 64 of file class.ilTestExpressPageObjectGUI.php.

References ILIAS\GlobalScreen\Provider\__construct().

65  {
66  parent::__construct($a_id, $a_old_nr);
67  }
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ addPageOfQuestions()

ilTestExpressPageObjectGUI::addPageOfQuestions (   $type = '')

Definition at line 215 of file class.ilTestExpressPageObjectGUI.php.

References $_GET, $DIC, ilPageObjectGUI\$obj, $type, assQuestionGUI\_getQuestionGUI(), ilObjectFactory\getInstanceByRefId(), and ilObjQuestionPool\getQuestionTypeByTypeId().

Referenced by executeCommand().

216  {
217  global $DIC;
218  $ilCtrl = $DIC['ilCtrl'];
219 
220  if (!$type) {
221  $qtype = $_REQUEST['qtype'];
222  $pool = new ilObjQuestionPool();
224  }
225 
226  $this->ctrl->setReturn($this, "questions");
227 
228  include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
230 
232 
233  $q_gui->object->setObjId($obj->getId());
234 
235  return $q_gui;
236  }
$type
$_GET["client_id"]
static getQuestionTypeByTypeId($type_id)
static _getQuestionGUI($question_type, $question_id=-1)
Creates a question gui representation and returns the alias to the question gui note: please do not u...
global $DIC
Definition: goto.php:24
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addQuestion()

ilTestExpressPageObjectGUI::addQuestion ( )

Definition at line 333 of file class.ilTestExpressPageObjectGUI.php.

References $data, $DIC, ilPageObjectGUI\$lng, $name, $si, ilPageObjectGUI\$tpl, ilObjQuestionPool\_getAvailableQuestionpools(), assQuestion\ADDITIONAL_CONTENT_EDITING_MODE_IPE, assQuestion\ADDITIONAL_CONTENT_EDITING_MODE_RTE, ilObjAssessmentFolder\isAdditionalQuestionContentEditingModePageObjectEnabled(), ilRadioOption\setInfo(), ilFormPropertyGUI\setInfo(), ilFormPropertyGUI\setRequired(), and ilRadioOption\setValue().

334  {
335  global $DIC;
336  $lng = $DIC['lng'];
337  $ilCtrl = $DIC['ilCtrl'];
338  $tpl = $DIC['tpl'];
339  global $DIC; /* @var \ILIAS\DI\Container $DIC */
340  $ilHelp = $DIC['ilHelp']; /* @var ilHelpGUI $ilHelp */
341 
342  $subScreenId = array('createQuestion');
343 
344  include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
345 
346  $ilCtrl->setParameter($this, 'qtype', $_REQUEST['qtype']);
347 
348  $form = new ilPropertyFormGUI();
349 
350  $ilCtrl->setParameter($this, 'test_express_mode', 1);
351 
352  $form->setFormAction($ilCtrl->getFormAction($this, "handleToolbarCommand"));
353  $form->setTitle($lng->txt("ass_create_question"));
354  include_once 'Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php';
355 
356  $pool = new ilObjQuestionPool();
357  $questionTypes = $pool->getQuestionTypes(false, true, false);
358  $options = array();
359 
360  // question type
361  foreach ($questionTypes as $label => $data) {
362  $options[$data['question_type_id']] = $label;
363  }
364 
365  include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
366  $si = new ilSelectInputGUI($lng->txt("question_type"), "qtype");
367  $si->setOptions($options);
368  $form->addItem($si, true);
369 
370  // position
371  $questions = $this->test_object->getQuestionTitlesAndIndexes();
372  if ($questions) {
373  $si = new ilSelectInputGUI($lng->txt("position"), "position");
374  $options = array('0' => $lng->txt('first'));
375  foreach ($questions as $key => $title) {
376  $options[$key] = $lng->txt('behind') . ' ' . $title . ' [' . $this->lng->txt('question_id_short') . ': ' . $key . ']';
377  }
378  $si->setOptions($options);
379  $si->setValue($_REQUEST['q_id']);
380  $form->addItem($si, true);
381  }
382 
383  // content editing mode
385  $subScreenId[] = 'editMode';
386 
387  $ri = new ilRadioGroupInputGUI($lng->txt("tst_add_quest_cont_edit_mode"), "add_quest_cont_edit_mode");
388 
389  $option_ipe = new ilRadioOption(
390  $lng->txt('tst_add_quest_cont_edit_mode_IPE'),
392  );
393  $option_ipe->setInfo($lng->txt('tst_add_quest_cont_edit_mode_IPE_info'));
394  $ri->addOption($option_ipe);
395 
396  $option_rte = new ilRadioOption(
397  $lng->txt('tst_add_quest_cont_edit_mode_RTE'),
399  );
400  $option_rte->setInfo($lng->txt('tst_add_quest_cont_edit_mode_RTE_info'));
401  $ri->addOption($option_rte);
402 
404 
405  $form->addItem($ri, true);
406  } else {
407  $hi = new ilHiddenInputGUI("question_content_editing_type");
409  $form->addItem($hi, true);
410  }
411 
412  if ($this->test_object->getPoolUsage()) {
413  $subScreenId[] = 'poolSelect';
414 
415  // use pool
416  $usage = new ilRadioGroupInputGUI($this->lng->txt("assessment_pool_selection"), "usage");
417  $usage->setRequired(true);
418  $no_pool = new ilRadioOption($this->lng->txt("assessment_no_pool"), 1);
419  $usage->addOption($no_pool);
420  $existing_pool = new ilRadioOption($this->lng->txt("assessment_existing_pool"), 3);
421  $usage->addOption($existing_pool);
422  $new_pool = new ilRadioOption($this->lng->txt("assessment_new_pool"), 2);
423  $usage->addOption($new_pool);
424  $form->addItem($usage);
425 
426  $usage->setValue(1);
427 
428  $questionpools = ilObjQuestionPool::_getAvailableQuestionpools(false, false, true, false, false, "write");
429  $pools_data = array();
430  foreach ($questionpools as $key => $p) {
431  $pools_data[$key] = $p['title'];
432  }
433  $pools = new ilSelectInputGUI($this->lng->txt("select_questionpool"), "sel_qpl");
434  $pools->setOptions($pools_data);
435  $existing_pool->addSubItem($pools);
436 
437  $name = new ilTextInputGUI($this->lng->txt("name"), "txt_qpl");
438  $name->setSize(50);
439  $name->setMaxLength(50);
440  $new_pool->addSubItem($name);
441  }
442 
443  $form->addCommandButton("handleToolbarCommand", $lng->txt("create"));
444  $form->addCommandButton("questions", $lng->txt("cancel"));
445 
446  $ilHelp->setSubScreenId(implode('_', $subScreenId));
447 
448  return $form->getHTML();
449  }
const ADDITIONAL_CONTENT_EDITING_MODE_IPE
constant for additional content editing mode "pageobject"
This class represents an option in a radio group.
static _getAvailableQuestionpools($use_object_id=false, $equal_points=false, $could_be_offline=false, $showPath=false, $with_questioncount=false, $permission="read", $usr_id="")
Returns the available question pools for the active user.
$data
Definition: storeScorm.php:23
This class represents a property form user interface.
setInfo($a_info)
Set Info.
setInfo($a_info)
Set Information Text.
if($format !==null) $name
Definition: metadata.php:230
This class represents a hidden form property in a property form.
This class represents a property in a property form.
setValue($a_value)
Set Value.
global $DIC
Definition: goto.php:24
const ADDITIONAL_CONTENT_EDITING_MODE_RTE
constant for additional content editing mode "default"
static isAdditionalQuestionContentEditingModePageObjectEnabled()
returns the fact wether content editing with ilias page editor is enabled for questions or not ...
setRequired($a_required)
Set Required.
+ Here is the call graph for this function:

◆ executeCommand()

ilTestExpressPageObjectGUI::executeCommand ( )

Definition at line 69 of file class.ilTestExpressPageObjectGUI.php.

References $_GET, $DIC, $ilUser, ilPageObjectGUI\$lng, $message, ilPageObjectGUI\$obj, $ret, $total, $type, assQuestionGUI\_getQuestionGUI(), addPageOfQuestions(), ilUtil\appendUrlParameterString(), ilPageObjectGUI\EDIT, ilPageObjectGUI\getEnableEditing(), ilPageObjectGUI\getHeader(), ilObjectFactory\getInstanceByRefId(), ilPageObjectGUI\getPageObject(), ilObjQuestionPool\getQuestionTypeByTypeId(), ilPageObjectGUI\PREVIEW, ilUtil\redirect(), ilUtil\sendFailure(), ilPageObjectGUI\setOutputMode(), ilAssQuestionPageGUI\showPage(), and ilUtil\stripSlashes().

70  {
71  global $DIC; /* @var ILIAS\DI\Container $DIC */
72  $ilCtrl = $DIC['ilCtrl'];
73  $ilTabs = $DIC['ilTabs'];
74  $ilUser = $DIC['ilUser'];
75  $lng = $DIC['lng'];
76 
77  $next_class = $this->ctrl->getNextClass($this);
78  $cmd = $this->ctrl->getCmd();
79 
80  switch ($next_class) {
81  case 'ilobjquestionpoolgui':
82 
83  $nodeParts = explode(':', $_GET['cmdNode']);
84 
85  $params = array(
86  'ref_id' => $_GET['ref_id'],
87  'calling_test' => $_GET['ref_id'],
88  'q_id' => $_GET['q_id'],
89  'cmd' => $_GET['cmd'],
90  'cmdClass' => $_GET['cmdClass'],
91  'baseClass' => 'ilObjQuestionPoolGUI',
92  'test_express_mode' => '1'
93  );
94 
97  '?' . http_build_query($params, null, '&'),
98  'cmdNode=' . ($nodeParts[count($nodeParts) - 2] . ':' . $nodeParts[count($nodeParts) - 1])
99  )
100  );
101 
102  break;
103 
104  case "ilpageeditorgui":
105 
106  if (!$this->getEnableEditing()) {
107  ilUtil::sendFailure($lng->txt("permission_denied"), true);
108  $ilCtrl->redirect($this, "preview");
109  }
110 
111  $page_editor = new ilPageEditorGUI($this->getPageObject(), $this);
112  $page_editor->setLocator($this->locator);
113  $page_editor->setHeader($this->getHeader());
114  $page_editor->setPageBackTitle($this->page_back_title);
115  $page_editor->setIntLinkReturn($this->int_link_return);
116 
117  $this->ctrl->saveParameterByClass('ilpageeditorgui', 'q_mode');
118 
119  $ret = $this->ctrl->forwardCommand($page_editor);
120  if ($ret != "") {
121  $this->tpl->setContent($ret);
122  }
123  break;
124 
125  case '':
126  case 'iltestexpresspageobjectgui':
127 
128  include_once 'Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
129 
130  if ($cmd == 'view') {
131  $cmd = 'showPage';
132  $ilCtrl->setCmd($cmd);
133  }
134 
135  $q_gui = assQuestionGUI::_getQuestionGUI('', (int) $_REQUEST["q_id"]);
136 
137  if ($q_gui->object) {
138  $obj = ilObjectFactory::getInstanceByRefId((int) $_REQUEST['ref_id']);
139  $q_gui->object->setObjId($obj->getId());
140  }
141 
142  $cmds = array(
143  'handleToolbarCommand',
144  'addQuestion',
145  'questions',
146  'insertQuestions',
147  'browseForQuestions',
148  'filterAvailableQuestions',
149  'resetfilterAvailableQuestions'
150  );
151 
152  if (in_array($cmd, $cmds)) {
153  return $this->$cmd();
154  } elseif ($q_gui->object) {
155  $total = $this->test_object->evalTotalPersons();
156 
158 
159  if ($total != 0) {
160  $link = $DIC->ui()->factory()->link()->standard(
161  $DIC->language()->txt("test_has_datasets_warning_page_view_link"),
162  $DIC->ctrl()->getLinkTargetByClass(array('ilTestResultsGUI', 'ilParticipantsTestResultsGUI'))
163  );
164 
165  $message = $DIC->language()->txt("test_has_datasets_warning_page_view");
166 
167  $msgBox = $DIC->ui()->factory()->messageBox()->info($message)->withLinks(array($link));
168 
169  $DIC->ui()->mainTemplate()->setCurrentBlock('mess');
170  $DIC->ui()->mainTemplate()->setVariable(
171  'MESSAGE',
172  $DIC->ui()->renderer()->render($msgBox)
173  );
174  $DIC->ui()->mainTemplate()->parseCurrentBlock();
175  }
176 
177  if ((in_array($cmd, array('view', 'showPage')) || $cmd == 'edit') && $this->test_object->evalTotalPersons()) {
178  return $this->showPage();
179  }
180 
181  return parent::executeCommand();
182  }
183 
184  break;
185 
186  default:
188 
189  if (!$_GET['q_id']) {
190  $q_gui = $this->addPageOfQuestions(preg_replace('/(.*?)gui/i', '$1', $_GET['sel_question_types']));
191  $q_gui->setQuestionTabs();
192 
193  $this->ctrl->forwardCommand($q_gui);
194  break;
195  }
196 
197  $this->ctrl->setReturn($this, "questions");
198 
199  require_once 'Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
200  $q_gui = assQuestionGUI::_getQuestionGUI($type, (int) $_GET['q_id']);
201  if ($q_gui->object) {
203  $q_gui->object->setObjId($obj->getId());
204  }
205 
206  $this->ctrl->saveParameterByClass('ilpageeditorgui', 'q_id');
207  $this->ctrl->saveParameterByClass('ilpageeditorgui', 'q_mode');
208 
209  $q_gui->setQuestionTabs();
210  $this->ctrl->forwardCommand($q_gui);
211  break;
212  }
213  }
getPageObject()
Get Page Object.
$type
$_GET["client_id"]
static getQuestionTypeByTypeId($type_id)
$total
Definition: Utf8Test.php:87
Page Editor GUI class.
static appendUrlParameterString($a_url, $a_par, $xml_style=false)
append URL parameter string ("par1=value1&par2=value2...") to given URL string
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...
getEnableEditing()
Get Enable Editing.
global $DIC
Definition: goto.php:24
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$ret
Definition: parser.php:6
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
$message
Definition: xapiexit.php:14
setOutputMode($a_mode=self::PRESENTATION)
Set Output Mode.
$ilUser
Definition: imgupload.php:18
static redirect($a_script)
+ Here is the call graph for this function:

◆ handleToolbarCommand()

ilTestExpressPageObjectGUI::handleToolbarCommand ( )

Definition at line 238 of file class.ilTestExpressPageObjectGUI.php.

References $_GET, $DIC, assQuestionGUI\_getQuestionGUI(), ilObject\_lookupObjectId(), assQuestion\ADDITIONAL_CONTENT_EDITING_MODE_RTE, ilObjQuestionPool\getQuestionTypeByTypeId(), ilObjAssessmentFolder\isAdditionalQuestionContentEditingModePageObjectEnabled(), ilUtil\redirect(), and redirectToQuestionEditPage().

239  {
240  global $DIC;
241  $ilCtrl = $DIC['ilCtrl'];
242 
243  include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
244 
245  if ($_REQUEST['qtype']) {
246  include_once 'Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php';
247  $questionType = ilObjQuestionPool::getQuestionTypeByTypeId($_REQUEST['qtype']);
248  } elseif ($_REQUEST['sel_question_types']) {
249  $questionType = $_REQUEST['sel_question_types'];
250  }
251 
252  include_once 'Modules/Test/classes/class.ilObjAssessmentFolder.php';
254  $addContEditMode = $_REQUEST['add_quest_cont_edit_mode'];
255  } else {
257  }
258 
259  $q_gui = &assQuestionGUI::_getQuestionGUI($questionType);
260 
261  $q_gui->object->setObjId(ilObject::_lookupObjectId($_GET['ref_id']));
262  $q_gui->object->setAdditionalContentEditingMode($addContEditMode);
263 
264  $q_gui->object->createNewQuestion();
265 
266  $previousQuestionId = $_REQUEST['position'];
267 
268  switch ($_REQUEST['usage']) {
269  case 3: // existing pool
270 
271  $ilCtrl->setParameterByClass('ilobjtestgui', 'sel_qpl', $_REQUEST['sel_qpl']);
272  $ilCtrl->setParameterByClass('ilobjtestgui', 'sel_question_types', $questionType);
273  $ilCtrl->setParameterByClass('ilobjtestgui', 'q_id', $q_gui->object->getId());
274  $ilCtrl->setParameterByClass('ilobjtestgui', 'prev_qid', $previousQuestionId);
275 
276  if ($_REQUEST['test_express_mode']) {
277  $ilCtrl->setParameterByClass('ilobjtestgui', 'test_express_mode', 1);
278  }
279 
280  if (isset($_REQUEST['add_quest_cont_edit_mode'])) {
281  $ilCtrl->setParameterByClass(
282  'ilobjtestgui',
283  'add_quest_cont_edit_mode',
284  $_REQUEST['add_quest_cont_edit_mode']
285  );
286  }
287 
288  $ilCtrl->setParameterByClass('ilobjtestgui', 'usage', 3);
289  $ilCtrl->setParameterByClass('ilobjtestgui', 'calling_test', $this->test_object->getId());
290 
291  $link = $ilCtrl->getLinkTargetByClass('ilobjtestgui', 'executeCreateQuestion', false, false, false);
292 
293  ilUtil::redirect($link);
294 
295  break;
296 
297  case 2: // new pool
298 
299  $ilCtrl->setParameterByClass('ilobjtestgui', 'txt_qpl', $_REQUEST['txt_qpl']);
300  $ilCtrl->setParameterByClass('ilobjtestgui', 'sel_question_types', $questionType);
301  $ilCtrl->setParameterByClass('ilobjtestgui', 'q_id', $q_gui->object->getId());
302  $ilCtrl->setParameterByClass('ilobjtestgui', 'prev_qid', $previousQuestionId);
303 
304  if ($_REQUEST['test_express_mode']) {
305  $ilCtrl->setParameterByClass('ilobjtestgui', 'test_express_mode', 1);
306  }
307 
308  if (isset($_REQUEST['add_quest_cont_edit_mode'])) {
309  $ilCtrl->setParameterByClass(
310  'ilobjtestgui',
311  'add_quest_cont_edit_mode',
312  $_REQUEST['add_quest_cont_edit_mode']
313  );
314  }
315 
316  $ilCtrl->setParameterByClass('ilobjtestgui', 'usage', 2);
317  $ilCtrl->setParameterByClass('ilobjtestgui', 'calling_test', $this->test_object->getId());
318 
319  $link = $ilCtrl->getLinkTargetByClass('ilobjtestgui', 'executeCreateQuestion', false, false, false);
320  ilUtil::redirect($link);
321 
322  break;
323 
324  case 1: // no pool
325  default:
326 
327  $this->redirectToQuestionEditPage($questionType, $q_gui->object->getId(), $previousQuestionId);
328 
329  break;
330  }
331  }
$_GET["client_id"]
static getQuestionTypeByTypeId($type_id)
static _lookupObjectId($a_ref_id)
lookup object id
static _getQuestionGUI($question_type, $question_id=-1)
Creates a question gui representation and returns the alias to the question gui note: please do not u...
global $DIC
Definition: goto.php:24
const ADDITIONAL_CONTENT_EDITING_MODE_RTE
constant for additional content editing mode "default"
redirectToQuestionEditPage($questionType, $qid, $prev_qid)
static isAdditionalQuestionContentEditingModePageObjectEnabled()
returns the fact wether content editing with ilias page editor is enabled for questions or not ...
static redirect($a_script)
+ Here is the call graph for this function:

◆ insertQuestions()

ilTestExpressPageObjectGUI::insertQuestions ( )

Definition at line 493 of file class.ilTestExpressPageObjectGUI.php.

References $_POST, $DIC, $ilDB, assQuestion\_needsManualScoring(), and ilUtil\sendInfo().

494  {
495  $selected_array = (is_array($_POST['q_id'])) ? $_POST['q_id'] : array();
496  if (!count($selected_array)) {
497  ilUtil::sendInfo($this->lng->txt("tst_insert_missing_question"), true);
498  $this->ctrl->redirect($this, "browseForQuestions");
499  } else {
500  include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
501  $manscoring = false;
502 
503  global $DIC;
504  $tree = $DIC['tree'];
505  $ilDB = $DIC['ilDB'];
506  $ilPluginAdmin = $DIC['ilPluginAdmin'];
507 
508  require_once 'Modules/Test/classes/class.ilTestQuestionSetConfigFactory.php';
509  $testQuestionSetConfigFactory = new ilTestQuestionSetConfigFactory($tree, $ilDB, $ilPluginAdmin, $this->test_object);
510  $testQuestionSetConfig = $testQuestionSetConfigFactory->getQuestionSetConfig();
511 
512  foreach ($selected_array as $key => $value) {
513  $last_question_id = $this->test_object->insertQuestion($testQuestionSetConfig, $value);
514 
515  if (!$manscoring) {
516  $manscoring = $manscoring | assQuestion::_needsManualScoring($value);
517  }
518  }
519  $this->test_object->saveCompleteStatus($testQuestionSetConfig);
520  if ($manscoring) {
521  ilUtil::sendInfo($this->lng->txt("manscoring_hint"), true);
522  } else {
523  ilUtil::sendSuccess($this->lng->txt("tst_questions_inserted"), true);
524  }
525 
526  $this->ctrl->setParameter($this, 'q_id', $last_question_id);
527  $this->ctrl->redirect($this, "showPage");
528  return;
529  }
530  }
static _needsManualScoring($question_id)
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
global $DIC
Definition: goto.php:24
global $ilDB
$_POST["username"]
+ Here is the call graph for this function:

◆ nextQuestion()

ilTestExpressPageObjectGUI::nextQuestion ( )

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

References ilPageObjectGUI\$obj, and ilUtil\redirect().

27  {
28  $obj = new ilObjTest($_REQUEST['ref_id']);
29  $questions = array_keys($obj->getQuestionTitlesAndIndexes());
30 
31  $pos = array_search($_REQUEST['q_id'], $questions);
32 
33  if ($pos !== false) {
34  $next = $questions[$pos + 1];
35  } else {
36  $next = $questions[0];
37  }
38 
39  $this->ctrl->setParameter($this, 'q_id', $next);
40  $link = $this->ctrl->getLinkTarget($this, 'edit', '', '', false);
41 
42  ilUtil::redirect($link);
43  }
static redirect($a_script)
+ Here is the call graph for this function:

◆ prevQuestion()

ilTestExpressPageObjectGUI::prevQuestion ( )

Definition at line 45 of file class.ilTestExpressPageObjectGUI.php.

References ilPageObjectGUI\$obj, and ilUtil\redirect().

46  {
47  $obj = new ilObjTest($_REQUEST['ref_id']);
48  $questions = array_keys($obj->getQuestionTitlesAndIndexes());
49 
50  $pos = array_search($_REQUEST['q_id'], $questions);
51 
52  if ($pos !== false) {
53  $next = $questions[$pos - 1];
54  } else {
55  $next = $questions[0];
56  }
57 
58  $this->ctrl->setParameter($this, 'q_id', $next);
59  $link = $this->ctrl->getLinkTarget($this, 'edit', '', '', false);
60 
61  ilUtil::redirect($link);
62  }
static redirect($a_script)
+ Here is the call graph for this function:

◆ questions()

ilTestExpressPageObjectGUI::questions ( )

Definition at line 451 of file class.ilTestExpressPageObjectGUI.php.

References $DIC.

452  {
453  global $DIC;
454  $ilCtrl = $DIC['ilCtrl'];
455 
456  $ilCtrl->saveParameterByClass('ilobjtestgui', 'q_id');
457 
458  $ilCtrl->redirectByClass('ilobjtestgui', 'showPage');
459  }
global $DIC
Definition: goto.php:24

◆ redirectToQuestionEditPage()

ilTestExpressPageObjectGUI::redirectToQuestionEditPage (   $questionType,
  $qid,
  $prev_qid 
)
private

Definition at line 461 of file class.ilTestExpressPageObjectGUI.php.

References $_GET.

Referenced by handleToolbarCommand().

462  {
463  $cmdClass = $questionType . 'GUI';
464 
465  $this->ctrl->setParameterByClass($cmdClass, 'ref_id', $_GET['ref_id']);
466  $this->ctrl->setParameterByClass($cmdClass, 'sel_question_types', $questionType);
467  $this->ctrl->setParameterByClass($cmdClass, 'test_ref_id', $_GET['ref_id']);
468  $this->ctrl->setParameterByClass($cmdClass, 'calling_test', $_GET['ref_id']);
469  $this->ctrl->setParameterByClass($cmdClass, 'q_id', $qid);
470  $this->ctrl->setParameterByClass($cmdClass, 'prev_qid', $prev_qid);
471 
472  if ($_REQUEST['test_express_mode']) {
473  $this->ctrl->setParameterByClass($cmdClass, 'test_express_mode', 1);
474  }
475 
476  $this->ctrl->redirectByClass(
477  array('ilRepositoryGUI', 'ilObjTestGUI', $questionType . "GUI"),
478  'editQuestion'
479  );
480  }
$_GET["client_id"]
+ Here is the caller graph for this function:

◆ redirectToQuestionPoolSelectionPage()

ilTestExpressPageObjectGUI::redirectToQuestionPoolSelectionPage (   $questionType,
  $qid,
  $prev_qid 
)
private

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

References ilUtil\redirect().

483  {
484  $this->ctrl->setParameterByClass('ilObjTestGUI', 'ref_id', $_REQUEST['ref_id']);
485  $this->ctrl->setParameterByClass('ilObjTestGUI', 'q_id', $qid);
486  $this->ctrl->setParameterByClass('ilObjTestGUI', 'sel_question_types', $questionType);
487  $this->ctrl->setParameterByClass('ilObjTestGUI', 'prev_qid', $prev_qid);
488  $redir = $this->ctrl->getLinkTargetByClass('ilObjTestGUI', 'createQuestion', '', false, false);
489 
490  ilUtil::redirect($redir);
491  }
static redirect($a_script)
+ Here is the call graph for this function:

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