ILIAS  release_8 Revision v8.24
ilTestExpressPageObjectGUI Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for 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...
 
 finishEditing ()
 
 postOutputProcessing (string $a_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 (string $a_output)
 Replace page toc placeholder with question info and actions. More...
 
- Public Member Functions inherited from ilPageObjectGUI
 __construct (string $a_parent_type, int $a_id, int $a_old_nr=0, bool $a_prevent_get_id=false, string $a_lang="", string $concrete_lang="")
 
 setTemplate (ilGlobalTemplateInterface $main_tpl)
 
 afterConstructor ()
 
 setAdvMdRecordObject (int $a_adv_ref_id, string $a_adv_type, string $a_adv_subtype="-")
 Set object, that defines the adv md records being used. More...
 
 getAdvMdRecordObject ()
 Get adv md record type. More...
 
 setParentType (string $a_val)
 
 getParentType ()
 
 setId (int $a_val)
 
 getId ()
 
 setOldNr (int $a_val)
 Set old nr (historic page) More...
 
 getOldNr ()
 
 setLanguage (string $a_val)
 
 getLanguage ()
 
 setEnablePCType (string $a_pc_type, bool $a_val)
 
 getEnablePCType (string $a_pc_type)
 
 setPageConfig (ilPageConfig $a_val)
 
 getPageConfig ()
 
 setPageObject (ilPageObject $a_pg_obj)
 
 getPageObject ()
 
 setOutputMode (string $a_mode=self::PRESENTATION)
 
 getOutputMode ()
 
 setTemplateOutput (bool $a_output=true)
 
 outputToTemplate ()
 
 setPresentationTitle (string $a_title="")
 
 getPresentationTitle ()
 
 setHeader (string $a_title="")
 
 getHeader ()
 
 setLinkParams (string $l_params="")
 
 getLinkParams ()
 
 setLinkFrame (string $l_frame="")
 
 getLinkFrame ()
 
 setPageLinker (\ILIAS\COPage\PageLinker $page_linker)
 
 getLinkXML ()
 
 setQuestionHTML (array $question_html)
 
 getQuestionHTML ()
 
 setTemplateTargetVar (string $a_variable)
 
 getTemplateTargetVar ()
 
 getTemplateOutputVar ()
 
 setSourcecodeDownloadScript (string $script_name)
 
 getSourcecodeDownloadScript ()
 
 setTabs (ilTabsGUI $a_tabs)
 
 setPageBackTitle (string $a_title)
 
 setFileDownloadLink (string $a_download_link)
 
 getFileDownloadLink ()
 
 setFullscreenLink (string $a_fullscreen_link)
 
 getFullscreenLink ()
 
 setIntLinkReturn (string $a_return)
 
 enableChangeComments (bool $a_enabled)
 
 isEnabledChangeComments ()
 
 enableNotes (bool $a_enabled, int $a_parent_id)
 
 isEnabledNotes ()
 
 setOfflineDirectory (string $offdir)
 
 getOfflineDirectory ()
 
 setViewPageLink (string $a_link, string $a_target="")
 set link for "view page" button More...
 
 getViewPageLink ()
 
 getViewPageTarget ()
 
 getViewPageText ()
 
 setActivationListener (object $a_obj, string $a_meth)
 
 setEnabledNews (bool $a_enabled, int $a_news_obj_id=0, string $a_news_obj_type="")
 
 getEnabledNews ()
 
 setTabHook (object $a_object, string $a_function)
 
 setEditPreview (bool $a_editpreview)
 Set Display first Edit tab, then Preview tab, instead of Page and Edit. More...
 
 getEditPreview ()
 
 setEnabledTabs (bool $a_enabledtabs)
 
 getEnabledTabs ()
 
 setEnabledPageFocus (bool $a_enabledpagefocus)
 
 setOpenPlaceHolder (string $a_val)
 
 getOpenPlaceHolder ()
 
 getEnabledPageFocus ()
 
 setPrependingHtml (string $a_prependinghtml)
 
 getPrependingHtml ()
 
 setEnableEditing (bool $a_enableediting)
 
 getEnableEditing ()
 
 setRawPageContent (bool $a_rawpagecontent)
 Set Get raw page content only. More...
 
 getRawPageContent ()
 
 setStyleId (int $a_styleid)
 
 getStyleId ()
 
 setCompareMode (bool $a_val)
 
 getCompareMode ()
 
 setAbstractOnly (bool $a_val, string $pcid="")
 Get only abstract (first text paragraph) More...
 
 getAbstractOnly ()
 
 setRenderPageContainer (bool $a_val)
 
 getRenderPageContainer ()
 
 getDisabledText ()
 
 getEnabledHref ()
 
 setEnabledHref (bool $enable)
 
 activateMetaDataEditor (ilObject $a_rep_obj, string $a_type, int $a_sub_obj_id, object $a_observer_obj=null, string $a_observer_func="")
 Activate meda data editor. More...
 
 determineFileDownloadLink ()
 
 determineFullscreenLink ()
 
 determineSourcecodeDownloadScript ()
 
 getComponentPluginsXML ()
 Put information about activated plugins into XML. More...
 
 executeCommand ()
 execute command More...
 
 setQEditTabs (string $a_active)
 Set question editing tabs. More...
 
 onFeedbackEditingForwarding ()
 
 deactivatePage ()
 
 activatePage ()
 
 showPage ()
 display content of page More...
 
 replaceCurlyBrackets (string $output)
 
 getActivationCaptions ()
 Get captions for activation action menu entries. More...
 
 setEditMode ()
 Set edit mode. More...
 
 setDefaultLinkXml ()
 
 setLinkXml (string $xml)
 
 getProfileBackUrl ()
 
 setProfileBackUrl (string $url)
 
 downloadFile ()
 
 displayMediaFullscreen ()
 
 displayMedia (bool $a_fullscreen=false)
 
 download_paragraph ()
 download source code paragraph More...
 
 insertPageToc (string $a_output)
 
 insertResources (string $a_output)
 
 insertAdvTrigger (string $a_output)
 Insert adv content trigger. More...
 
 postOutputProcessing (string $a_output)
 Finalizing output processing. More...
 
 previewHistory ()
 Preview history. More...
 
 preview ()
 
 edit ()
 
 getBlockingInfoMessage ()
 
 insertJSAtPlaceholder ()
 
 presentation (string $a_mode=self::PRESENTATION)
 
 getHTML ()
 
 showMediaFullscreen (int $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 ()
 
 getTabs (string $a_activate="")
 
 compareVersion ()
 Compares two revisions of the page. More...
 
 replaceDiffTags (string $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 (object $a_content_object=null, bool $a_enable_private_notes=true, bool $a_enable_public_notes=false, bool $a_enable_notes_deletion=false, callable $a_callback=null, bool $export=false)
 Get html for public and/or private notes. More...
 
 processAnswer ()
 Process answer. More...
 
 initialOpenedContent ()
 Initially opened content. More...
 
 initOpenedContentForm ()
 
 saveInitialOpenedContent ()
 
 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 ()
 
 getAdditionalPageActions ()
 Get additional page actions. More...
 

Data Fields

 $test_object
 
- 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"
 
string $page_back_title = ""
 
ilPageObject $obj
 
string $presentation_title = ""
 
string $target_script = ""
 
string $return_location = ""
 
string $target_var = ""
 
string $template_output_var = ""
 
bool $output2template = false
 
string $link_params = ""
 
string $sourcecode_download_script = ""
 
bool $change_comments = false
 
bool $activation = false
 
bool $activated = true
 
bool $editpreview = false
 
bool $use_meta_data = false
 
ilObject $meta_data_rep_obj = null
 
int $meta_data_sub_obj_id = 0
 
string $meta_data_type = ""
 
object $meta_data_observer_obj = null
 
string $meta_data_observer_func = ""
 
bool $link_xml_set = false
 
bool $enableediting = true
 
bool $rawpagecontent = false
 
bool $enabledcontentincludes = false
 
bool $compare_mode = false
 
ilPageConfig $page_config = null
 
bool $tabs_enabled = true
 
bool $render_page_container = false
 
string $pl_start = "{{{{{"
 
string $pl_end = "}}}}}"
 

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 (string $a_par_type, bool $a_int_links=false, bool $a_wiki_links=false, bool $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...
 
- 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 ()
 
 showEditLockInfo ()
 
 setBackToEditTabs ()
 
 isPageContainerToBeRendered ()
 
 addResourcesToTemplate (ilGlobalTemplateInterface $tpl)
 Add resources to template. More...
 
- Protected Attributes inherited from ilPageObjectGUI
int $requested_ref_id
 
int $requested_pg_id
 
string $requested_file_id
 
string $requested_transl
 
int $requested_old_nr
 
EditGUIRequest $request
 
EditSessionRepository $edit_repo
 
string $exp_target_script = ""
 
string $exp_id = ""
 
string $exp_frame = ""
 
string $act_meth = ""
 
object $act_obj
 
int $notes_parent_id = 0
 
ilPropertyFormGUI $form
 
int $styleid = 0
 
bool $enabledpagefocus
 
string $link_xml
 
int $old_nr = 0
 
int $id
 
string $language
 
ilGlobalTemplateInterface $tpl
 
ilLanguage $lng
 
ilCtrl $ctrl
 
ilTabsGUI $tabs_gui
 
ilAccessHandler $access
 
ilLogger $log
 
ilObjUser $user
 
ilHelpGUI $help
 
string $output_mode = ""
 
string $parent_type = ""
 
string $file_download_link = ''
 
string $fullscreen_link = ''
 
string $link_frame = ''
 
ILIAS GlobalScreen ScreenContext ContextServices $tool_context
 
ILIAS DI UIServices $ui
 
ILIAS COPage PageLinker $page_linker
 
string $abstract_pcid = ""
 
ilToolbarGUI $toolbar
 
string $open_place_holder = ""
 
int $requested_user_id = 0
 
int $requested_q_id = 0
 
int $requested_history_mode = 0
 
bool $enabled_news = false
 
int $news_obj_id = 0
 
string $news_obj_type = ""
 
array $tab_hook = null
 
string $view_page_link = ""
 
string $view_page_target = ""
 
string $offline_directory = ""
 
bool $notes_enabled = false
 
string $prependinghtml = ""
 
string $header = ""
 
string $int_link_return = ""
 
bool $enabled_href = true
 
int $adv_ref_id = null
 
string $adv_type = null
 
string $adv_subtype = null
 
string $concrete_lang = ""
 
string $profile_back_url = ""
 
ilComponentFactory $component_factory
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning @ilCtrl_Calls ilTestExpressPageObjectGUI: assMultipleChoiceGUI, assClozeTestGUI, assMatchingQuestionGUI @ilCtrl_Calls ilTestExpressPageObjectGUI: assOrderingQuestionGUI, assImagemapQuestionGUI @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 @ilCtrl_IsCalledBy ilTestExpressPageObjectGUI: assNumericGUI @ilCtrl_IsCalledBy ilTestExpressPageObjectGUI: assTextSubsetGUI @ilCtrl_IsCalledBy ilTestExpressPageObjectGUI: assSingleChoiceGUI @ilCtrl_IsCalledBy ilTestExpressPageObjectGUI: assTextQuestionGUI, assFormulaQuestionGUI

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

Constructor & Destructor Documentation

◆ __construct()

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

Constructor.

Parameters
int$a_id
int$a_old_nr

Reimplemented from ilAssQuestionPageGUI.

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

79 {
80 parent::__construct($a_id, $a_old_nr);
81 }
__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 230 of file class.ilTestExpressPageObjectGUI.php.

231 {
232 global $DIC;
233 $ilCtrl = $DIC['ilCtrl'];
234
235 if (!$type) {
236 $qtype = $this->testrequest->raw('qtype');
237 $pool = new ilObjQuestionPool();
239 }
240
241 $this->ctrl->setReturn($this, "questions");
242
243 include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
245
246 $obj = ilObjectFactory::getInstanceByRefId($this->testrequest->getRefId());
247
248 $q_gui->object->setObjId($obj->getId());
249
250 return $q_gui;
251 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _getQuestionGUI(string $question_type='', int $question_id=-1)
Creates a question gui representation and returns the alias to the question gui.
static getQuestionTypeByTypeId($type_id)
static getInstanceByRefId(int $ref_id, bool $stop_on_error=true)
get an instance of an Ilias object by reference id
global $DIC
Definition: feed.php:28
$type

References $DIC, ilPageObjectGUI\$obj, $type, assQuestionGUI\_getQuestionGUI(), ILIAS\Repository\ctrl(), ilPageObject\getId(), 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 348 of file class.ilTestExpressPageObjectGUI.php.

348 : string
349 {
350 global $DIC;
351 $lng = $DIC['lng'];
352 $ilCtrl = $DIC['ilCtrl'];
353 $tpl = $DIC['tpl'];
354 global $DIC; /* @var \ILIAS\DI\Container $DIC */
355 $ilHelp = $DIC['ilHelp']; /* @var ilHelpGUI $ilHelp */
356
357 $subScreenId = array('createQuestion');
358
359 include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
360
361 $ilCtrl->setParameter($this, 'qtype', $this->testrequest->raw('qtype'));
362
363 $form = new ilPropertyFormGUI();
364
365 $ilCtrl->setParameter($this, 'test_express_mode', 1);
366
367 $form->setFormAction($ilCtrl->getFormAction($this, "handleToolbarCommand"));
368 $form->setTitle($lng->txt("ass_create_question"));
369 include_once 'Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php';
370
371 $pool = new ilObjQuestionPool();
372 $questionTypes = $pool->getQuestionTypes(false, true, false);
373 $options = array();
374
375 // question type
376 foreach ($questionTypes as $label => $data) {
377 $options[$data['question_type_id']] = $label;
378 }
379
380 include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
381 $si = new ilSelectInputGUI($lng->txt("question_type"), "qtype");
382 $si->setOptions($options);
383 $form->addItem($si, true);
384
385 // position
386 $questions = $this->test_object->getQuestionTitlesAndIndexes();
387 if ($questions) {
388 $si = new ilSelectInputGUI($lng->txt("position"), "position");
389 $options = array('0' => $lng->txt('first'));
390 foreach ($questions as $key => $title) {
391 $options[$key] = $lng->txt('behind') . ' ' . $title . ' [' . $this->lng->txt('question_id_short') . ': ' . $key . ']';
392 }
393 $si->setOptions($options);
394 $si->setValue($this->testrequest->raw('q_id'));
395 $form->addItem($si, true);
396 }
397
398 // content editing mode
400 $subScreenId[] = 'editMode';
401
402 $ri = new ilRadioGroupInputGUI($lng->txt("tst_add_quest_cont_edit_mode"), "add_quest_cont_edit_mode");
403
404 $option_ipe = new ilRadioOption(
405 $lng->txt('tst_add_quest_cont_edit_mode_IPE'),
407 );
408 $option_ipe->setInfo($lng->txt('tst_add_quest_cont_edit_mode_IPE_info'));
409 $ri->addOption($option_ipe);
410
411 $option_rte = new ilRadioOption(
412 $lng->txt('tst_add_quest_cont_edit_mode_RTE'),
414 );
415 $option_rte->setInfo($lng->txt('tst_add_quest_cont_edit_mode_RTE_info'));
416 $ri->addOption($option_rte);
417
419
420 $form->addItem($ri, true);
421 } else {
422 $hi = new ilHiddenInputGUI("question_content_editing_type");
424 $form->addItem($hi, true);
425 }
426
427 $subScreenId[] = 'poolSelect';
428
429 // use pool
430 $usage = new ilRadioGroupInputGUI($this->lng->txt("assessment_pool_selection"), "usage");
431 $usage->setRequired(true);
432 $no_pool = new ilRadioOption($this->lng->txt("assessment_no_pool"), 1);
433 $usage->addOption($no_pool);
434 $existing_pool = new ilRadioOption($this->lng->txt("assessment_existing_pool"), 3);
435 $usage->addOption($existing_pool);
436 $new_pool = new ilRadioOption($this->lng->txt("assessment_new_pool"), 2);
437 $usage->addOption($new_pool);
438 $form->addItem($usage);
439
440 $usage->setValue(1);
441
442 $questionpools = ilObjQuestionPool::_getAvailableQuestionpools(false, false, true, false, false, "write");
443 $pools_data = array();
444 foreach ($questionpools as $key => $p) {
445 $pools_data[$key] = $p['title'];
446 }
447 $pools = new ilSelectInputGUI($this->lng->txt("select_questionpool"), "sel_qpl");
448 $pools->setOptions($pools_data);
449 $existing_pool->addSubItem($pools);
450
451 $name = new ilTextInputGUI($this->lng->txt("name"), "txt_qpl");
452 $name->setSize(50);
453 $name->setMaxLength(50);
454 $new_pool->addSubItem($name);
455
456 $form->addCommandButton("handleToolbarCommand", $lng->txt("create"));
457 $form->addCommandButton("questions", $lng->txt("cancel"));
458
459 $ilHelp->setSubScreenId(implode('_', $subScreenId));
460
461 return $form->getHTML();
462 }
const ADDITIONAL_CONTENT_EDITING_MODE_RTE
const ADDITIONAL_CONTENT_EDITING_MODE_IPE
setFormAction(string $a_formaction)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
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.
ilPropertyFormGUI $form
ilGlobalTemplateInterface $tpl
This class represents a property form user interface.
addCommandButton(string $a_cmd, string $a_text, string $a_id="")
This class represents a property in a property form.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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:247
string $key
Consumer key/client ID value.
Definition: System.php:193

References $data, $DIC, ilPageObjectGUI\$form, ILIAS\LTI\ToolProvider\$key, ilPageObjectGUI\$lng, $name, ilPageObjectGUI\$tpl, ilObjQuestionPool\_getAvailableQuestionpools(), ilPropertyFormGUI\addCommandButton(), ilPropertyFormGUI\addItem(), assQuestion\ADDITIONAL_CONTENT_EDITING_MODE_IPE, assQuestion\ADDITIONAL_CONTENT_EDITING_MODE_RTE, ilPropertyFormGUI\getHTML(), ilObjAssessmentFolder\isAdditionalQuestionContentEditingModePageObjectEnabled(), ILIAS\Repository\lng(), ilFormGUI\setFormAction(), ilPropertyFormGUI\setTitle(), and ilLanguage\txt().

+ Here is the call graph for this function:

◆ executeCommand()

ilTestExpressPageObjectGUI::executeCommand ( )

execute command

Reimplemented from ilPageObjectGUI.

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

83 : string
84 {
85 global $DIC; /* @var ILIAS\DI\Container $DIC */
86 $ilCtrl = $DIC['ilCtrl'];
87 $ilTabs = $DIC['ilTabs'];
88 $ilUser = $DIC['ilUser'];
89 $lng = $DIC['lng'];
90
91 $next_class = $this->ctrl->getNextClass($this);
92 $cmd = $this->ctrl->getCmd();
93
94 switch ($next_class) {
95 case 'ilobjquestionpoolgui':
96
97 $nodeParts = explode(':', $this->testrequest->raw('cmdNode'));
98
99 $params = array(
100 'ref_id' => $this->testrequest->getRefId(),
101 'calling_test' => $this->testrequest->getRefId(),
102 'q_id' => $this->testrequest->getQuestionId(),
103 'cmd' => $this->testrequest->raw('cmd'),
104 'cmdClass' => $this->testrequest->raw('cmdClass'),
105 'baseClass' => 'ilObjQuestionPoolGUI',
106 'test_express_mode' => '1'
107 );
108
111 '?' . http_build_query($params, null, '&'),
112 'cmdNode=' . ($nodeParts[count($nodeParts) - 2] . ':' . $nodeParts[count($nodeParts) - 1])
113 )
114 );
115
116 break;
117
118 case "ilpageeditorgui":
119
120 if (!$this->getEnableEditing()) {
121 $this->tpl->setOnScreenMessage('failure', $lng->txt("permission_denied"), true);
122 $ilCtrl->redirect($this, "preview");
123 }
124
125 $page_editor = new ilPageEditorGUI($this->getPageObject(), $this);
126 //$page_editor->setLocator($this->locator);
127 $page_editor->setHeader($this->getHeader());
128 $page_editor->setPageBackTitle($this->page_back_title);
129 $page_editor->setIntLinkReturn($this->int_link_return);
130
131 $this->ctrl->saveParameterByClass('ilpageeditorgui', 'q_mode');
132
133 $ret = $this->ctrl->forwardCommand($page_editor);
134 if ($ret != "") {
135 $this->tpl->setContent($ret);
136 }
137 break;
138
139 case '':
140 case 'iltestexpresspageobjectgui':
141
142 include_once 'Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
143
144 if ($cmd == 'view') {
145 $cmd = 'showPage';
146 $ilCtrl->setCmd($cmd);
147 }
148
149 $q_gui = assQuestionGUI::_getQuestionGUI('', (int) $this->testrequest->raw('q_id'));
150
151 if ($q_gui->object) {
152 $obj = ilObjectFactory::getInstanceByRefId((int) $this->testrequest->getRefId());
153 $q_gui->object->setObjId($obj->getId());
154 }
155
156 $cmds = array(
157 'handleToolbarCommand',
158 'addQuestion',
159 'questions',
160 'insertQuestions',
161 'browseForQuestions',
162 'filterAvailableQuestions',
163 'resetfilterAvailableQuestions'
164 );
165
166 if (in_array($cmd, $cmds)) {
167 return $this->$cmd();
168 } elseif ($q_gui->object) {
169 $total = $this->test_object->evalTotalPersons();
170
172
173 if ($total != 0) {
174 $link = $DIC->ui()->factory()->link()->standard(
175 $DIC->language()->txt("test_has_datasets_warning_page_view_link"),
176 $DIC->ctrl()->getLinkTargetByClass(array('ilTestResultsGUI', 'ilParticipantsTestResultsGUI'))
177 );
178
179 $message = $DIC->language()->txt("test_has_datasets_warning_page_view");
180
181 $msgBox = $DIC->ui()->factory()->messageBox()->info($message)->withLinks(array($link));
182
183 $DIC->ui()->mainTemplate()->setCurrentBlock('mess');
184 $DIC->ui()->mainTemplate()->setVariable(
185 'MESSAGE',
186 $DIC->ui()->renderer()->render($msgBox)
187 );
188 $DIC->ui()->mainTemplate()->parseCurrentBlock();
189 }
190
191 if ((in_array($cmd, array('view', 'showPage')) || $cmd == 'edit') && $this->test_object->evalTotalPersons()) {
192 return $this->showPage();
193 }
194
195 return parent::executeCommand();
196 }
197
198 break;
199
200 default:
201 $type = ilObjQuestionPool::getQuestionTypeByTypeId(ilUtil::stripSlashes((string) $this->testrequest->raw('qtype')));
202
203 if (!$this->testrequest->raw('q_id')) {
204 $q_gui = $this->addPageOfQuestions(preg_replace('/(.*?)gui/i', '$1', $this->testrequest->raw('sel_question_types')));
205 $q_gui->setQuestionTabs();
206
207 $this->ctrl->forwardCommand($q_gui);
208 break;
209 }
210
211 $this->ctrl->setReturn($this, "questions");
212
213 require_once 'Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
214 $q_gui = assQuestionGUI::_getQuestionGUI($type, (int) $this->testrequest->raw('q_id'));
215 if ($q_gui->object) {
216 $obj = ilObjectFactory::getInstanceByRefId((int) $this->testrequest->getRefId());
217 $q_gui->object->setObjId($obj->getId());
218 }
219
220 $this->ctrl->saveParameterByClass('ilpageeditorgui', 'q_id');
221 $this->ctrl->saveParameterByClass('ilpageeditorgui', 'q_mode');
222
223 $q_gui->setQuestionTabs();
224 $this->ctrl->forwardCommand($q_gui);
225 break;
226 }
227 return '';
228 }
showPage()
display content of page
Page Editor GUI class.
setOutputMode(string $a_mode=self::PRESENTATION)
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
static appendUrlParameterString(string $a_url, string $a_par, bool $xml_style=false)
static redirect(string $a_script)
$ilUser
Definition: imgupload.php:34
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
Definition: ltiregstart.php:33
$message
Definition: xapiexit.php:32

References $DIC, $ilUser, ilPageObjectGUI\$lng, $message, ilPageObjectGUI\$obj, $params, $type, assQuestionGUI\_getQuestionGUI(), addPageOfQuestions(), ilUtil\appendUrlParameterString(), ILIAS\Repository\ctrl(), ilPageObjectGUI\EDIT, ilPageObjectGUI\getEnableEditing(), ilPageObjectGUI\getHeader(), ilPageObject\getId(), ilObjectFactory\getInstanceByRefId(), ilPageObjectGUI\getPageObject(), ilObjQuestionPool\getQuestionTypeByTypeId(), ilPageObjectGUI\PREVIEW, ilUtil\redirect(), ilPageObjectGUI\setOutputMode(), ilAssQuestionPageGUI\showPage(), ilUtil\stripSlashes(), and ilLanguage\txt().

+ Here is the call graph for this function:

◆ handleToolbarCommand()

ilTestExpressPageObjectGUI::handleToolbarCommand ( )

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

254 {
255 global $DIC;
256 $ilCtrl = $DIC['ilCtrl'];
257
258 include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
259
260 if ($this->testrequest->raw('qtype')) {
261 include_once 'Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php';
262 $questionType = ilObjQuestionPool::getQuestionTypeByTypeId($this->testrequest->raw('qtype'));
263 } elseif ($this->testrequest->raw('sel_question_types')) {
264 $questionType = $this->testrequest->raw('sel_question_types');
265 }
266
267 include_once 'Modules/Test/classes/class.ilObjAssessmentFolder.php';
269 $addContEditMode = $this->testrequest->raw('add_quest_cont_edit_mode');
270 } else {
272 }
273
274 $q_gui = assQuestionGUI::_getQuestionGUI($questionType);
275
276 $q_gui->object->setObjId(ilObject::_lookupObjectId($this->testrequest->getRefId()));
277 $q_gui->object->setAdditionalContentEditingMode($addContEditMode);
278
279 $q_gui->object->createNewQuestion();
280
281 $previousQuestionId = $this->testrequest->raw('position');
282
283 switch ($this->testrequest->raw('usage')) {
284 case 3: // existing pool
285
286 $ilCtrl->setParameterByClass('ilobjtestgui', 'sel_qpl', $this->testrequest->raw('sel_qpl'));
287 $ilCtrl->setParameterByClass('ilobjtestgui', 'sel_question_types', $questionType);
288 $ilCtrl->setParameterByClass('ilobjtestgui', 'q_id', $q_gui->object->getId());
289 $ilCtrl->setParameterByClass('ilobjtestgui', 'prev_qid', $previousQuestionId);
290
291 if ($this->testrequest->raw('test_express_mode')) {
292 $ilCtrl->setParameterByClass('ilobjtestgui', 'test_express_mode', 1);
293 }
294
295 if ($this->testrequest->isset('add_quest_cont_edit_mode')) {
296 $ilCtrl->setParameterByClass(
297 'ilobjtestgui',
298 'add_quest_cont_edit_mode',
299 $this->testrequest->raw('add_quest_cont_edit_mode')
300 );
301 }
302
303 $ilCtrl->setParameterByClass('ilobjtestgui', 'usage', 3);
304 $ilCtrl->setParameterByClass('ilobjtestgui', 'calling_test', $this->test_object->getId());
305
306 $link = $ilCtrl->getLinkTargetByClass('ilobjtestgui', 'executeCreateQuestion', false, false, false);
307
308 ilUtil::redirect($link);
309
310 break;
311
312 case 2: // new pool
313
314 $ilCtrl->setParameterByClass('ilobjtestgui', 'txt_qpl', $this->testrequest->raw('txt_qpl'));
315 $ilCtrl->setParameterByClass('ilobjtestgui', 'sel_question_types', $questionType);
316 $ilCtrl->setParameterByClass('ilobjtestgui', 'q_id', $q_gui->object->getId());
317 $ilCtrl->setParameterByClass('ilobjtestgui', 'prev_qid', $previousQuestionId);
318
319 if ($this->testrequest->raw('test_express_mode')) {
320 $ilCtrl->setParameterByClass('ilobjtestgui', 'test_express_mode', 1);
321 }
322
323 if ($this->testrequest->isset('add_quest_cont_edit_mode')) {
324 $ilCtrl->setParameterByClass(
325 'ilobjtestgui',
326 'add_quest_cont_edit_mode',
327 $this->testrequest->raw('add_quest_cont_edit_mode')
328 );
329 }
330
331 $ilCtrl->setParameterByClass('ilobjtestgui', 'usage', 2);
332 $ilCtrl->setParameterByClass('ilobjtestgui', 'calling_test', $this->test_object->getId());
333
334 $link = $ilCtrl->getLinkTargetByClass('ilobjtestgui', 'executeCreateQuestion', false, false, false);
335 ilUtil::redirect($link);
336
337 break;
338
339 case 1: // no pool
340 default:
341
342 $this->redirectToQuestionEditPage($questionType, $q_gui->object->getId(), $previousQuestionId);
343
344 break;
345 }
346 }
static _lookupObjectId(int $ref_id)
redirectToQuestionEditPage($questionType, $qid, $prev_qid)

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

+ Here is the call graph for this function:

◆ insertQuestions()

ilTestExpressPageObjectGUI::insertQuestions ( )

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

507 {
508 $selected_array = (is_array($_POST['q_id'])) ? $_POST['q_id'] : array();
509 if (!count($selected_array)) {
510 $this->tpl->setOnScreenMessage('info', $this->lng->txt("tst_insert_missing_question"), true);
511 $this->ctrl->redirect($this, "browseForQuestions");
512 } else {
513 include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
514 $manscoring = false;
515
516 global $DIC;
517 $tree = $DIC['tree'];
518 $ilDB = $DIC['ilDB'];
519 $component_repository = $DIC['component.repository'];
520
521 $testQuestionSetConfigFactory = new ilTestQuestionSetConfigFactory($tree, $ilDB, $component_repository, $this->test_object);
522 $testQuestionSetConfig = $testQuestionSetConfigFactory->getQuestionSetConfig();
523
524 foreach ($selected_array as $key => $value) {
525 $last_question_id = $this->test_object->insertQuestion($testQuestionSetConfig, $value);
526
527 if (!$manscoring) {
528 $manscoring = $manscoring | assQuestion::_needsManualScoring($value);
529 }
530 }
531 $this->test_object->saveCompleteStatus($testQuestionSetConfig);
532 if ($manscoring) {
533 $this->tpl->setOnScreenMessage('info', $this->lng->txt("manscoring_hint"), true);
534 } else {
535 $this->tpl->setOnScreenMessage('success', $this->lng->txt("tst_questions_inserted"), true);
536 }
537
538 $this->ctrl->setParameter($this, 'q_id', $last_question_id);
539 $this->ctrl->redirect($this, "showPage");
540 return;
541 }
542 }
static _needsManualScoring(int $question_id)

References $DIC, $ilDB, ILIAS\LTI\ToolProvider\$key, assQuestion\_needsManualScoring(), ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ nextQuestion()

ilTestExpressPageObjectGUI::nextQuestion ( )

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

41 {
42 $obj = new ilObjTest($this->testrequest->getRefId());
43 $questions = array_keys($obj->getQuestionTitlesAndIndexes());
44
45 $pos = array_search($this->testrequest->raw('q_id'), $questions);
46
47 if ($pos !== false) {
48 $next = $questions[$pos + 1];
49 } else {
50 $next = $questions[0];
51 }
52
53 $this->ctrl->setParameter($this, 'q_id', $next);
54 $link = $this->ctrl->getLinkTarget($this, 'edit', '', '', false);
55
56 ilUtil::redirect($link);
57 }

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

+ Here is the call graph for this function:

◆ prevQuestion()

ilTestExpressPageObjectGUI::prevQuestion ( )

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

60 {
61 $obj = new ilObjTest($this->testrequest->getRefId());
62 $questions = array_keys($obj->getQuestionTitlesAndIndexes());
63
64 $pos = array_search($this->testrequest->raw('q_id'), $questions);
65
66 if ($pos !== false) {
67 $next = $questions[$pos - 1];
68 } else {
69 $next = $questions[0];
70 }
71
72 $this->ctrl->setParameter($this, 'q_id', $next);
73 $link = $this->ctrl->getLinkTarget($this, 'edit', '', '', false);
74
75 ilUtil::redirect($link);
76 }

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

+ Here is the call graph for this function:

◆ questions()

ilTestExpressPageObjectGUI::questions ( )

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

465 {
466 global $DIC;
467 $ilCtrl = $DIC['ilCtrl'];
468
469 $ilCtrl->saveParameterByClass('ilobjtestgui', 'q_id');
470
471 $ilCtrl->redirectByClass('ilobjtestgui', 'showPage');
472 }

References $DIC.

◆ redirectToQuestionEditPage()

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

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

475 {
476 $cmdClass = $questionType . 'GUI';
477
478 $this->ctrl->setParameterByClass($cmdClass, 'ref_id', $this->testrequest->getRefId());
479 $this->ctrl->setParameterByClass($cmdClass, 'sel_question_types', $questionType);
480 $this->ctrl->setParameterByClass($cmdClass, 'test_ref_id', $this->testrequest->getRefId());
481 $this->ctrl->setParameterByClass($cmdClass, 'calling_test', $this->testrequest->getRefId());
482 $this->ctrl->setParameterByClass($cmdClass, 'q_id', $qid);
483 $this->ctrl->setParameterByClass($cmdClass, 'prev_qid', $prev_qid);
484
485 if ($this->testrequest->raw('test_express_mode')) {
486 $this->ctrl->setParameterByClass($cmdClass, 'test_express_mode', 1);
487 }
488
489 $this->ctrl->redirectByClass(
490 array('ilRepositoryGUI', 'ilObjTestGUI', $questionType . "GUI"),
491 'editQuestion'
492 );
493 }

References ILIAS\Repository\ctrl().

Referenced by handleToolbarCommand().

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

◆ redirectToQuestionPoolSelectionPage()

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

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

496 {
497 $this->ctrl->setParameterByClass('ilObjTestGUI', 'ref_id', $this->testrequest->getRefId());
498 $this->ctrl->setParameterByClass('ilObjTestGUI', 'q_id', $qid);
499 $this->ctrl->setParameterByClass('ilObjTestGUI', 'sel_question_types', $questionType);
500 $this->ctrl->setParameterByClass('ilObjTestGUI', 'prev_qid', $prev_qid);
501 $redir = $this->ctrl->getLinkTargetByClass('ilObjTestGUI', 'createQuestion', '', false, false);
502
503 ilUtil::redirect($redir);
504 }

References ILIAS\Repository\ctrl(), and ilUtil\redirect().

+ Here is the call graph for this function:

Field Documentation

◆ $test_object

ilTestExpressPageObjectGUI::$test_object

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


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