ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
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 ()
 
 browseForQuestions ()
 
 insertQuestions ()
 
 filterAvailableQuestions ()
 
 resetfilterAvailableQuestions ()
 
- Public Member Functions inherited from ilAssQuestionPageGUI
 __construct ($a_id=0, $a_old_nr=0)
 Constructor. More...
 
- 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_id, $a_sub_obj_id, $a_type, $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 ()
 
 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...
 
 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...
 
 getQuestionJsOfPage ($a_no_interaction=false)
 Get question js. More...
 
 initSelfAssessmentRendering ($a_force_no_form=false)
 Init question handling. More...
 
 processAnswer ()
 Process answer. More...
 
 selfAssessmentRendering ($a_output)
 Self assessment question rendering. 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)
 Get Tiny Menu. More...
 
static addPreparationJavascript ($a_tpl, $a_lang)
 Add standard texts. More...
 
static getJSTextInitCode ($a_lang)
 Get js txt init code. More...
 
- 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 ilPageObjectGUI
 initPageObject ()
 Init page object. More...
 
 getActivationCaptions ()
 Get captions for activation action menu entries. More...
 
- Protected Attributes inherited from ilPageObjectGUI
 $parent_type = ""
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

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

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

80  {
81  parent::__construct($a_id, $a_old_nr);
82  }

Member Function Documentation

◆ addPageOfQuestions()

ilTestExpressPageObjectGUI::addPageOfQuestions (   $type = '')

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

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

Referenced by executeCommand().

224  {
225  global $ilCtrl;
226 
227  if( !$type )
228  {
229  $qtype = $_REQUEST['qtype'];
230  $pool = new ilObjQuestionPool();
232  }
233 
234  $this->ctrl->setReturn($this, "questions");
235 
236  include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
237  $q_gui = & assQuestionGUI::_getQuestionGUI($type);
238 
240 
241  $q_gui->object->setObjId($obj->getId());
242 
243  return $q_gui;
244  }
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 347 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().

348  {
349  global $lng, $ilCtrl, $tpl;
350 
351  include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
352 
353  $ilCtrl->setParameter($this, 'qtype', $_REQUEST['qtype']);
354 
355  $form = new ilPropertyFormGUI();
356 
357  $ilCtrl->setParameter($this, 'test_express_mode', 1);
358 
359  $form->setFormAction($ilCtrl->getFormAction($this, "handleToolbarCommand"));
360  $form->setTitle($lng->txt("ass_create_question"));
361  include_once 'Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php';
362 
363  $pool = new ilObjQuestionPool();
364  $questionTypes = $pool->getQuestionTypes(false, true);
365  $options = array();
366 
367  // question type
368  foreach($questionTypes as $label => $data)
369  {
370  $options[$data['question_type_id']] = $label;
371  }
372 
373  include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
374  $si = new ilSelectInputGUI($lng->txt("question_type"), "qtype");
375  $si->setOptions($options);
376  $form->addItem($si, true);
377 
378  // position
379  $questions = $this->test_object->getQuestionTitlesAndIndexes();
380  if($questions)
381  {
382  $si = new ilSelectInputGUI($lng->txt("position"), "position");
383  $options = array('0' => $lng->txt('first'));
384  foreach($questions as $key => $title)
385  {
386  $options[$key] = $lng->txt('behind') . ' '. $title . ' ['.$this->lng->txt('question_id_short') . ': '. $key .']';
387  }
388  $si->setOptions($options);
389  $si->setValue($_REQUEST['q_id']);
390  $form->addItem($si, true);
391  }
392 
393  // content editing mode
395  {
396  $ri = new ilRadioGroupInputGUI($lng->txt("tst_add_quest_cont_edit_mode"), "add_quest_cont_edit_mode");
397 
398  $ri->addOption(new ilRadioOption(
399  $lng->txt('tst_add_quest_cont_edit_mode_default'),
401  ));
402 
403  $ri->addOption(new ilRadioOption(
404  $lng->txt('tst_add_quest_cont_edit_mode_page_object'),
406  ));
407 
409 
410  $form->addItem($ri, true);
411  }
412  else
413  {
414  $hi = new ilHiddenInputGUI("question_content_editing_type");
416  $form->addItem($hi, true);
417  }
418 
419  if($this->test_object->getPoolUsage())
420  {
421  // use pool
422  $usage = new ilRadioGroupInputGUI($this->lng->txt("assessment_pool_selection"), "usage");
423  $usage->setRequired(true);
424  $no_pool = new ilRadioOption($this->lng->txt("assessment_no_pool"), 1);
425  $usage->addOption($no_pool);
426  $existing_pool = new ilRadioOption($this->lng->txt("assessment_existing_pool"), 3);
427  $usage->addOption($existing_pool);
428  $new_pool = new ilRadioOption($this->lng->txt("assessment_new_pool"), 2);
429  $usage->addOption($new_pool);
430  $form->addItem($usage);
431 
432  $usage->setValue(1);
433 
434  $questionpools = ilObjQuestionPool::_getAvailableQuestionpools(FALSE, FALSE, TRUE, FALSE, FALSE, "write");
435  $pools_data = array();
436  foreach($questionpools as $key => $p)
437  {
438  $pools_data[$key] = $p['title'];
439  }
440  $pools = new ilSelectInputGUI($this->lng->txt("select_questionpool"), "sel_qpl");
441  $pools->setOptions($pools_data);
442  $existing_pool->addSubItem($pools);
443 
444  $name = new ilTextInputGUI($this->lng->txt("name"), "txt_qpl");
445  $name->setSize(50);
446  $name->setMaxLength(50);
447  $new_pool->addSubItem($name);
448  }
449 
450  $form->addCommandButton("handleToolbarCommand", $lng->txt("create"));
451  $form->addCommandButton("questions", $lng->txt("cancel"));
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.
const ADDITIONAL_CONTENT_EDITING_MODE_DEFAULT
constant for additional content editing mode "default"
while($lm_rec=$ilDB->fetchAssoc($lm_set)) $data
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:

◆ browseForQuestions()

ilTestExpressPageObjectGUI::browseForQuestions ( )

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

References $_REQUEST, $data, $ilCtrl, and ilPageObjectGUI\$tpl.

498  {
499  global $ilAccess, $tpl, $ilCtrl;
500 
501  $ilCtrl->setParameterByClass(get_class($this), "browse", "1");
502 
503  include_once "./Modules/Test/classes/tables/class.ilTestQuestionBrowserTableGUI.php";
504  $table_gui = new ilTestQuestionBrowserTableGUI($this, 'browseForQuestions', (($ilAccess->checkAccess("write", "", $_REQUEST['ref_id']) ? true : false)));
505  $arrFilter = array();
506  foreach ($table_gui->getFilterItems() as $item)
507  {
508  if ($item->getValue() !== false)
509  {
510  $arrFilter[$item->getPostVar()] = $item->getValue();
511  }
512  }
513  $data = $this->test_object->getAvailableQuestions($arrFilter, 1);
514 
515  $table_gui->setData($data);
516  $tpl->setVariable('ADM_CONTENT', $table_gui->getHTML());
517  }
global $ilCtrl
Definition: ilias.php:18
while($lm_rec=$ilDB->fetchAssoc($lm_set)) $data
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7

◆ executeCommand()

& ilTestExpressPageObjectGUI::executeCommand ( )

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

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

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

◆ filterAvailableQuestions()

ilTestExpressPageObjectGUI::filterAvailableQuestions ( )

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

564  {
565  include_once "./Modules/Test/classes/tables/class.ilTestQuestionBrowserTableGUI.php";
566  $table_gui = new ilTestQuestionBrowserTableGUI($this, 'browseForQuestions');
567  $table_gui->writeFilterToSession();
568  $this->ctrl->redirect($this, "browseForQuestions");
569  }

◆ handleToolbarCommand()

ilTestExpressPageObjectGUI::handleToolbarCommand ( )

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

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

247  {
248  global $ilCtrl;
249 
250  include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
251 
252  if( $_REQUEST['qtype'] )
253  {
254  include_once 'Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php';
255  $questionType = ilObjQuestionPool::getQuestionTypeByTypeId($_REQUEST['qtype']);
256  }
257  elseif( $_REQUEST['sel_question_types'] )
258  {
259  $questionType = $_REQUEST['sel_question_types'];
260  }
261  require_once 'Modules/Test/classes/class.ilObjAssessmentFolder.php';
263  {
264  $addContEditMode = $_POST['add_quest_cont_edit_mode'];
265  }
266  else
267  {
269  }
270 
271  $q_gui =& assQuestionGUI::_getQuestionGUI($questionType);
272 
273  // CHECK THIS !!! --> obj or ref id ???
274  $q_gui->object->setObjId($_GET['ref_id']);
275  $q_gui->object->setAdditionalContentEditingMode($addContEditMode);
276 
277  $q_gui->object->createNewQuestion();
278 
279  $previousQuestionId = $_REQUEST['position'];
280 
281  switch( $_REQUEST['usage'] )
282  {
283  case 3: // existing pool
284 
285  $ilCtrl->setParameterByClass('ilobjtestgui', 'sel_qpl', $_REQUEST['sel_qpl']);
286  $ilCtrl->setParameterByClass('ilobjtestgui', 'sel_question_types', $questionType);
287  $ilCtrl->setParameterByClass('ilobjtestgui', 'q_id', $q_gui->object->getId());
288  $ilCtrl->setParameterByClass('ilobjtestgui', 'prev_qid', $previousQuestionId);
289 
290  if ($_REQUEST['test_express_mode'])
291  {
292  $ilCtrl->setParameterByClass('ilobjtestgui', 'test_express_mode', 1);
293  }
294 
295  if( isset($_REQUEST['add_quest_cont_edit_mode']) )
296  {
297  $ilCtrl->setParameterByClass(
298  'ilobjtestgui', 'add_quest_cont_edit_mode', $_REQUEST['add_quest_cont_edit_mode']
299  );
300  }
301 
302  $ilCtrl->setParameterByClass('ilobjtestgui', 'usage', 3);
303  $ilCtrl->setParameterByClass('ilobjtestgui', 'calling_test', $this->test_object->getId());
304 
305  $link = $ilCtrl->getLinkTargetByClass('ilobjtestgui', 'executeCreateQuestion', false, false, false);
306 
307  ilUtil::redirect($link);
308 
309  break;
310 
311  case 2: // new pool
312 
313  $ilCtrl->setParameterByClass('ilobjtestgui', 'txt_qpl', $_REQUEST['txt_qpl']);
314  $ilCtrl->setParameterByClass('ilobjtestgui', 'sel_question_types', $questionType);
315  $ilCtrl->setParameterByClass('ilobjtestgui', 'q_id', $q_gui->object->getId());
316  $ilCtrl->setParameterByClass('ilobjtestgui', 'prev_qid', $previousQuestionId);
317 
318  if ($_REQUEST['test_express_mode'])
319  {
320  $ilCtrl->setParameterByClass('ilobjtestgui', 'test_express_mode', 1);
321  }
322 
323  if( isset($_REQUEST['add_quest_cont_edit_mode']) )
324  {
325  $ilCtrl->setParameterByClass(
326  'ilobjtestgui', 'add_quest_cont_edit_mode', $_REQUEST['add_quest_cont_edit_mode']
327  );
328  }
329 
330  $ilCtrl->setParameterByClass('ilobjtestgui', 'usage', 2);
331  $ilCtrl->setParameterByClass('ilobjtestgui', 'calling_test', $this->test_object->getId());
332 
333  $link = $ilCtrl->getLinkTargetByClass('ilobjtestgui', 'executeCreateQuestion', false, false, false);
334  ilUtil::redirect($link);
335 
336  break;
337 
338  case 1: // no pool
339  default:
340 
341  $this->redirectToQuestionEditPage($questionType, $q_gui->object->getId(), $previousQuestionId);
342 
343  break;
344  }
345  }
$_POST['username']
Definition: cron.php:12
$_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 519 of file class.ilTestExpressPageObjectGUI.php.

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

520  {
521  $selected_array = (is_array($_POST['q_id'])) ? $_POST['q_id'] : array();
522  if (!count($selected_array))
523  {
524  ilUtil::sendInfo($this->lng->txt("tst_insert_missing_question"), true);
525  $this->ctrl->redirect($this, "browseForQuestions");
526  }
527  else
528  {
529  include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
530  $manscoring = FALSE;
531 
532  global $tree, $ilDB, $ilPluginAdmin;
533 
534  require_once 'Modules/Test/classes/class.ilTestQuestionSetConfigFactory.php';
535  $testQuestionSetConfigFactory = new ilTestQuestionSetConfigFactory($tree, $ilDB, $ilPluginAdmin, $this->test_object);
536  $testQuestionSetConfig = $testQuestionSetConfigFactory->getQuestionSetConfig();
537 
538  foreach ($selected_array as $key => $value)
539  {
540  $last_question_id = $this->test_object->insertQuestion( $testQuestionSetConfig, $value );
541 
542  if (!$manscoring)
543  {
544  $manscoring = $manscoring | assQuestion::_needsManualScoring($value);
545  }
546  }
547  $this->test_object->saveCompleteStatus( $testQuestionSetConfig );
548  if ($manscoring)
549  {
550  ilUtil::sendInfo($this->lng->txt("manscoring_hint"), TRUE);
551  }
552  else
553  {
554  ilUtil::sendSuccess($this->lng->txt("tst_questions_inserted"), TRUE);
555  }
556 
557  $this->ctrl->setParameter($this, 'q_id', $last_question_id);
558  $this->ctrl->redirect($this, "showPage");
559  return;
560  }
561  }
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)
+ Here is the call graph for this function:

◆ nextQuestion()

ilTestExpressPageObjectGUI::nextQuestion ( )

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

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

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 == count($questions) - 1 )
34  {
35  ilUtil::sendInfo('test_express_end_reached_moved_to_first', true);
36  $next = $questions[0];
37  }
38  elseif( $pos !== false )
39  {
40  $next = $questions[$pos + 1];
41  }
42  else
43  {
44  $next = $questions[0];
45  }
46 
47  $this->ctrl->setParameter($this, 'q_id', $next);
48  $link = $this->ctrl->getLinkTarget($this, 'edit', '', '', false);
49 
50  ilUtil::redirect($link);
51  }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
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 53 of file class.ilTestExpressPageObjectGUI.php.

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

54  {
55  $obj = new ilObjTest($_REQUEST['ref_id']);
56  $questions = array_keys($obj->getQuestionTitlesAndIndexes());
57 
58  $pos = array_search($_REQUEST['q_id'], $questions);
59 
60  if( $pos == 0 )
61  {
62  ilUtil::sendInfo('test_express_start_reached_moved_to_last', true);
63  $next = $questions[count($questions) - 1];
64  }
65  elseif( $pos !== false )
66  {
67  $next = $questions[$pos - 1];
68  }
69  else
70  {
71  $next = $questions[0];
72  }
73 
74  $this->ctrl->setParameter($this, 'q_id', $next);
75  $link = $this->ctrl->getLinkTarget($this, 'edit', '', '', false);
76 
77  ilUtil::redirect($link);
78  }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
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 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 $_REQUEST.

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"]
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 486 of file class.ilTestExpressPageObjectGUI.php.

References $_REQUEST, and 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  }
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:

◆ resetfilterAvailableQuestions()

ilTestExpressPageObjectGUI::resetfilterAvailableQuestions ( )

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

572  {
573  include_once "./Modules/Test/classes/tables/class.ilTestQuestionBrowserTableGUI.php";
574  $table_gui = new ilTestQuestionBrowserTableGUI($this, 'browseForQuestions');
575  $table_gui->resetFilter();
576  $this->ctrl->redirect($this, "browseForQuestions");
577  }

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