ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
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 ()
 
 browseForQuestions ()
 
 insertQuestions ()
 
 filterAvailableQuestions ()
 
 resetfilterAvailableQuestions ()
 
 __construct ($a_id=0, $a_old_nr=0)
 Constructor. More...
 
- Public Member Functions inherited from ilPageObjectGUI
 ilPageObjectGUI ($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...
 
 setBibId ($a_id)
 Set Bib Id. More...
 
 getBibId ()
 Get Bib Id. More...
 
 setPageObject ($a_pg_obj)
 Set Page Object. More...
 
 getPageObject ()
 Get Page Object. More...
 
 setOutputMode ($a_mode=IL_PAGE_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 ()
 
 setLinkXML ($link_xml)
 
 getLinkXML ()
 
 setQuestionXML ($question_xml)
 
 setQuestionHTML ($question_html)
 
 getQuestionXML ()
 
 getQuestionHTML ()
 
 setTemplateTargetVar ($a_variable)
 
 getTemplateTargetVar ()
 
 setTemplateOutputVar ($a_value)
 
 getTemplateOutputVar ()
 
 setSourcecodeDownloadScript ($script_name)
 
 getSourcecodeDownloadScript ()
 
 enableCitation ($a_enabled)
 
 isEnabledCitation ()
 
 setLocator (&$a_locator)
 
 setTabs ($a_tabs)
 
 setPageBackTitle ($a_title)
 
 setFileDownloadLink ($a_download_link)
 
 getFileDownloadLink ()
 
 setFullscreenLink ($a_fullscreen_link)
 
 getFullscreenLink ()
 
 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...
 
 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...
 
 activateMetaDataEditor ($a_rep_obj_id, $a_sub_obj_id, $a_type, $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...
 
 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...
 
 insertContentIncludes ($a_html)
 Insert content includes. 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...
 
 insertHelp ($a_tpl)
 Insert help texts. More...
 
 previewHistory ()
 Preview history. More...
 
 preview ()
 preview More...
 
 edit ()
 edit ("view" before) More...
 
 insertJSAtPlaceholder ()
 InsertJS at placeholder. More...
 
 presentation ($a_mode=IL_PAGE_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...
 

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)
 Get Tiny Menu. More...
 
- Data Fields inherited from ilPageObjectGUI
 $tpl
 
 $lng
 
 $ctrl
 
 $obj
 
 $output_mode
 
 $presentation_title
 
 $target_script
 
 $return_location
 
 $target_var
 
 $template_output_var
 
 $output2template
 
 $link_params
 
 $bib_id
 
 $citation
 
 $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...
 
 isPageContainerToBeRendered ()
 
- Protected Attributes inherited from ilPageObjectGUI
 $parent_type = ""
 

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 70 of file class.ilTestExpressPageObjectGUI.php.

70 {
71 parent::__construct($a_id, $a_old_nr);
72 }

Member Function Documentation

◆ addPageOfQuestions()

ilTestExpressPageObjectGUI::addPageOfQuestions (   $type = '')

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

214 {
215 global $ilCtrl;
216
217 if( !$type )
218 {
219 $qtype = $_REQUEST['qtype'];
220 $pool = new ilObjQuestionPool();
222 }
223
224 $this->ctrl->setReturn($this, "questions");
225
226 include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
227 $q_gui = & assQuestionGUI::_getQuestionGUI($type);
228
230
231 $q_gui->object->setObjId($obj->getId());
232
233 return $q_gui;
234 }
$_GET["client_id"]
& _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)
getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
global $ilCtrl
Definition: ilias.php:18
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7

References $_GET, $_REQUEST, $ilCtrl, ilPageObjectGUI\$obj, 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 338 of file class.ilTestExpressPageObjectGUI.php.

339 {
340 global $lng, $ilCtrl, $tpl;
341
342 include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
343
344 $ilCtrl->setParameter($this, 'qtype', $_REQUEST['qtype']);
345
346 $form = new ilPropertyFormGUI();
347
348 $ilCtrl->setParameter($this, 'test_express_mode', 1);
349
350 $form->setFormAction($ilCtrl->getFormAction($this, "handleToolbarCommand"));
351 $form->setTitle($lng->txt("ass_create_question"));
352 include_once 'Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php';
353
354 $pool = new ilObjQuestionPool();
355 $questionTypes = $pool->getQuestionTypes(false, true);
356 $options = array();
357
358 // question type
359 foreach($questionTypes as $label => $data)
360 {
361 $options[$data['question_type_id']] = $label;
362 }
363
364 include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
365 $si = new ilSelectInputGUI($lng->txt("question_type"), "qtype");
366 $si->setOptions($options);
367 $form->addItem($si, true);
368
369 // position
370 $questions = $this->test_object->getQuestionTitlesAndIndexes();
371 if($questions)
372 {
373 $si = new ilSelectInputGUI($lng->txt("position"), "position");
374 $options = array('0' => $lng->txt('first'));
375 foreach($questions as $key => $title)
376 {
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 {
387 $ri = new ilRadioGroupInputGUI($lng->txt("tst_add_quest_cont_edit_mode"), "add_quest_cont_edit_mode");
388
389 $ri->addOption(new ilRadioOption(
390 $lng->txt('tst_add_quest_cont_edit_mode_default'),
392 ));
393
394 $ri->addOption(new ilRadioOption(
395 $lng->txt('tst_add_quest_cont_edit_mode_page_object'),
397 ));
398
400
401 $form->addItem($ri, true);
402 }
403 else
404 {
405 $hi = new ilHiddenInputGUI("question_content_editing_type");
407 $form->addItem($hi, true);
408 }
409
410 if($this->test_object->getPoolUsage())
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 {
429 $pools_data[$key] = $p['title'];
430 }
431 $pools = new ilSelectInputGUI($this->lng->txt("select_questionpool"), "sel_qpl");
432 $pools->setOptions($pools_data);
433 $existing_pool->addSubItem($pools);
434
435 $name = new ilTextInputGUI($this->lng->txt("name"), "txt_qpl");
436 $name->setSize(50);
437 $name->setMaxLength(50);
438 $new_pool->addSubItem($name);
439 }
440
441 $form->addCommandButton("handleToolbarCommand", $lng->txt("create"));
442 $form->addCommandButton("questions", $lng->txt("cancel"));
443
444 return $tpl->setContent($form->getHTML());
445 }
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
& _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(!is_array($argv)) $options

References $_REQUEST, $data, $ilCtrl, ilPageObjectGUI\$lng, $options, $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:

◆ browseForQuestions()

ilTestExpressPageObjectGUI::browseForQuestions ( )

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

489 {
490 global $ilAccess, $tpl, $ilCtrl;
491
492 $ilCtrl->setParameterByClass(get_class($this), "browse", "1");
493
494 include_once "./Modules/Test/classes/tables/class.ilTestQuestionBrowserTableGUI.php";
495 $table_gui = new ilTestQuestionBrowserTableGUI($this, 'browseForQuestions', $_REQUEST['ref_id'], (($ilAccess->checkAccess("write", "", $_REQUEST['ref_id']) ? true : false)));
496 $arrFilter = array();
497 foreach ($table_gui->getFilterItems() as $item)
498 {
499 if ($item->getValue() !== false)
500 {
501 $arrFilter[$item->getPostVar()] = $item->getValue();
502 }
503 }
504 $data = $this->test_object->getAvailableQuestions($arrFilter, 1);
505
506 $table_gui->setData($data);
507 $tpl->setVariable('ADM_CONTENT', $table_gui->getHTML());
508 }

References $_REQUEST, $data, $ilCtrl, and ilPageObjectGUI\$tpl.

◆ executeCommand()

& ilTestExpressPageObjectGUI::executeCommand ( )

execute command

Reimplemented from ilPageObjectGUI.

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

75 {
76 global $ilCtrl, $ilTabs, $ilUser, $lng;
77
78 $next_class = $this->ctrl->getNextClass($this);
79 $cmd = $this->ctrl->getCmd();
80
81 switch ($next_class)
82 {
83 case 'ilobjquestionpoolgui':
84
85 $nodeParts = explode(':', $_GET['cmdNode']);
86
87 $params = array(
88 'ref_id' => $_GET['ref_id'],
89 'calling_test' => $_GET['ref_id'],
90 'q_id' => $_GET['q_id'],
91 'cmd' => $_GET['cmd'],
92 'cmdClass' => $_GET['cmdClass'],
93 'cmdNode' => $nodeParts[count($nodeParts) - 2] . ':' . $nodeParts[count($nodeParts) - 1],
94 'baseClass' => 'ilObjQuestionPoolGUI',
95 'test_express_mode' => '1'
96 );
97
98 ilUtil::redirect('ilias.php?' . http_build_query($params, null, '&'));
99
100 break;
101
102 case "ilpageeditorgui":
103
104 if (!$this->getEnableEditing())
105 {
106 ilUtil::sendFailure($lng->txt("permission_denied"), true);
107 $ilCtrl->redirect($this, "preview");
108 }
109
110 $page_editor = & new ilPageEditorGUI($this->getPageObject(), $this);
111 $page_editor->setLocator($this->locator);
112 $page_editor->setHeader($this->getHeader());
113 $page_editor->setPageBackTitle($this->page_back_title);
114 $page_editor->setIntLinkReturn($this->int_link_return);
115
116 $this->ctrl->saveParameterByClass('ilpageeditorgui', 'q_mode');
117
118 $ret = & $this->ctrl->forwardCommand($page_editor);
119
120 break;
121
122 case '':
123 case 'iltestexpresspageobjectgui':
124
125 include_once 'Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
126
127 if( $cmd == 'view' )
128 {
129 $cmd = 'showPage';
130 }
131
132 $q_gui = & assQuestionGUI::_getQuestionGUI('', $_REQUEST["q_id"]);
133
134 if ($q_gui->object)
135 {
137 $q_gui->object->setObjId($obj->getId());
138 }
139
140 $cmds = array(
141 'handleToolbarCommand',
142 'addQuestion',
143 'questions',
144 'insertQuestions',
145 'browseForQuestions',
146 'filterAvailableQuestions',
147 'resetfilterAvailableQuestions'
148 );
149
150 if( in_array($cmd, $cmds) )
151 {
152 return $this->$cmd();
153 }
154 elseif( $q_gui->object )
155 {
156 $total = $this->test_object->evalTotalPersons();
157
159
160 if( $total != 0 )
161 {
162 $link = $ilCtrl->getLinkTargetByClass('ilobjtestgui', "participants");
163 $link = "<a href=\"".$link."\">".$lng->txt("test_has_datasets_warning_page_view_link")."</a>";
164 ilUtil::sendInfo($lng->txt("test_has_datasets_warning_page_view")." ".$link);
165 }
166
167 if( in_array($cmd, array('view', 'showPage')) || $cmd == 'edit' && $this->test_object->evalTotalPersons() )
168 {
169 return $this->showPage();
170 }
171
172 return parent::executeCommand();
173 }
174
175 break;
176
177 default:
178
179 $qtype = $_REQUEST['qtype'];
181
182 if( !$_GET['q_id'] )
183 {
184 $q_gui = $this->addPageOfQuestions(preg_replace('/(.*?)gui/i', '$1', $_GET['sel_question_types']));
185 $q_gui->setQuestionTabs();
186
187 $ret = $this->ctrl->forwardCommand($q_gui);
188
189 break;
190 }
191
192 $this->ctrl->setReturn($this, "questions");
193
194 include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
195 $q_gui = & assQuestionGUI::_getQuestionGUI($type, $_GET["q_id"]);
196
197 if( $q_gui->object )
198 {
200 $q_gui->object->setObjId($obj->getId());
201 }
202
203 $this->ctrl->saveParameterByClass('ilpageeditorgui', 'q_id');
204 $this->ctrl->saveParameterByClass('ilpageeditorgui', 'q_mode');
205
206 $q_gui->setQuestionTabs();
207 $ret = & $this->ctrl->forwardCommand($q_gui);
208
209 break;
210 }
211 }
const IL_PAGE_EDIT
const IL_PAGE_PREVIEW
Page Editor GUI class.
showPage()
display content of page
getPageObject()
Get Page Object.
setOutputMode($a_mode=IL_PAGE_PRESENTATION)
Set Output Mode.
getEnableEditing()
Get Enable Editing.
static redirect($a_script)
http redirect to other script
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
$cmd
Definition: sahs_server.php:35
global $ilUser
Definition: imgupload.php:15

References $_GET, $_REQUEST, $cmd, $ilCtrl, $ilUser, ilPageObjectGUI\$lng, ilPageObjectGUI\$obj, $ret, $total, assQuestionGUI\_getQuestionGUI(), addPageOfQuestions(), ilPageObjectGUI\getEnableEditing(), ilPageObjectGUI\getHeader(), ilObjectFactory\getInstanceByRefId(), ilPageObjectGUI\getPageObject(), ilObjQuestionPool\getQuestionTypeByTypeId(), IL_PAGE_EDIT, IL_PAGE_PREVIEW, ilUtil\redirect(), ilUtil\sendFailure(), ilUtil\sendInfo(), ilPageObjectGUI\setOutputMode(), and ilPageObjectGUI\showPage().

+ Here is the call graph for this function:

◆ filterAvailableQuestions()

ilTestExpressPageObjectGUI::filterAvailableQuestions ( )

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

555 {
556 include_once "./Modules/Test/classes/tables/class.ilTestQuestionBrowserTableGUI.php";
557 $table_gui = new ilTestQuestionBrowserTableGUI($this, 'browseForQuestions', $_REQUEST['ref_id']);
558 $table_gui->resetOffset();
559 $table_gui->writeFilterToSession();
560 $this->ctrl->redirect($this, "browseForQuestions");
561 }

References $_REQUEST.

◆ handleToolbarCommand()

ilTestExpressPageObjectGUI::handleToolbarCommand ( )

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

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

References $_GET, $_POST, $_REQUEST, $ilCtrl, assQuestionGUI\_getQuestionGUI(), 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 510 of file class.ilTestExpressPageObjectGUI.php.

511 {
512 $selected_array = (is_array($_POST['q_id'])) ? $_POST['q_id'] : array();
513 if (!count($selected_array))
514 {
515 ilUtil::sendInfo($this->lng->txt("tst_insert_missing_question"), true);
516 $this->ctrl->redirect($this, "browseForQuestions");
517 }
518 else
519 {
520 include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
521 $manscoring = FALSE;
522
523 global $tree, $ilDB, $ilPluginAdmin;
524
525 require_once 'Modules/Test/classes/class.ilTestQuestionSetConfigFactory.php';
526 $testQuestionSetConfigFactory = new ilTestQuestionSetConfigFactory($tree, $ilDB, $ilPluginAdmin, $this->test_object);
527 $testQuestionSetConfig = $testQuestionSetConfigFactory->getQuestionSetConfig();
528
529 foreach ($selected_array as $key => $value)
530 {
531 $last_question_id = $this->test_object->insertQuestion( $testQuestionSetConfig, $value );
532
533 if (!$manscoring)
534 {
535 $manscoring = $manscoring | assQuestion::_needsManualScoring($value);
536 }
537 }
538 $this->test_object->saveCompleteStatus( $testQuestionSetConfig );
539 if ($manscoring)
540 {
541 ilUtil::sendInfo($this->lng->txt("manscoring_hint"), TRUE);
542 }
543 else
544 {
545 ilUtil::sendSuccess($this->lng->txt("tst_questions_inserted"), TRUE);
546 }
547
548 $this->ctrl->setParameter($this, 'q_id', $last_question_id);
549 $this->ctrl->redirect($this, "showPage");
550 return;
551 }
552 }
_needsManualScoring($question_id)
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
global $ilDB

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

+ 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 {
35 $next = $questions[$pos + 1];
36 }
37 else
38 {
39 $next = $questions[0];
40 }
41
42 $this->ctrl->setParameter($this, 'q_id', $next);
43 $link = $this->ctrl->getLinkTarget($this, 'edit', '', '', false);
44
45 ilUtil::redirect($link);
46 }

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

+ Here is the call graph for this function:

◆ prevQuestion()

ilTestExpressPageObjectGUI::prevQuestion ( )

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

49 {
50 $obj = new ilObjTest($_REQUEST['ref_id']);
51 $questions = array_keys($obj->getQuestionTitlesAndIndexes());
52
53 $pos = array_search($_REQUEST['q_id'], $questions);
54
55 if( $pos !== false )
56 {
57 $next = $questions[$pos - 1];
58 }
59 else
60 {
61 $next = $questions[0];
62 }
63
64 $this->ctrl->setParameter($this, 'q_id', $next);
65 $link = $this->ctrl->getLinkTarget($this, 'edit', '', '', false);
66
67 ilUtil::redirect($link);
68 }

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

+ Here is the call graph for this function:

◆ questions()

ilTestExpressPageObjectGUI::questions ( )

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

448 {
449 global $ilCtrl;
450
451 $ilCtrl->saveParameterByClass('ilobjtestgui', 'q_id');
452
453 $ilCtrl->redirectByClass('ilobjtestgui', 'showPage');
454 }

References $ilCtrl.

◆ redirectToQuestionEditPage()

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

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

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

References $_GET, and $_REQUEST.

Referenced by handleToolbarCommand().

+ Here is the caller graph for this function:

◆ redirectToQuestionPoolSelectionPage()

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

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

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

References $_REQUEST, and ilUtil\redirect().

+ Here is the call graph for this function:

◆ resetfilterAvailableQuestions()

ilTestExpressPageObjectGUI::resetfilterAvailableQuestions ( )

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

564 {
565 include_once "./Modules/Test/classes/tables/class.ilTestQuestionBrowserTableGUI.php";
566 $table_gui = new ilTestQuestionBrowserTableGUI($this, 'browseForQuestions', $_REQUEST['ref_id']);
567 $table_gui->resetOffset();
568 $table_gui->resetFilter();
569 $this->ctrl->redirect($this, "browseForQuestions");
570 }

References $_REQUEST.


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