ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilTestExpressPageObjectGUI Class Reference

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

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

Public Member Functions

 nextQuestion ()
 
 prevQuestion ()
 
 __construct ($a_id=0, $a_old_nr=0, $test_object=null)
 
 executeCommand ()
 
 addPageOfQuestions ($type='')
 
 handleToolbarCommand ()
 
 addQuestion ()
 
 questions ()
 
 insertQuestions ()
 
- Public Member Functions inherited from ilAssQuestionPageGUI
 __construct ($a_id=0, $a_old_nr=0)
 Constructor. More...
 
 getOriginalPresentationTitle ()
 
 setOriginalPresentationTitle ($originalPresentationTitle)
 
 showPage ()
 
 finishEditing ()
 
 postOutputProcessing (string $a_output)
 
 setQuestionInfoHTML ($a_html)
 Set the HTML of a question info block below the title (number, status, ...) More...
 
 setQuestionActionsHTML ($a_html)
 Set the HTML of a question actions block below the title. More...
 
 insertPageToc (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 ()
 
 getMetaDataLink ()
 
 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...
 
 afterDeleteContents ()
 

Protected Attributes

 $test_object
 
- Protected Attributes inherited from ilPageObjectGUI
ILIAS TestQuestionPool QuestionInfoService $questioninfo
 
ILIAS COPage Page PageManager $pm
 
ILIAS COPage Link LinkManager $link
 
ILIAS COPage InternalGUIService $gui
 
ILIAS COPage PC PCDefinition $pc_definition
 
ILIAS COPage Xsl XslManager $xsl
 
ILIAS COPage Editor GUIService $editor_gui
 
ILIAS Notes Service $notes
 
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
 
ILIAS COPage Compare PageCompare $compare
 

Private Member Functions

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

Private Attributes

ilTree $tree
 
ilDBInterface $db
 
ilComponentRepository $component_repository
 

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...
 
- 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 = "}}}}}"
 
- 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 ()
 
 setBackToHistoryTabs ()
 
 checkLangPageAvailable (int $id, string $lang)
 
 isPageContainerToBeRendered ()
 
 addResourcesToTemplate (ilGlobalTemplateInterface $tpl)
 Add resources to template. More...
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

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

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

References $DIC, $test_object, and ILIAS\MetaData\Repository\Validation\Data\__construct().

85  {
86  global $DIC;
87  $this->tree = $DIC['tree'];
88  $this->db = $DIC['ilDB'];
89  $this->component_repository = $DIC['component.repository'];
90  $this->test_object = $test_object;
91 
92  parent::__construct($a_id, $a_old_nr);
93  }
global $DIC
Definition: feed.php:28
__construct(VocabulariesInterface $vocabularies)
+ Here is the call graph for this function:

Member Function Documentation

◆ addPageOfQuestions()

ilTestExpressPageObjectGUI::addPageOfQuestions (   $type = '')

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

References ilPageObjectGUI\$obj, assQuestionGUI\_getQuestionGUI(), ILIAS\Repository\ctrl(), ilPageObject\getId(), ilObjectFactory\getInstanceByRefId(), and ilObjQuestionPool\getQuestionTypeByTypeId().

Referenced by executeCommand().

233  {
234  if (!$type) {
235  $qtype = $this->testrequest->raw('qtype');
236  $pool = new ilObjQuestionPool();
238  }
239 
240  $this->ctrl->setReturn($this, 'questions');
241 
242  $q_gui = assQuestionGUI::_getQuestionGUI($type);
243 
244  $obj = ilObjectFactory::getInstanceByRefId($this->testrequest->getRefId());
245 
246  $q_gui->object->setObjId($obj->getId());
247 
248  return $q_gui;
249  }
static getQuestionTypeByTypeId($type_id)
static _getQuestionGUI(string $question_type='', int $question_id=-1)
Creates a question gui representation and returns the alias to the question gui.
static getInstanceByRefId(int $ref_id, bool $stop_on_error=true)
get an instance of an Ilias object by reference id
Basic GUI class for assessment questions.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addQuestion()

ilTestExpressPageObjectGUI::addQuestion ( )

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

References $data, ilPageObjectGUI\$form, ILIAS\LTI\ToolProvider\$key, ilObjQuestionPool\_getAvailableQuestionpools(), ilPropertyFormGUI\addCommandButton(), ilPropertyFormGUI\addItem(), assQuestion\ADDITIONAL_CONTENT_EDITING_MODE_IPE, assQuestion\ADDITIONAL_CONTENT_EDITING_MODE_RTE, ILIAS\Repository\ctrl(), ilPropertyFormGUI\getHTML(), ILIAS\Repository\help(), ilObjAssessmentFolder\isAdditionalQuestionContentEditingModePageObjectEnabled(), ILIAS\Repository\lng(), ilFormGUI\setFormAction(), ilRadioOption\setInfo(), ilFormPropertyGUI\setInfo(), ilSelectInputGUI\setOptions(), ilFormPropertyGUI\setRequired(), and ilPropertyFormGUI\setTitle().

339  : string
340  {
341  $subScreenId = ['createQuestion'];
342 
343  $this->ctrl->setParameter($this, 'qtype', $this->testrequest->raw('qtype'));
344 
345  $form = new ilPropertyFormGUI();
346 
347  $this->ctrl->setParameter($this, 'test_express_mode', 1);
348 
349  $form->setFormAction($this->ctrl->getFormAction($this, 'handleToolbarCommand'));
350  $form->setTitle($this->lng->txt('ass_create_question'));
351 
352  $pool = new ilObjQuestionPool();
353  $questionTypes = $pool->getQuestionTypes(false, true, false);
354  $options = [];
355 
356  // question type
357  foreach ($questionTypes as $label => $data) {
358  $options[$data['question_type_id']] = $label;
359  }
360 
361  $si = new ilSelectInputGUI($this->lng->txt('question_type'), 'qtype');
362  $si->setOptions($options);
363  $form->addItem($si, true);
364 
365  // position
366  $questions = $this->test_object->getQuestionTitlesAndIndexes();
367  if ($questions) {
368  $si = new ilSelectInputGUI($this->lng->txt('position'), 'position');
369  $options = ['0' => $this->lng->txt('first')];
370  foreach ($questions as $key => $title) {
371  $options[$key] = $this->lng->txt('behind') . ' ' . $title . ' [' . $this->lng->txt('question_id_short') . ': ' . $key . ']';
372  }
373  $si->setOptions($options);
374  $si->setValue($this->testrequest->raw('q_id'));
375  $form->addItem($si, true);
376  }
377 
378  // content editing mode
380  $subScreenId[] = 'editMode';
381 
382  $ri = new ilRadioGroupInputGUI($this->lng->txt('tst_add_quest_cont_edit_mode'), 'add_quest_cont_edit_mode');
383 
384  $option_ipe = new ilRadioOption(
385  $this->lng->txt('tst_add_quest_cont_edit_mode_IPE'),
387  );
388  $option_ipe->setInfo($this->lng->txt('tst_add_quest_cont_edit_mode_IPE_info'));
389  $ri->addOption($option_ipe);
390 
391  $option_rte = new ilRadioOption(
392  $this->lng->txt('tst_add_quest_cont_edit_mode_RTE'),
394  );
395  $option_rte->setInfo($this->lng->txt('tst_add_quest_cont_edit_mode_RTE_info'));
396  $ri->addOption($option_rte);
397 
399 
400  $form->addItem($ri, true);
401  } else {
402  $hi = new ilHiddenInputGUI('question_content_editing_type');
404  $form->addItem($hi, true);
405  }
406 
407  $subScreenId[] = 'poolSelect';
408 
409  // use pool
410  $usage = new ilRadioGroupInputGUI($this->lng->txt('assessment_pool_selection'), 'usage');
411  $usage->setRequired(true);
412  $no_pool = new ilRadioOption($this->lng->txt('assessment_no_pool'), '1');
413  $usage->addOption($no_pool);
414  $existing_pool = new ilRadioOption($this->lng->txt('assessment_existing_pool'), '3');
415  $usage->addOption($existing_pool);
416  $new_pool = new ilRadioOption($this->lng->txt('assessment_new_pool'), '2');
417  $usage->addOption($new_pool);
418  $form->addItem($usage);
419 
420  $usage->setValue(1);
421 
422  $questionpools = ilObjQuestionPool::_getAvailableQuestionpools(false, false, true, false, false, 'write');
423  $pools_data = [];
424  foreach ($questionpools as $key => $p) {
425  $pools_data[$key] = $p['title'];
426  }
427  $pools = new ilSelectInputGUI($this->lng->txt('select_questionpool'), 'sel_qpl');
428  $pools->setOptions($pools_data);
429  $existing_pool->addSubItem($pools);
430 
431  $name = new ilTextInputGUI($this->lng->txt('name'), 'txt_qpl');
432  $name->setSize(50);
433  $name->setMaxLength(50);
434  $new_pool->addSubItem($name);
435 
436  $form->addCommandButton('handleToolbarCommand', $this->lng->txt('create'));
437  $form->addCommandButton('questions', $this->lng->txt('cancel'));
438 
439  $this->help->setSubScreenId(implode('_', $subScreenId));
440 
441  return $form->getHTML();
442  }
const ADDITIONAL_CONTENT_EDITING_MODE_IPE
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.
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.
setInfo(string $a_info)
setOptions(array $a_options)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class represents a property in a property form.
setFormAction(string $a_formaction)
string $key
Consumer key/client ID value.
Definition: System.php:193
setRequired(bool $a_required)
addCommandButton(string $a_cmd, string $a_text, string $a_id="")
const ADDITIONAL_CONTENT_EDITING_MODE_RTE
static isAdditionalQuestionContentEditingModePageObjectEnabled()
Returns the fact wether content editing with ilias page editor is enabled for questions or not...
ilPropertyFormGUI $form
+ Here is the call graph for this function:

◆ executeCommand()

ilTestExpressPageObjectGUI::executeCommand ( )

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

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

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

◆ handleToolbarCommand()

ilTestExpressPageObjectGUI::handleToolbarCommand ( )

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

References ilPageObjectGUI\$link, assQuestionGUI\_getQuestionGUI(), ilObject\_lookupObjectId(), assQuestion\ADDITIONAL_CONTENT_EDITING_MODE_RTE, ILIAS\Repository\ctrl(), ilObjQuestionPool\getQuestionTypeByTypeId(), ilObjAssessmentFolder\isAdditionalQuestionContentEditingModePageObjectEnabled(), ilUtil\redirect(), and redirectToQuestionEditPage().

252  {
253  if ($this->testrequest->raw('qtype')) {
254  $questionType = ilObjQuestionPool::getQuestionTypeByTypeId($this->testrequest->raw('qtype'));
255  } elseif ($this->testrequest->raw('sel_question_types')) {
256  $questionType = $this->testrequest->raw('sel_question_types');
257  }
258 
260  $addContEditMode = $this->testrequest->raw('add_quest_cont_edit_mode');
261  } else {
263  }
264 
265  $q_gui = assQuestionGUI::_getQuestionGUI($questionType);
266 
267  $q_gui->object->setObjId(ilObject::_lookupObjectId($this->testrequest->getRefId()));
268  $q_gui->object->setAdditionalContentEditingMode($addContEditMode);
269 
270  $q_gui->object->createNewQuestion();
271 
272  $previousQuestionId = $this->testrequest->raw('position');
273 
274  switch ($this->testrequest->raw('usage')) {
275  case 3: // existing pool
276 
277  $this->ctrl->setParameterByClass('ilobjtestgui', 'sel_qpl', $this->testrequest->raw('sel_qpl'));
278  $this->ctrl->setParameterByClass('ilobjtestgui', 'sel_question_types', $questionType);
279  $this->ctrl->setParameterByClass('ilobjtestgui', 'q_id', $q_gui->object->getId());
280  $this->ctrl->setParameterByClass('ilobjtestgui', 'prev_qid', $previousQuestionId);
281 
282  if ($this->testrequest->raw('test_express_mode')) {
283  $this->ctrl->setParameterByClass('ilobjtestgui', 'test_express_mode', 1);
284  }
285 
286  if ($this->testrequest->isset('add_quest_cont_edit_mode')) {
287  $this->ctrl->setParameterByClass(
288  'ilobjtestgui',
289  'add_quest_cont_edit_mode',
290  $this->testrequest->raw('add_quest_cont_edit_mode')
291  );
292  }
293 
294  $this->ctrl->setParameterByClass('ilobjtestgui', 'usage', 3);
295  $this->ctrl->setParameterByClass('ilobjtestgui', 'calling_test', $this->test_object->getId());
296 
297  $link = $this->ctrl->getLinkTargetByClass('ilobjtestgui', 'executeCreateQuestion', false, false, false);
298 
300 
301  break;
302 
303  case 2: // new pool
304 
305  $this->ctrl->setParameterByClass('ilobjtestgui', 'txt_qpl', $this->testrequest->raw('txt_qpl'));
306  $this->ctrl->setParameterByClass('ilobjtestgui', 'sel_question_types', $questionType);
307  $this->ctrl->setParameterByClass('ilobjtestgui', 'q_id', $q_gui->object->getId());
308  $this->ctrl->setParameterByClass('ilobjtestgui', 'prev_qid', $previousQuestionId);
309 
310  if ($this->testrequest->raw('test_express_mode')) {
311  $this->ctrl->setParameterByClass('ilobjtestgui', 'test_express_mode', 1);
312  }
313 
314  if ($this->testrequest->isset('add_quest_cont_edit_mode')) {
315  $this->ctrl->setParameterByClass(
316  'ilobjtestgui',
317  'add_quest_cont_edit_mode',
318  $this->testrequest->raw('add_quest_cont_edit_mode')
319  );
320  }
321 
322  $this->ctrl->setParameterByClass('ilobjtestgui', 'usage', 2);
323  $this->ctrl->setParameterByClass('ilobjtestgui', 'calling_test', $this->test_object->getId());
324 
325  $link = $this->ctrl->getLinkTargetByClass('ilobjtestgui', 'executeCreateQuestion', false, false, false);
327 
328  break;
329 
330  case 1: // no pool
331  default:
332 
333  $this->redirectToQuestionEditPage($questionType, $q_gui->object->getId(), $previousQuestionId);
334 
335  break;
336  }
337  }
static getQuestionTypeByTypeId($type_id)
static _getQuestionGUI(string $question_type='', int $question_id=-1)
Creates a question gui representation and returns the alias to the question gui.
ILIAS COPage Link LinkManager $link
static _lookupObjectId(int $ref_id)
static redirect(string $a_script)
const ADDITIONAL_CONTENT_EDITING_MODE_RTE
redirectToQuestionEditPage($questionType, $qid, $prev_qid)
static isAdditionalQuestionContentEditingModePageObjectEnabled()
Returns the fact wether content editing with ilias page editor is enabled for questions or not...
+ Here is the call graph for this function:

◆ insertQuestions()

ilTestExpressPageObjectGUI::insertQuestions ( )

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

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

483  {
484  $selected_array = (is_array($_POST['q_id'])) ? $_POST['q_id'] : [];
485  if (!count($selected_array)) {
486  $this->tpl->setOnScreenMessage('info', $this->lng->txt('tst_insert_missing_question'), true);
487  $this->ctrl->redirect($this, 'browseForQuestions');
488  } else {
489  $manscoring = false;
490 
491  $test_question_set_config_factory = new ilTestQuestionSetConfigFactory(
492  $this->tree,
493  $this->db,
494  $this->lng,
495  $this->log,
496  $this->component_repository,
497  $this->test_object,
498  $this->questioninfo
499  );
500  $test_question_set_config = $test_question_set_config_factory->getQuestionSetConfig();
501 
502  foreach ($selected_array as $key => $value) {
503  $last_question_id = $this->test_object->insertQuestion($test_question_set_config, $value);
504 
505  if (!$manscoring) {
506  $manscoring = $manscoring | assQuestion::_needsManualScoring($value);
507  }
508  }
509  $this->test_object->saveCompleteStatus($test_question_set_config);
510  if ($manscoring) {
511  $this->tpl->setOnScreenMessage('info', $this->lng->txt('manscoring_hint'), true);
512  } else {
513  $this->tpl->setOnScreenMessage('success', $this->lng->txt('tst_questions_inserted'), true);
514  }
515 
516  $this->ctrl->setParameter($this, 'q_id', $last_question_id);
517  $this->ctrl->redirect($this, 'showPage');
518  return;
519  }
520  }
static _needsManualScoring(int $question_id)
string $key
Consumer key/client ID value.
Definition: System.php:193
+ Here is the call graph for this function:

◆ nextQuestion()

ilTestExpressPageObjectGUI::nextQuestion ( )

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

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

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

◆ prevQuestion()

ilTestExpressPageObjectGUI::prevQuestion ( )

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

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

66  {
67  $obj = new ilObjTest($this->testrequest->getRefId());
68  $questions = array_keys($obj->getQuestionTitlesAndIndexes());
69 
70  $pos = array_search($this->testrequest->raw('q_id'), $questions);
71 
72  if ($pos !== false) {
73  $next = $questions[$pos - 1];
74  } else {
75  $next = $questions[0];
76  }
77 
78  $this->ctrl->setParameter($this, 'q_id', $next);
79  $link = $this->ctrl->getLinkTarget($this, 'edit', '', '', false);
80 
82  }
ILIAS COPage Link LinkManager $link
static redirect(string $a_script)
+ Here is the call graph for this function:

◆ questions()

ilTestExpressPageObjectGUI::questions ( )

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

References ILIAS\Repository\ctrl().

445  {
446  $this->ctrl->saveParameterByClass('ilobjtestgui', 'q_id');
447  $this->ctrl->redirectByClass('ilobjtestgui', 'showPage');
448  }
+ Here is the call graph for this function:

◆ redirectToQuestionEditPage()

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

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

References ILIAS\Repository\ctrl().

Referenced by handleToolbarCommand().

451  {
452  $cmdClass = $questionType . 'GUI';
453 
454  $this->ctrl->setParameterByClass($cmdClass, 'ref_id', $this->testrequest->getRefId());
455  $this->ctrl->setParameterByClass($cmdClass, 'sel_question_types', $questionType);
456  $this->ctrl->setParameterByClass($cmdClass, 'test_ref_id', $this->testrequest->getRefId());
457  $this->ctrl->setParameterByClass($cmdClass, 'calling_test', $this->testrequest->getRefId());
458  $this->ctrl->setParameterByClass($cmdClass, 'q_id', $qid);
459  $this->ctrl->setParameterByClass($cmdClass, 'prev_qid', $prev_qid);
460 
461  if ($this->testrequest->raw('test_express_mode')) {
462  $this->ctrl->setParameterByClass($cmdClass, 'test_express_mode', 1);
463  }
464 
465  $this->ctrl->redirectByClass(
466  ['ilRepositoryGUI', 'ilObjTestGUI', $questionType . 'GUI'],
467  'editQuestion'
468  );
469  }
+ 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 471 of file class.ilTestExpressPageObjectGUI.php.

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

472  {
473  $this->ctrl->setParameterByClass('ilObjTestGUI', 'ref_id', $this->testrequest->getRefId());
474  $this->ctrl->setParameterByClass('ilObjTestGUI', 'q_id', $qid);
475  $this->ctrl->setParameterByClass('ilObjTestGUI', 'sel_question_types', $questionType);
476  $this->ctrl->setParameterByClass('ilObjTestGUI', 'prev_qid', $prev_qid);
477  $redir = $this->ctrl->getLinkTargetByClass('ilObjTestGUI', 'createQuestion', '', false, false);
478 
479  ilUtil::redirect($redir);
480  }
static redirect(string $a_script)
+ Here is the call graph for this function:

Field Documentation

◆ $component_repository

ilComponentRepository ilTestExpressPageObjectGUI::$component_repository
private

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

◆ $db

ilDBInterface ilTestExpressPageObjectGUI::$db
private

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

◆ $test_object

ilTestExpressPageObjectGUI::$test_object
protected

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

Referenced by __construct().

◆ $tree

ilTree ilTestExpressPageObjectGUI::$tree
private

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


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