ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilLOEditorGUI Class Reference

Class ilLOEditorGUI. More...

+ Collaboration diagram for ilLOEditorGUI:

Public Member Functions

 __construct ($a_parent_obj)
 Constructor. More...
 
 executeCommand ()
 Execute command. More...
 
 getParentObject ()
 
 getSettings ()
 Settings. More...
 
 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

 returnFromObjectives ()
 Return from objectives. More...
 
 settings (ilPropertyFormGUI $form=NULL)
 Objective Settings. More...
 
 deleteAssignments ($a_type)
 Delete assignments. More...
 
 updateTestAssignments (ilLOSettings $settings)
 Update Test assignments. More...
 
 saveSettings ()
 
 initSettingsForm ()
 Init settings form. More...
 
 materials ()
 
 testsOverview ()
 View test assignments () More...
 
 testOverview ()
 Show test overview. More...
 
 confirmDeleteTests ()
 Show delete test confirmation. More...
 
 confirmDeleteTest ()
 Show delete confirmation screen. More...
 
 deleteTests ()
 Delete test assignments. More...
 
 deleteTest ()
 Delete test assignment. More...
 
 testAssignment (ilPropertyFormGUI $form=null)
 new test assignment More...
 
 testSettings (ilPropertyFormGUI $form=NULL)
 Show test settings. More...
 
 applySettingsTemplate (ilObjTest $tst)
 Apply auto generated setttings template. More...
 
 updateStartObjects ()
 Add Test as start object. More...
 
 saveMultiTestAssignment ()
 
 updateMaterialAssignments (ilObjTest $test)
 
 saveTest ()
 Save Test. More...
 
 listObjectives ()
 List all abvailable objectives. More...
 
 showObjectiveCreation (ilPropertyFormGUI $form=NULL)
 Show objective creation form. More...
 
 initSimpleObjectiveForm ()
 Show objective creation form. More...
 
 saveObjectiveCreation ()
 
 saveSorting ()
 save position More...
 
 askDeleteObjectives ()
 Confirm delete objectives. More...
 
 activateObjectives ()
 activate chosen objectives More...
 
 deactivateObjectives ()
 activate chosen objectives More...
 
 deleteObjectives ()
 Delete objectives @global type $rbacsystem. More...
 
 showStatus ($a_section)
 Show status panel. More...
 
 setTabs ($a_section='')
 Set tabs. More...
 

Private Attributes

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

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilLOEditorGUI::__construct (   $a_parent_obj)

Constructor.

Parameters
type$a_parent_obj

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

50 {
51 $this->parent_obj = $a_parent_obj;
53 $this->lng = $GLOBALS['lng'];
54 $this->ctrl = $GLOBALS['ilCtrl'];
55
56 $this->logger = ilLoggerFactory::getLogger('crs');
57 }
settings(ilPropertyFormGUI $form=NULL)
Objective Settings.
static getInstanceByObjId($a_obj_id)
get singleton instance
static getLogger($a_component_id)
Get component logger.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.

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

+ Here is the call graph for this function:

Member Function Documentation

◆ activateObjectives()

ilLOEditorGUI::activateObjectives ( )
protected

activate chosen objectives

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

1249 {
1250 $enabled = (array) $_REQUEST['objective'];
1251
1252 include_once './Modules/Course/classes/class.ilCourseObjective.php';
1253 $objectives = ilCourseObjective::_getObjectiveIds($this->getParentObject()->getId(),false);
1254 foreach((array) $objectives as $objective_id)
1255 {
1256 $objective = new ilCourseObjective($this->getParentObject(),$objective_id);
1257 if(in_array($objective_id, $enabled))
1258 {
1259 $objective->setActive(true);
1260 $objective->update();
1261 }
1262 }
1263
1264 include_once './Services/Tracking/classes/class.ilLPStatusWrapper.php';
1266
1267 ilUtil::sendSuccess($this->lng->txt('settings_saved'),true);
1268 $this->ctrl->redirect($this,'listObjectives');
1269 }
class ilcourseobjective
static _getObjectiveIds($course_id, $a_activated_only=false)
static _refreshStatus($a_obj_id, $a_users=null)
Set dirty.
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.

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

+ Here is the call graph for this function:

◆ applySettingsTemplate()

ilLOEditorGUI::applySettingsTemplate ( ilObjTest  $tst)
protected

Apply auto generated setttings template.

Parameters
ilObjTest$tst

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

862 {
863 include_once "Services/Administration/classes/class.ilSettingsTemplate.php";
864 include_once './Modules/Test/classes/class.ilObjAssessmentFolderGUI.php';
865
866 $tpl_id = 0;
867 foreach(ilSettingsTemplate::getAllSettingsTemplates('tst', true) as $nr => $template)
868 {
869 switch($this->getTestType())
870 {
872 if($template['title'] == self::SETTINGS_TEMPLATE_IT)
873 {
874 $tpl_id = $template['id'];
875 }
876 break;
878 if($template['title'] == self::SETTINGS_TEMPLATE_QT)
879 {
880 $tpl_id = $template['id'];
881 }
882 break;
883 }
884 if($tpl_id)
885 {
886 break;
887 }
888 }
889
890 if(!$tpl_id)
891 {
892 return false;
893 }
894
895 include_once "Services/Administration/classes/class.ilSettingsTemplate.php";
896 include_once './Modules/Test/classes/class.ilObjAssessmentFolderGUI.php';
898 $template_settings = $template->getSettings();
899 if($template_settings)
900 {
901 include_once './Modules/Test/classes/class.ilObjTestGUI.php';
902 $tst_gui = new ilObjTestGUI();
903 $tst_gui->applyTemplate($template_settings, $tst);
904 }
905 $tst->setTemplate($tpl_id);
906 return true;
907 }
Class ilObjTestGUI.
setTemplate($template_id)
Settings template application class.
static getAllSettingsTemplates($a_type, $a_include_auto_generated=false)
Get all settings templates of type.

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

Referenced by saveMultiTestAssignment(), and saveTest().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ askDeleteObjectives()

ilLOEditorGUI::askDeleteObjectives ( )
protected

Confirm delete objectives.

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

1219 {
1220 $GLOBALS['ilTabs']->activateSubTab('objectives');
1221
1222 include_once './Services/Utilities/classes/class.ilConfirmationGUI.php';
1223 $confirm = new ilConfirmationGUI();
1224 $confirm->setFormAction($this->ctrl->getFormAction($this));
1225 $confirm->setHeaderText($this->lng->txt('crs_delete_objectve_sure'));
1226 $confirm->setConfirm($this->lng->txt('delete'), 'deleteObjectives');
1227 $confirm->setCancel($this->lng->txt('cancel'), 'listObjectives');
1228
1229 foreach($_POST['objective'] as $objective_id)
1230 {
1231 include_once './Modules/Course/classes/class.ilCourseObjective.php';
1232 $obj = new ilCourseObjective($this->getParentObject(),$objective_id);
1233 $name = $obj->getTitle();
1234
1235 $confirm->addItem(
1236 'objective_ids[]',
1237 $objective_id,
1238 $name
1239 );
1240 }
1241 $GLOBALS['tpl']->setContent($confirm->getHTML());
1243 }
$_POST["username"]
Confirmation screen class.
showStatus($a_section)
Show status panel.

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

+ Here is the call graph for this function:

◆ confirmDeleteTest()

ilLOEditorGUI::confirmDeleteTest ( )
protected

Show delete confirmation screen.

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

651 {
652 $this->setTestType((int) $_REQUEST['tt']);
653 $this->ctrl->setParameter($this,'tt',$this->getTestType());
654
656 switch($this->getTestType())
657 {
659 $GLOBALS['ilTabs']->activateSubTab('itest');
660 break;
661
663 $GLOBALS['ilTabs']->activateSubTab('qtest');
664 break;
665 }
666
667 if(!(int) $_REQUEST['tst'])
668 {
669 ilUtil::sendFailure($this->lng->txt('select_one'),true);
670 $this->ctrl->redirect($this,'testOverview');
671 }
672
673 include_once './Services/Utilities/classes/class.ilConfirmationGUI.php';
674 $confirm = new ilConfirmationGUI();
675 $confirm->setHeaderText($this->lng->txt('crs_loc_confirm_delete_tst'));
676 $confirm->setFormAction($this->ctrl->getFormAction($this));
677 $confirm->setConfirm($this->lng->txt('crs_loc_delete_assignment'), 'deleteTest');
678 $confirm->setCancel($this->lng->txt('cancel'), 'testOverview');
679
680 foreach((array) $_REQUEST['tst'] as $tst_id)
681 {
682 $obj_id = ilObject::_lookupObjId($tst_id);
683 $confirm->addItem('tst[]', $tst_id, ilObject::_lookupTitle($obj_id));
684 }
685
686 $GLOBALS['tpl']->setContent($confirm->getHTML());
687
688 $this->showStatus(
692 );
693 }
static _lookupObjId($a_id)
static _lookupTitle($a_id)
lookup object title
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.

References $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.

+ Here is the call graph for this function:

◆ confirmDeleteTests()

ilLOEditorGUI::confirmDeleteTests ( )
protected

Show delete test confirmation.

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

599 {
600 $this->setTestType((int) $_REQUEST['tt']);
601 $this->ctrl->setParameter($this,'tt',$this->getTestType());
602
604 switch($this->getTestType())
605 {
607 $GLOBALS['ilTabs']->activateSubTab('itests');
608 break;
609
611 $GLOBALS['ilTabs']->activateSubTab('qtests');
612 break;
613 }
614
615 if(!(int) $_REQUEST['tst'])
616 {
617 ilUtil::sendFailure($this->lng->txt('select_one'),true);
618 $this->ctrl->redirect($this,'testsOverview');
619 }
620
621 include_once './Services/Utilities/classes/class.ilConfirmationGUI.php';
622 $confirm = new ilConfirmationGUI();
623 $confirm->setHeaderText($this->lng->txt('crs_loc_confirm_delete_tst'));
624 $confirm->setFormAction($this->ctrl->getFormAction($this));
625 $confirm->setConfirm($this->lng->txt('crs_loc_delete_assignment'), 'deleteTests');
626 $confirm->setCancel($this->lng->txt('cancel'), 'testsOverview');
627
628 foreach((array) $_REQUEST['tst'] as $assign_id)
629 {
630 include_once './Modules/Course/classes/Objectives/class.ilLOTestAssignment.php';
631 $assignment = new ilLOTestAssignment($assign_id);
632
633
634 $obj_id = ilObject::_lookupObjId($assignment->getTestRefId());
635 $confirm->addItem('tst[]', $assign_id, ilObject::_lookupTitle($obj_id));
636 }
637
638 $GLOBALS['tpl']->setContent($confirm->getHTML());
639
640 $this->showStatus(
644 );
645 }
Settings for LO courses.

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

+ Here is the call graph for this function:

◆ deactivateObjectives()

ilLOEditorGUI::deactivateObjectives ( )
protected

activate chosen objectives

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

1275 {
1276 $disabled = (array) $_REQUEST['objective'];
1277
1278 include_once './Modules/Course/classes/class.ilCourseObjective.php';
1279 $objectives = ilCourseObjective::_getObjectiveIds($this->getParentObject()->getId(),false);
1280 foreach((array) $objectives as $objective_id)
1281 {
1282 $objective = new ilCourseObjective($this->getParentObject(),$objective_id);
1283 if(in_array($objective_id, $disabled))
1284 {
1285 $objective->setActive(false);
1286 $objective->update();
1287 }
1288 }
1289
1290 include_once './Services/Tracking/classes/class.ilLPStatusWrapper.php';
1292
1293 ilUtil::sendSuccess($this->lng->txt('settings_saved'),true);
1294 $this->ctrl->redirect($this,'listObjectives');
1295 }

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

+ Here is the call graph for this function:

◆ deleteAssignments()

ilLOEditorGUI::deleteAssignments (   $a_type)
protected

Delete assignments.

Parameters
type$a_type

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

241 {
242
243
244 include_once './Modules/Course/classes/Objectives/class.ilLOTestAssignments.php';
245 $assignments = ilLOTestAssignments::getInstance($this->getParentObject()->getId());
246 foreach($assignments->getAssignmentsByType($a_type) as $assignment)
247 {
248 $assignment->delete();
249 }
250 return;
251 }
static getInstance($a_container_id)
Get instance by container id.
$a_type
Definition: workflow.php:93

References $a_type, ilLOTestAssignments\getInstance(), and getParentObject().

Referenced by updateTestAssignments().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deleteObjectives()

ilLOEditorGUI::deleteObjectives ( )
protected

Delete objectives @global type $rbacsystem.

Returns
boolean

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

1303 {
1304 global $rbacsystem;
1305
1306 foreach($_POST['objective_ids'] as $objective_id)
1307 {
1308 include_once './Modules/Course/classes/class.ilCourseObjective.php';
1309 $objective_obj = new ilCourseObjective($this->getParentObject(),$objective_id);
1310 $objective_obj->delete();
1311 }
1312
1313 include_once './Services/Tracking/classes/class.ilLPStatusWrapper.php';
1315
1316 ilUtil::sendSuccess($this->lng->txt('crs_objectives_deleted'),true);
1317 $this->ctrl->redirect($this,'listObjectives');
1318
1319 return true;
1320 }

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

+ Here is the call graph for this function:

◆ deleteTest()

ilLOEditorGUI::deleteTest ( )
protected

Delete test assignment.

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

743 {
744 $this->setTestType((int) $_REQUEST['tt']);
745 $this->ctrl->setParameter($this,'tt',$this->getTestType());
746
748 switch($this->getTestType())
749 {
751 $GLOBALS['ilTabs']->activateSubTab('itest');
752 break;
753
755 $GLOBALS['ilTabs']->activateSubTab('qtest');
756 break;
757 }
758
759 foreach((array) $_REQUEST['tst'] as $tst_id)
760 {
761 switch($this->getTestType())
762 {
764 $settings->setInitialTest(0);
765 break;
766
768 $settings->setQualifiedTest(0);
769 break;
770 }
771 $settings->update();
772
773 // finally delete start object assignment
774 include_once './Services/Container/classes/class.ilContainerStartObjects.php';
776 $this->getParentObject()->getRefId(),
777 $this->getParentObject()->getId()
778 );
779 $start->deleteItem($tst_id);
780
781 // ... and assigned questions
782 include_once './Modules/Course/classes/class.ilCourseObjectiveQuestion.php';
784 }
785
786
787 ilUtil::sendSuccess($this->lng->txt('settings_saved'),true);
788 $this->ctrl->redirect($this,'testOverview');
789 }

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

+ Here is the call graph for this function:

◆ deleteTests()

ilLOEditorGUI::deleteTests ( )
protected

Delete test assignments.

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

699 {
700 $this->setTestType((int) $_REQUEST['tt']);
701 $this->ctrl->setParameter($this,'tt',$this->getTestType());
702
704 switch($this->getTestType())
705 {
707 $GLOBALS['ilTabs']->activateSubTab('itests');
708 break;
709
711 $GLOBALS['ilTabs']->activateSubTab('qtests');
712 break;
713 }
714
715 foreach((array) $_REQUEST['tst'] as $assign_id)
716 {
717 include_once './Modules/Course/classes/Objectives/class.ilLOTestAssignment.php';
718 $assignment = new ilLOTestAssignment($assign_id);
719 $assignment->delete();
720
721 // finally delete start object assignment
722 include_once './Services/Container/classes/class.ilContainerStartObjects.php';
724 $this->getParentObject()->getRefId(),
725 $this->getParentObject()->getId()
726 );
727 $start->deleteItem($assignment->getTestRefId());
728
729 // ... and assigned questions
730 include_once './Modules/Course/classes/class.ilCourseObjectiveQuestion.php';
731 ilCourseObjectiveQuestion::deleteTest($assignment->getTestRefId());
732 }
733
734
735 ilUtil::sendSuccess($this->lng->txt('settings_saved'),true);
736 $this->ctrl->redirect($this,'testsOverview');
737 }

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

+ Here is the call graph for this function:

◆ executeCommand()

ilLOEditorGUI::executeCommand ( )

Execute command.

Returns
<type>

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

64 {
65 global $ilCtrl;
66
67 $next_class = $ilCtrl->getNextClass($this);
68 $cmd = $ilCtrl->getCmd();
69
70 $this->setTabs();
71 switch($next_class)
72 {
73 case 'ilcourseobjectivesgui':
74
75 $this->ctrl->setReturn($this,'returnFromObjectives');
76 $GLOBALS['ilTabs']->clearTargets();
77 $GLOBALS['ilTabs']->setBackTarget(
78 $this->lng->txt('back'),
79 $this->ctrl->getLinkTarget($this,'listObjectives'));
80
81 include_once './Modules/Course/classes/class.ilCourseObjectivesGUI.php';
82 $reg_gui = new ilCourseObjectivesGUI($this->getParentObject()->getRefId());
83 $this->ctrl->forwardCommand($reg_gui);
84 break;
85
86 case 'ilcontainerstartobjectsgui':
87
88 include_once './Services/Container/classes/class.ilContainerStartObjectsGUI.php';
89 $stgui = new ilContainerStartObjectsGUI($this->getParentObject());
90 $ret = $this->ctrl->forwardCommand($stgui);
91
92 $GLOBALS['ilTabs']->activateSubTab('start');
93 $GLOBALS['ilTabs']->removeSubTab('manage');
94
95 #$GLOBALS['tpl']->setContent($this->ctrl->getHTML($stgui));
96 break;
97
98 case 'ilconditionhandlergui':
99
100 $this->ctrl->saveParameterByClass('ilconditionhandlergui','objective_id');
101
102 $GLOBALS['ilTabs']->clearTargets();
103 $GLOBALS['ilTabs']->setBackTarget(
104 $this->lng->txt('back'),
105 $this->ctrl->getLinkTarget($this,'listObjectives'));
106
107 include_once './Services/AccessControl/classes/class.ilConditionHandlerInterface.php';
108 $cond = new ilConditionHandlerGUI($this);
109 $cond->setBackButtons(array());
110 $cond->setAutomaticValidation(false);
111 $cond->setTargetType("lobj");
112 $cond->setTargetRefId($this->getParentObject()->getRefId());
113
114 $cond->setTargetId((int) $_REQUEST['objective_id']);
115
116 // objecitve
117 include_once './Modules/Course/classes/class.ilCourseObjective.php';
118 $obj = new ilCourseObjective($this->getParentObject(),(int) $_REQUEST['objective_id']);
119 $cond->setTargetTitle($obj->getTitle());
120 $this->ctrl->forwardCommand($cond);
121 break;
122
123 case 'illopagegui':
124 $this->ctrl->saveParameterByClass('illopagegui','objective_id');
125
126 $GLOBALS['ilTabs']->clearTargets();
127 $GLOBALS['ilTabs']->setBackTarget(
128 $this->lng->txt('back'),
129 $this->ctrl->getLinkTarget($this,'listObjectives'));
130
131 $objtv_id = (int)$_REQUEST['objective_id'];
132
133 include_once 'Modules/Course/classes/Objectives/class.ilLOPage.php';
134 if(!ilLOPage::_exists('lobj', $objtv_id))
135 {
136 // doesn't exist -> create new one
137 $new_page_object = new ilLOPage();
138 $new_page_object->setParentId($objtv_id);
139 $new_page_object->setId($objtv_id);
140 $new_page_object->createFromXML();
141 unset($new_page_object);
142 }
143
144 $this->ctrl->setReturn($this, 'listObjectives');
145 include_once 'Modules/Course/classes/Objectives/class.ilLOPageGUI.php';
146 $pgui = new ilLOPageGUI($objtv_id);
147 $pgui->setPresentationTitle(ilCourseObjective::lookupObjectiveTitle($objtv_id));
148
149 include_once('./Services/Style/Content/classes/class.ilObjStyleSheet.php');
151 $this->parent_obj->getStyleSheetId(), $this->parent_obj->getType()));
152
153 // #14895
154 $GLOBALS['tpl']->setCurrentBlock("ContentStyle");
155 $GLOBALS['tpl']->setVariable("LOCATION_CONTENT_STYLESHEET",
157 $this->parent_obj->getStyleSheetId(), $this->parent_obj->getType())));
158 $GLOBALS['tpl']->parseCurrentBlock();
159
160 $ret = $this->ctrl->forwardCommand($pgui);
161 if($ret)
162 {
163 $GLOBALS['tpl']->setContent($ret);
164 }
165 break;
166
167 default:
168 if(!$cmd)
169 {
170 // get first unaccomplished step
171 include_once './Modules/Course/classes/Objectives/class.ilLOEditorStatus.php';
172 $cmd = ilLOEditorStatus::getInstance($this->getParentObject())->getFirstFailedStep();
173 }
174 $this->$cmd();
175
176 break;
177 }
178 return true;
179 }
class ilConditionHandlerGUI
Class ilContainerStartObjectsGUI.
static lookupObjectiveTitle($a_objective_id, $a_add_description=false)
class ilobjcourseobjectivesgui
setTabs($a_section='')
Set tabs.
static getInstance(ilObject $a_parent)
Get instance.
(Course) learning objective page GUI class
(Course) learning objective page object
static getEffectiveContentStyleId($a_style_id, $a_type="")
Get effective Style Id.
static getContentStylePath($a_style_id)
get content style path
static _exists($a_parent_type, $a_id, $a_lang="", $a_no_cache=false)
Checks whether page exists.
global $ilCtrl
Definition: ilias.php:18
$ret
Definition: parser.php:6
$cmd
Definition: sahs_server.php:35

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

+ Here is the call graph for this function:

◆ getParentObject()

◆ getSettings()

ilLOEditorGUI::getSettings ( )

Settings.

Returns
ilLOSettings

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

205 {
206 return $this->settings;
207 }

References $settings.

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

+ Here is the caller graph for this function:

◆ getTestType()

ilLOEditorGUI::getTestType ( )

◆ initSettingsForm()

ilLOEditorGUI::initSettingsForm ( )
protected

Init settings form.

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

370 {
371 include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
372 $form = new ilPropertyFormGUI();
373 $form->setFormAction($this->ctrl->getFormAction($this));
374 $form->setTitle($this->lng->txt('crs_loc_settings_tbl'));
375
376 // initial test
377 $type_selector = new ilRadioGroupInputGUI($this->lng->txt('crs_loc_settings_it_type'), 'ittype');
378 $type_selector->setRequired(TRUE);
379 $type_selector->setValue($this->getSettings()->getInitialTestType());
380
381 $type_ipa = new ilRadioOption($this->lng->txt('crs_loc_settings_type_it_placement_all'), ilLOSettings::TYPE_INITIAL_PLACEMENT_ALL);
382 $type_ipa->setInfo($this->lng->txt('crs_loc_settings_type_it_placement_all_info'));
383 $type_selector->addOption($type_ipa);
384
385 $start_ip = new ilCheckboxInputGUI($this->lng->txt('crs_loc_settings_it_start_object'),'start_ip');
386 $start_ip->setValue(1);
387 $start_ip->setChecked($this->getSettings()->isInitialTestStart());
388 $type_ipa->addSubItem($start_ip);
389
390 $type_ips = new ilRadioOption($this->lng->txt('crs_loc_settings_type_it_placement_sel'), ilLOSettings::TYPE_INITIAL_PLACEMENT_SELECTED);
391 $type_ips->setInfo($this->lng->txt('crs_loc_settings_type_it_placement_sel_info'));
392 $type_selector->addOption($type_ips);
393
394 $type_iqa = new ilRadioOption($this->lng->txt('crs_loc_settings_type_it_qualifying_all'), ilLOSettings::TYPE_INITIAL_QUALIFYING_ALL);
395 $type_iqa->setInfo($this->lng->txt('crs_loc_settings_type_it_qualifying_all_info'));
396 $type_selector->addOption($type_iqa);
397
398 $start_iq = new ilCheckboxInputGUI($this->lng->txt('crs_loc_settings_it_start_object'),'start_iq');
399 $start_iq->setValue(1);
400 $start_iq->setChecked($this->getSettings()->isInitialTestStart());
401 $type_iqa->addSubItem($start_iq);
402
403 $type_iqs = new ilRadioOption($this->lng->txt('crs_loc_settings_type_it_qualifying_sel'), ilLOSettings::TYPE_INITIAL_QUALIFYING_SELECTED);
404 $type_iqs->setInfo($this->lng->txt('crs_loc_settings_type_it_qualifying_sel_info'));
405 $type_selector->addOption($type_iqs);
406
407 $type_ino = new ilRadioOption($this->lng->txt('crs_loc_settings_type_it_none'), ilLOSettings::TYPE_INITIAL_NONE);
408 $type_ino->setInfo($this->lng->txt('crs_loc_settings_type_it_none_info'));
409 $type_selector->addOption($type_ino);
410
411 $form->addItem($type_selector);
412
413 // qualifying test
414 $qt_selector = new ilRadioGroupInputGUI($this->lng->txt('crs_loc_settings_qt_all'),'qttype');
415 $qt_selector->setRequired(TRUE);
416 $qt_selector->setValue($this->getSettings()->getQualifyingTestType());
417
418 $type_qa = new ilRadioOption($this->lng->txt('crs_loc_settings_type_q_all'), ilLOSettings::TYPE_QUALIFYING_ALL);
419 $type_qa->setInfo($this->lng->txt('crs_loc_settings_type_q_all_info'));
420 $qt_selector->addOption($type_qa);
421
422 $start_q = new ilCheckboxInputGUI($this->lng->txt('crs_loc_settings_qt_start_object'),'start_q');
423 $start_q->setValue(1);
424 $start_q->setChecked($this->getSettings()->isQualifyingTestStart());
425 $type_qa->addSubItem($start_q);
426
427 $passed_mode = new ilRadioGroupInputGUI($this->lng->txt('crs_loc_settings_passed_mode'),'passed_mode');
428 $passed_mode->setValue($this->getSettings()->getPassedObjectiveMode());
429
430 $passed_mode->addOption(
431 new ilRadioOption(
432 $this->lng->txt('crs_loc_settings_passed_mode_hide'),
434 );
435 $passed_mode->addOption(
436 new ilRadioOption(
437 $this->lng->txt('crs_loc_settings_passed_mode_mark'),
439 );
440 $type_qa->addSubItem($passed_mode);
441
442 $type_qs = new ilRadioOption($this->lng->txt('crs_loc_settings_type_q_selected'), ilLOSettings::TYPE_QUALIFYING_SELECTED);
443 $type_qs->setInfo($this->lng->txt('crs_loc_settings_type_q_selected_info'));
444 $qt_selector->addOption($type_qs);
445
446 $form->addItem($qt_selector);
447
448 // reset results
449 $reset = new ilCheckboxInputGUI($this->lng->txt('crs_loc_settings_reset'),'reset');
450 $reset->setValue(1);
451 $reset->setChecked($this->getSettings()->isResetResultsEnabled());
452 $reset->setOptionTitle($this->lng->txt('crs_loc_settings_reset_enable'));
453 $reset->setInfo($this->lng->txt('crs_loc_settings_reset_enable_info'));
454 $form->addItem($reset);
455
456 $form->addCommandButton('saveSettings', $this->lng->txt('save'));
457
458
459 return $form;
460 }
This class represents a checkbox property in a property form.
const TYPE_INITIAL_QUALIFYING_ALL
const TYPE_INITIAL_PLACEMENT_SELECTED
const HIDE_PASSED_OBJECTIVE_QST
const TYPE_INITIAL_PLACEMENT_ALL
const MARK_PASSED_OBJECTIVE_QST
const TYPE_QUALIFYING_SELECTED
const TYPE_INITIAL_QUALIFYING_SELECTED
This class represents a property form user interface.
This class represents a property in a property form.
This class represents an option in a radio group.

References getSettings(), ilLOSettings\HIDE_PASSED_OBJECTIVE_QST, ilLOSettings\MARK_PASSED_OBJECTIVE_QST, ilLOSettings\TYPE_INITIAL_NONE, ilLOSettings\TYPE_INITIAL_PLACEMENT_ALL, ilLOSettings\TYPE_INITIAL_PLACEMENT_SELECTED, ilLOSettings\TYPE_INITIAL_QUALIFYING_ALL, ilLOSettings\TYPE_INITIAL_QUALIFYING_SELECTED, ilLOSettings\TYPE_QUALIFYING_ALL, and ilLOSettings\TYPE_QUALIFYING_SELECTED.

Referenced by saveSettings(), and settings().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initSimpleObjectiveForm()

ilLOEditorGUI::initSimpleObjectiveForm ( )
protected

Show objective creation form.

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

1153 {
1154 include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
1155 $form = new ilPropertyFormGUI();
1156 $form->setTitle($this->lng->txt('crs_loc_form_create_objectives'));
1157 $form->setFormAction($this->ctrl->getFormAction($this));
1158
1159 $txt = new ilTextWizardInputGUI($this->lng->txt('crs_objectives'), 'objectives');
1160 $txt->setValues(array(0 => ''));
1161 $txt->setRequired(true);
1162 $form->addItem($txt);
1163
1164 $form->addCommandButton('saveObjectiveCreation', $this->lng->txt('save'));
1165
1166 return $form;
1167 }
This class represents a text wizard property in a property form.
$txt
Definition: error.php:12

References $txt.

Referenced by saveObjectiveCreation(), and showObjectiveCreation().

+ Here is the caller graph for this function:

◆ listObjectives()

ilLOEditorGUI::listObjectives ( )
protected

List all abvailable objectives.

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

1099 {
1100 global $ilToolbar;
1101
1102 include_once './Modules/Course/classes/class.ilCourseObjectivesGUI.php';
1104
1105
1106 $GLOBALS['ilTabs']->activateSubTab('objectives');
1107
1109 $this->getParentObject()->getId(),
1110 FALSE
1111 );
1112
1113 if(!count($objectives))
1114 {
1115 return $this->showObjectiveCreation();
1116 }
1117
1118 $ilToolbar->addButton(
1119 $this->lng->txt('crs_add_objective'),
1120 $this->ctrl->getLinkTargetByClass('ilcourseobjectivesgui', "create"));
1121
1122 include_once('./Modules/Course/classes/class.ilCourseObjectivesTableGUI.php');
1123 $table = new ilCourseObjectivesTableGUI($this,$this->getParentObject());
1124 $table->setTitle($this->lng->txt('crs_objectives'),'',$this->lng->txt('crs_objectives'));
1125 $table->parse($objectives);
1126 $GLOBALS['tpl']->setContent($table->getHTML());
1127
1129 }
$_SESSION["AccountId"]
showObjectiveCreation(ilPropertyFormGUI $form=NULL)
Show objective creation form.

References $_SESSION, $GLOBALS, ilCourseObjective\_getObjectiveIds(), getParentObject(), ilCourseObjectivesGUI\MODE_UNDEFINED, ilLOEditorStatus\SECTION_OBJECTIVES, showObjectiveCreation(), and showStatus().

Referenced by returnFromObjectives(), and saveSorting().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ materials()

ilLOEditorGUI::materials ( )
protected

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

463 {
464 $GLOBALS['ilTabs']->activateSubTab('materials');
465
466 include_once "Services/Object/classes/class.ilObjectAddNewItemGUI.php";
467 $gui = new ilObjectAddNewItemGUI($this->getParentObject()->getRefId());
468 $gui->setDisabledObjectTypes(array("itgr"));
469 #$gui->setAfterCreationCallback($this->getParentObject()->getRefId());
470 $gui->render();
471
472 include_once './Services/Object/classes/class.ilObjectTableGUI.php';
473 $obj_table = new ilObjectTableGUI(
474 $this,
475 'materials',
476 $this->getParentObject()->getRefId()
477 );
478 $obj_table->init();
479 $obj_table->setObjects($GLOBALS['tree']->getChildIds($this->getParentObject()->getRefId()));
480 $obj_table->parse();
481 $GLOBALS['tpl']->setContent($obj_table->getHTML());
482
484 }
Render add new item selector.
Settings for LO courses.

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

+ Here is the call graph for this function:

◆ returnFromObjectives()

ilLOEditorGUI::returnFromObjectives ( )
protected

Return from objectives.

Returns
type

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

186 {
187 include_once './Modules/Course/classes/class.ilCourseObjectivesGUI.php';
189 return $this->listObjectives();
190 }
listObjectives()
List all abvailable objectives.

References $_SESSION, listObjectives(), and ilCourseObjectivesGUI\MODE_UNDEFINED.

+ Here is the call graph for this function:

◆ saveMultiTestAssignment()

ilLOEditorGUI::saveMultiTestAssignment ( )
protected

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

922 {
923
924 $this->ctrl->setParameter($this,'tt',(int) $_REQUEST['tt']);
925 $this->setTestType((int) $_REQUEST['tt']);
926
928
929 include_once './Modules/Course/classes/Objectives/class.ilLOTestAssignmentForm.php';
930 $form_helper = new ilLOTestAssignmentForm($this,$this->getParentObject(), $this->getTestType());
931 $form = $form_helper->initForm(TRUE);
932
933 if($form->checkInput())
934 {
935 $mode = $form->getInput('mode');
936
937 if($mode == self::TEST_NEW)
938 {
939 $tst = new ilObjTest();
940 $tst->setType('tst');
941 $tst->setTitle($form->getInput('title'));
942 $tst->setDescription($form->getInput('desc'));
943 $tst->create();
944 $tst->createReference();
945 $tst->putInTree($this->getParentObject()->getRefId());
946 $tst->setPermissions($this->getParentObject()->getRefId());
947
948 // apply settings template
949 $this->applySettingsTemplate($tst);
950
951 $tst->setQuestionSetType($form->getInput('qtype'));
952
953 $tst->saveToDb();
954
955 include_once './Modules/Course/classes/Objectives/class.ilLOTestAssignment.php';
956 $assignment = new ilLOTestAssignment();
957 $assignment->setContainerId($this->getParentObject()->getId());
958 $assignment->setAssignmentType($this->getTestType());
959 $assignment->setObjectiveId($form->getInput('objective'));
960 $assignment->setTestRefId($tst->getRefId());
961 $assignment->save();
962 }
963 else
964 {
965 include_once './Modules/Course/classes/Objectives/class.ilLOTestAssignment.php';
966 $assignment = new ilLOTestAssignment();
967 $assignment->setContainerId($this->getParentObject()->getId());
968 $assignment->setAssignmentType($this->getTestType());
969 $assignment->setObjectiveId($form->getInput('objective'));
970 $assignment->setTestRefId($form->getInput('tst'));
971 $assignment->save();
972
973 $tst = new ilObjTest($form->getInput('tst'),true);
974 $this->applySettingsTemplate($tst);
975 $tst->saveToDb();
976 }
977
978 // deassign as objective material
979 if($tst instanceof ilObjTest)
980 {
981 $this->updateMaterialAssignments($tst);
982 }
983 $this->updateStartObjects();
984
985 ilUtil::sendSuccess($this->lng->txt('settings_saved'));
986 $this->ctrl->redirect($this,'testsOverview');
987 }
988
989 // Error
990 ilUtil::sendFailure($this->lng->txt('err_check_input'));
991 $form->setValuesByPost();
992 $this->testAssignment($form);
993 }
updateStartObjects()
Add Test as start object.
updateMaterialAssignments(ilObjTest $test)
testAssignment(ilPropertyFormGUI $form=null)
new test assignment
applySettingsTemplate(ilObjTest $tst)
Apply auto generated setttings template.

References $settings, applySettingsTemplate(), ilLOSettings\getInstanceByObjId(), getParentObject(), getTestType(), ilUtil\sendFailure(), ilUtil\sendSuccess(), setTestType(), testAssignment(), updateMaterialAssignments(), and updateStartObjects().

+ Here is the call graph for this function:

◆ saveObjectiveCreation()

ilLOEditorGUI::saveObjectiveCreation ( )
protected

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

1170 {
1171 $form = $this->initSimpleObjectiveForm();
1172 if($form->checkInput())
1173 {
1174 foreach((array) $form->getInput('objectives') as $idx => $title)
1175 {
1176 include_once './Modules/Course/classes/class.ilCourseObjective.php';
1177 $obj = new ilCourseObjective($this->getParentObject());
1178 $obj->setActive(TRUE);
1179 $obj->setTitle($title);
1180 $obj->add();
1181 }
1182 ilUtil::sendSuccess($this->lng->txt('settings_saved'),true);
1183 $this->ctrl->redirect($this,'');
1184 }
1185
1186 $form->setValuesByPost();
1187 $GLOBALS['ilTabs']->activateSubTab('objectives');
1189 $this->showObjectiveCreation($form);
1190 }
initSimpleObjectiveForm()
Show objective creation form.

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

+ Here is the call graph for this function:

◆ saveSettings()

ilLOEditorGUI::saveSettings ( )
protected

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

295 {
296 $form = $this->initSettingsForm();
297 if($form->checkInput())
298 {
300 $settings->setInitialTestType($form->getInput('ittype'));
301 switch($settings->getInitialTestType())
302 {
304 $settings->setInitialTestAsStart($form->getInput('start_ip'));
305 break;
306
308 $settings->setInitialTestAsStart(FALSE);
309 break;
310
312 $settings->setInitialTestAsStart($form->getInput('start_iq'));
313 break;
314
316 $settings->setInitialTestAsStart(FALSE);
317 break;
318
320 $settings->setInitialTestAsStart(FALSE);
321 break;
322 }
323
324 $settings->setQualifyingTestType($form->getInput('qttype'));
325 switch($settings->getQualifyingTestType())
326 {
328 $settings->setQualifyingTestAsStart($form->getInput('start_q'));
329 break;
330
332 $settings->setQualifyingTestAsStart(false);
333 break;
334 }
335
336
337 $settings->resetResults($form->getInput('reset'));
338 $settings->setPassedObjectiveMode($form->getInput('passed_mode'));
339
340 if(
341 ($settings->getInitialTestType() != ilLOSettings::TYPE_INITIAL_NONE) &&
342 ($settings->isQualifyingTestStart())
343 )
344 {
345 $settings->setQualifyingTestAsStart(FALSE);
346 ilUtil::sendInfo($this->lng->txt('crs_loc_settings_err_qstart'),TRUE);
347 }
348
349 $settings->update();
350 $this->updateStartObjects();
352
353 include_once './Services/Tracking/classes/class.ilLPStatusWrapper.php';
355
356 ilUtil::sendSuccess($this->lng->txt('settings_saved'),true);
357 $this->ctrl->redirect($this,'settings');
358 }
359
360 // Error
361 ilUtil::sendFailure($this->lng->txt('err_check_input'));
362 $form->setValuesByPost();
363 $this->settings($form);
364 }
updateTestAssignments(ilLOSettings $settings)
Update Test assignments.
initSettingsForm()
Init settings form.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.

References $settings, ilLPStatusWrapper\_refreshStatus(), ilLOSettings\getInstanceByObjId(), getParentObject(), initSettingsForm(), ilUtil\sendFailure(), ilUtil\sendInfo(), ilUtil\sendSuccess(), settings(), ilLOSettings\TYPE_INITIAL_NONE, ilLOSettings\TYPE_INITIAL_PLACEMENT_ALL, ilLOSettings\TYPE_INITIAL_PLACEMENT_SELECTED, ilLOSettings\TYPE_INITIAL_QUALIFYING_ALL, ilLOSettings\TYPE_INITIAL_QUALIFYING_SELECTED, ilLOSettings\TYPE_QUALIFYING_ALL, ilLOSettings\TYPE_QUALIFYING_SELECTED, updateStartObjects(), and updateTestAssignments().

+ Here is the call graph for this function:

◆ saveSorting()

ilLOEditorGUI::saveSorting ( )
protected

save position

@access protected

Returns

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

1199 {
1200 global $ilAccess,$ilErr,$ilObjDataCache;
1201
1202 asort($_POST['position'],SORT_NUMERIC);
1203
1204 $counter = 1;
1205 foreach($_POST['position'] as $objective_id => $position)
1206 {
1207 include_once './Modules/Course/classes/class.ilCourseObjective.php';
1208 $objective = new ilCourseObjective($this->getParentObject(),$objective_id);
1209 $objective->writePosition($counter++);
1210 }
1211 ilUtil::sendSuccess($this->lng->txt('crs_objective_saved_sorting'));
1212 $this->listObjectives();
1213 }
$counter
global $ilErr
Definition: raiseError.php:16

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

+ Here is the call graph for this function:

◆ saveTest()

ilLOEditorGUI::saveTest ( )
protected

Save Test.

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

1019 {
1020 $this->ctrl->setParameter($this,'tt',(int) $_REQUEST['tt']);
1021 $this->setTestType((int) $_REQUEST['tt']);
1022
1024
1025 include_once './Modules/Course/classes/Objectives/class.ilLOTestAssignmentForm.php';
1026 $form_helper = new ilLOTestAssignmentForm($this, $this->getParentObject(),$this->getTestType());
1027 $form = $form_helper->initForm(FALSE);
1028
1029 if($form->checkInput())
1030 {
1031 $mode = $form->getInput('mode');
1032
1033 if($mode == self::TEST_NEW)
1034 {
1035 $tst = new ilObjTest();
1036 $tst->setType('tst');
1037 $tst->setTitle($form->getInput('title'));
1038 $tst->setDescription($form->getInput('desc'));
1039 $tst->create();
1040 $tst->createReference();
1041 $tst->putInTree($this->getParentObject()->getRefId());
1042 $tst->setPermissions($this->getParentObject()->getRefId());
1043
1044 // apply settings template
1045 $this->applySettingsTemplate($tst);
1046
1047 $tst->setQuestionSetType($form->getInput('qtype'));
1048
1049 $tst->saveToDb();
1050
1051 if($this->getTestType() == self::TEST_TYPE_IT)
1052 {
1053 $this->getSettings()->setInitialTest($tst->getRefId());
1054 }
1055 else
1056 {
1057 $this->getSettings()->setQualifiedTest($tst->getRefId());
1058 }
1059 $this->getSettings()->update();
1060 }
1061 else
1062 {
1063 if($this->getTestType() == self::TEST_TYPE_IT)
1064 {
1065 $this->getSettings()->setInitialTest($form->getInput('tst'));
1066 }
1067 else
1068 {
1069 $this->getSettings()->setQualifiedTest($form->getInput('tst'));
1070 }
1071
1072 $this->getSettings()->update();
1073 $tst = new ilObjTest($settings->getTestByType($this->getTestType()),true);
1074 $this->applySettingsTemplate($tst);
1075 $tst->saveToDb();
1076 }
1077
1078 // deassign as objective material
1079 if($tst instanceof ilObjTest)
1080 {
1081 $this->updateMaterialAssignments($tst);
1082 }
1083 $this->updateStartObjects();
1084
1085 ilUtil::sendSuccess($this->lng->txt('settings_saved'));
1086 $this->ctrl->redirect($this,'testOverview');
1087 }
1088
1089 // Error
1090 ilUtil::sendFailure($this->lng->txt('err_check_input'));
1091 $form->setValuesByPost();
1092 $this->testSettings($form);
1093 }
testSettings(ilPropertyFormGUI $form=NULL)
Show test settings.

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

+ Here is the call graph for this function:

◆ setTabs()

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

Set tabs.

Parameters
type$a_section

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

1341 {
1342 // objective settings
1343 $GLOBALS['ilTabs']->addSubTab(
1344 'settings',
1345 $this->lng->txt('settings'),
1346 $this->ctrl->getLinkTarget($this,'settings')
1347 );
1348 // learning objectives
1349 $GLOBALS['ilTabs']->addSubTab(
1350 'objectives',
1351 $this->lng->txt('crs_loc_tab_objectives'),
1352 $this->ctrl->getLinkTarget($this,'listObjectives')
1353 );
1354 // materials
1355 /*
1356 $GLOBALS['ilTabs']->addTab(
1357 'materials',
1358 $this->lng->txt('crs_loc_tab_materials'),
1359 $this->ctrl->getLinkTarget($this,'materials')
1360 );
1361 */
1362 // tests
1364 if($settings->worksWithInitialTest())
1365 {
1366 if(
1367 $settings->getInitialTestType() == ilLOSettings::TYPE_INITIAL_PLACEMENT_ALL ||
1369 )
1370 {
1371 $this->ctrl->setParameter($this,'tt', ilLOSettings::TYPE_TEST_INITIAL);
1372 $GLOBALS['ilTabs']->addSubTab(
1373 'itest',
1374 $this->lng->txt('crs_loc_tab_itest'),
1375 $this->ctrl->getLinkTarget($this,'testOverview')
1376 );
1377 }
1378 else
1379 {
1380 $this->ctrl->setParameter($this,'tt', ilLOSettings::TYPE_TEST_INITIAL);
1381 $GLOBALS['ilTabs']->addSubTab(
1382 'itests',
1383 $this->lng->txt('crs_loc_tab_itests'),
1384 $this->ctrl->getLinkTarget($this,'testsOverview')
1385 );
1386 }
1387
1388
1389
1390 }
1391
1392 if($settings->getQualifyingTestType() == ilLOSettings::TYPE_QUALIFYING_ALL)
1393 {
1394 $this->ctrl->setParameter($this,'tt', ilLOSettings::TYPE_TEST_QUALIFIED);
1395 $GLOBALS['ilTabs']->addSubTab(
1396 'qtest',
1397 $this->lng->txt('crs_loc_tab_qtest'),
1398 $this->ctrl->getLinkTarget($this,'testOverview')
1399 );
1400 }
1401 else
1402 {
1403 $this->ctrl->setParameter($this,'tt', ilLOSettings::TYPE_TEST_QUALIFIED);
1404 $GLOBALS['ilTabs']->addSubTab(
1405 'qtests',
1406 $this->lng->txt('crs_loc_tab_qtests'),
1407 $this->ctrl->getLinkTarget($this,'testsOverview')
1408 );
1409 }
1410
1411 if($settings->worksWithStartObjects())
1412 {
1413 $GLOBALS['ilTabs']->addSubTab(
1414 'start',
1415 $this->lng->txt('crs_loc_tab_start'),
1416 $this->ctrl->getLinkTargetByClass('ilcontainerstartobjectsgui','')
1417 );
1418 }
1419
1420 // Member view
1421 #include_once './Services/Container/classes/class.ilMemberViewGUI.php';
1422 #ilMemberViewGUI::showMemberViewSwitch($this->getParentObject()->getRefId());
1423 }

References $GLOBALS, $settings, ilLOSettings\getInstanceByObjId(), getParentObject(), ilLOSettings\TYPE_INITIAL_PLACEMENT_ALL, ilLOSettings\TYPE_INITIAL_QUALIFYING_ALL, ilLOSettings\TYPE_QUALIFYING_ALL, ilLOSettings\TYPE_TEST_INITIAL, and ilLOSettings\TYPE_TEST_QUALIFIED.

Referenced by executeCommand().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setTestType()

ilLOEditorGUI::setTestType (   $a_type)

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

210 {
211 $this->test_type = $a_type;
212 }

References $a_type.

Referenced by confirmDeleteTest(), confirmDeleteTests(), deleteTest(), deleteTests(), saveMultiTestAssignment(), saveTest(), testAssignment(), testOverview(), and testsOverview().

+ Here is the caller graph for this function:

◆ settings()

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

Objective Settings.

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

224 {
225 if(!$form instanceof ilPropertyFormGUI)
226 {
227 $form = $this->initSettingsForm();
228 }
229
230 $GLOBALS['ilTabs']->activateSubTab('settings');
231 $GLOBALS['tpl']->setContent($form->getHTML());
232
234 }

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

Referenced by __construct(), and saveSettings().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showObjectiveCreation()

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

Show objective creation form.

Parameters
ilPropertyFormGUI$form

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

1136 {
1137 $GLOBALS['ilTabs']->activateSubTab('objectives');
1138
1139 if(!$form instanceof ilPropertyFormGUI)
1140 {
1141 $form = $this->initSimpleObjectiveForm();
1142 }
1143
1144 $GLOBALS['tpl']->setContent($form->getHTML());
1145
1147 }

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

Referenced by listObjectives(), and saveObjectiveCreation().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showStatus()

ilLOEditorGUI::showStatus (   $a_section)
protected

Show status panel.

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

1326 {
1327 include_once './Modules/Course/classes/Objectives/class.ilLOEditorStatus.php';
1328 $status = new ilLOEditorStatus($this->getParentObject());
1329 $status->setSection($a_section);
1330 $status->setCmdClass($this);
1331 $GLOBALS['tpl']->setRightContent($status->getHTML());
1332 }
Presentation of the status of single steps during the configuration process.

References $GLOBALS, and getParentObject().

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ testAssignment()

ilLOEditorGUI::testAssignment ( ilPropertyFormGUI  $form = null)
protected

new test assignment

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

795 {
796 $this->setTestType((int) $_REQUEST['tt']);
797 $this->ctrl->setParameter($this,'tt',$this->getTestType());
798
799 switch($this->getTestType())
800 {
802 $GLOBALS['ilTabs']->activateSubTab('itests');
803 break;
804
806 $GLOBALS['ilTabs']->activateSubTab('qtests');
807 break;
808 }
809 if(!$form instanceof ilPropertyFormGUI)
810 {
811 include_once './Modules/Course/classes/Objectives/class.ilLOTestAssignmentForm.php';
812 $form_helper = new ilLOTestAssignmentForm($this,$this->getParentObject(), $this->getTestType());
813 $form = $form_helper->initForm(TRUE);
814 }
815 $GLOBALS['tpl']->setContent($form->getHTML());
816
817 $this->showStatus(
818 ($this->getTestType() == self::TEST_TYPE_IT) ?
821 );
822 }

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

Referenced by saveMultiTestAssignment().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ testOverview()

ilLOEditorGUI::testOverview ( )
protected

Show test overview.

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

547 {
548 $this->setTestType((int) $_REQUEST['tt']);
549 $this->ctrl->setParameter($this,'tt',$this->getTestType());
550
552 switch($this->getTestType())
553 {
555 $GLOBALS['ilTabs']->activateSubTab('itest');
556 break;
557
559 $GLOBALS['ilTabs']->activateSubTab('qtest');
560 break;
561 }
562
563
564 // Check if test is assigned
565 if(!$settings->getTestByType($this->getTestType()))
566 {
567 return $this->testSettings();
568 }
569
570 try {
571 include_once './Modules/Course/classes/Objectives/class.ilLOTestAssignmentTableGUI.php';
572 $table = new ilLOTestAssignmentTableGUI(
573 $this,
574 'testOverview',
575 $this->getParentObject()->getId(),
576 $this->getTestType()
577 );
578 $table->init();
579 $table->parse(ilLOSettings::getInstanceByObjId($this->getParentObject()->getId())->getTestByType($this->getTestType()));
580 $GLOBALS['tpl']->setContent($table->getHTML());
581
582 $this->showStatus(
586 );
587 }
589 {
590 $GLOBALS['ilLog']->write(__METHOD__.': Show new assignment screen because of : '. $ex->getMessage());
591 $this->testSettings();
592 }
593 }
Class ilLOInvalidConfigurationException.
Class ilLOTestAssignmentTableGUI.

References $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.

+ Here is the call graph for this function:

◆ testSettings()

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

Show test settings.

Parameters
ilPropertyFormGUI$form

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

829 {
830 $this->ctrl->setParameter($this,'tt',(int) $_REQUEST['tt']);
831 switch($this->getTestType())
832 {
834 $GLOBALS['ilTabs']->activateSubTab('itest');
835 break;
836
838 $GLOBALS['ilTabs']->activateSubTab('qtest');
839 break;
840 }
841
842 if(!$form instanceof ilPropertyFormGUI)
843 {
844 include_once './Modules/Course/classes/Objectives/class.ilLOTestAssignmentForm.php';
845 $form_helper = new ilLOTestAssignmentForm($this, $this->getParentObject(),$this->getTestType());
846 $form = $form_helper->initForm(FALSE);
847 }
848 $GLOBALS['tpl']->setContent($form->getHTML());
849
850 $this->showStatus(
851 ($this->getTestType() == self::TEST_TYPE_IT) ?
854 );
855 }

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

Referenced by saveTest(), testOverview(), and testsOverview().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ testsOverview()

ilLOEditorGUI::testsOverview ( )
protected

View test assignments ()

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

490 {
491 $this->setTestType((int) $_REQUEST['tt']);
492 $this->ctrl->setParameter($this,'tt',$this->getTestType());
493
494 $GLOBALS['ilToolbar']->setFormAction($this->ctrl->getFormAction($this));
495 $GLOBALS['ilToolbar']->addButton(
496 $this->lng->txt('crs_loc_btn_new_assignment'),
497 $this->ctrl->getLinkTarget($this,'testAssignment')
498 );
499
500
502 switch($this->getTestType())
503 {
505 $GLOBALS['ilTabs']->activateSubTab('itests');
506 break;
507
509 $GLOBALS['ilTabs']->activateSubTab('qtests');
510 break;
511 }
512
513 try {
514 include_once './Modules/Course/classes/Objectives/class.ilLOTestAssignmentTableGUI.php';
515 $table = new ilLOTestAssignmentTableGUI(
516 $this,
517 'testsOverview',
518 $this->getParentObject()->getId(),
519 $this->getTestType(),
521 );
522 $table->init();
523 $table->parseMultipleAssignments();
524 $GLOBALS['tpl']->setContent($table->getHTML());
525
526 $this->showStatus(
530 );
531 }
533 {
534 $GLOBALS['ilLog']->write(__METHOD__.': Show new assignment screen because of : '. $ex->getMessage());
535 $this->testSettings();
536 }
537
538
539
540 }

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

+ Here is the call graph for this function:

◆ updateMaterialAssignments()

ilLOEditorGUI::updateMaterialAssignments ( ilObjTest  $test)
protected
Parameters
\ilObjTest$test

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

999 {
1000 include_once './Modules/Course/classes/class.ilCourseObjective.php';
1001 foreach(ilCourseObjective::_getObjectiveIds($this->getParentObject()->getId()) as $objective_id)
1002 {
1003 include_once './Modules/Course/classes/class.ilCourseObjectiveMaterials.php';
1004 $materials = new ilCourseObjectiveMaterials($objective_id);
1005 foreach($materials->getMaterials() as $key => $material)
1006 {
1007 if($material['ref_id'] == $test->getRefId())
1008 {
1009 $materials->delete($material['lm_ass_id']);
1010 }
1011 }
1012 }
1013 }
$test
Definition: Utf8Test.php:84
class ilCourseObjectiveMaterials

References $test, ilCourseObjective\_getObjectiveIds(), and getParentObject().

Referenced by saveMultiTestAssignment(), and saveTest().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateStartObjects()

ilLOEditorGUI::updateStartObjects ( )
protected

Add Test as start object.

Parameters
ilObjTest$tst

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

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

References $start, getParentObject(), and getSettings().

Referenced by saveMultiTestAssignment(), saveSettings(), and saveTest().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateTestAssignments()

ilLOEditorGUI::updateTestAssignments ( ilLOSettings  $settings)
protected

Update Test assignments.

Parameters
ilLOSettings$settings

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

258 {
259 switch($settings->getInitialTestType())
260 {
262 $settings->setInitialTest(0);
264
268
269 break;
270
273 $settings->setInitialTest(0);
274 break;
275 }
276
277 switch($settings->getQualifyingTestType())
278 {
281 break;
282
284 $settings->setQualifiedTest(0);
285 break;
286 }
287 $settings->update();
288 }
deleteAssignments($a_type)
Delete assignments.
setInitialTest($a_id)
set initial test id
setQualifiedTest($a_id)
set qualified test

References $settings, deleteAssignments(), ilLOSettings\setInitialTest(), ilLOSettings\setQualifiedTest(), ilLOSettings\TYPE_INITIAL_NONE, ilLOSettings\TYPE_INITIAL_PLACEMENT_ALL, ilLOSettings\TYPE_INITIAL_PLACEMENT_SELECTED, ilLOSettings\TYPE_INITIAL_QUALIFYING_ALL, ilLOSettings\TYPE_INITIAL_QUALIFYING_SELECTED, ilLOSettings\TYPE_QUALIFYING_ALL, ilLOSettings\TYPE_QUALIFYING_SELECTED, ilLOSettings\TYPE_TEST_INITIAL, and ilLOSettings\TYPE_TEST_QUALIFIED.

Referenced by saveSettings().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $ctrl

ilLOEditorGUI::$ctrl = NULL
private

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

◆ $lng

ilLOEditorGUI::$lng = NULL
private

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

◆ $logger

ilLOEditorGUI::$logger = null
private

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

◆ $parent_obj

ilLOEditorGUI::$parent_obj
private

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

Referenced by getParentObject().

◆ $settings

◆ $test_type

ilLOEditorGUI::$test_type = 0
private

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

Referenced by getTestType().

◆ SETTINGS_TEMPLATE_IT

const ilLOEditorGUI::SETTINGS_TEMPLATE_IT = 'il_astpl_loc_initial'

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

◆ SETTINGS_TEMPLATE_QT

const ilLOEditorGUI::SETTINGS_TEMPLATE_QT = 'il_astpl_loc_qualified'

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

◆ TEST_ASSIGN

const ilLOEditorGUI::TEST_ASSIGN = 2

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

◆ TEST_NEW

const ilLOEditorGUI::TEST_NEW = 1

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

◆ TEST_TYPE_IT

const ilLOEditorGUI::TEST_TYPE_IT = 1

◆ TEST_TYPE_QT

const ilLOEditorGUI::TEST_TYPE_QT = 2

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

Referenced by applySettingsTemplate().


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