ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilLOEditorGUI Class Reference

Class ilLOEditorGUI. More...

+ Collaboration diagram for ilLOEditorGUI:

Public Member Functions

 __construct ($a_parent_obj)
 Constructor.
 executeCommand ()
 Execute command.
 getParentObject ()
 getSettings ()
 Settings.
 setTestType ($a_type)
 getTestType ()

Data Fields

const TEST_TYPE_IT = 1
const TEST_TYPE_QT = 2
const TEST_NEW = 1
const TEST_ASSIGN = 2
const SETTINGS_TEMPLATE_IT = 'il_astpl_loc_initial'
const SETTINGS_TEMPLATE_QT = 'il_astpl_loc_qualified'

Protected Member Functions

 settings (ilPropertyFormGUI $form=NULL)
 Objective Settings.
 saveSettings ()
 initSettingsForm ()
 Init settings form.
 materials ()
 testOverview ()
 Show test overview.
 confirmDeleteTest ()
 Show delete confirmation screen.
 deleteTest ()
 Delete test assignment.
 testSettings (ilPropertyFormGUI $form=NULL)
 Show test settings.
 getAssignableTests ()
 Get assignable tests.
 initTestForm ()
 Show test config form.
 applySettingsTemplate (ilObjTest $tst)
 Apply auto generated setttings template.
 updateStartObjects ()
 Add Test as start object.
 saveTest ()
 Save Test.
 listObjectives ()
 List all abvailable objectives.
 showObjectiveCreation (ilPropertyFormGUI $form=NULL)
 Show objective creation form.
 initSimpleObjectiveForm ()
 Show objective creation form.
 saveObjectiveCreation ()
 saveSorting ()
 save position
 askDeleteObjectives ()
 Confirm delete objectives.
 activateObjectives ()
 activate chosen objectives
 deactivateObjectives ()
 activate chosen objectives
 deleteObjectives ()
 Delete objectives type $rbacsystem.
 showStatus ($a_section)
 Show status panel.
 setTabs ($a_section= '')
 Set tabs.

Private Attributes

 $parent_obj
 $settings = NULL
 $lng = NULL
 $ctrl = NULL
 $test_type = 0

Detailed Description

Constructor & Destructor Documentation

ilLOEditorGUI::__construct (   $a_parent_obj)

Constructor.

Parameters
type$a_parent_obj

Definition at line 43 of file class.ilLOEditorGUI.php.

References $GLOBALS, ilLOSettings\getInstanceByObjId(), getParentObject(), and settings().

{
$this->parent_obj = $a_parent_obj;
$this->lng = $GLOBALS['lng'];
$this->ctrl = $GLOBALS['ilCtrl'];
}

+ Here is the call graph for this function:

Member Function Documentation

ilLOEditorGUI::activateObjectives ( )
protected

activate chosen objectives

Definition at line 940 of file class.ilLOEditorGUI.php.

References $_REQUEST, ilCourseObjective\_getObjectiveIds(), ilLPStatusWrapper\_refreshStatus(), getParentObject(), and ilUtil\sendSuccess().

{
$enabled = (array) $_REQUEST['objective'];
include_once './Modules/Course/classes/class.ilCourseObjective.php';
$objectives = ilCourseObjective::_getObjectiveIds($this->getParentObject()->getId(),false);
foreach((array) $objectives as $objective_id)
{
$objective = new ilCourseObjective($this->getParentObject(),$objective_id);
if(in_array($objective_id, $enabled))
{
$objective->setActive(true);
$objective->update();
}
}
include_once './Services/Tracking/classes/class.ilLPStatusWrapper.php';
ilUtil::sendSuccess($this->lng->txt('settings_saved'),true);
$this->ctrl->redirect($this,'listObjectives');
}

+ Here is the call graph for this function:

ilLOEditorGUI::applySettingsTemplate ( ilObjTest  $tst)
protected

Apply auto generated setttings template.

Parameters
ilObjTest$tst

Definition at line 670 of file class.ilLOEditorGUI.php.

References ilSettingsTemplate\getAllSettingsTemplates(), ilObjAssessmentFolderGUI\getSettingsTemplateConfig(), getTestType(), and ilObjTest\setTemplate().

Referenced by saveTest().

{
include_once "Services/Administration/classes/class.ilSettingsTemplate.php";
include_once './Modules/Test/classes/class.ilObjAssessmentFolderGUI.php';
$tpl_id = 0;
foreach(ilSettingsTemplate::getAllSettingsTemplates('tst', true) as $nr => $template)
{
switch($this->getTestType())
{
case self::TEST_TYPE_IT:
if($template['title'] == self::SETTINGS_TEMPLATE_IT)
{
$tpl_id = $template['id'];
}
break;
case self::TEST_TYPE_QT:
if($template['title'] == self::SETTINGS_TEMPLATE_QT)
{
$tpl_id = $template['id'];
}
break;
}
if($tpl_id)
{
break;
}
}
if(!$tpl_id)
{
return false;
}
include_once "Services/Administration/classes/class.ilSettingsTemplate.php";
include_once './Modules/Test/classes/class.ilObjAssessmentFolderGUI.php';
$template_settings = $template->getSettings();
if($template_settings)
{
include_once './Modules/Test/classes/class.ilObjTestGUI.php';
$tst_gui = new ilObjTestGUI();
$tst_gui->applyTemplate($template_settings, $tst);
}
$tst->setTemplate($tpl_id);
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilLOEditorGUI::askDeleteObjectives ( )
protected

Confirm delete objectives.

Definition at line 910 of file class.ilLOEditorGUI.php.

References $_POST, $GLOBALS, getParentObject(), ilLOEditorStatus\SECTION_OBJECTIVES, and showStatus().

{
$GLOBALS['ilTabs']->activateSubTab('objectives');
include_once './Services/Utilities/classes/class.ilConfirmationGUI.php';
$confirm = new ilConfirmationGUI();
$confirm->setFormAction($this->ctrl->getFormAction($this));
$confirm->setHeaderText($this->lng->txt('crs_delete_objectve_sure'));
$confirm->setConfirm($this->lng->txt('delete'), 'deleteObjectives');
$confirm->setCancel($this->lng->txt('cancel'), 'listObjectives');
foreach($_POST['objective'] as $objective_id)
{
include_once './Modules/Course/classes/class.ilCourseObjective.php';
$obj = new ilCourseObjective($this->getParentObject(),$objective_id);
$name = $obj->getTitle();
$confirm->addItem(
'objective_ids[]',
$objective_id,
$name
);
}
$GLOBALS['tpl']->setContent($confirm->getHTML());
}

+ Here is the call graph for this function:

ilLOEditorGUI::confirmDeleteTest ( )
protected

Show delete confirmation screen.

Definition at line 400 of file class.ilLOEditorGUI.php.

References $_REQUEST, $GLOBALS, $settings, ilObject\_lookupObjId(), ilObject\_lookupTitle(), ilLOSettings\getInstanceByObjId(), getParentObject(), getTestType(), ilLOEditorStatus\SECTION_ITES, ilLOEditorStatus\SECTION_QTEST, ilUtil\sendFailure(), setTestType(), showStatus(), TEST_TYPE_IT, ilLOSettings\TYPE_TEST_INITIAL, and ilLOSettings\TYPE_TEST_QUALIFIED.

{
$this->setTestType((int) $_REQUEST['tt']);
$this->ctrl->setParameter($this,'tt',$this->getTestType());
switch($this->getTestType())
{
$GLOBALS['ilTabs']->activateSubTab('itest');
break;
$GLOBALS['ilTabs']->activateSubTab('qtest');
break;
}
if(!(int) $_REQUEST['tst'])
{
ilUtil::sendFailure($this->lng->txt('select_one'),true);
$this->ctrl->redirect($this,'testOverview');
}
include_once './Services/Utilities/classes/class.ilConfirmationGUI.php';
$confirm = new ilConfirmationGUI();
$confirm->setHeaderText($this->lng->txt('crs_loc_confirm_delete_tst'));
$confirm->setFormAction($this->ctrl->getFormAction($this));
$confirm->setConfirm($this->lng->txt('delete'), 'deleteTest');
$confirm->setCancel($this->lng->txt('cancel'), 'testOverview');
foreach((array) $_REQUEST['tst'] as $tst_id)
{
$obj_id = ilObject::_lookupObjId($tst_id);
$confirm->addItem('tst[]', $tst_id, ilObject::_lookupTitle($obj_id));
}
$GLOBALS['tpl']->setContent($confirm->getHTML());
$this->showStatus(
);
}

+ Here is the call graph for this function:

ilLOEditorGUI::deactivateObjectives ( )
protected

activate chosen objectives

Definition at line 966 of file class.ilLOEditorGUI.php.

References $_REQUEST, ilCourseObjective\_getObjectiveIds(), ilLPStatusWrapper\_refreshStatus(), getParentObject(), and ilUtil\sendSuccess().

{
$disabled = (array) $_REQUEST['objective'];
include_once './Modules/Course/classes/class.ilCourseObjective.php';
$objectives = ilCourseObjective::_getObjectiveIds($this->getParentObject()->getId(),false);
foreach((array) $objectives as $objective_id)
{
$objective = new ilCourseObjective($this->getParentObject(),$objective_id);
if(in_array($objective_id, $disabled))
{
$objective->setActive(false);
$objective->update();
}
}
include_once './Services/Tracking/classes/class.ilLPStatusWrapper.php';
ilUtil::sendSuccess($this->lng->txt('settings_saved'),true);
$this->ctrl->redirect($this,'listObjectives');
}

+ Here is the call graph for this function:

ilLOEditorGUI::deleteObjectives ( )
protected

Delete objectives type $rbacsystem.

Returns
boolean

Definition at line 994 of file class.ilLOEditorGUI.php.

References $_POST, ilLPStatusWrapper\_refreshStatus(), getParentObject(), and ilUtil\sendSuccess().

{
global $rbacsystem;
foreach($_POST['objective_ids'] as $objective_id)
{
include_once './Modules/Course/classes/class.ilCourseObjective.php';
$objective_obj = new ilCourseObjective($this->getParentObject(),$objective_id);
$objective_obj->delete();
}
include_once './Services/Tracking/classes/class.ilLPStatusWrapper.php';
ilUtil::sendSuccess($this->lng->txt('crs_objectives_deleted'),true);
$this->ctrl->redirect($this,'listObjectives');
return true;
}

+ Here is the call graph for this function:

ilLOEditorGUI::deleteTest ( )
protected

Delete test assignment.

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

References $_REQUEST, $GLOBALS, $settings, ilLOSettings\getInstanceByObjId(), getParentObject(), getTestType(), ilUtil\sendSuccess(), setTestType(), ilLOSettings\TYPE_TEST_INITIAL, and ilLOSettings\TYPE_TEST_QUALIFIED.

{
$this->setTestType((int) $_REQUEST['tt']);
$this->ctrl->setParameter($this,'tt',$this->getTestType());
switch($this->getTestType())
{
$GLOBALS['ilTabs']->activateSubTab('itest');
break;
$GLOBALS['ilTabs']->activateSubTab('qtest');
break;
}
foreach((array) $_REQUEST['tst'] as $tst_id)
{
switch($this->getTestType())
{
$settings->setInitialTest(0);
break;
$settings->setQualifiedTest(0);
break;
}
$settings->update();
// finally delete start object assignment
include_once './Services/Container/classes/class.ilContainerStartObjects.php';
$this->getParentObject()->getRefId(),
$this->getParentObject()->getId()
);
$start->deleteItem($tst_id);
// ... and assigned questions
include_once './Modules/Course/classes/class.ilCourseObjectiveQuestion.php';
}
ilUtil::sendSuccess($this->lng->txt('settings_saved'),true);
$this->ctrl->redirect($this,'testOverview');
}

+ Here is the call graph for this function:

ilLOEditorGUI::executeCommand ( )

Execute command.

Returns
<type>

Definition at line 55 of file class.ilLOEditorGUI.php.

References $_REQUEST, $cmd, $GLOBALS, $ilCtrl, $ret, ilPageObject\_exists(), ilObjStyleSheet\getContentStylePath(), ilObjStyleSheet\getEffectiveContentStyleId(), ilLOEditorStatus\getInstance(), getParentObject(), ilCourseObjective\lookupObjectiveTitle(), and setTabs().

{
global $ilCtrl;
$next_class = $ilCtrl->getNextClass($this);
$cmd = $ilCtrl->getCmd();
$this->setTabs();
switch($next_class)
{
case 'ilcourseobjectivesgui':
$this->ctrl->setReturn($this,'listObjectives');
$GLOBALS['ilTabs']->clearTargets();
$GLOBALS['ilTabs']->setBackTarget(
$this->lng->txt('back'),
$this->ctrl->getLinkTarget($this,'listObjectives'));
include_once './Modules/Course/classes/class.ilCourseObjectivesGUI.php';
$reg_gui =& new ilCourseObjectivesGUI($this->getParentObject()->getRefId());
$this->ctrl->forwardCommand($reg_gui);
break;
case 'ilcontainerstartobjectsgui':
include_once './Services/Container/classes/class.ilContainerStartObjectsGUI.php';
$ret = $this->ctrl->forwardCommand($stgui);
$GLOBALS['ilTabs']->activateSubTab('start');
$GLOBALS['ilTabs']->removeSubTab('manage');
#$GLOBALS['tpl']->setContent($this->ctrl->getHTML($stgui));
break;
case 'ilconditionhandlergui':
$this->ctrl->saveParameterByClass('ilconditionhandlergui','objective_id');
$GLOBALS['ilTabs']->clearTargets();
$GLOBALS['ilTabs']->setBackTarget(
$this->lng->txt('back'),
$this->ctrl->getLinkTarget($this,'listObjectives'));
include_once './Services/AccessControl/classes/class.ilConditionHandlerInterface.php';
$cond = new ilConditionHandlerGUI($this);
$cond->setBackButtons(array());
$cond->setAutomaticValidation(false);
$cond->setTargetType("lobj");
$cond->setTargetRefId($this->getParentObject()->getRefId());
$cond->setTargetId((int) $_REQUEST['objective_id']);
// objecitve
include_once './Modules/Course/classes/class.ilCourseObjective.php';
$obj = new ilCourseObjective($this->getParentObject(),(int) $_REQUEST['objective_id']);
$cond->setTargetTitle($obj->getTitle());
$this->ctrl->forwardCommand($cond);
break;
case 'illopagegui':
$this->ctrl->saveParameterByClass('illopagegui','objective_id');
$GLOBALS['ilTabs']->clearTargets();
$GLOBALS['ilTabs']->setBackTarget(
$this->lng->txt('back'),
$this->ctrl->getLinkTarget($this,'listObjectives'));
$objtv_id = (int)$_REQUEST['objective_id'];
include_once 'Modules/Course/classes/Objectives/class.ilLOPage.php';
if(!ilLOPage::_exists('lobj', $objtv_id))
{
// doesn't exist -> create new one
$new_page_object = new ilLOPage();
$new_page_object->setParentId($objtv_id);
$new_page_object->setId($objtv_id);
$new_page_object->createFromXML();
unset($new_page_object);
}
$this->ctrl->setReturn($this, 'listObjectives');
include_once 'Modules/Course/classes/Objectives/class.ilLOPageGUI.php';
$pgui = new ilLOPageGUI($objtv_id);
$pgui->setPresentationTitle(ilCourseObjective::lookupObjectiveTitle($objtv_id));
// needed for editor?
include_once('./Services/Style/classes/class.ilObjStyleSheet.php');
// #14895
$GLOBALS['tpl']->setCurrentBlock("ContentStyle");
$GLOBALS['tpl']->setVariable("LOCATION_CONTENT_STYLESHEET",
$GLOBALS['tpl']->parseCurrentBlock();
$ret = $this->ctrl->forwardCommand($pgui);
if($ret)
{
$GLOBALS['tpl']->setContent($ret);
}
break;
default:
if(!$cmd)
{
// get first unaccomplished step
include_once './Modules/Course/classes/Objectives/class.ilLOEditorStatus.php';
$cmd = ilLOEditorStatus::getInstance($this->getParentObject())->getFirstFailedStep();
}
$this->$cmd();
break;
}
return true;
}

+ Here is the call graph for this function:

ilLOEditorGUI::getAssignableTests ( )
protected

Get assignable tests.

Definition at line 531 of file class.ilLOEditorGUI.php.

References $GLOBALS, $tests, getParentObject(), and getSettings().

Referenced by initTestForm().

{
$tests = array();
foreach($GLOBALS['tree']->getChildsByType($this->getParentObject()->getRefId(),'tst') as $tree_node)
{
if(!in_array($tree_node['child'], $this->getSettings()->getTests()))
{
$tests[] = $tree_node['child'];
}
}
return $tests;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilLOEditorGUI::getSettings ( )

Settings.

Returns
ilLOSettings

Definition at line 184 of file class.ilLOEditorGUI.php.

References $settings.

Referenced by getAssignableTests(), initSettingsForm(), initTestForm(), saveTest(), and updateStartObjects().

{
}

+ Here is the caller graph for this function:

ilLOEditorGUI::getTestType ( )

Definition at line 194 of file class.ilLOEditorGUI.php.

References $test_type.

Referenced by applySettingsTemplate(), confirmDeleteTest(), deleteTest(), initTestForm(), saveTest(), testOverview(), and testSettings().

{
}

+ Here is the caller graph for this function:

ilLOEditorGUI::initSettingsForm ( )
protected

Init settings form.

Definition at line 251 of file class.ilLOEditorGUI.php.

References ilLOSettings\getInstanceByObjId(), getParentObject(), getSettings(), ilLOSettings\LOC_INITIAL_ALL, ilLOSettings\LOC_INITIAL_SEL, ilLOSettings\LOC_PRACTISE, ilLOSettings\LOC_QUALIFIED, ilLOSettings\QT_VISIBLE_ALL, ilLOSettings\QT_VISIBLE_OBJECTIVE, ilRadioOption\setInfo(), ilFormPropertyGUI\setRequired(), and ilCheckboxInputGUI\setValue().

Referenced by saveSettings(), and settings().

{
include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
$form = new ilPropertyFormGUI();
$form->setFormAction($this->ctrl->getFormAction($this));
$form->setTitle($this->lng->txt('crs_loc_settings_tbl'));
$type = new ilRadioGroupInputGUI($this->lng->txt('crs_loc_settings_type'), 'type');
$type->setRequired(true);
$type->setValue(ilLOSettings::getInstanceByObjId($this->getParentObject()->getId())->getType());
$type_1 = new ilRadioOption($this->lng->txt('crs_loc_type_initial_all'), ilLOSettings::LOC_INITIAL_ALL);
$type_1->setInfo($this->lng->txt('crs_loc_type_initial_all_info'));
$type->addOption($type_1);
$type_2 = new ilRadioOption($this->lng->txt('crs_loc_type_initial_sel'), ilLOSettings::LOC_INITIAL_SEL);
#$type->addOption($type_2);
$type_3 = new ilRadioOption($this->lng->txt('crs_loc_type_qualified'), ilLOSettings::LOC_QUALIFIED);
$type_3->setInfo($this->lng->txt('crs_loc_type_qualified_info'));
$type->addOption($type_3);
$type_4 = new ilRadioOption($this->lng->txt('crs_loc_type_practise'), ilLOSettings::LOC_PRACTISE);
$type_4->setInfo($this->lng->txt('crs_loc_type_practise_info'));
$type->addOption($type_4);
$form->addItem($type);
$form->addCommandButton('saveSettings', $this->lng->txt('save'));
// qualified test visibility
$qtv = new ilCheckboxGroupInputGUI($this->lng->txt('crs_loc_qt_visibility'),'qtv');
$qtv_values = array();
if($this->getSettings()->isGeneralQualifiedTestVisible())
{
}
if($this->getSettings()->isQualifiedTestPerObjectiveVisible())
{
}
$qtv->setValue($qtv_values);
$qtv->setRequired(true);
$qtv->addOption(new ilCheckboxOption(
$this->lng->txt('crs_loc_qt_visibility_all'),
);
$qtv->addOption(new ilCheckboxOption(
$this->lng->txt('crs_loc_qt_visibility_lo'),
);
#$form->addItem($qtv);
// reset results
$reset = new ilCheckboxInputGUI($this->lng->txt('crs_loc_settings_reset'),'reset');
$reset->setValue(1);
$reset->setChecked($this->getSettings()->isResetResultsEnabled());
$reset->setOptionTitle($this->lng->txt('crs_loc_settings_reset_enable'));
$reset->setInfo($this->lng->txt('crs_loc_settings_reset_enable_info'));
$form->addItem($reset);
return $form;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilLOEditorGUI::initSimpleObjectiveForm ( )
protected

Show objective creation form.

Definition at line 845 of file class.ilLOEditorGUI.php.

References $txt.

Referenced by saveObjectiveCreation(), and showObjectiveCreation().

{
include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
$form = new ilPropertyFormGUI();
$form->setTitle($this->lng->txt('crs_loc_form_create_objectives'));
$form->setFormAction($this->ctrl->getFormAction($this));
$txt = new ilTextWizardInputGUI($this->lng->txt('crs_objectives'), 'objectives');
$txt->setValues(array(0 => ''));
$txt->setRequired(true);
$form->addItem($txt);
$form->addCommandButton('saveObjectiveCreation', $this->lng->txt('save'));
return $form;
}

+ Here is the caller graph for this function:

ilLOEditorGUI::initTestForm ( )
protected

Show test config form.

Returns

Definition at line 548 of file class.ilLOEditorGUI.php.

References $options, ilObject\_lookupDescription(), ilObject\_lookupObjId(), ilObject\_lookupTitle(), ilRadioOption\addSubItem(), getAssignableTests(), getSettings(), getTestType(), ilObjTest\QUESTION_SET_TYPE_FIXED, ilObjTest\QUESTION_SET_TYPE_RANDOM, ilFormPropertyGUI\setRequired(), ilTextInputGUI\setValue(), ilTextAreaInputGUI\setValue(), TEST_ASSIGN, TEST_NEW, ilLOSettings\TYPE_TEST_INITIAL, and ilLOSettings\TYPE_TEST_QUALIFIED.

Referenced by saveTest(), and testSettings().

{
include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
$form = new ilPropertyFormGUI();
$form->setFormAction($this->ctrl->getFormAction($this));
$form->addCommandButton('saveTest', $this->lng->txt('save'));
switch($this->getTestType())
{
case self::TEST_TYPE_IT:
$form->setTitle($this->lng->txt('crs_loc_settings_itest_tbl'));
break;
case self::TEST_TYPE_QT:
$form->setTitle($this->lng->txt('crs_loc_settings_qtest_tbl'));
break;
}
$assignable = $this->getAssignableTests();
$cr_mode = new ilRadioGroupInputGUI($this->lng->txt('crs_loc_form_assign_it'),'mode');
$cr_mode->setRequired(true);
$cr_mode->setValue(self::TEST_NEW);
$new = new ilRadioOption($this->lng->txt('crs_loc_form_tst_new'),self::TEST_NEW);
switch($this->getTestType())
{
$new->setInfo($this->lng->txt("crs_loc_form_tst_new_initial_info"));
break;
$new->setInfo($this->lng->txt("crs_loc_form_tst_new_qualified_info"));
break;
}
// title
$ti = new ilTextInputGUI($this->lng->txt("title"), "title");
$ti->setValue(
);
$ti->setMaxLength(128);
$ti->setSize(40);
$ti->setRequired(true);
$new->addSubItem($ti);
// description
$ta = new ilTextAreaInputGUI($this->lng->txt("description"), "desc");
$ta->setValue(
);
$ta->setCols(40);
$ta->setRows(2);
$new->addSubItem($ta);
// Question assignment type
include_once './Modules/Test/classes/class.ilObjTest.php';
$this->lng->loadLanguageModule('assessment');
$qst = new ilRadioGroupInputGUI($this->lng->txt('tst_question_set_type'),'qtype');
$qst->setRequired(true);
$qst->setValue(
$this->getSettings()->isRandomTestType($this->getTestType()) ?
);
$random = new ilRadioOption(
$this->lng->txt('tst_question_set_type_random'),
);
$qst->addOption($random);
$fixed = new ilRadioOption(
$this->lng->txt('tst_question_set_type_fixed'),
ilObjTest::QUESTION_SET_TYPE_FIXED
);
$qst->addOption($fixed);
$new->addSubItem($qst);
$cr_mode->addOption($new);
// assign existing
$existing = new ilRadioOption($this->lng->txt('crs_loc_form_assign'),self::TEST_ASSIGN);
switch($this->getTestType())
{
$existing->setInfo($this->lng->txt("crs_loc_form_assign_initial_info"));
break;
$existing->setInfo($this->lng->txt("crs_loc_form_assign_qualified_info"));
break;
}
if(!$assignable)
{
$existing->setDisabled(true);
}
$cr_mode->addOption($existing);
$options = array();
$options[0] = $this->lng->txt('select_one');
foreach((array) $assignable as $tst_ref_id)
{
$tst_obj_id = ilObject::_lookupObjId($tst_ref_id);
$options[$tst_ref_id] = ilObject::_lookupTitle($tst_obj_id);
}
$selectable = new ilSelectInputGUI($this->lng->txt('crs_loc_form_available_tsts'),'tst');
$selectable->setRequired(true);
$selectable->setOptions($options);
$existing->addSubItem($selectable);
$form->addItem($cr_mode);
return $form;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilLOEditorGUI::listObjectives ( )
protected

List all abvailable objectives.

Definition at line 805 of file class.ilLOEditorGUI.php.

References $GLOBALS, ilCourseObjective\_getObjectiveIds(), getParentObject(), ilLOEditorStatus\SECTION_OBJECTIVES, and showStatus().

Referenced by saveSorting().

{
global $ilToolbar;
$GLOBALS['ilTabs']->activateSubTab('objectives');
$ilToolbar->addButton(
$this->lng->txt('crs_add_objective'),
$this->ctrl->getLinkTargetByClass('ilcourseobjectivesgui', "create"));
include_once('./Modules/Course/classes/class.ilCourseObjectivesTableGUI.php');
$table = new ilCourseObjectivesTableGUI($this,$this->getParentObject());
$table->setTitle($this->lng->txt('crs_objectives'),'',$this->lng->txt('crs_objectives'));
$table->parse(ilCourseObjective::_getObjectiveIds($this->getParentObject()->getId(),false));
$GLOBALS['tpl']->setContent($table->getHTML());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilLOEditorGUI::materials ( )
protected

Definition at line 319 of file class.ilLOEditorGUI.php.

References $GLOBALS, getParentObject(), ilLOEditorStatus\SECTION_MATERIALS, and showStatus().

{
$GLOBALS['ilTabs']->activateSubTab('materials');
include_once "Services/Object/classes/class.ilObjectAddNewItemGUI.php";
$gui = new ilObjectAddNewItemGUI($this->getParentObject()->getRefId());
$gui->setDisabledObjectTypes(array("itgr"));
#$gui->setAfterCreationCallback($this->getParentObject()->getRefId());
$gui->render();
include_once './Services/Object/classes/class.ilObjectTableGUI.php';
$obj_table = new ilObjectTableGUI(
$this,
'materials',
$this->getParentObject()->getRefId()
);
$obj_table->init();
$obj_table->setObjects($GLOBALS['tree']->getChildIds($this->getParentObject()->getRefId()));
$obj_table->parse();
$GLOBALS['tpl']->setContent($obj_table->getHTML());
}

+ Here is the call graph for this function:

ilLOEditorGUI::saveObjectiveCreation ( )
protected

Definition at line 862 of file class.ilLOEditorGUI.php.

References $GLOBALS, getParentObject(), initSimpleObjectiveForm(), ilLOEditorStatus\SECTION_OBJECTIVES, ilUtil\sendSuccess(), and showStatus().

{
$form = $this->initSimpleObjectiveForm();
if($form->checkInput())
{
foreach((array) $form->getInput('objectives') as $idx => $title)
{
include_once './Modules/Course/classes/class.ilCourseObjective.php';
$obj = new ilCourseObjective($this->getParentObject());
$obj->setActive(false);
$obj->setTitle($title);
$obj->add();
}
ilUtil::sendSuccess($this->lng->txt('settings_saved'),true);
$this->ctrl->redirect($this,'');
}
$form->setValuesByPost();
$GLOBALS['ilTabs']->activateSubTab('objectives');
}

+ Here is the call graph for this function:

ilLOEditorGUI::saveSettings ( )
protected

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

References $settings, ilLOSettings\getInstanceByObjId(), getParentObject(), initSettingsForm(), ilLOSettings\QT_VISIBLE_ALL, ilLOSettings\QT_VISIBLE_OBJECTIVE, ilUtil\sendFailure(), ilUtil\sendSuccess(), settings(), and updateStartObjects().

{
$form = $this->initSettingsForm();
if($form->checkInput())
{
$settings->setType($form->getInput('type'));
$qtv_values = (array) $form->getInput('qtv');
$settings->setGeneralQualifiedTestVisibility(in_array(ilLOSettings::QT_VISIBLE_ALL, $qtv_values));
$settings->setQualifiedTestPerObjectiveVisibility(in_array(ilLOSettings::QT_VISIBLE_OBJECTIVE, $qtv_values));
$settings->resetResults($form->getInput('reset'));
$settings->update();
ilUtil::sendSuccess($this->lng->txt('settings_saved'),true);
$this->ctrl->redirect($this,'settings');
}
// Error
ilUtil::sendFailure($this->lng->txt('err_check_input'));
$form->setValuesByPost();
$this->settings($form);
}

+ Here is the call graph for this function:

ilLOEditorGUI::saveSorting ( )
protected

save position

protected

Returns

Definition at line 890 of file class.ilLOEditorGUI.php.

References $_POST, $ilErr, getParentObject(), listObjectives(), and ilUtil\sendSuccess().

{
global $ilAccess,$ilErr,$ilObjDataCache;
asort($_POST['position'],SORT_NUMERIC);
$counter = 1;
foreach($_POST['position'] as $objective_id => $position)
{
include_once './Modules/Course/classes/class.ilCourseObjective.php';
$objective = new ilCourseObjective($this->getParentObject(),$objective_id);
$objective->writePosition($counter++);
}
ilUtil::sendSuccess($this->lng->txt('crs_objective_saved_sorting'));
$this->listObjectives();
}

+ Here is the call graph for this function:

ilLOEditorGUI::saveTest ( )
protected

Save Test.

Definition at line 733 of file class.ilLOEditorGUI.php.

References $_REQUEST, $settings, applySettingsTemplate(), ilLOSettings\getInstanceByObjId(), getParentObject(), getSettings(), getTestType(), initTestForm(), ilUtil\sendFailure(), ilUtil\sendSuccess(), setTestType(), testSettings(), and updateStartObjects().

{
$this->ctrl->setParameter($this,'tt',(int) $_REQUEST['tt']);
$this->setTestType((int) $_REQUEST['tt']);
$form = $this->initTestForm();
if($form->checkInput())
{
$mode = $form->getInput('mode');
if($mode == self::TEST_NEW)
{
$tst = new ilObjTest();
$tst->setType('tst');
$tst->setTitle($form->getInput('title'));
$tst->setDescription($form->getInput('desc'));
$tst->create();
$tst->createReference();
$tst->putInTree($this->getParentObject()->getRefId());
$tst->setPermissions($this->getParentObject()->getRefId());
// apply settings template
$this->applySettingsTemplate($tst);
$tst->setQuestionSetType($form->getInput('qtype'));
$tst->saveToDb();
if($this->getTestType() == self::TEST_TYPE_IT)
{
$this->getSettings()->setInitialTest($tst->getRefId());
}
else
{
$this->getSettings()->setQualifiedTest($tst->getRefId());
}
$this->getSettings()->update();
}
else
{
if($this->getTestType() == self::TEST_TYPE_IT)
{
$this->getSettings()->setInitialTest($form->getInput('tst'));
}
else
{
$this->getSettings()->setQualifiedTest($form->getInput('tst'));
}
$this->getSettings()->update();
$tst = new ilObjTest($settings->getTestByType($this->getTestType()),true);
$this->applySettingsTemplate($tst);
$tst->saveToDb();
}
ilUtil::sendSuccess($this->lng->txt('settings_saved'));
$this->ctrl->redirect($this,'testOverview');
}
// Error
ilUtil::sendFailure($this->lng->txt('err_check_input'));
$form->setValuesByPost();
$this->testSettings($form);
}

+ Here is the call graph for this function:

ilLOEditorGUI::setTabs (   $a_section = '')
protected

Set tabs.

Parameters
type$a_section

Definition at line 1032 of file class.ilLOEditorGUI.php.

References $GLOBALS, $settings, ilLOSettings\getInstanceByObjId(), and getParentObject().

Referenced by executeCommand().

{
// objective settings
$GLOBALS['ilTabs']->addSubTab(
'settings',
$this->lng->txt('settings'),
$this->ctrl->getLinkTarget($this,'settings')
);
// learning objectives
$GLOBALS['ilTabs']->addSubTab(
'objectives',
$this->lng->txt('crs_loc_tab_objectives'),
$this->ctrl->getLinkTarget($this,'listObjectives')
);
// materials
/*
$GLOBALS['ilTabs']->addTab(
'materials',
$this->lng->txt('crs_loc_tab_materials'),
$this->ctrl->getLinkTarget($this,'materials')
);
*/
// tests
if($settings->worksWithInitialTest())
{
$this->ctrl->setParameter($this,'tt',self::TEST_TYPE_IT);
$GLOBALS['ilTabs']->addSubTab(
'itest',
$this->lng->txt('crs_loc_tab_itest'),
$this->ctrl->getLinkTarget($this,'testOverview')
);
}
$this->ctrl->setParameter($this,'tt',self::TEST_TYPE_QT);
$GLOBALS['ilTabs']->addSubTab(
'qtest',
$this->lng->txt('crs_loc_tab_qtest'),
$this->ctrl->getLinkTarget($this,'testOverview')
);
// start objects
$GLOBALS['ilTabs']->addSubTab(
'start',
$this->lng->txt('crs_loc_tab_start'),
$this->ctrl->getLinkTargetByClass('ilcontainerstartobjectsgui','')
);
// Member view
#include_once './Services/Container/classes/class.ilMemberViewGUI.php';
#ilMemberViewGUI::showMemberViewSwitch($this->getParentObject()->getRefId());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilLOEditorGUI::setTestType (   $a_type)

Definition at line 189 of file class.ilLOEditorGUI.php.

Referenced by confirmDeleteTest(), deleteTest(), saveTest(), and testOverview().

{
$this->test_type = $a_type;
}

+ Here is the caller graph for this function:

ilLOEditorGUI::settings ( ilPropertyFormGUI  $form = NULL)
protected

Objective Settings.

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

References $GLOBALS, initSettingsForm(), ilLOEditorStatus\SECTION_SETTINGS, and showStatus().

Referenced by __construct(), and saveSettings().

{
if(!$form instanceof ilPropertyFormGUI)
{
$form = $this->initSettingsForm();
}
$GLOBALS['ilTabs']->activateSubTab('settings');
$GLOBALS['tpl']->setContent($form->getHTML());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilLOEditorGUI::showObjectiveCreation ( ilPropertyFormGUI  $form = NULL)
protected

Show objective creation form.

Parameters
ilPropertyFormGUI$form

Definition at line 828 of file class.ilLOEditorGUI.php.

References $GLOBALS, initSimpleObjectiveForm(), ilLOEditorStatus\SECTION_OBJECTIVES_NEW, and showStatus().

{
$GLOBALS['ilTabs']->activateSubTab('objectives');
if(!$form instanceof ilPropertyFormGUI)
{
$form = $this->initSimpleObjectiveForm();
}
$GLOBALS['tpl']->setContent($form->getHTML());
}

+ Here is the call graph for this function:

ilLOEditorGUI::showStatus (   $a_section)
protected

Show status panel.

Definition at line 1017 of file class.ilLOEditorGUI.php.

References $GLOBALS, and getParentObject().

Referenced by askDeleteObjectives(), confirmDeleteTest(), listObjectives(), materials(), saveObjectiveCreation(), settings(), showObjectiveCreation(), testOverview(), and testSettings().

{
include_once './Modules/Course/classes/Objectives/class.ilLOEditorStatus.php';
$status = new ilLOEditorStatus($this->getParentObject());
$status->setSection($a_section);
$status->setCmdClass($this);
$GLOBALS['tpl']->setRightContent($status->getHTML());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilLOEditorGUI::testOverview ( )
protected

Show test overview.

Definition at line 347 of file class.ilLOEditorGUI.php.

References $_REQUEST, $GLOBALS, $settings, ilLOSettings\getInstanceByObjId(), getParentObject(), getTestType(), ilLOEditorStatus\SECTION_ITES, ilLOEditorStatus\SECTION_QTEST, setTestType(), showStatus(), TEST_TYPE_IT, testSettings(), ilLOSettings\TYPE_TEST_INITIAL, and ilLOSettings\TYPE_TEST_QUALIFIED.

{
$this->setTestType((int) $_REQUEST['tt']);
$this->ctrl->setParameter($this,'tt',$this->getTestType());
switch($this->getTestType())
{
$GLOBALS['ilTabs']->activateSubTab('itest');
break;
$GLOBALS['ilTabs']->activateSubTab('qtest');
break;
}
// Check if test is assigned
if(!$settings->getTestByType($this->getTestType()))
{
return $this->testSettings();
}
try {
include_once './Modules/Course/classes/Objectives/class.ilLOTestAssignmentTableGUI.php';
$this,
'testOverview',
$this->getParentObject()->getId(),
$this->getTestType()
);
$table->setTitle($this->lng->txt('crs_loc_tst_assignment'));
$table->init();
$table->parse(ilLOSettings::getInstanceByObjId($this->getParentObject()->getId())->getTestByType($this->getTestType()));
$GLOBALS['tpl']->setContent($table->getHTML());
$this->showStatus(
);
}
{
$GLOBALS['ilLog']->write(__METHOD__.': Show new assignment sceen because of : '. $ex->getMessage());
$this->testSettings();
}
}

+ Here is the call graph for this function:

ilLOEditorGUI::testSettings ( ilPropertyFormGUI  $form = NULL)
protected

Show test settings.

Parameters
ilPropertyFormGUI$form

Definition at line 501 of file class.ilLOEditorGUI.php.

References $_REQUEST, $GLOBALS, getTestType(), initTestForm(), ilLOEditorStatus\SECTION_ITES, ilLOEditorStatus\SECTION_QTEST, showStatus(), ilLOSettings\TYPE_TEST_INITIAL, and ilLOSettings\TYPE_TEST_QUALIFIED.

Referenced by saveTest(), and testOverview().

{
$this->ctrl->setParameter($this,'tt',(int) $_REQUEST['tt']);
switch($this->getTestType())
{
$GLOBALS['ilTabs']->activateSubTab('itest');
break;
$GLOBALS['ilTabs']->activateSubTab('qtest');
break;
}
if(!$form instanceof ilPropertyFormGUI)
{
$form = $this->initTestForm();
}
$GLOBALS['tpl']->setContent($form->getHTML());
$this->showStatus(
($this->getTestType() == self::TEST_TYPE_IT) ?
);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilLOEditorGUI::updateStartObjects ( )
protected

Add Test as start object.

Parameters
ilObjTest$tst

Definition at line 722 of file class.ilLOEditorGUI.php.

References getParentObject(), and getSettings().

Referenced by saveSettings(), and saveTest().

{
include_once './Services/Container/classes/class.ilContainerStartObjects.php';
$start = new ilContainerStartObjects(0, $this->getParentObject()->getId());
$this->getSettings()->updateStartObjects($start);
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Field Documentation

ilLOEditorGUI::$ctrl = NULL
private

Definition at line 34 of file class.ilLOEditorGUI.php.

ilLOEditorGUI::$lng = NULL
private

Definition at line 33 of file class.ilLOEditorGUI.php.

ilLOEditorGUI::$parent_obj
private

Definition at line 31 of file class.ilLOEditorGUI.php.

Referenced by getParentObject().

ilLOEditorGUI::$settings = NULL
private
ilLOEditorGUI::$test_type = 0
private

Definition at line 36 of file class.ilLOEditorGUI.php.

Referenced by getTestType().

const ilLOEditorGUI::SETTINGS_TEMPLATE_IT = 'il_astpl_loc_initial'

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

const ilLOEditorGUI::SETTINGS_TEMPLATE_QT = 'il_astpl_loc_qualified'

Definition at line 28 of file class.ilLOEditorGUI.php.

const ilLOEditorGUI::TEST_ASSIGN = 2

Definition at line 25 of file class.ilLOEditorGUI.php.

Referenced by initTestForm().

const ilLOEditorGUI::TEST_NEW = 1

Definition at line 24 of file class.ilLOEditorGUI.php.

Referenced by initTestForm().

const ilLOEditorGUI::TEST_TYPE_IT = 1

Definition at line 21 of file class.ilLOEditorGUI.php.

Referenced by confirmDeleteTest(), and testOverview().

const ilLOEditorGUI::TEST_TYPE_QT = 2

Definition at line 22 of file class.ilLOEditorGUI.php.


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