ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilTestExpressPageObjectGUI Class Reference

@ilCtrl_Calls ilTestExpressPageObjectGUI: assMultipleChoiceGUI, assClozeTestGUI, assMatchingQuestionGUI @ilCtrl_Calls ilTestExpressPageObjectGUI: assOrderingQuestionGUI, assImagemapQuestionGUI, assJavaAppletGUI @ilCtrl_Calls ilTestExpressPageObjectGUI: assNumericGUI @ilCtrl_Calls ilTestExpressPageObjectGUI: assTextSubsetGUI @ilCtrl_Calls ilTestExpressPageObjectGUI: assSingleChoiceGUI @ilCtrl_Calls ilTestExpressPageObjectGUI: assTextQuestionGUI, assFormulaQuestionGUI @ilCtrl_Calls ilTestExpressPageObjectGUI: ilPageEditorGUI, ilEditClipboardGUI, ilMediaPoolTargetSelector @ilCtrl_Calls ilTestExpressPageObjectGUI: ilRatingGUI, ilPublicUserProfileGUI, ilAssQuestionPageGUI, ilNoteGUI @ilCtrl_Calls ilTestExpressPageObjectGUI: ilObjQuestionPoolGUI @ilCtrl_IsCalledBy ilTestExpressPageObjectGUI: assMultipleChoiceGUI, assClozeTestGUI, assMatchingQuestionGUI @ilCtrl_IsCalledBy ilTestExpressPageObjectGUI: assOrderingQuestionGUI, assImagemapQuestionGUI, assJavaAppletGUI @ilCtrl_IsCalledBy ilTestExpressPageObjectGUI: assNumericGUI @ilCtrl_IsCalledBy ilTestExpressPageObjectGUI: assTextSubsetGUI @ilCtrl_IsCalledBy ilTestExpressPageObjectGUI: assSingleChoiceGUI @ilCtrl_IsCalledBy 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)
 Constructor. More...
 
 executeCommand ()
 execute command More...
 
 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 ()
 display content of page More...
 
 postOutputProcessing ($output)
 Finalizing output processing. More...
 
 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="")
 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...
 
 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)
 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...
 
 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...
 
 addActionsMenu ($a_tpl, $sel_media_mode, $sel_html_mode, $sel_js_mode)
 Add actions menu. More...
 
 addMultiLangActionsAndInfo ($a_list, $a_tpl)
 Add multi-language actions to menu. 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...
 
 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)
 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...
 
 getPagePermaLink ()
 Get page perma link. 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)
 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...
 
 getActivationCaptions ()
 Get captions for activation action menu entries. More...
 
 getBlockingInfoMessage ()
 Get block info message. More...
 
 isPageContainerToBeRendered ()
 
 addResourcesToTemplate (ilGlobalTemplateInterface $tpl)
 Add resources to template. More...
 
- Protected Attributes inherited from ilPageObjectGUI
 $profile_back_url = ""
 
 $tpl
 
 $lng
 
 $ctrl
 
 $tabs_gui
 
 $access
 
 $plugin_admin
 
 $log
 
 $user
 
 $help
 
 $output_mode
 
 $parent_type = ""
 
 $tool_context
 
 $ui
 
 $page_linker
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

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

Constructor.

Parameters
int$a_id
int$a_old_nr
Returns
\ilAssQuestionPageGUI

Reimplemented from ilAssQuestionPageGUI.

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

65 {
66 parent::__construct($a_id, $a_old_nr);
67 }
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References ILIAS\GlobalScreen\Provider\__construct().

+ Here is the call graph for this function:

Member Function Documentation

◆ addPageOfQuestions()

ilTestExpressPageObjectGUI::addPageOfQuestions (   $type = '')

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

217 {
218 global $DIC;
219 $ilCtrl = $DIC['ilCtrl'];
220
221 if (!$type) {
222 $qtype = $_REQUEST['qtype'];
223 $pool = new ilObjQuestionPool();
225 }
226
227 $this->ctrl->setReturn($this, "questions");
228
229 include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
231
233
234 $q_gui->object->setObjId($obj->getId());
235
236 return $q_gui;
237 }
$_GET["client_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...
static getQuestionTypeByTypeId($type_id)
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
global $ilCtrl
Definition: ilias.php:18
$type
$DIC
Definition: xapitoken.php:46

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

Referenced by executeCommand().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addQuestion()

ilTestExpressPageObjectGUI::addQuestion ( )

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

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

References $data, $DIC, $ilCtrl, ilPageObjectGUI\$lng, $name, $si, ilPageObjectGUI\$tpl, ilObjQuestionPool\_getAvailableQuestionpools(), assQuestion\ADDITIONAL_CONTENT_EDITING_MODE_DEFAULT, assQuestion\ADDITIONAL_CONTENT_EDITING_MODE_PAGE_OBJECT, and ilObjAssessmentFolder\isAdditionalQuestionContentEditingModePageObjectEnabled().

+ Here is the call graph for this function:

◆ executeCommand()

ilTestExpressPageObjectGUI::executeCommand ( )

execute command

Reimplemented from ilPageObjectGUI.

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

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

References $_GET, $DIC, $ilCtrl, $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().

+ Here is the call graph for this function:

◆ handleToolbarCommand()

ilTestExpressPageObjectGUI::handleToolbarCommand ( )

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

240 {
241 global $DIC;
242 $ilCtrl = $DIC['ilCtrl'];
243
244 include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
245
246 if ($_REQUEST['qtype']) {
247 include_once 'Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php';
248 $questionType = ilObjQuestionPool::getQuestionTypeByTypeId($_REQUEST['qtype']);
249 } elseif ($_REQUEST['sel_question_types']) {
250 $questionType = $_REQUEST['sel_question_types'];
251 }
252
253 include_once 'Modules/Test/classes/class.ilObjAssessmentFolder.php';
255 $addContEditMode = $_REQUEST['add_quest_cont_edit_mode'];
256 } else {
258 }
259
260 $q_gui = &assQuestionGUI::_getQuestionGUI($questionType);
261
262 $q_gui->object->setObjId(ilObject::_lookupObjectId($_GET['ref_id']));
263 $q_gui->object->setAdditionalContentEditingMode($addContEditMode);
264
265 $q_gui->object->createNewQuestion();
266
267 $previousQuestionId = $_REQUEST['position'];
268
269 switch ($_REQUEST['usage']) {
270 case 3: // existing pool
271
272 $ilCtrl->setParameterByClass('ilobjtestgui', 'sel_qpl', $_REQUEST['sel_qpl']);
273 $ilCtrl->setParameterByClass('ilobjtestgui', 'sel_question_types', $questionType);
274 $ilCtrl->setParameterByClass('ilobjtestgui', 'q_id', $q_gui->object->getId());
275 $ilCtrl->setParameterByClass('ilobjtestgui', 'prev_qid', $previousQuestionId);
276
277 if ($_REQUEST['test_express_mode']) {
278 $ilCtrl->setParameterByClass('ilobjtestgui', 'test_express_mode', 1);
279 }
280
281 if (isset($_REQUEST['add_quest_cont_edit_mode'])) {
282 $ilCtrl->setParameterByClass(
283 'ilobjtestgui',
284 'add_quest_cont_edit_mode',
285 $_REQUEST['add_quest_cont_edit_mode']
286 );
287 }
288
289 $ilCtrl->setParameterByClass('ilobjtestgui', 'usage', 3);
290 $ilCtrl->setParameterByClass('ilobjtestgui', 'calling_test', $this->test_object->getId());
291
292 $link = $ilCtrl->getLinkTargetByClass('ilobjtestgui', 'executeCreateQuestion', false, false, false);
293
294 ilUtil::redirect($link);
295
296 break;
297
298 case 2: // new pool
299
300 $ilCtrl->setParameterByClass('ilobjtestgui', 'txt_qpl', $_REQUEST['txt_qpl']);
301 $ilCtrl->setParameterByClass('ilobjtestgui', 'sel_question_types', $questionType);
302 $ilCtrl->setParameterByClass('ilobjtestgui', 'q_id', $q_gui->object->getId());
303 $ilCtrl->setParameterByClass('ilobjtestgui', 'prev_qid', $previousQuestionId);
304
305 if ($_REQUEST['test_express_mode']) {
306 $ilCtrl->setParameterByClass('ilobjtestgui', 'test_express_mode', 1);
307 }
308
309 if (isset($_REQUEST['add_quest_cont_edit_mode'])) {
310 $ilCtrl->setParameterByClass(
311 'ilobjtestgui',
312 'add_quest_cont_edit_mode',
313 $_REQUEST['add_quest_cont_edit_mode']
314 );
315 }
316
317 $ilCtrl->setParameterByClass('ilobjtestgui', 'usage', 2);
318 $ilCtrl->setParameterByClass('ilobjtestgui', 'calling_test', $this->test_object->getId());
319
320 $link = $ilCtrl->getLinkTargetByClass('ilobjtestgui', 'executeCreateQuestion', false, false, false);
321 ilUtil::redirect($link);
322
323 break;
324
325 case 1: // no pool
326 default:
327
328 $this->redirectToQuestionEditPage($questionType, $q_gui->object->getId(), $previousQuestionId);
329
330 break;
331 }
332 }
static _lookupObjectId($a_ref_id)
lookup object id
redirectToQuestionEditPage($questionType, $qid, $prev_qid)

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

+ Here is the call graph for this function:

◆ insertQuestions()

ilTestExpressPageObjectGUI::insertQuestions ( )

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

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

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

+ Here is the call graph for this function:

◆ nextQuestion()

ilTestExpressPageObjectGUI::nextQuestion ( )

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

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 }

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

+ Here is the call graph for this function:

◆ prevQuestion()

ilTestExpressPageObjectGUI::prevQuestion ( )

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

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 }

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

+ Here is the call graph for this function:

◆ questions()

ilTestExpressPageObjectGUI::questions ( )

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

449 {
450 global $DIC;
451 $ilCtrl = $DIC['ilCtrl'];
452
453 $ilCtrl->saveParameterByClass('ilobjtestgui', 'q_id');
454
455 $ilCtrl->redirectByClass('ilobjtestgui', 'showPage');
456 }

References $DIC, and $ilCtrl.

◆ redirectToQuestionEditPage()

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

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

459 {
460 $cmdClass = $questionType . 'GUI';
461
462 $this->ctrl->setParameterByClass($cmdClass, 'ref_id', $_GET['ref_id']);
463 $this->ctrl->setParameterByClass($cmdClass, 'sel_question_types', $questionType);
464 $this->ctrl->setParameterByClass($cmdClass, 'test_ref_id', $_GET['ref_id']);
465 $this->ctrl->setParameterByClass($cmdClass, 'calling_test', $_GET['ref_id']);
466 $this->ctrl->setParameterByClass($cmdClass, 'q_id', $qid);
467 $this->ctrl->setParameterByClass($cmdClass, 'prev_qid', $prev_qid);
468
469 if ($_REQUEST['test_express_mode']) {
470 $this->ctrl->setParameterByClass($cmdClass, 'test_express_mode', 1);
471 }
472
473 $this->ctrl->redirectByClass(
474 array('ilRepositoryGUI', 'ilObjTestGUI', $questionType . "GUI"),
475 'editQuestion'
476 );
477 }

References $_GET.

Referenced by handleToolbarCommand().

+ Here is the caller graph for this function:

◆ redirectToQuestionPoolSelectionPage()

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

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

480 {
481 $this->ctrl->setParameterByClass('ilObjTestGUI', 'ref_id', $_REQUEST['ref_id']);
482 $this->ctrl->setParameterByClass('ilObjTestGUI', 'q_id', $qid);
483 $this->ctrl->setParameterByClass('ilObjTestGUI', 'sel_question_types', $questionType);
484 $this->ctrl->setParameterByClass('ilObjTestGUI', 'prev_qid', $prev_qid);
485 $redir = $this->ctrl->getLinkTargetByClass('ilObjTestGUI', 'createQuestion', '', false, false);
486
487 ilUtil::redirect($redir);
488 }

References ilUtil\redirect().

+ Here is the call graph for this function:

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