ILIAS  Release_4_2_x_branch Revision 61807
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilTestExpressPageObjectGUI Class Reference

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

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

Public Member Functions

 nextQuestion ()
 prevQuestion ()
executeCommand ()
 execute command
 addPageOfQuestions ($type= '')
 handleToolbarCommand ()
 addQuestion ()
 questions ()
 browseForQuestions ()
 insertQuestions ()
 filterAvailableQuestions ()
 resetfilterAvailableQuestions ()
- Public Member Functions inherited from ilPageObjectGUI
 ilPageObjectGUI ($a_parent_type, $a_id=0, $a_old_nr=0, $a_prevent_get_id=false)
 Constructor public.
 setEnablePCType ($a_pc_type, $a_val)
 Set enable pc type.
 getEnablePCType ($a_pc_type)
 Get enable pc type.
 setPageConfig ($a_val)
 Set page config object.
 getPageConfig ()
 Get page config object.
 initPageObject ($a_parent_type, $a_id, $a_old_nr)
 setBibId ($a_id)
 Set Bib Id.
 getBibId ()
 Get Bib Id.
 setPageObject ($a_pg_obj)
 Set Page Object.
 getPageObject ()
 Get Page Object.
 setOutputMode ($a_mode=IL_PAGE_PRESENTATION)
 Set Output Mode.
 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 ()
 setOutputSubmode ($a_mode)
 getOutputSubmode ()
 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 ()
 setEnableKeywords ($a_val)
 Set enable keywords handling.
 getEnableKeywords ()
 Get enable keywords handling.
 setEnableAnchors ($a_val)
 Set enable anchors.
 getEnableAnchors ()
 Get enable anchors.
 setIntLinkHelpDefault ($a_type, $a_id)
 setIntLinkReturn ($a_return)
 enableChangeComments ($a_enabled)
 isEnabledChangeComments ()
 enableNotes ($a_enabled, $a_parent_id)
 isEnabledNotes ()
 enableContentIncludes ($a_enable)
 Enable content includes.
 isEnabledContentIncludes ()
 Are content includes enabled?
 setOfflineDirectory ($offdir)
 set offline directory to offdir
 getOfflineDirectory ()
 get offline directory
 setViewPageLink ($a_link, $a_target="")
 set link for "view page" button
 getViewPageLink ()
 get view page link
 getViewPageTarget ()
 get view page target frame
 setActivationListener (&$a_obj, $a_meth)
 setEnabledActivation ($a_act)
 getEnabledActivation ()
 setEnabledScheduledActivation ($a_act)
 getEnabledScheduledActivation ()
 setPageToc ($a_val)
 Set page toc.
 getPageToc ()
 Get page toc.
 setEnabledNews ($a_enabled, $a_news_obj_id=0, $a_news_obj_type=0)
 Set enabled news.
 getEnabledNews ()
 Get enabled news.
 setTabHook ($a_object, $a_function)
 Set tab hook.
 setEnabledInternalLinks ($a_enabledinternallinks)
 Set Enable internal links.
 getEnabledInternalLinks ()
 Get Enable internal links.
 setEditPreview ($a_editpreview)
 Set Display first Edit tab, then Preview tab, instead of Page and Edit.
 getEditPreview ()
 Get Display first Edit tab, then Preview tab, instead of Page and Edit.
 setPreventHTMLUnmasking ($a_preventhtmlunmasking)
 Set Prevent HTML Unmasking (true/false).
 getPreventHTMLUnmasking ()
 Get Prevent HTML Unmasking (true/false).
 setEnabledTabs ($a_enabledtabs)
 Set Output tabs.
 getEnabledTabs ()
 Get Output tabs.
 setEnabledRepositoryObjects ($a_enabledrepositoryobjects)
 Set Enable Repository Objects Content Component.
 getEnabledRepositoryObjects ()
 Get Enable Repository Objects Content Component.
 setEnabledLoginPage ($a_enablegloginpage)
 Set enable login page.
 getEnabledLoginPage ()
 Get enable login page.
 setEnabledMaps ($a_enabledmaps)
 Set Enable Maps Content Component.
 getEnabledMaps ()
 Get Enable Maps Content Component.
 setEnabledPCTabs ($a_enabledpctabs)
 Set Enable Tabs Content Component.
 getEnabledPCTabs ()
 Get Enable Tabs Content Component.
 setEnabledFileLists ($a_enabledfilelists)
 Set Enable File Lists Content Componente (Default is true).
 getEnabledFileLists ()
 Get Enable File Lists Content Componente (Default is true).
 setEnabledPageFocus ($a_enabledpagefocus)
 Set Enable page focus.
 getEnabledPageFocus ()
 Get Enable page focus.
 getEnabledProfile ()
 Get Enable Profile Content Component.
 setEnabledProfile ($a_enableprofile)
 Set Enable Profile Content Component.
 getEnabledVerification ()
 Get Enable Verification Content Component.
 setEnabledVerification ($a_enableverification)
 Set Enable Verification Content Component.
 getEnabledBlog ()
 Get Enable Blog Content Component.
 setEnabledBlog ($a_enableblog)
 Set Enable Blog Content Component.
 getEnabledSkills ()
 Get Enable Skills Content Component.
 setEnabledSkills ($a_enableskills)
 Set Enable Skills Content Component.
 setExplorerUpdater ($a_exp_frame, $a_exp_id, $a_exp_target_script)
 Set Explorer Updater.
 setPrependingHtml ($a_prependinghtml)
 Set Prepending HTML.
 getPrependingHtml ()
 Get Prepending HTML.
 setEnabledWikiLinks ($a_enablewikilinks)
 Set Enable Wiki Links.
 getEnabledWikiLinks ()
 Get Enable Wiki Links.
 setEnableEditing ($a_enableediting)
 Set Enable Editing.
 getEnableEditing ()
 Get Enable Editing.
 setRawPageContent ($a_rawpagecontent)
 Set Get raw page content only.
 getRawPageContent ()
 Get Get raw page content only.
 setLayoutMode ($a_layout_mode)
 Set Layout Mode.
 getLayoutMode ()
 Get Layout Mode enabled/disabled.
 setStyleId ($a_styleid)
 Set Style Id.
 getStyleId ()
 Get Style Id.
 setEnabledSelfAssessment ($a_enabledselfassessment, $a_scorm=true)
 Set Enable Self Assessment Questions.
 getEnabledSelfAssessment ()
 Get Enable Self Assessment Questions.
 getEnabledSelfAssessmentScorm ()
 Is self assessment used in SCORM mode?
 setCompareMode ($a_val)
 Set compare mode.
 getCompareMode ()
 Get compare mode.
 setAbstractOnly ($a_val)
 Set abstract only.
 getAbstractOnly ()
 Get abstract only.
 activateMetaDataEditor ($a_rep_obj_id, $a_sub_obj_id, $a_type, $a_observer_obj=NULL, $a_observer_func="")
 Activate meda data editor.
 determineFileDownloadLink ()
 Determine file download link.
 determineFullscreenLink ()
 Determine fullscreen link.
 determineSourcecodeDownloadScript ()
 Determine source code download script.
 getComponentPluginsXML ()
 Put information about activated plugins into XML.
 deactivatePage ()
 activatePage ()
 showPage ()
 replaceCurlyBrackets ($output)
 Replace curly brackets.
 addActionsMenu ($a_tpl, $sel_media_mode, $sel_html_mode, $sel_js_mode)
 Add actions menu.
 setEditMode ()
 Set edit mode.
 setDefaultLinkXml ()
 Set standard link xml.
 downloadFile ()
 Download file of file lists.
 displayMediaFullscreen ()
 Show media in fullscreen mode.
 displayMedia ($a_fullscreen=false)
 Display media.
 download_paragraph ()
 download source code paragraph
 insertMaps ($a_html)
 Insert Maps.
 insertContentIncludes ($a_html)
 Insert Maps.
 insertPageToc ($a_output)
 Insert page toc.
 postOutputProcessing ($a_output)
 Finalizing output processing.
 insertHelp ($a_tpl)
 Insert help texts.
 preview ()
 edit ()
 edit ("view" before)
 insertJSAtPlaceholder ()
 InsertJS at placeholder.
 presentation ($a_mode=IL_PAGE_PRESENTATION)
 getHTML ()
 showMediaFullscreen ($a_style_id=0)
 show fullscreen view of media object
 displayValidationError ($a_error)
 display validation error
 history ()
 Get history table as HTML.
 rollbackConfirmation ()
 Rollback confirmation.
 rollback ()
 Rollback to a previous version.
 getTabs ($a_activate="")
 adds tabs to tab gui object
 compareVersion ()
 Compares two revisions of the page.
 replaceDiffTags ($a_html)
 editActivation ()
 Edit activation (only, if scheduled page activation is activated in administration)
 initActivationForm ()
 Init activation form.
 getActivationFormValues ()
 Get values for activation form.
 saveActivation ()
 Save Activation.
 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.
 getQuestionJsOfPage ($a_no_interaction=false)
 Get question js.
 initSelfAssessmentRendering ($a_force_no_form=false)
 Init question handling.
 processAnswer ()
 Process answer.
 selfAssessmentRendering ($a_output)
 Self assessment question rendering.

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)
 Get Tiny Menu.
static addPreparationJavascript ($a_tpl, $a_lang)
 Add standard texts.
static getJSTextInitCode ($a_lang)
 Get js txt init code.
- Data Fields inherited from ilPageObjectGUI
 $ilias
 $tpl
 $lng
 $ctrl
 $obj
 $output_mode
 $output_submode
 $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
 $enabledinternallinks = false
 $editpreview = false
 $use_meta_data = false
 $enabledpctabs = false
 $link_xml_set = false
 $enableediting = true
 $rawpagecontent = false
 $layoutmode = false
 $enabledcontentincludes = false
 $compare_mode = false
 $page_config = null
 $enable_keywords = false
 $enable_anchors = false
 $tabs_enabled = true
 $pl_start = "{{{{{"
 $pl_end = "}}}}}"
 $pc_types
- Protected Member Functions inherited from ilPageObjectGUI
 getActivationCaptions ()
 Get captions for activation action menu entries.

Detailed Description

Member Function Documentation

ilTestExpressPageObjectGUI::addPageOfQuestions (   $type = '')

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

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

Referenced by executeCommand().

{
global $ilCtrl;
if (!$type) {
$qtype = $_REQUEST['qtype'];
$pool = new ilObjQuestionPool();
}
$this->ctrl->setReturn($this, "questions");
include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
$q_gui->object->setObjId($obj->getId());
return $q_gui;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTestExpressPageObjectGUI::addQuestion ( )

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

References $_REQUEST, $data, $ilCtrl, ilPageObjectGUI\$lng, $title, ilPageObjectGUI\$tpl, ilObjQuestionPool\_getAvailableQuestionpools(), ilSelectInputGUI\setOptions(), ilFormPropertyGUI\setRequired(), ilTextInputGUI\setSize(), and ilRadioOption\setValue().

{
global $lng, $ilCtrl, $tpl;
include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
$ilCtrl->setParameter($this, 'qtype', $_REQUEST['qtype']);
$form = new ilPropertyFormGUI();
$ilCtrl->setParameter($this, 'test_express_mode', 1);
$form->setFormAction($ilCtrl->getFormAction($this, "handleToolbarCommand"));
$form->setTitle($lng->txt("test_create_question"));
include_once 'Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php';
$pool = new ilObjQuestionPool();
$questionTypes = $pool->getQuestionTypes();
$options = array();
// question type
foreach($questionTypes as $label => $data) {
$options[$data['question_type_id']] = $label;
}
include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
$si = new ilSelectInputGUI($lng->txt("question_type"), "qtype");
$si->setOptions($options);
$form->addItem($si, true);
// position
$questions = $this->test_object->getQuestionTitlesAndIndexes();
if ($questions) {
$si = new ilSelectInputGUI($lng->txt("position"), "position");
$options = array('0' => $lng->txt('first'));
foreach($questions as $key => $title) {
$options[$key] = $lng->txt('behind') . ' '. $title;
}
$si->setOptions($options);
$si->setValue($_REQUEST['q_id']);
$form->addItem($si, true);
}
if ($this->test_object->getPoolUsage()) {
// use pool
$usage = new ilRadioGroupInputGUI($this->lng->txt("assessment_pool_selection"), "usage");
$usage->setRequired(true);
$no_pool = new ilRadioOption($this->lng->txt("assessment_no_pool"), 1);
$usage->addOption($no_pool);
$existing_pool = new ilRadioOption($this->lng->txt("assessment_existing_pool"), 3);
$usage->addOption($existing_pool);
$new_pool = new ilRadioOption($this->lng->txt("assessment_new_pool"), 2);
$usage->addOption($new_pool);
$form->addItem($usage);
$usage->setValue(1);
$questionpools = ilObjQuestionPool::_getAvailableQuestionpools(FALSE, FALSE, TRUE, FALSE, FALSE, "write");
$pools_data = array();
foreach($questionpools as $key => $p) {
$pools_data[$key] = $p['title'];
}
$pools = new ilSelectInputGUI($this->lng->txt("select_questionpool"), "sel_qpl");
$pools->setOptions($pools_data);
$existing_pool->addSubItem($pools);
$name = new ilTextInputGUI($this->lng->txt("cat_create_qpl"), "txt_qpl");
$name->setSize(50);
$name->setMaxLength(50);
$new_pool->addSubItem($name);
}
$form->addCommandButton("handleToolbarCommand", $lng->txt("submit"));
$form->addCommandButton("questions", $lng->txt("cancel"));
return $tpl->setContent($form->getHTML());
}

+ Here is the call graph for this function:

ilTestExpressPageObjectGUI::browseForQuestions ( )

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

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

{
global $ilAccess, $tpl, $ilCtrl;
$ilCtrl->setParameterByClass(get_class($this), "browse", "1");
include_once "./Modules/Test/classes/tables/class.ilTestQuestionBrowserTableGUI.php";
$table_gui = new ilTestQuestionBrowserTableGUI($this, 'browseForQuestions', (($ilAccess->checkAccess("write", "", $_REQUEST['ref_id']) ? true : false)));
$arrFilter = array();
foreach ($table_gui->getFilterItems() as $item)
{
if ($item->getValue() !== false)
{
$arrFilter[$item->getPostVar()] = $item->getValue();
}
}
$data = $this->test_object->getAvailableQuestions($arrFilter, 1);
$table_gui->setData($data);
$tpl->setVariable('ADM_CONTENT', $table_gui->getHTML());
}
& ilTestExpressPageObjectGUI::executeCommand ( )

execute command

Reimplemented from ilPageObjectGUI.

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

References $_GET, $_REQUEST, $cmd, $ilCtrl, ilPageObjectGUI\$lng, ilPageObjectGUI\$obj, $ret, $total, assQuestionGUI\_getQuestionGUI(), addPageOfQuestions(), ilPageObjectGUI\getEnabledInternalLinks(), ilPageObjectGUI\getEnableEditing(), ilPageObjectGUI\getEnableKeywords(), 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().

{
global $ilCtrl, $ilTabs, $ilUser, $lng;
$next_class = $this->ctrl->getNextClass($this);
$cmd = $this->ctrl->getCmd();
switch ($next_class) {
case 'ilobjquestionpoolgui':
$nodeParts = explode(':', $_GET['cmdNode']);
$params = array(
'ref_id' => $_GET['ref_id'],
'calling_test' => $_GET['ref_id'],
'q_id' => $_GET['q_id'],
'cmd' => $_GET['cmd'],
'cmdClass' => $_GET['cmdClass'],
'cmdNode' => $nodeParts[count($nodeParts) - 2] . ':' . $nodeParts[count($nodeParts) - 1],
'baseClass' => 'ilObjQuestionPoolGUI',
'test_express_mode' => '1'
);
ilUtil::redirect('ilias.php?' . http_build_query($params, null, '&'));
break;
case "ilpageeditorgui":
if (!$this->getEnableEditing()) {
ilUtil::sendFailure($lng->txt("permission_denied"), true);
$ilCtrl->redirect($this, "preview");
}
$page_editor = & new ilPageEditorGUI($this->getPageObject(), $this);
$page_editor->setLocator($this->locator);
$page_editor->setHeader($this->getHeader());
$page_editor->setPageBackTitle($this->page_back_title);
$page_editor->setEnableInternalLinks($this->getEnabledInternalLinks());
$page_editor->setEnableKeywords($this->getEnableKeywords());
$page_editor->setIntLinkHelpDefault($this->int_link_def_type,
$this->int_link_def_id);
$page_editor->setIntLinkReturn($this->int_link_return);
$this->ctrl->saveParameterByClass('ilpageeditorgui', 'q_mode');
$ret = & $this->ctrl->forwardCommand($page_editor);
break;
case '':
case 'iltestexpresspageobjectgui':
include_once 'Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
if ($cmd == 'view')
$cmd = 'showPage';
$q_gui = & assQuestionGUI::_getQuestionGUI('', $_REQUEST["q_id"]);
if ($q_gui->object) {
$q_gui->object->setObjId($obj->getId());
}
if (in_array($cmd, array(
'handleToolbarCommand',
'addQuestion',
'questions',
'insertQuestions',
'browseForQuestions',
'filterAvailableQuestions',
'resetfilterAvailableQuestions'
))) {
return $this->$cmd();
}
else if ($q_gui->object) {
$total = $this->test_object->evalTotalPersons();
if($total != 0)
{
$link = $ilCtrl->getLinkTargetByClass('ilobjtestgui', "participants");
$link = "<a href=\"".$link."\">".$lng->txt("test_has_datasets_warning_page_view_link")."</a>";
ilUtil::sendInfo($lng->txt("test_has_datasets_warning_page_view")." ".$link);
}
if (in_array($cmd, array('view', 'showPage')) || $cmd == 'edit' && $this->test_object->evalTotalPersons()) {
return $this->showPage();
}
}
break;
default:
$qtype = $_REQUEST['qtype'];
if (!$_GET['q_id']) {
$q_gui = $this->addPageOfQuestions(preg_replace('/(.*?)gui/i', '$1', $_GET['sel_question_types']));
$q_gui->setQuestionTabs();
$ret = $this->ctrl->forwardCommand($q_gui);
break;
} else {
}
$this->ctrl->setReturn($this, "questions");
include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
$q_gui = & assQuestionGUI::_getQuestionGUI($type, $_GET["q_id"]);
if ($q_gui->object) {
$q_gui->object->setObjId($obj->getId());
}
$this->ctrl->saveParameterByClass('ilpageeditorgui', 'q_id');
$this->ctrl->saveParameterByClass('ilpageeditorgui', 'q_mode');
$q_gui->setQuestionTabs();
$ret = & $this->ctrl->forwardCommand($q_gui);
break;
}
}

+ Here is the call graph for this function:

ilTestExpressPageObjectGUI::filterAvailableQuestions ( )

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

{
include_once "./Modules/Test/classes/tables/class.ilTestQuestionBrowserTableGUI.php";
$table_gui = new ilTestQuestionBrowserTableGUI($this, 'browseForQuestions');
$table_gui->writeFilterToSession();
$this->ctrl->redirect($this, "browseForQuestions");
}
ilTestExpressPageObjectGUI::handleToolbarCommand ( )

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

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

{
include_once "./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
if ($_REQUEST['qtype']) {
include_once 'Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php';
}
else if ($_REQUEST['sel_question_types']) {
$questionType = $_REQUEST['sel_question_types'];
}
$q_gui =& assQuestionGUI::_getQuestionGUI($questionType);
$q_gui->object->setObjId($_GET['ref_id']);
$q_gui->object->createNewQuestion();
$previousQuestionId = $_REQUEST['position'];
switch($_REQUEST['usage']) {
case 3: // existing pool
global $ilCtrl;
$ilCtrl->setParameterByClass('ilobjtestgui', 'sel_qpl', $_REQUEST['sel_qpl']);
$ilCtrl->setParameterByClass('ilobjtestgui', 'sel_question_types', $questionType);
$ilCtrl->setParameterByClass('ilobjtestgui', 'q_id', $q_gui->object->getId());
$ilCtrl->setParameterByClass('ilobjtestgui', 'prev_qid', $previousQuestionId);
if ($_REQUEST['test_express_mode'])
$ilCtrl->setParameterByClass('ilobjtestgui', 'test_express_mode', 1);
$ilCtrl->setParameterByClass('ilobjtestgui', 'usage', 3);
$ilCtrl->setParameterByClass('ilobjtestgui', 'calling_test', $this->test_object->getId());
$link = $ilCtrl->getLinkTargetByClass('ilobjtestgui', 'executeCreateQuestion', false, false, false);
break;
case 2: // new pool
global $ilCtrl;
$ilCtrl->setParameterByClass('ilobjtestgui', 'txt_qpl', $_REQUEST['txt_qpl']);
$ilCtrl->setParameterByClass('ilobjtestgui', 'sel_question_types', $questionType);
$ilCtrl->setParameterByClass('ilobjtestgui', 'q_id', $q_gui->object->getId());
$ilCtrl->setParameterByClass('ilobjtestgui', 'prev_qid', $previousQuestionId);
if ($_REQUEST['test_express_mode'])
$ilCtrl->setParameterByClass('ilobjtestgui', 'test_express_mode', 1);
$ilCtrl->setParameterByClass('ilobjtestgui', 'usage', 2);
$ilCtrl->setParameterByClass('ilobjtestgui', 'calling_test', $this->test_object->getId());
$link = $ilCtrl->getLinkTargetByClass('ilobjtestgui', 'executeCreateQuestion', false, false, false);
break;
case 1: // no pool
default:
$this->redirectToQuestionEditPage($questionType, $q_gui->object->getId(), $previousQuestionId);
break;
}
}

+ Here is the call graph for this function:

ilTestExpressPageObjectGUI::insertQuestions ( )

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

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

{
$selected_array = (is_array($_POST['q_id'])) ? $_POST['q_id'] : array();
if (!count($selected_array))
{
ilUtil::sendInfo($this->lng->txt("tst_insert_missing_question"), true);
$this->ctrl->redirect($this, "browseForQuestions");
}
else
{
include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
$manscoring = FALSE;
foreach ($selected_array as $key => $value)
{
$last_question_id = $this->test_object->insertQuestion($value);
if (!$manscoring)
{
$manscoring = $manscoring | assQuestion::_needsManualScoring($value);
}
}
$this->test_object->saveCompleteStatus();
if ($manscoring)
{
ilUtil::sendInfo($this->lng->txt("manscoring_hint"), TRUE);
}
else
{
ilUtil::sendSuccess($this->lng->txt("tst_questions_inserted"), TRUE);
}
$this->ctrl->setParameter($this, 'q_id', $last_question_id);
$this->ctrl->redirect($this, "showPage");
return;
}
}

+ Here is the call graph for this function:

ilTestExpressPageObjectGUI::nextQuestion ( )

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

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

{
$obj = new ilObjTest($_REQUEST['ref_id']);
$questions = array_keys($obj->getQuestionTitlesAndIndexes());
$pos = array_search($_REQUEST['q_id'], $questions);
if ($pos == count($questions) - 1) {
ilUtil::sendInfo('test_express_end_reached_moved_to_first', true);
$next = $questions[0];
} else if ($pos !== false) {
$next = $questions[$pos + 1];
} else {
$next = $questions[0];
}
$this->ctrl->setParameter($this, 'q_id', $next);
$link = $this->ctrl->getLinkTarget($this, 'edit', '', '', false);
}

+ Here is the call graph for this function:

ilTestExpressPageObjectGUI::prevQuestion ( )

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

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

{
$obj = new ilObjTest($_REQUEST['ref_id']);
$questions = array_keys($obj->getQuestionTitlesAndIndexes());
$pos = array_search($_REQUEST['q_id'], $questions);
if ($pos == 0) {
ilUtil::sendInfo('test_express_start_reached_moved_to_last', true);
$next = $questions[count($questions) - 1];
} else if ($pos !== false) {
$next = $questions[$pos - 1];
} else {
$next = $questions[0];
}
$this->ctrl->setParameter($this, 'q_id', $next);
$link = $this->ctrl->getLinkTarget($this, 'edit', '', '', false);
}

+ Here is the call graph for this function:

ilTestExpressPageObjectGUI::questions ( )

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

References $ilCtrl.

{
global $ilCtrl;
$ilCtrl->saveParameterByClass('ilobjtestgui', 'q_id');
$ilCtrl->redirectByClass('ilobjtestgui', 'showPage');
}
ilTestExpressPageObjectGUI::redirectToQuestionEditPage (   $questionType,
  $qid,
  $prev_qid 
)
private

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

References $_GET, $_REQUEST, $cmd, $ref_id, ilTestExpressPage\getNodeId(), and ilUtil\redirect().

Referenced by handleToolbarCommand().

{
include_once 'Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php';
$ref_id = $_GET['ref_id'];
$sel_question_types = $questionType;
$cmd = 'editQuestion';
$cmdClass = strtolower($questionType);
$cmdNode = $_GET['cmdNode'];
$baseClass = 'ilObjTestGUI';
$node = ilTestExpressPage::getNodeId(strtolower($questionType) . 'gui');
$cmdNodes = explode(':', $_GET['cmdNode']);
$firstNode = $cmdNodes[0];
$linkParams = array(
'ref_id' => $_GET['ref_id'],
'sel_question_types' => $questionType,
'cmd' => 'editQuestion',
'cmdClass' => strtolower($questionType) . 'gui',
'cmdNode' => $firstNode . ':' . $node,
'baseClass' => 'ilObjTestGUI',
'test_ref_id' => $_GET['ref_id'],
'calling_test' => $_GET['ref_id'],
//'express_mode' => 'true',
'q_id' => $qid,
'prev_qid' => $prev_qid
);
if ($_REQUEST['test_express_mode'])
$linkParams['test_express_mode'] = 1;
ilUtil::redirect('ilias.php?' . http_build_query($linkParams, 'null', '&'));
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

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

References $_REQUEST, and ilUtil\redirect().

{
$this->ctrl->setParameterByClass('ilObjTestGUI', 'ref_id', $_REQUEST['ref_id']);
$this->ctrl->setParameterByClass('ilObjTestGUI', 'q_id', $qid);
$this->ctrl->setParameterByClass('ilObjTestGUI', 'sel_question_types', $questionType);
$this->ctrl->setParameterByClass('ilObjTestGUI', 'prev_qid', $prev_qid);
$redir = $this->ctrl->getLinkTargetByClass('ilObjTestGUI', 'createQuestion', '', false, false);
}

+ Here is the call graph for this function:

ilTestExpressPageObjectGUI::resetfilterAvailableQuestions ( )

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

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

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