ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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...
 
 setBibId ($a_id)
 Set Bib Id. More...
 
 getBibId ()
 Get Bib Id. More...
 
 setPageObject ($a_pg_obj)
 Set Page Object. More...
 
 getPageObject ()
 Get Page Object. More...
 
 setOutputMode ($a_mode=IL_PAGE_PRESENTATION)
 Set Output Mode. More...
 
 getOutputMode ()
 
 setTemplateOutput ($a_output=true)
 
 outputToTemplate ()
 
 setPresentationTitle ($a_title="")
 
 getPresentationTitle ()
 
 setHeader ($a_title="")
 
 getHeader ()
 
 setLinkParams ($l_params="")
 
 getLinkParams ()
 
 setLinkFrame ($l_frame="")
 
 getLinkFrame ()
 
 setLinkXML ($link_xml)
 
 getLinkXML ()
 
 setQuestionXML ($question_xml)
 
 setQuestionHTML ($question_html)
 
 getQuestionXML ()
 
 getQuestionHTML ()
 
 setTemplateTargetVar ($a_variable)
 
 getTemplateTargetVar ()
 
 setTemplateOutputVar ($a_value)
 
 getTemplateOutputVar ()
 
 setSourcecodeDownloadScript ($script_name)
 Set sourcecode download script. More...
 
 getSourcecodeDownloadScript ()
 Get sourcecode download script. More...
 
 enableCitation ($a_enabled)
 
 isEnabledCitation ()
 
 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...
 
 setActivationListener (&$a_obj, $a_meth)
 
 setEnabledNews ($a_enabled, $a_news_obj_id=0, $a_news_obj_type=0)
 Set enabled news. More...
 
 getEnabledNews ()
 Get enabled news. More...
 
 setTabHook ($a_object, $a_function)
 Set tab hook. More...
 
 setEditPreview ($a_editpreview)
 Set Display first Edit tab, then Preview tab, instead of Page and Edit. More...
 
 getEditPreview ()
 Get Display first Edit tab, then Preview tab, instead of Page and Edit. More...
 
 setEnabledTabs ($a_enabledtabs)
 Set Output tabs. More...
 
 getEnabledTabs ()
 Get Output tabs. More...
 
 setEnabledPageFocus ($a_enabledpagefocus)
 Set Enable page focus. More...
 
 getEnabledPageFocus ()
 Get Enable page focus. More...
 
 setExplorerUpdater ($a_exp_frame, $a_exp_id, $a_exp_target_script)
 Set Explorer Updater. More...
 
 setPrependingHtml ($a_prependinghtml)
 Set Prepending HTML. More...
 
 getPrependingHtml ()
 Get Prepending HTML. More...
 
 setEnableEditing ($a_enableediting)
 Set Enable Editing. More...
 
 getEnableEditing ()
 Get Enable Editing. More...
 
 setRawPageContent ($a_rawpagecontent)
 Set Get raw page content only. More...
 
 getRawPageContent ()
 Get Get raw page content only. More...
 
 setStyleId ($a_styleid)
 Set Style Id. More...
 
 getStyleId ()
 Get Style Id. More...
 
 setCompareMode ($a_val)
 Set compare mode. More...
 
 getCompareMode ()
 Get compare mode. More...
 
 setAbstractOnly ($a_val)
 Set abstract only. More...
 
 getAbstractOnly ()
 Get abstract only. More...
 
 setRenderPageContainer ($a_val)
 Set render page container. More...
 
 getRenderPageContainer ()
 Get render page container. More...
 
 activateMetaDataEditor ($a_rep_obj, $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...
 
 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...
 
 presentation ($a_mode=IL_PAGE_PRESENTATION)
 
 getHTML ()
 
 showMediaFullscreen ($a_style_id=0)
 show fullscreen view of media object More...
 
 displayValidationError ($a_error)
 display validation error More...
 
 history ()
 Get history table as HTML. More...
 
 rollbackConfirmation ()
 Rollback confirmation. More...
 
 rollback ()
 Rollback to a previous version. More...
 
 setScreenIdComponent ()
 Set screen id component. More...
 
 getTabs ($a_activate="")
 adds tabs to tab gui object More...
 
 compareVersion ()
 Compares two revisions of the page. More...
 
 replaceDiffTags ($a_html)
 
 editActivation ()
 Edit activation (only, if scheduled page activation is activated in administration) More...
 
 initActivationForm ()
 Init activation form. More...
 
 getActivationFormValues ()
 Get values for activation form. More...
 
 saveActivation ()
 Save Activation. More...
 
 getNotesHTML ($a_content_object=null, $a_enable_private_notes=true, $a_enable_public_notes=false, $a_enable_notes_deletion=false, $a_callback=null)
 Get html for public and/or private notes. More...
 
 processAnswer ()
 Process answer. More...
 
 initialOpenedContent ()
 Initially opened content. More...
 
 initOpenedContentForm ()
 Init form for initially opened content. More...
 
 saveInitialOpenedContent ()
 Save initial opened content. More...
 
 switchToLanguage ()
 Switch to language. More...
 
 confirmPageTranslationCreation ()
 Confirm page translation creation. More...
 
 editMasterLanguage ()
 Edit master language. More...
 
 createPageTranslation ()
 Create page translation. More...
 
 releasePageLock ()
 Release page lock. More...
 

Private Member Functions

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

Additional Inherited Members

- Static Public Member Functions inherited from ilPageObjectGUI
static getTinyMenu ($a_par_type, $a_int_links=false, $a_wiki_links=false, $a_keywords=false, $a_style_id=0, $a_paragraph_styles=true, $a_save_return=true, $a_anchors=false, $a_save_new=true, $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
 $tpl
 
 $lng
 
 $ctrl
 
 $obj
 
 $output_mode
 
 $presentation_title
 
 $target_script
 
 $return_location
 
 $target_var
 
 $template_output_var
 
 $output2template
 
 $link_params
 
 $bib_id
 
 $citation
 
 $sourcecode_download_script
 
 $change_comments
 
 $question_html
 
 $activation = false
 
 $activated = true
 
 $editpreview = false
 
 $use_meta_data = false
 
 $link_xml_set = false
 
 $enableediting = true
 
 $rawpagecontent = false
 
 $enabledcontentincludes = false
 
 $compare_mode = false
 
 $page_config = null
 
 $tabs_enabled = true
 
 $render_page_container = false
 
 $pl_start = "{{{{{"
 
 $pl_end = "}}}}}"
 
- Protected Member Functions inherited from ilAssQuestionPageGUI
 isPageContainerToBeRendered ()
 
- Protected Member Functions inherited from ilPageObjectGUI
 initPageObject ()
 Init page object. More...
 
 getActivationCaptions ()
 Get captions for activation action menu entries. More...
 
 isPageContainerToBeRendered ()
 
- Protected Attributes inherited from ilPageObjectGUI
 $parent_type = ""
 
 $log
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

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

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

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

Member Function Documentation

◆ addPageOfQuestions()

ilTestExpressPageObjectGUI::addPageOfQuestions (   $type = '')

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

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

Referenced by executeCommand().

214  {
215  global $ilCtrl;
216 
217  if( !$type )
218  {
219  $qtype = $_REQUEST['qtype'];
220  $pool = new ilObjQuestionPool();
222  }
223 
224  $this->ctrl->setReturn($this, "questions");
225 
226  include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
227  $q_gui = & assQuestionGUI::_getQuestionGUI($type);
228 
230 
231  $q_gui->object->setObjId($obj->getId());
232 
233  return $q_gui;
234  }
$_GET["client_id"]
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 337 of file class.ilTestExpressPageObjectGUI.php.

References $data, $DIC, $ilCtrl, ilPageObjectGUI\$lng, $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(), ilFormPropertyGUI\setRequired(), ilTextInputGUI\setSize(), and ilRadioOption\setValue().

338  {
339  global $lng, $ilCtrl, $tpl;
340  global $DIC; /* @var \ILIAS\DI\Container $DIC */
341  $ilHelp = $DIC['ilHelp']; /* @var ilHelpGUI $ilHelp */
342 
343  $subScreenId = array('createQuestion');
344 
345  include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
346 
347  $ilCtrl->setParameter($this, 'qtype', $_REQUEST['qtype']);
348 
349  $form = new ilPropertyFormGUI();
350 
351  $ilCtrl->setParameter($this, 'test_express_mode', 1);
352 
353  $form->setFormAction($ilCtrl->getFormAction($this, "handleToolbarCommand"));
354  $form->setTitle($lng->txt("ass_create_question"));
355  include_once 'Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php';
356 
357  $pool = new ilObjQuestionPool();
358  $questionTypes = $pool->getQuestionTypes(false, true);
359  $options = array();
360 
361  // question type
362  foreach($questionTypes as $label => $data)
363  {
364  $options[$data['question_type_id']] = $label;
365  }
366 
367  include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
368  $si = new ilSelectInputGUI($lng->txt("question_type"), "qtype");
369  $si->setOptions($options);
370  $form->addItem($si, true);
371 
372  // position
373  $questions = $this->test_object->getQuestionTitlesAndIndexes();
374  if($questions)
375  {
376  $si = new ilSelectInputGUI($lng->txt("position"), "position");
377  $options = array('0' => $lng->txt('first'));
378  foreach($questions as $key => $title)
379  {
380  $options[$key] = $lng->txt('behind') . ' '. $title . ' ['.$this->lng->txt('question_id_short') . ': '. $key .']';
381  }
382  $si->setOptions($options);
383  $si->setValue($_REQUEST['q_id']);
384  $form->addItem($si, true);
385  }
386 
387  // content editing mode
389  {
390  $subScreenId[] = 'editMode';
391 
392  $ri = new ilRadioGroupInputGUI($lng->txt("tst_add_quest_cont_edit_mode"), "add_quest_cont_edit_mode");
393 
394  $ri->addOption(new ilRadioOption(
395  $lng->txt('tst_add_quest_cont_edit_mode_default'),
397  ));
398 
399  $ri->addOption(new ilRadioOption(
400  $lng->txt('tst_add_quest_cont_edit_mode_page_object'),
402  ));
403 
405 
406  $form->addItem($ri, true);
407  }
408  else
409  {
410  $hi = new ilHiddenInputGUI("question_content_editing_type");
412  $form->addItem($hi, true);
413  }
414 
415  if($this->test_object->getPoolUsage())
416  {
417  $subScreenId[] = 'poolSelect';
418 
419  // use pool
420  $usage = new ilRadioGroupInputGUI($this->lng->txt("assessment_pool_selection"), "usage");
421  $usage->setRequired(true);
422  $no_pool = new ilRadioOption($this->lng->txt("assessment_no_pool"), 1);
423  $usage->addOption($no_pool);
424  $existing_pool = new ilRadioOption($this->lng->txt("assessment_existing_pool"), 3);
425  $usage->addOption($existing_pool);
426  $new_pool = new ilRadioOption($this->lng->txt("assessment_new_pool"), 2);
427  $usage->addOption($new_pool);
428  $form->addItem($usage);
429 
430  $usage->setValue(1);
431 
432  $questionpools = ilObjQuestionPool::_getAvailableQuestionpools(FALSE, FALSE, TRUE, FALSE, FALSE, "write");
433  $pools_data = array();
434  foreach($questionpools as $key => $p)
435  {
436  $pools_data[$key] = $p['title'];
437  }
438  $pools = new ilSelectInputGUI($this->lng->txt("select_questionpool"), "sel_qpl");
439  $pools->setOptions($pools_data);
440  $existing_pool->addSubItem($pools);
441 
442  $name = new ilTextInputGUI($this->lng->txt("name"), "txt_qpl");
443  $name->setSize(50);
444  $name->setMaxLength(50);
445  $new_pool->addSubItem($name);
446  }
447 
448  $form->addCommandButton("handleToolbarCommand", $lng->txt("create"));
449  $form->addCommandButton("questions", $lng->txt("cancel"));
450 
451  $ilHelp->setSubScreenId(implode('_', $subScreenId));
452 
453  return $tpl->setContent($form->getHTML());
454  }
This class represents an option in a radio group.
This class represents a selection list property in a property form.
This class represents a property form user interface.
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.
This class represents a property in a property form.
addOption($a_option)
Add Option.
setValue($a_value)
Set Value.
if(!is_array($argv)) $options
setSize($a_size)
Set Size.
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 ...
global $DIC
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.
setRequired($a_required)
Set Required.
+ Here is the call graph for this function:

◆ executeCommand()

ilTestExpressPageObjectGUI::executeCommand ( )

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

References $_GET, $cmd, $ilCtrl, $ilUser, ilPageObjectGUI\$lng, ilPageObjectGUI\$obj, $params, $ret, $total, 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().

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

◆ handleToolbarCommand()

ilTestExpressPageObjectGUI::handleToolbarCommand ( )

Definition at line 236 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().

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

◆ insertQuestions()

ilTestExpressPageObjectGUI::insertQuestions ( )

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

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

498  {
499  $selected_array = (is_array($_POST['q_id'])) ? $_POST['q_id'] : array();
500  if (!count($selected_array))
501  {
502  ilUtil::sendInfo($this->lng->txt("tst_insert_missing_question"), true);
503  $this->ctrl->redirect($this, "browseForQuestions");
504  }
505  else
506  {
507  include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
508  $manscoring = FALSE;
509 
510  global $tree, $ilDB, $ilPluginAdmin;
511 
512  require_once 'Modules/Test/classes/class.ilTestQuestionSetConfigFactory.php';
513  $testQuestionSetConfigFactory = new ilTestQuestionSetConfigFactory($tree, $ilDB, $ilPluginAdmin, $this->test_object);
514  $testQuestionSetConfig = $testQuestionSetConfigFactory->getQuestionSetConfig();
515 
516  foreach ($selected_array as $key => $value)
517  {
518  $last_question_id = $this->test_object->insertQuestion( $testQuestionSetConfig, $value );
519 
520  if (!$manscoring)
521  {
522  $manscoring = $manscoring | assQuestion::_needsManualScoring($value);
523  }
524  }
525  $this->test_object->saveCompleteStatus( $testQuestionSetConfig );
526  if ($manscoring)
527  {
528  ilUtil::sendInfo($this->lng->txt("manscoring_hint"), TRUE);
529  }
530  else
531  {
532  ilUtil::sendSuccess($this->lng->txt("tst_questions_inserted"), TRUE);
533  }
534 
535  $this->ctrl->setParameter($this, 'q_id', $last_question_id);
536  $this->ctrl->redirect($this, "showPage");
537  return;
538  }
539  }
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
$_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  {
35  $next = $questions[$pos + 1];
36  }
37  else
38  {
39  $next = $questions[0];
40  }
41 
42  $this->ctrl->setParameter($this, 'q_id', $next);
43  $link = $this->ctrl->getLinkTarget($this, 'edit', '', '', false);
44 
45  ilUtil::redirect($link);
46  }
static redirect($a_script)
http redirect to other script
+ Here is the call graph for this function:

◆ prevQuestion()

ilTestExpressPageObjectGUI::prevQuestion ( )

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

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

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

◆ questions()

ilTestExpressPageObjectGUI::questions ( )

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

References $ilCtrl.

457  {
458  global $ilCtrl;
459 
460  $ilCtrl->saveParameterByClass('ilobjtestgui', 'q_id');
461 
462  $ilCtrl->redirectByClass('ilobjtestgui', 'showPage');
463  }
global $ilCtrl
Definition: ilias.php:18

◆ redirectToQuestionEditPage()

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

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

References $_GET, and array.

Referenced by handleToolbarCommand().

466  {
467  $cmdClass = $questionType.'GUI';
468 
469  $this->ctrl->setParameterByClass($cmdClass, 'ref_id', $_GET['ref_id']);
470  $this->ctrl->setParameterByClass($cmdClass, 'sel_question_types', $questionType);
471  $this->ctrl->setParameterByClass($cmdClass, 'test_ref_id', $_GET['ref_id']);
472  $this->ctrl->setParameterByClass($cmdClass, 'calling_test', $_GET['ref_id']);
473  $this->ctrl->setParameterByClass($cmdClass, 'q_id', $qid);
474  $this->ctrl->setParameterByClass($cmdClass, 'prev_qid', $prev_qid);
475 
476  if ($_REQUEST['test_express_mode'])
477  {
478  $this->ctrl->setParameterByClass($cmdClass, 'test_express_mode', 1);
479  }
480 
481  $this->ctrl->redirectByClass(
482  array('ilRepositoryGUI', 'ilObjTestGUI', $questionType."GUI"), 'editQuestion'
483  );
484  }
$_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 486 of file class.ilTestExpressPageObjectGUI.php.

References ilUtil\redirect().

487  {
488  $this->ctrl->setParameterByClass('ilObjTestGUI', 'ref_id', $_REQUEST['ref_id']);
489  $this->ctrl->setParameterByClass('ilObjTestGUI', 'q_id', $qid);
490  $this->ctrl->setParameterByClass('ilObjTestGUI', 'sel_question_types', $questionType);
491  $this->ctrl->setParameterByClass('ilObjTestGUI', 'prev_qid', $prev_qid);
492  $redir = $this->ctrl->getLinkTargetByClass('ilObjTestGUI', 'createQuestion', '', false, false);
493 
494  ilUtil::redirect($redir);
495  }
static redirect($a_script)
http redirect to other script
+ Here is the call graph for this function:

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