ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilTestExpressPageObjectGUI Class Reference

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

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

Public Member Functions

 nextQuestion ()
 
 prevQuestion ()
 
 __construct ($a_id=0, $a_old_nr=0)
 
 executeCommand ()
 
 addPageOfQuestions ($type='')
 
 handleToolbarCommand ()
 
 addQuestion ()
 
 questions ()
 
 insertQuestions ()
 
- Public Member Functions inherited from ilAssQuestionPageGUI
 __construct ($a_id=0, $a_old_nr=0)
 Constructor. More...
 
 getOriginalPresentationTitle ()
 
 setOriginalPresentationTitle ($originalPresentationTitle)
 
 showPage ()
 
 postOutputProcessing ($output)
 
 setQuestionInfoHTML ($a_html)
 Set the HTML of a question info block below the title (number, status, ...) More...
 
 setQuestionActionsHTML ($a_html)
 Set the HTML of a question actions block below the title. More...
 
 insertPageToc ($a_output)
 Replace page toc placeholder with question info and actions. More...
 
- Public Member Functions inherited from ilPageObjectGUI
 __construct ( $a_parent_type, $a_id, $a_old_nr=0, $a_prevent_get_id=false, $a_lang="")
 Constructor. More...
 
 afterConstructor ()
 After constructor. More...
 
 setParentType ($a_val)
 Set parent type. More...
 
 getParentType ()
 Get parent type. More...
 
 setId ($a_val)
 Set ID. More...
 
 getId ()
 Get ID. More...
 
 setOldNr ($a_val)
 Set old nr (historic page) More...
 
 getOldNr ()
 Get old nr (historic page) More...
 
 setLanguage ($a_val)
 Set language. More...
 
 getLanguage ()
 Get language. More...
 
 setEnablePCType ($a_pc_type, $a_val)
 Set enable pc type. More...
 
 getEnablePCType ($a_pc_type)
 Get enable pc type. More...
 
 setPageConfig ($a_val)
 Set page config object. More...
 
 getPageConfig ()
 Get page config object. More...
 
 setPageObject (ilPageObject $a_pg_obj)
 Set Page Object. More...
 
 getPageObject ()
 Get Page Object. More...
 
 setOutputMode ($a_mode=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)
 Set sourcecode download script. More...
 
 getSourcecodeDownloadScript ()
 Get sourcecode download script. More...
 
 setLocator (&$a_locator)
 
 setTabs ($a_tabs)
 
 setPageBackTitle ($a_title)
 
 setFileDownloadLink ($a_download_link)
 Set file download link. More...
 
 getFileDownloadLink ()
 Get file download link. More...
 
 setFullscreenLink ($a_fullscreen_link)
 Set fullscreen link. More...
 
 getFullscreenLink ()
 Get fullscreen link. More...
 
 setIntLinkReturn ($a_return)
 
 enableChangeComments ($a_enabled)
 
 isEnabledChangeComments ()
 
 enableNotes ($a_enabled, $a_parent_id)
 
 isEnabledNotes ()
 
 setOfflineDirectory ($offdir)
 set offline directory to offdir More...
 
 getOfflineDirectory ()
 get offline directory More...
 
 setViewPageLink ($a_link, $a_target="")
 set link for "view page" button More...
 
 getViewPageLink ()
 get view page link More...
 
 getViewPageTarget ()
 get view page target frame More...
 
 getViewPageText ()
 get view page text More...
 
 setActivationListener (&$a_obj, $a_meth)
 
 setEnabledNews ($a_enabled, $a_news_obj_id=0, $a_news_obj_type=0)
 Set enabled news. More...
 
 getEnabledNews ()
 Get enabled news. More...
 
 setTabHook ($a_object, $a_function)
 Set tab hook. More...
 
 setEditPreview ($a_editpreview)
 Set Display first Edit tab, then Preview tab, instead of Page and Edit. More...
 
 getEditPreview ()
 Get Display first Edit tab, then Preview tab, instead of Page and Edit. More...
 
 setEnabledTabs ($a_enabledtabs)
 Set Output tabs. More...
 
 getEnabledTabs ()
 Get Output tabs. More...
 
 setEnabledPageFocus ($a_enabledpagefocus)
 Set Enable page focus. More...
 
 getEnabledPageFocus ()
 Get Enable page focus. More...
 
 setExplorerUpdater ($a_exp_frame, $a_exp_id, $a_exp_target_script)
 Set Explorer Updater. More...
 
 setPrependingHtml ($a_prependinghtml)
 Set Prepending HTML. More...
 
 getPrependingHtml ()
 Get Prepending HTML. More...
 
 setEnableEditing ($a_enableediting)
 Set Enable Editing. More...
 
 getEnableEditing ()
 Get Enable Editing. More...
 
 setRawPageContent ($a_rawpagecontent)
 Set Get raw page content only. More...
 
 getRawPageContent ()
 Get Get raw page content only. More...
 
 setStyleId ($a_styleid)
 Set Style Id. More...
 
 getStyleId ()
 Get Style Id. More...
 
 setCompareMode ($a_val)
 Set compare mode. More...
 
 getCompareMode ()
 Get compare mode. More...
 
 setAbstractOnly ($a_val)
 Set abstract only. More...
 
 getAbstractOnly ()
 Get abstract only. More...
 
 setRenderPageContainer ($a_val)
 Set render page container. More...
 
 getRenderPageContainer ()
 Get render page container. More...
 
 getDisabledText ()
 Get disabled text. More...
 
 activateMetaDataEditor ( $a_rep_obj, $a_type, $a_sub_obj_id, $a_observer_obj=null, $a_observer_func="")
 Activate meda data editor. More...
 
 determineFileDownloadLink ()
 Determine file download link. More...
 
 determineFullscreenLink ()
 Determine fullscreen link. More...
 
 determineSourcecodeDownloadScript ()
 Determine source code download script. More...
 
 getComponentPluginsXML ()
 Put information about activated plugins into XML. More...
 
 executeCommand ()
 execute command More...
 
 setQEditTabs ($a_active)
 Set question editing tabs. More...
 
 onFeedbackEditingForwarding ()
 On feedback editing forwarding. More...
 
 deactivatePage ()
 
 activatePage ()
 
 showPage ()
 display content of page More...
 
 replaceCurlyBrackets ($output)
 Replace curly brackets. More...
 
 addActionsMenu ($a_tpl, $sel_media_mode, $sel_html_mode, $sel_js_mode)
 Add actions menu. More...
 
 addMultiLangActionsAndInfo ($a_list, $a_tpl)
 Add multi-language actions to menu. More...
 
 setEditMode ()
 Set edit mode. More...
 
 setDefaultLinkXml ()
 Set standard link xml. More...
 
 getProfileBackUrl ()
 Get profile back url. More...
 
 downloadFile ()
 Download file of file lists. More...
 
 displayMediaFullscreen ()
 Show media in fullscreen mode. More...
 
 displayMedia ($a_fullscreen=false)
 Display media. More...
 
 download_paragraph ()
 download source code paragraph More...
 
 insertPageToc ($a_output)
 Insert page toc. More...
 
 insertResources ($a_output)
 Insert resources. More...
 
 insertAdvTrigger ($a_output)
 Insert adv content trigger. More...
 
 postOutputProcessing ($a_output)
 Finalizing output processing. More...
 
 insertHelp ($a_tpl)
 Insert help texts. More...
 
 previewHistory ()
 Preview history. More...
 
 preview ()
 preview More...
 
 edit ()
 edit ("view" before) More...
 
 insertJSAtPlaceholder ()
 InsertJS at placeholder. More...
 
 initCaptchaForm ()
 Init captcha form. More...
 
 presentation ($a_mode=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...
 
 getPagePermaLink ()
 Get page perma link. More...
 

Private Member Functions

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

Additional Inherited Members

- Static Public Member Functions inherited from ilPageObjectGUI
static getTinyMenu ( $a_par_type, $a_int_links=false, $a_wiki_links=false, $a_keywords=false, $a_style_id=0, $a_paragraph_styles=true, $a_save_return=true, $a_anchors=false, $a_save_new=true, $a_user_links=false)
 Get Tiny Menu. More...
 
- Data Fields inherited from ilAssQuestionPageGUI
const TEMP_PRESENTATION_TITLE_PLACEHOLDER = '___TEMP_PRESENTATION_TITLE_PLACEHOLDER___'
 
- Data Fields inherited from ilPageObjectGUI
 $obj
 
 $presentation_title
 
 $target_script
 
 $return_location
 
 $target_var
 
 $template_output_var
 
 $output2template
 
 $link_params
 
 $sourcecode_download_script
 
 $change_comments
 
 $question_html
 
 $activation = false
 
 $activated = true
 
 $editpreview = false
 
 $use_meta_data = false
 
 $link_xml_set = false
 
 $enableediting = true
 
 $rawpagecontent = false
 
 $enabledcontentincludes = false
 
 $compare_mode = false
 
 $page_config = null
 
 $tabs_enabled = true
 
 $render_page_container = false
 
 $pl_start = "{{{{{"
 
 $pl_end = "}}}}}"
 
- Protected Member Functions inherited from ilAssQuestionPageGUI
 isPageContainerToBeRendered ()
 
- Protected Member Functions inherited from ilPageObjectGUI
 initPageObject ()
 Init page object. More...
 
 getActivationCaptions ()
 Get captions for activation action menu entries. More...
 
 isPageContainerToBeRendered ()
 
- Protected Attributes inherited from ilPageObjectGUI
 $tpl
 
 $lng
 
 $ctrl
 
 $tabs_gui
 
 $access
 
 $plugin_admin
 
 $log
 
 $user
 
 $help
 
 $output_mode
 
 $parent_type = ""
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

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

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

65  {
66  parent::__construct($a_id, $a_old_nr);
67  }

Member Function Documentation

◆ addPageOfQuestions()

ilTestExpressPageObjectGUI::addPageOfQuestions (   $type = '')

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

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

Referenced by executeCommand().

198  {
199  global $ilCtrl;
200 
201  if (!$type) {
202  $qtype = $_REQUEST['qtype'];
203  $pool = new ilObjQuestionPool();
205  }
206 
207  $this->ctrl->setReturn($this, "questions");
208 
209  include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
211 
213 
214  $q_gui->object->setObjId($obj->getId());
215 
216  return $q_gui;
217  }
$type
$_GET["client_id"]
static getQuestionTypeByTypeId($type_id)
global $ilCtrl
Definition: ilias.php:18
static _getQuestionGUI($question_type, $question_id=-1)
Creates a question gui representation and returns the alias to the question gui note: please do not u...
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addQuestion()

ilTestExpressPageObjectGUI::addQuestion ( )

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

References $data, $DIC, $form, $ilCtrl, $key, ilPageObjectGUI\$lng, $name, $options, $si, $title, ilPageObjectGUI\$tpl, ilObjQuestionPool\_getAvailableQuestionpools(), assQuestion\ADDITIONAL_CONTENT_EDITING_MODE_DEFAULT, assQuestion\ADDITIONAL_CONTENT_EDITING_MODE_PAGE_OBJECT, ilRadioGroupInputGUI\addOption(), array, ilObjAssessmentFolder\isAdditionalQuestionContentEditingModePageObjectEnabled(), ilSelectInputGUI\setOptions(), and ilFormPropertyGUI\setRequired().

314  {
315  global $lng, $ilCtrl, $tpl;
316  global $DIC; /* @var \ILIAS\DI\Container $DIC */
317  $ilHelp = $DIC['ilHelp']; /* @var ilHelpGUI $ilHelp */
318 
319  $subScreenId = array('createQuestion');
320 
321  include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
322 
323  $ilCtrl->setParameter($this, 'qtype', $_REQUEST['qtype']);
324 
325  $form = new ilPropertyFormGUI();
326 
327  $ilCtrl->setParameter($this, 'test_express_mode', 1);
328 
329  $form->setFormAction($ilCtrl->getFormAction($this, "handleToolbarCommand"));
330  $form->setTitle($lng->txt("ass_create_question"));
331  include_once 'Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php';
332 
333  $pool = new ilObjQuestionPool();
334  $questionTypes = $pool->getQuestionTypes(false, true);
335  $options = array();
336 
337  // question type
338  foreach ($questionTypes as $label => $data) {
339  $options[$data['question_type_id']] = $label;
340  }
341 
342  include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
343  $si = new ilSelectInputGUI($lng->txt("question_type"), "qtype");
344  $si->setOptions($options);
345  $form->addItem($si, true);
346 
347  // position
348  $questions = $this->test_object->getQuestionTitlesAndIndexes();
349  if ($questions) {
350  $si = new ilSelectInputGUI($lng->txt("position"), "position");
351  $options = array('0' => $lng->txt('first'));
352  foreach ($questions as $key => $title) {
353  $options[$key] = $lng->txt('behind') . ' ' . $title . ' [' . $this->lng->txt('question_id_short') . ': ' . $key . ']';
354  }
355  $si->setOptions($options);
356  $si->setValue($_REQUEST['q_id']);
357  $form->addItem($si, true);
358  }
359 
360  // content editing mode
362  $subScreenId[] = 'editMode';
363 
364  $ri = new ilRadioGroupInputGUI($lng->txt("tst_add_quest_cont_edit_mode"), "add_quest_cont_edit_mode");
365 
366  $ri->addOption(new ilRadioOption(
367  $lng->txt('tst_add_quest_cont_edit_mode_default'),
369  ));
370 
371  $ri->addOption(new ilRadioOption(
372  $lng->txt('tst_add_quest_cont_edit_mode_page_object'),
374  ));
375 
377 
378  $form->addItem($ri, true);
379  } else {
380  $hi = new ilHiddenInputGUI("question_content_editing_type");
382  $form->addItem($hi, true);
383  }
384 
385  if ($this->test_object->getPoolUsage()) {
386  $subScreenId[] = 'poolSelect';
387 
388  // use pool
389  $usage = new ilRadioGroupInputGUI($this->lng->txt("assessment_pool_selection"), "usage");
390  $usage->setRequired(true);
391  $no_pool = new ilRadioOption($this->lng->txt("assessment_no_pool"), 1);
392  $usage->addOption($no_pool);
393  $existing_pool = new ilRadioOption($this->lng->txt("assessment_existing_pool"), 3);
394  $usage->addOption($existing_pool);
395  $new_pool = new ilRadioOption($this->lng->txt("assessment_new_pool"), 2);
396  $usage->addOption($new_pool);
397  $form->addItem($usage);
398 
399  $usage->setValue(1);
400 
401  $questionpools = ilObjQuestionPool::_getAvailableQuestionpools(false, false, true, false, false, "write");
402  $pools_data = array();
403  foreach ($questionpools as $key => $p) {
404  $pools_data[$key] = $p['title'];
405  }
406  $pools = new ilSelectInputGUI($this->lng->txt("select_questionpool"), "sel_qpl");
407  $pools->setOptions($pools_data);
408  $existing_pool->addSubItem($pools);
409 
410  $name = new ilTextInputGUI($this->lng->txt("name"), "txt_qpl");
411  $name->setSize(50);
412  $name->setMaxLength(50);
413  $new_pool->addSubItem($name);
414  }
415 
416  $form->addCommandButton("handleToolbarCommand", $lng->txt("create"));
417  $form->addCommandButton("questions", $lng->txt("cancel"));
418 
419  $ilHelp->setSubScreenId(implode('_', $subScreenId));
420 
421  return $tpl->setContent($form->getHTML());
422  }
This class represents an option in a radio group.
static _getAvailableQuestionpools($use_object_id=false, $equal_points=false, $could_be_offline=false, $showPath=false, $with_questioncount=false, $permission="read", $usr_id="")
Returns the available question pools for the active user.
This class represents a selection list property in a property form.
This class represents a property form user interface.
global $DIC
Definition: saml.php:7
const ADDITIONAL_CONTENT_EDITING_MODE_PAGE_OBJECT
constant for additional content editing mode "pageobject"
global $ilCtrl
Definition: ilias.php:18
This class represents a hidden form property in a property form.
if($format !==null) $name
Definition: metadata.php:146
This class represents a property in a property form.
addOption($a_option)
Add Option.
if(isset($_POST['submit'])) $form
This class represents a text property in a property form.
setOptions($a_options)
Set Options.
Create styles array
The data for the language used.
const ADDITIONAL_CONTENT_EDITING_MODE_DEFAULT
constant for additional content editing mode "default"
static isAdditionalQuestionContentEditingModePageObjectEnabled()
returns the fact wether content editing with ilias page editor is enabled for questions or not ...
$key
Definition: croninfo.php:18
setRequired($a_required)
Set Required.
if(!isset($_REQUEST['ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options
Definition: as_login.php:20
+ Here is the call graph for this function:

◆ executeCommand()

ilTestExpressPageObjectGUI::executeCommand ( )

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

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

70  {
71  global $ilCtrl, $ilTabs, $ilUser, $lng;
72 
73  $next_class = $this->ctrl->getNextClass($this);
74  $cmd = $this->ctrl->getCmd();
75 
76  switch ($next_class) {
77  case 'ilobjquestionpoolgui':
78 
79  $nodeParts = explode(':', $_GET['cmdNode']);
80 
81  $params = array(
82  'ref_id' => $_GET['ref_id'],
83  'calling_test' => $_GET['ref_id'],
84  'q_id' => $_GET['q_id'],
85  'cmd' => $_GET['cmd'],
86  'cmdClass' => $_GET['cmdClass'],
87  'baseClass' => 'ilObjQuestionPoolGUI',
88  'test_express_mode' => '1'
89  );
90 
93  '?' . http_build_query($params, null, '&'),
94  'cmdNode=' . ($nodeParts[count($nodeParts) - 2] . ':' . $nodeParts[count($nodeParts) - 1])
95  )
96  );
97 
98  break;
99 
100  case "ilpageeditorgui":
101 
102  if (!$this->getEnableEditing()) {
103  ilUtil::sendFailure($lng->txt("permission_denied"), true);
104  $ilCtrl->redirect($this, "preview");
105  }
106 
107  $page_editor = new ilPageEditorGUI($this->getPageObject(), $this);
108  $page_editor->setLocator($this->locator);
109  $page_editor->setHeader($this->getHeader());
110  $page_editor->setPageBackTitle($this->page_back_title);
111  $page_editor->setIntLinkReturn($this->int_link_return);
112 
113  $this->ctrl->saveParameterByClass('ilpageeditorgui', 'q_mode');
114 
115  $ret = &$this->ctrl->forwardCommand($page_editor);
116 
117  break;
118 
119  case '':
120  case 'iltestexpresspageobjectgui':
121 
122  include_once 'Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
123 
124  if ($cmd == 'view') {
125  $cmd = 'showPage';
126  $ilCtrl->setCmd($cmd);
127  }
128 
129  $q_gui = assQuestionGUI::_getQuestionGUI('', (int) $_REQUEST["q_id"]);
130 
131  if ($q_gui->object) {
132  $obj = ilObjectFactory::getInstanceByRefId((int) $_REQUEST['ref_id']);
133  $q_gui->object->setObjId($obj->getId());
134  }
135 
136  $cmds = array(
137  'handleToolbarCommand',
138  'addQuestion',
139  'questions',
140  'insertQuestions',
141  'browseForQuestions',
142  'filterAvailableQuestions',
143  'resetfilterAvailableQuestions'
144  );
145 
146  if (in_array($cmd, $cmds)) {
147  return $this->$cmd();
148  } elseif ($q_gui->object) {
149  $total = $this->test_object->evalTotalPersons();
150 
152 
153  if ($total != 0) {
154  $link = $ilCtrl->getLinkTargetByClass('ilobjtestgui', "participants");
155  $link = "<a href=\"" . $link . "\">" . $lng->txt("test_has_datasets_warning_page_view_link") . "</a>";
156  ilUtil::sendInfo($lng->txt("test_has_datasets_warning_page_view") . " " . $link);
157  }
158 
159  if ((in_array($cmd, array('view', 'showPage')) || $cmd == 'edit') && $this->test_object->evalTotalPersons()) {
160  return $this->showPage();
161  }
162 
163  return parent::executeCommand();
164  }
165 
166  break;
167 
168  default:
170 
171  if (!$_GET['q_id']) {
172  $q_gui = $this->addPageOfQuestions(preg_replace('/(.*?)gui/i', '$1', $_GET['sel_question_types']));
173  $q_gui->setQuestionTabs();
174 
175  $this->ctrl->forwardCommand($q_gui);
176  break;
177  }
178 
179  $this->ctrl->setReturn($this, "questions");
180 
181  require_once 'Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
182  $q_gui = assQuestionGUI::_getQuestionGUI($type, (int) $_GET['q_id']);
183  if ($q_gui->object) {
185  $q_gui->object->setObjId($obj->getId());
186  }
187 
188  $this->ctrl->saveParameterByClass('ilpageeditorgui', 'q_id');
189  $this->ctrl->saveParameterByClass('ilpageeditorgui', 'q_mode');
190 
191  $q_gui->setQuestionTabs();
192  $this->ctrl->forwardCommand($q_gui);
193  break;
194  }
195  }
$params
Definition: disable.php:11
const IL_PAGE_PREVIEW
getPageObject()
Get Page Object.
$type
$_GET["client_id"]
static getQuestionTypeByTypeId($type_id)
$total
Definition: Utf8Test.php:87
Page Editor GUI class.
global $ilCtrl
Definition: ilias.php:18
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static appendUrlParameterString($a_url, $a_par, $xml_style=false)
append URL parameter string ("par1=value1&par2=value2...") to given URL string
static _getQuestionGUI($question_type, $question_id=-1)
Creates a question gui representation and returns the alias to the question gui note: please do not u...
getEnableEditing()
Get Enable Editing.
$ilUser
Definition: imgupload.php:18
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
const IL_PAGE_EDIT
Create styles array
The data for the language used.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$ret
Definition: parser.php:6
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
static redirect($a_script)
setOutputMode($a_mode=IL_PAGE_PRESENTATION)
Set Output Mode.
+ Here is the call graph for this function:

◆ handleToolbarCommand()

ilTestExpressPageObjectGUI::handleToolbarCommand ( )

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

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

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

◆ insertQuestions()

ilTestExpressPageObjectGUI::insertQuestions ( )

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

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

466  {
467  $selected_array = (is_array($_POST['q_id'])) ? $_POST['q_id'] : array();
468  if (!count($selected_array)) {
469  ilUtil::sendInfo($this->lng->txt("tst_insert_missing_question"), true);
470  $this->ctrl->redirect($this, "browseForQuestions");
471  } else {
472  include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
473  $manscoring = false;
474 
475  global $tree, $ilDB, $ilPluginAdmin;
476 
477  require_once 'Modules/Test/classes/class.ilTestQuestionSetConfigFactory.php';
478  $testQuestionSetConfigFactory = new ilTestQuestionSetConfigFactory($tree, $ilDB, $ilPluginAdmin, $this->test_object);
479  $testQuestionSetConfig = $testQuestionSetConfigFactory->getQuestionSetConfig();
480 
481  foreach ($selected_array as $key => $value) {
482  $last_question_id = $this->test_object->insertQuestion($testQuestionSetConfig, $value);
483 
484  if (!$manscoring) {
485  $manscoring = $manscoring | assQuestion::_needsManualScoring($value);
486  }
487  }
488  $this->test_object->saveCompleteStatus($testQuestionSetConfig);
489  if ($manscoring) {
490  ilUtil::sendInfo($this->lng->txt("manscoring_hint"), true);
491  } else {
492  ilUtil::sendSuccess($this->lng->txt("tst_questions_inserted"), true);
493  }
494 
495  $this->ctrl->setParameter($this, 'q_id', $last_question_id);
496  $this->ctrl->redirect($this, "showPage");
497  return;
498  }
499  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static _needsManualScoring($question_id)
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
Create styles array
The data for the language used.
global $ilDB
$key
Definition: croninfo.php:18
$_POST["username"]
+ Here is the call graph for this function:

◆ nextQuestion()

ilTestExpressPageObjectGUI::nextQuestion ( )

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

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

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

◆ prevQuestion()

ilTestExpressPageObjectGUI::prevQuestion ( )

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

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

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

◆ questions()

ilTestExpressPageObjectGUI::questions ( )

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

References $ilCtrl.

425  {
426  global $ilCtrl;
427 
428  $ilCtrl->saveParameterByClass('ilobjtestgui', 'q_id');
429 
430  $ilCtrl->redirectByClass('ilobjtestgui', 'showPage');
431  }
global $ilCtrl
Definition: ilias.php:18

◆ redirectToQuestionEditPage()

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

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

References $_GET, and array.

Referenced by handleToolbarCommand().

434  {
435  $cmdClass = $questionType . 'GUI';
436 
437  $this->ctrl->setParameterByClass($cmdClass, 'ref_id', $_GET['ref_id']);
438  $this->ctrl->setParameterByClass($cmdClass, 'sel_question_types', $questionType);
439  $this->ctrl->setParameterByClass($cmdClass, 'test_ref_id', $_GET['ref_id']);
440  $this->ctrl->setParameterByClass($cmdClass, 'calling_test', $_GET['ref_id']);
441  $this->ctrl->setParameterByClass($cmdClass, 'q_id', $qid);
442  $this->ctrl->setParameterByClass($cmdClass, 'prev_qid', $prev_qid);
443 
444  if ($_REQUEST['test_express_mode']) {
445  $this->ctrl->setParameterByClass($cmdClass, 'test_express_mode', 1);
446  }
447 
448  $this->ctrl->redirectByClass(
449  array('ilRepositoryGUI', 'ilObjTestGUI', $questionType . "GUI"),
450  'editQuestion'
451  );
452  }
$_GET["client_id"]
Create styles array
The data for the language used.
+ Here is the caller graph for this function:

◆ redirectToQuestionPoolSelectionPage()

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

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

References ilUtil\redirect().

455  {
456  $this->ctrl->setParameterByClass('ilObjTestGUI', 'ref_id', $_REQUEST['ref_id']);
457  $this->ctrl->setParameterByClass('ilObjTestGUI', 'q_id', $qid);
458  $this->ctrl->setParameterByClass('ilObjTestGUI', 'sel_question_types', $questionType);
459  $this->ctrl->setParameterByClass('ilObjTestGUI', 'prev_qid', $prev_qid);
460  $redir = $this->ctrl->getLinkTargetByClass('ilObjTestGUI', 'createQuestion', '', false, false);
461 
462  ilUtil::redirect($redir);
463  }
static redirect($a_script)
+ Here is the call graph for this function:

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