ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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)
 
- Public Member Functions inherited from ilPageObjectGUI
 ilPageObjectGUI ($a_parent_type, $a_id, $a_old_nr=0, $a_prevent_get_id=false, $a_lang="")
 Constructor. More...
 
 afterConstructor ()
 After constructor. More...
 
 setParentType ($a_val)
 Set parent type. More...
 
 getParentType ()
 Get parent type. More...
 
 setId ($a_val)
 Set ID. More...
 
 getId ()
 Get ID. More...
 
 setOldNr ($a_val)
 Set old nr (historic page) More...
 
 getOldNr ()
 Get old nr (historic page) More...
 
 setLanguage ($a_val)
 Set language. More...
 
 getLanguage ()
 Get language. More...
 
 setEnablePCType ($a_pc_type, $a_val)
 Set enable pc type. More...
 
 getEnablePCType ($a_pc_type)
 Get enable pc type. More...
 
 setPageConfig ($a_val)
 Set page config object. More...
 
 getPageConfig ()
 Get page config object. More...
 
 setBibId ($a_id)
 Set Bib Id. More...
 
 getBibId ()
 Get Bib Id. More...
 
 setPageObject ($a_pg_obj)
 Set Page Object. More...
 
 getPageObject ()
 Get Page Object. More...
 
 setOutputMode ($a_mode=IL_PAGE_PRESENTATION)
 Set Output Mode. More...
 
 getOutputMode ()
 
 setTemplateOutput ($a_output=true)
 
 outputToTemplate ()
 
 setPresentationTitle ($a_title="")
 
 getPresentationTitle ()
 
 setHeader ($a_title="")
 
 getHeader ()
 
 setLinkParams ($l_params="")
 
 getLinkParams ()
 
 setLinkFrame ($l_frame="")
 
 getLinkFrame ()
 
 setLinkXML ($link_xml)
 
 getLinkXML ()
 
 setQuestionXML ($question_xml)
 
 setQuestionHTML ($question_html)
 
 getQuestionXML ()
 
 getQuestionHTML ()
 
 setTemplateTargetVar ($a_variable)
 
 getTemplateTargetVar ()
 
 setTemplateOutputVar ($a_value)
 
 getTemplateOutputVar ()
 
 setSourcecodeDownloadScript ($script_name)
 
 getSourcecodeDownloadScript ()
 
 enableCitation ($a_enabled)
 
 isEnabledCitation ()
 
 setLocator (&$a_locator)
 
 setTabs ($a_tabs)
 
 setPageBackTitle ($a_title)
 
 setFileDownloadLink ($a_download_link)
 
 getFileDownloadLink ()
 
 setFullscreenLink ($a_fullscreen_link)
 
 getFullscreenLink ()
 
 setIntLinkReturn ($a_return)
 
 enableChangeComments ($a_enabled)
 
 isEnabledChangeComments ()
 
 enableNotes ($a_enabled, $a_parent_id)
 
 isEnabledNotes ()
 
 setOfflineDirectory ($offdir)
 set offline directory to offdir More...
 
 getOfflineDirectory ()
 get offline directory More...
 
 setViewPageLink ($a_link, $a_target="")
 set link for "view page" button More...
 
 getViewPageLink ()
 get view page link More...
 
 getViewPageTarget ()
 get view page target frame More...
 
 setActivationListener (&$a_obj, $a_meth)
 
 setEnabledNews ($a_enabled, $a_news_obj_id=0, $a_news_obj_type=0)
 Set enabled news. More...
 
 getEnabledNews ()
 Get enabled news. More...
 
 setTabHook ($a_object, $a_function)
 Set tab hook. More...
 
 setEditPreview ($a_editpreview)
 Set Display first Edit tab, then Preview tab, instead of Page and Edit. More...
 
 getEditPreview ()
 Get Display first Edit tab, then Preview tab, instead of Page and Edit. More...
 
 setEnabledTabs ($a_enabledtabs)
 Set Output tabs. More...
 
 getEnabledTabs ()
 Get Output tabs. More...
 
 setEnabledPageFocus ($a_enabledpagefocus)
 Set Enable page focus. More...
 
 getEnabledPageFocus ()
 Get Enable page focus. More...
 
 setExplorerUpdater ($a_exp_frame, $a_exp_id, $a_exp_target_script)
 Set Explorer Updater. More...
 
 setPrependingHtml ($a_prependinghtml)
 Set Prepending HTML. More...
 
 getPrependingHtml ()
 Get Prepending HTML. More...
 
 setEnableEditing ($a_enableediting)
 Set Enable Editing. More...
 
 getEnableEditing ()
 Get Enable Editing. More...
 
 setRawPageContent ($a_rawpagecontent)
 Set Get raw page content only. More...
 
 getRawPageContent ()
 Get Get raw page content only. More...
 
 setStyleId ($a_styleid)
 Set Style Id. More...
 
 getStyleId ()
 Get Style Id. More...
 
 setCompareMode ($a_val)
 Set compare mode. More...
 
 getCompareMode ()
 Get compare mode. More...
 
 setAbstractOnly ($a_val)
 Set abstract only. More...
 
 getAbstractOnly ()
 Get abstract only. More...
 
 setRenderPageContainer ($a_val)
 Set render page container. More...
 
 getRenderPageContainer ()
 Get render page container. More...
 
 activateMetaDataEditor ($a_rep_obj, $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...
 
 insertContentIncludes ($a_html)
 Insert content includes. More...
 
 insertPageToc ($a_output)
 Insert page toc. More...
 
 insertResources ($a_output)
 Insert resources. More...
 
 insertAdvTrigger ($a_output)
 Insert adv content trigger. More...
 
 postOutputProcessing ($a_output)
 Finalizing output processing. More...
 
 insertHelp ($a_tpl)
 Insert help texts. More...
 
 previewHistory ()
 Preview history. More...
 
 preview ()
 preview More...
 
 edit ()
 edit ("view" before) More...
 
 insertJSAtPlaceholder ()
 InsertJS at placeholder. More...
 
 presentation ($a_mode=IL_PAGE_PRESENTATION)
 
 getHTML ()
 
 showMediaFullscreen ($a_style_id=0)
 show fullscreen view of media object More...
 
 displayValidationError ($a_error)
 display validation error More...
 
 history ()
 Get history table as HTML. More...
 
 rollbackConfirmation ()
 Rollback confirmation. More...
 
 rollback ()
 Rollback to a previous version. More...
 
 setScreenIdComponent ()
 Set screen id component. More...
 
 getTabs ($a_activate="")
 adds tabs to tab gui object More...
 
 compareVersion ()
 Compares two revisions of the page. More...
 
 replaceDiffTags ($a_html)
 
 editActivation ()
 Edit activation (only, if scheduled page activation is activated in administration) More...
 
 initActivationForm ()
 Init activation form. More...
 
 getActivationFormValues ()
 Get values for activation form. More...
 
 saveActivation ()
 Save Activation. More...
 
 getNotesHTML ($a_content_object=null, $a_enable_private_notes=true, $a_enable_public_notes=false, $a_enable_notes_deletion=false, $a_callback=null)
 Get html for public and/or private notes. More...
 
 processAnswer ()
 Process answer. More...
 
 initialOpenedContent ()
 Initially opened content. More...
 
 initOpenedContentForm ()
 Init form for initially opened content. More...
 
 saveInitialOpenedContent ()
 Save initial opened content. More...
 
 switchToLanguage ()
 Switch to language. More...
 
 confirmPageTranslationCreation ()
 Confirm page translation creation. More...
 
 editMasterLanguage ()
 Edit master language. More...
 
 createPageTranslation ()
 Create page translation. More...
 
 releasePageLock ()
 Release page lock. More...
 

Private Member Functions

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

Additional Inherited Members

- Static Public Member Functions inherited from ilPageObjectGUI
static getTinyMenu ($a_par_type, $a_int_links=false, $a_wiki_links=false, $a_keywords=false, $a_style_id=0, $a_paragraph_styles=true, $a_save_return=true, $a_anchors=false, $a_save_new=true, $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 214 of file class.ilTestExpressPageObjectGUI.php.

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

Referenced by executeCommand().

215  {
216  global $ilCtrl;
217 
218  if( !$type )
219  {
220  $qtype = $_REQUEST['qtype'];
221  $pool = new ilObjQuestionPool();
223  }
224 
225  $this->ctrl->setReturn($this, "questions");
226 
227  include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
228  $q_gui = & assQuestionGUI::_getQuestionGUI($type);
229 
231 
232  $q_gui->object->setObjId($obj->getId());
233 
234  return $q_gui;
235  }
getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
$_GET["client_id"]
static getQuestionTypeByTypeId($type_id)
global $ilCtrl
Definition: ilias.php:18
& _getQuestionGUI($question_type, $question_id=-1)
Creates a question gui representation and returns the alias to the question gui note: please do not u...
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
+ 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 $_REQUEST, $data, $ilCtrl, ilPageObjectGUI\$lng, $options, $si, ilPageObjectGUI\$tpl, ilObjQuestionPool\_getAvailableQuestionpools(), assQuestion\ADDITIONAL_CONTENT_EDITING_MODE_DEFAULT, assQuestion\ADDITIONAL_CONTENT_EDITING_MODE_PAGE_OBJECT, ilRadioGroupInputGUI\addOption(), ilObjAssessmentFolder\isAdditionalQuestionContentEditingModePageObjectEnabled(), ilSelectInputGUI\setOptions(), ilFormPropertyGUI\setRequired(), ilTextInputGUI\setSize(), and ilRadioOption\setValue().

340  {
341  global $lng, $ilCtrl, $tpl;
342 
343  include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
344 
345  $ilCtrl->setParameter($this, 'qtype', $_REQUEST['qtype']);
346 
347  $form = new ilPropertyFormGUI();
348 
349  $ilCtrl->setParameter($this, 'test_express_mode', 1);
350 
351  $form->setFormAction($ilCtrl->getFormAction($this, "handleToolbarCommand"));
352  $form->setTitle($lng->txt("ass_create_question"));
353  include_once 'Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php';
354 
355  $pool = new ilObjQuestionPool();
356  $questionTypes = $pool->getQuestionTypes(false, true);
357  $options = array();
358 
359  // question type
360  foreach($questionTypes as $label => $data)
361  {
362  $options[$data['question_type_id']] = $label;
363  }
364 
365  include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
366  $si = new ilSelectInputGUI($lng->txt("question_type"), "qtype");
367  $si->setOptions($options);
368  $form->addItem($si, true);
369 
370  // position
371  $questions = $this->test_object->getQuestionTitlesAndIndexes();
372  if($questions)
373  {
374  $si = new ilSelectInputGUI($lng->txt("position"), "position");
375  $options = array('0' => $lng->txt('first'));
376  foreach($questions as $key => $title)
377  {
378  $options[$key] = $lng->txt('behind') . ' '. $title . ' ['.$this->lng->txt('question_id_short') . ': '. $key .']';
379  }
380  $si->setOptions($options);
381  $si->setValue($_REQUEST['q_id']);
382  $form->addItem($si, true);
383  }
384 
385  // content editing mode
387  {
388  $ri = new ilRadioGroupInputGUI($lng->txt("tst_add_quest_cont_edit_mode"), "add_quest_cont_edit_mode");
389 
390  $ri->addOption(new ilRadioOption(
391  $lng->txt('tst_add_quest_cont_edit_mode_default'),
393  ));
394 
395  $ri->addOption(new ilRadioOption(
396  $lng->txt('tst_add_quest_cont_edit_mode_page_object'),
398  ));
399 
401 
402  $form->addItem($ri, true);
403  }
404  else
405  {
406  $hi = new ilHiddenInputGUI("question_content_editing_type");
408  $form->addItem($hi, true);
409  }
410 
411  if($this->test_object->getPoolUsage())
412  {
413  // use pool
414  $usage = new ilRadioGroupInputGUI($this->lng->txt("assessment_pool_selection"), "usage");
415  $usage->setRequired(true);
416  $no_pool = new ilRadioOption($this->lng->txt("assessment_no_pool"), 1);
417  $usage->addOption($no_pool);
418  $existing_pool = new ilRadioOption($this->lng->txt("assessment_existing_pool"), 3);
419  $usage->addOption($existing_pool);
420  $new_pool = new ilRadioOption($this->lng->txt("assessment_new_pool"), 2);
421  $usage->addOption($new_pool);
422  $form->addItem($usage);
423 
424  $usage->setValue(1);
425 
426  $questionpools = ilObjQuestionPool::_getAvailableQuestionpools(FALSE, FALSE, TRUE, FALSE, FALSE, "write");
427  $pools_data = array();
428  foreach($questionpools as $key => $p)
429  {
430  $pools_data[$key] = $p['title'];
431  }
432  $pools = new ilSelectInputGUI($this->lng->txt("select_questionpool"), "sel_qpl");
433  $pools->setOptions($pools_data);
434  $existing_pool->addSubItem($pools);
435 
436  $name = new ilTextInputGUI($this->lng->txt("name"), "txt_qpl");
437  $name->setSize(50);
438  $name->setMaxLength(50);
439  $new_pool->addSubItem($name);
440  }
441 
442  $form->addCommandButton("handleToolbarCommand", $lng->txt("create"));
443  $form->addCommandButton("questions", $lng->txt("cancel"));
444 
445  return $tpl->setContent($form->getHTML());
446  }
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.
$data
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.
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 ...
& _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.
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
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, $_REQUEST, $cmd, $ilCtrl, $ilUser, ilPageObjectGUI\$lng, ilPageObjectGUI\$obj, $params, $ret, $total, assQuestionGUI\_getQuestionGUI(), addPageOfQuestions(), ilPageObjectGUI\getEnableEditing(), ilPageObjectGUI\getHeader(), ilObjectFactory\getInstanceByRefId(), ilPageObjectGUI\getPageObject(), ilObjQuestionPool\getQuestionTypeByTypeId(), IL_PAGE_EDIT, IL_PAGE_PREVIEW, ilUtil\redirect(), ilUtil\sendFailure(), ilUtil\sendInfo(), ilPageObjectGUI\setOutputMode(), and ilAssQuestionPageGUI\showPage().

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

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

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

◆ insertQuestions()

ilTestExpressPageObjectGUI::insertQuestions ( )

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

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

490  {
491  $selected_array = (is_array($_POST['q_id'])) ? $_POST['q_id'] : array();
492  if (!count($selected_array))
493  {
494  ilUtil::sendInfo($this->lng->txt("tst_insert_missing_question"), true);
495  $this->ctrl->redirect($this, "browseForQuestions");
496  }
497  else
498  {
499  include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
500  $manscoring = FALSE;
501 
502  global $tree, $ilDB, $ilPluginAdmin;
503 
504  require_once 'Modules/Test/classes/class.ilTestQuestionSetConfigFactory.php';
505  $testQuestionSetConfigFactory = new ilTestQuestionSetConfigFactory($tree, $ilDB, $ilPluginAdmin, $this->test_object);
506  $testQuestionSetConfig = $testQuestionSetConfigFactory->getQuestionSetConfig();
507 
508  foreach ($selected_array as $key => $value)
509  {
510  $last_question_id = $this->test_object->insertQuestion( $testQuestionSetConfig, $value );
511 
512  if (!$manscoring)
513  {
514  $manscoring = $manscoring | assQuestion::_needsManualScoring($value);
515  }
516  }
517  $this->test_object->saveCompleteStatus( $testQuestionSetConfig );
518  if ($manscoring)
519  {
520  ilUtil::sendInfo($this->lng->txt("manscoring_hint"), TRUE);
521  }
522  else
523  {
524  ilUtil::sendSuccess($this->lng->txt("tst_questions_inserted"), TRUE);
525  }
526 
527  $this->ctrl->setParameter($this, 'q_id', $last_question_id);
528  $this->ctrl->redirect($this, "showPage");
529  return;
530  }
531  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
_needsManualScoring($question_id)
global $ilDB
+ Here is the call graph for this function:

◆ nextQuestion()

ilTestExpressPageObjectGUI::nextQuestion ( )

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

References $_REQUEST, 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  }
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
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 $_REQUEST, 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  }
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
static redirect($a_script)
http redirect to other script
+ Here is the call graph for this function:

◆ questions()

ilTestExpressPageObjectGUI::questions ( )

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

References $ilCtrl.

449  {
450  global $ilCtrl;
451 
452  $ilCtrl->saveParameterByClass('ilobjtestgui', 'q_id');
453 
454  $ilCtrl->redirectByClass('ilobjtestgui', 'showPage');
455  }
global $ilCtrl
Definition: ilias.php:18

◆ redirectToQuestionEditPage()

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

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

References $_GET, and $_REQUEST.

Referenced by handleToolbarCommand().

458  {
459  $cmdClass = $questionType.'GUI';
460 
461  $this->ctrl->setParameterByClass($cmdClass, 'ref_id', $_GET['ref_id']);
462  $this->ctrl->setParameterByClass($cmdClass, 'sel_question_types', $questionType);
463  $this->ctrl->setParameterByClass($cmdClass, 'test_ref_id', $_GET['ref_id']);
464  $this->ctrl->setParameterByClass($cmdClass, 'calling_test', $_GET['ref_id']);
465  $this->ctrl->setParameterByClass($cmdClass, 'q_id', $qid);
466  $this->ctrl->setParameterByClass($cmdClass, 'prev_qid', $prev_qid);
467 
468  if ($_REQUEST['test_express_mode'])
469  {
470  $this->ctrl->setParameterByClass($cmdClass, 'test_express_mode', 1);
471  }
472 
473  $this->ctrl->redirectByClass(
474  array('ilRepositoryGUI', 'ilObjTestGUI', $questionType."GUI"), 'editQuestion'
475  );
476  }
$_GET["client_id"]
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
+ Here is the caller graph for this function:

◆ redirectToQuestionPoolSelectionPage()

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

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

References $_REQUEST, and ilUtil\redirect().

479  {
480  $this->ctrl->setParameterByClass('ilObjTestGUI', 'ref_id', $_REQUEST['ref_id']);
481  $this->ctrl->setParameterByClass('ilObjTestGUI', 'q_id', $qid);
482  $this->ctrl->setParameterByClass('ilObjTestGUI', 'sel_question_types', $questionType);
483  $this->ctrl->setParameterByClass('ilObjTestGUI', 'prev_qid', $prev_qid);
484  $redir = $this->ctrl->getLinkTargetByClass('ilObjTestGUI', 'createQuestion', '', false, false);
485 
486  ilUtil::redirect($redir);
487  }
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
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: