ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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...
 
 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 ()
 
 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

 $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 43 of file class.ilLOEditorGUI.php.

44 {
45 $this->parent_obj = $a_parent_obj;
47 $this->lng = $GLOBALS['lng'];
48 $this->ctrl = $GLOBALS['ilCtrl'];
49 }
settings(ilPropertyFormGUI $form=NULL)
Objective Settings.
static getInstanceByObjId($a_obj_id)
get singleton instance
$GLOBALS['PHPCAS_CLIENT']
This global variable is used by the interface class phpCAS.
Definition: CAS.php:276

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

+ Here is the call graph for this function:

Member Function Documentation

◆ activateObjectives()

ilLOEditorGUI::activateObjectives ( )
protected

activate chosen objectives

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

1170 {
1171 $enabled = (array) $_REQUEST['objective'];
1172
1173 include_once './Modules/Course/classes/class.ilCourseObjective.php';
1174 $objectives = ilCourseObjective::_getObjectiveIds($this->getParentObject()->getId(),false);
1175 foreach((array) $objectives as $objective_id)
1176 {
1177 $objective = new ilCourseObjective($this->getParentObject(),$objective_id);
1178 if(in_array($objective_id, $enabled))
1179 {
1180 $objective->setActive(true);
1181 $objective->update();
1182 }
1183 }
1184
1185 include_once './Services/Tracking/classes/class.ilLPStatusWrapper.php';
1187
1188 ilUtil::sendSuccess($this->lng->txt('settings_saved'),true);
1189 $this->ctrl->redirect($this,'listObjectives');
1190 }
class ilcourseobjective
static _getObjectiveIds($course_id, $a_activated_only=false)
_refreshStatus($a_obj_id, $a_users=null)
Set dirty.
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7

References $_REQUEST, 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 813 of file class.ilLOEditorGUI.php.

814 {
815 include_once "Services/Administration/classes/class.ilSettingsTemplate.php";
816 include_once './Modules/Test/classes/class.ilObjAssessmentFolderGUI.php';
817
818 $tpl_id = 0;
819 foreach(ilSettingsTemplate::getAllSettingsTemplates('tst', true) as $nr => $template)
820 {
821 switch($this->getTestType())
822 {
824 if($template['title'] == self::SETTINGS_TEMPLATE_IT)
825 {
826 $tpl_id = $template['id'];
827 }
828 break;
830 if($template['title'] == self::SETTINGS_TEMPLATE_QT)
831 {
832 $tpl_id = $template['id'];
833 }
834 break;
835 }
836 if($tpl_id)
837 {
838 break;
839 }
840 }
841
842 if(!$tpl_id)
843 {
844 return false;
845 }
846
847 include_once "Services/Administration/classes/class.ilSettingsTemplate.php";
848 include_once './Modules/Test/classes/class.ilObjAssessmentFolderGUI.php';
850 $template_settings = $template->getSettings();
851 if($template_settings)
852 {
853 include_once './Modules/Test/classes/class.ilObjTestGUI.php';
854 $tst_gui = new ilObjTestGUI();
855 $tst_gui->applyTemplate($template_settings, $tst);
856 }
857 $tst->setTemplate($tpl_id);
858 return true;
859 }
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 1139 of file class.ilLOEditorGUI.php.

1140 {
1141 $GLOBALS['ilTabs']->activateSubTab('objectives');
1142
1143 include_once './Services/Utilities/classes/class.ilConfirmationGUI.php';
1144 $confirm = new ilConfirmationGUI();
1145 $confirm->setFormAction($this->ctrl->getFormAction($this));
1146 $confirm->setHeaderText($this->lng->txt('crs_delete_objectve_sure'));
1147 $confirm->setConfirm($this->lng->txt('delete'), 'deleteObjectives');
1148 $confirm->setCancel($this->lng->txt('cancel'), 'listObjectives');
1149
1150 foreach($_POST['objective'] as $objective_id)
1151 {
1152 include_once './Modules/Course/classes/class.ilCourseObjective.php';
1153 $obj = new ilCourseObjective($this->getParentObject(),$objective_id);
1154 $name = $obj->getTitle();
1155
1156 $confirm->addItem(
1157 'objective_ids[]',
1158 $objective_id,
1159 $name
1160 );
1161 }
1162 $GLOBALS['tpl']->setContent($confirm->getHTML());
1164 }
Confirmation screen class.
showStatus($a_section)
Show status panel.
$_POST['username']
Definition: cron.php:12

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 602 of file class.ilLOEditorGUI.php.

603 {
604 $this->setTestType((int) $_REQUEST['tt']);
605 $this->ctrl->setParameter($this,'tt',$this->getTestType());
606
608 switch($this->getTestType())
609 {
611 $GLOBALS['ilTabs']->activateSubTab('itest');
612 break;
613
615 $GLOBALS['ilTabs']->activateSubTab('qtest');
616 break;
617 }
618
619 if(!(int) $_REQUEST['tst'])
620 {
621 ilUtil::sendFailure($this->lng->txt('select_one'),true);
622 $this->ctrl->redirect($this,'testOverview');
623 }
624
625 include_once './Services/Utilities/classes/class.ilConfirmationGUI.php';
626 $confirm = new ilConfirmationGUI();
627 $confirm->setHeaderText($this->lng->txt('crs_loc_confirm_delete_tst'));
628 $confirm->setFormAction($this->ctrl->getFormAction($this));
629 $confirm->setConfirm($this->lng->txt('crs_loc_delete_assignment'), 'deleteTest');
630 $confirm->setCancel($this->lng->txt('cancel'), 'testOverview');
631
632 foreach((array) $_REQUEST['tst'] as $tst_id)
633 {
634 $obj_id = ilObject::_lookupObjId($tst_id);
635 $confirm->addItem('tst[]', $tst_id, ilObject::_lookupTitle($obj_id));
636 }
637
638 $GLOBALS['tpl']->setContent($confirm->getHTML());
639
640 $this->showStatus(
644 );
645 }
static _lookupObjId($a_id)
static _lookupTitle($a_id)
lookup object title
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.

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.

+ Here is the call graph for this function:

◆ confirmDeleteTests()

ilLOEditorGUI::confirmDeleteTests ( )
protected

Show delete test confirmation.

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

551 {
552 $this->setTestType((int) $_REQUEST['tt']);
553 $this->ctrl->setParameter($this,'tt',$this->getTestType());
554
556 switch($this->getTestType())
557 {
559 $GLOBALS['ilTabs']->activateSubTab('itests');
560 break;
561
563 $GLOBALS['ilTabs']->activateSubTab('qtests');
564 break;
565 }
566
567 if(!(int) $_REQUEST['tst'])
568 {
569 ilUtil::sendFailure($this->lng->txt('select_one'),true);
570 $this->ctrl->redirect($this,'testsOverview');
571 }
572
573 include_once './Services/Utilities/classes/class.ilConfirmationGUI.php';
574 $confirm = new ilConfirmationGUI();
575 $confirm->setHeaderText($this->lng->txt('crs_loc_confirm_delete_tst'));
576 $confirm->setFormAction($this->ctrl->getFormAction($this));
577 $confirm->setConfirm($this->lng->txt('crs_loc_delete_assignment'), 'deleteTests');
578 $confirm->setCancel($this->lng->txt('cancel'), 'testsOverview');
579
580 foreach((array) $_REQUEST['tst'] as $assign_id)
581 {
582 include_once './Modules/Course/classes/Objectives/class.ilLOTestAssignment.php';
583 $assignment = new ilLOTestAssignment($assign_id);
584
585
586 $obj_id = ilObject::_lookupObjId($assignment->getTestRefId());
587 $confirm->addItem('tst[]', $assign_id, ilObject::_lookupTitle($obj_id));
588 }
589
590 $GLOBALS['tpl']->setContent($confirm->getHTML());
591
592 $this->showStatus(
596 );
597 }
Settings for LO courses.

References $_REQUEST, $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 1195 of file class.ilLOEditorGUI.php.

1196 {
1197 $disabled = (array) $_REQUEST['objective'];
1198
1199 include_once './Modules/Course/classes/class.ilCourseObjective.php';
1200 $objectives = ilCourseObjective::_getObjectiveIds($this->getParentObject()->getId(),false);
1201 foreach((array) $objectives as $objective_id)
1202 {
1203 $objective = new ilCourseObjective($this->getParentObject(),$objective_id);
1204 if(in_array($objective_id, $disabled))
1205 {
1206 $objective->setActive(false);
1207 $objective->update();
1208 }
1209 }
1210
1211 include_once './Services/Tracking/classes/class.ilLPStatusWrapper.php';
1213
1214 ilUtil::sendSuccess($this->lng->txt('settings_saved'),true);
1215 $this->ctrl->redirect($this,'listObjectives');
1216 }

References $_REQUEST, 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 232 of file class.ilLOEditorGUI.php.

233 {
234 include_once './Modules/Course/classes/Objectives/class.ilLOTestAssignments.php';
235 $assignments = ilLOTestAssignments::getInstance($this->getParentObject()->getId());
236 foreach($assignments->getAssignmentsByType($a_type) as $assignment)
237 {
238 $assignment->delete();
239 }
240 return;
241 }
static getInstance($a_container_id)
Get instance by container id.

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

Referenced by saveSettings().

+ 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 1223 of file class.ilLOEditorGUI.php.

1224 {
1225 global $rbacsystem;
1226
1227 foreach($_POST['objective_ids'] as $objective_id)
1228 {
1229 include_once './Modules/Course/classes/class.ilCourseObjective.php';
1230 $objective_obj = new ilCourseObjective($this->getParentObject(),$objective_id);
1231 $objective_obj->delete();
1232 }
1233
1234 include_once './Services/Tracking/classes/class.ilLPStatusWrapper.php';
1236
1237 ilUtil::sendSuccess($this->lng->txt('crs_objectives_deleted'),true);
1238 $this->ctrl->redirect($this,'listObjectives');
1239
1240 return true;
1241 }

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 694 of file class.ilLOEditorGUI.php.

695 {
696 $this->setTestType((int) $_REQUEST['tt']);
697 $this->ctrl->setParameter($this,'tt',$this->getTestType());
698
700 switch($this->getTestType())
701 {
703 $GLOBALS['ilTabs']->activateSubTab('itest');
704 break;
705
707 $GLOBALS['ilTabs']->activateSubTab('qtest');
708 break;
709 }
710
711 foreach((array) $_REQUEST['tst'] as $tst_id)
712 {
713 switch($this->getTestType())
714 {
716 $settings->setInitialTest(0);
717 break;
718
720 $settings->setQualifiedTest(0);
721 break;
722 }
723 $settings->update();
724
725 // finally delete start object assignment
726 include_once './Services/Container/classes/class.ilContainerStartObjects.php';
727 $start = new ilContainerStartObjects(
728 $this->getParentObject()->getRefId(),
729 $this->getParentObject()->getId()
730 );
731 $start->deleteItem($tst_id);
732
733 // ... and assigned questions
734 include_once './Modules/Course/classes/class.ilCourseObjectiveQuestion.php';
736 }
737
738
739 ilUtil::sendSuccess($this->lng->txt('settings_saved'),true);
740 $this->ctrl->redirect($this,'testOverview');
741 }

References $_REQUEST, $GLOBALS, $settings, 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 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('itests');
660 break;
661
663 $GLOBALS['ilTabs']->activateSubTab('qtests');
664 break;
665 }
666
667 foreach((array) $_REQUEST['tst'] as $assign_id)
668 {
669 include_once './Modules/Course/classes/Objectives/class.ilLOTestAssignment.php';
670 $assignment = new ilLOTestAssignment($assign_id);
671 $assignment->delete();
672
673 // finally delete start object assignment
674 include_once './Services/Container/classes/class.ilContainerStartObjects.php';
675 $start = new ilContainerStartObjects(
676 $this->getParentObject()->getRefId(),
677 $this->getParentObject()->getId()
678 );
679 $start->deleteItem($assignment->getTestRefId());
680
681 // ... and assigned questions
682 include_once './Modules/Course/classes/class.ilCourseObjectiveQuestion.php';
683 ilCourseObjectiveQuestion::deleteTest($assignment->getTestRefId());
684 }
685
686
687 ilUtil::sendSuccess($this->lng->txt('settings_saved'),true);
688 $this->ctrl->redirect($this,'testsOverview');
689 }

References $_REQUEST, $GLOBALS, $settings, 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 55 of file class.ilLOEditorGUI.php.

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

References $_REQUEST, $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 196 of file class.ilLOEditorGUI.php.

197 {
198 return $this->settings;
199 }

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 321 of file class.ilLOEditorGUI.php.

322 {
323 include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
324 $form = new ilPropertyFormGUI();
325 $form->setFormAction($this->ctrl->getFormAction($this));
326 $form->setTitle($this->lng->txt('crs_loc_settings_tbl'));
327
328 // initial test
329 $type_selector = new ilRadioGroupInputGUI($this->lng->txt('crs_loc_settings_it_type'), 'ittype');
330 $type_selector->setRequired(TRUE);
331 $type_selector->setValue($this->getSettings()->getInitialTestType());
332
333 $type_ipa = new ilRadioOption($this->lng->txt('crs_loc_settings_type_it_placement_all'), ilLOSettings::TYPE_INITIAL_PLACEMENT_ALL);
334 $type_ipa->setInfo($this->lng->txt('crs_loc_settings_type_it_placement_all_info'));
335 $type_selector->addOption($type_ipa);
336
337 $start_ip = new ilCheckboxInputGUI($this->lng->txt('crs_loc_settings_it_start_object'),'start_ip');
338 $start_ip->setValue(1);
339 $start_ip->setChecked($this->getSettings()->isInitialTestStart());
340 $type_ipa->addSubItem($start_ip);
341
342 $type_ips = new ilRadioOption($this->lng->txt('crs_loc_settings_type_it_placement_sel'), ilLOSettings::TYPE_INITIAL_PLACEMENT_SELECTED);
343 $type_ips->setInfo($this->lng->txt('crs_loc_settings_type_it_placement_sel_info'));
344 $type_selector->addOption($type_ips);
345
346 $type_iqa = new ilRadioOption($this->lng->txt('crs_loc_settings_type_it_qualifying_all'), ilLOSettings::TYPE_INITIAL_QUALIFYING_ALL);
347 $type_iqa->setInfo($this->lng->txt('crs_loc_settings_type_it_qualifying_all_info'));
348 $type_selector->addOption($type_iqa);
349
350 $start_iq = new ilCheckboxInputGUI($this->lng->txt('crs_loc_settings_it_start_object'),'start_iq');
351 $start_iq->setValue(1);
352 $start_iq->setChecked($this->getSettings()->isInitialTestStart());
353 $type_iqa->addSubItem($start_iq);
354
355 $type_iqs = new ilRadioOption($this->lng->txt('crs_loc_settings_type_it_qualifying_sel'), ilLOSettings::TYPE_INITIAL_QUALIFYING_SELECTED);
356 $type_iqs->setInfo($this->lng->txt('crs_loc_settings_type_it_qualifying_sel_info'));
357 $type_selector->addOption($type_iqs);
358
359 $type_ino = new ilRadioOption($this->lng->txt('crs_loc_settings_type_it_none'), ilLOSettings::TYPE_INITIAL_NONE);
360 $type_ino->setInfo($this->lng->txt('crs_loc_settings_type_it_none_info'));
361 $type_selector->addOption($type_ino);
362
363 $form->addItem($type_selector);
364
365 // qualifying test
366 $qt_selector = new ilRadioGroupInputGUI($this->lng->txt('crs_loc_settings_qt_all'),'qttype');
367 $qt_selector->setRequired(TRUE);
368 $qt_selector->setValue($this->getSettings()->getQualifyingTestType());
369
370 $type_qa = new ilRadioOption($this->lng->txt('crs_loc_settings_type_q_all'), ilLOSettings::TYPE_QUALIFYING_ALL);
371 $type_qa->setInfo($this->lng->txt('crs_loc_settings_type_q_all_info'));
372 $qt_selector->addOption($type_qa);
373
374 $start_q = new ilCheckboxInputGUI($this->lng->txt('crs_loc_settings_qt_start_object'),'start_q');
375 $start_q->setValue(1);
376 $start_q->setChecked($this->getSettings()->isQualifyingTestStart());
377 $type_qa->addSubItem($start_q);
378
379 $passed_mode = new ilRadioGroupInputGUI($this->lng->txt('crs_loc_settings_passed_mode'),'passed_mode');
380 $passed_mode->setValue($this->getSettings()->getPassedObjectiveMode());
381
382 $passed_mode->addOption(
383 new ilRadioOption(
384 $this->lng->txt('crs_loc_settings_passed_mode_hide'),
386 );
387 $passed_mode->addOption(
388 new ilRadioOption(
389 $this->lng->txt('crs_loc_settings_passed_mode_mark'),
391 );
392 $type_qa->addSubItem($passed_mode);
393
394 $type_qs = new ilRadioOption($this->lng->txt('crs_loc_settings_type_q_selected'), ilLOSettings::TYPE_QUALIFYING_SELECTED);
395 $type_qs->setInfo($this->lng->txt('crs_loc_settings_type_q_selected_info'));
396 $qt_selector->addOption($type_qs);
397
398 $form->addItem($qt_selector);
399
400 // reset results
401 $reset = new ilCheckboxInputGUI($this->lng->txt('crs_loc_settings_reset'),'reset');
402 $reset->setValue(1);
403 $reset->setChecked($this->getSettings()->isResetResultsEnabled());
404 $reset->setOptionTitle($this->lng->txt('crs_loc_settings_reset_enable'));
405 $reset->setInfo($this->lng->txt('crs_loc_settings_reset_enable_info'));
406 $form->addItem($reset);
407
408 $form->addCommandButton('saveSettings', $this->lng->txt('save'));
409
410
411 return $form;
412 }
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 1074 of file class.ilLOEditorGUI.php.

1075 {
1076 include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
1077 $form = new ilPropertyFormGUI();
1078 $form->setTitle($this->lng->txt('crs_loc_form_create_objectives'));
1079 $form->setFormAction($this->ctrl->getFormAction($this));
1080
1081 $txt = new ilTextWizardInputGUI($this->lng->txt('crs_objectives'), 'objectives');
1082 $txt->setValues(array(0 => ''));
1083 $txt->setRequired(true);
1084 $form->addItem($txt);
1085
1086 $form->addCommandButton('saveObjectiveCreation', $this->lng->txt('save'));
1087
1088 return $form;
1089 }
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 1020 of file class.ilLOEditorGUI.php.

1021 {
1022 global $ilToolbar;
1023
1024 include_once './Modules/Course/classes/class.ilCourseObjectivesGUI.php';
1026
1027
1028 $GLOBALS['ilTabs']->activateSubTab('objectives');
1029
1031 $this->getParentObject()->getId(),
1032 FALSE
1033 );
1034
1035 if(!count($objectives))
1036 {
1037 return $this->showObjectiveCreation();
1038 }
1039
1040 $ilToolbar->addButton(
1041 $this->lng->txt('crs_add_objective'),
1042 $this->ctrl->getLinkTargetByClass('ilcourseobjectivesgui', "create"));
1043
1044 include_once('./Modules/Course/classes/class.ilCourseObjectivesTableGUI.php');
1045 $table = new ilCourseObjectivesTableGUI($this,$this->getParentObject());
1046 $table->setTitle($this->lng->txt('crs_objectives'),'',$this->lng->txt('crs_objectives'));
1047 $table->parse($objectives);
1048 $GLOBALS['tpl']->setContent($table->getHTML());
1049
1051 }
$_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 414 of file class.ilLOEditorGUI.php.

415 {
416 $GLOBALS['ilTabs']->activateSubTab('materials');
417
418 include_once "Services/Object/classes/class.ilObjectAddNewItemGUI.php";
419 $gui = new ilObjectAddNewItemGUI($this->getParentObject()->getRefId());
420 $gui->setDisabledObjectTypes(array("itgr"));
421 #$gui->setAfterCreationCallback($this->getParentObject()->getRefId());
422 $gui->render();
423
424 include_once './Services/Object/classes/class.ilObjectTableGUI.php';
425 $obj_table = new ilObjectTableGUI(
426 $this,
427 'materials',
428 $this->getParentObject()->getRefId()
429 );
430 $obj_table->init();
431 $obj_table->setObjects($GLOBALS['tree']->getChildIds($this->getParentObject()->getRefId()));
432 $obj_table->parse();
433 $GLOBALS['tpl']->setContent($obj_table->getHTML());
434
436 }
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 177 of file class.ilLOEditorGUI.php.

178 {
179 include_once './Modules/Course/classes/class.ilCourseObjectivesGUI.php';
181 return $this->listObjectives();
182 }
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 873 of file class.ilLOEditorGUI.php.

874 {
875
876 $this->ctrl->setParameter($this,'tt',(int) $_REQUEST['tt']);
877 $this->setTestType((int) $_REQUEST['tt']);
878
880
881 include_once './Modules/Course/classes/Objectives/class.ilLOTestAssignmentForm.php';
882 $form_helper = new ilLOTestAssignmentForm($this,$this->getParentObject(), $this->getTestType());
883 $form = $form_helper->initForm(TRUE);
884
885 if($form->checkInput())
886 {
887 $mode = $form->getInput('mode');
888
889 if($mode == self::TEST_NEW)
890 {
891 $tst = new ilObjTest();
892 $tst->setType('tst');
893 $tst->setTitle($form->getInput('title'));
894 $tst->setDescription($form->getInput('desc'));
895 $tst->create();
896 $tst->createReference();
897 $tst->putInTree($this->getParentObject()->getRefId());
898 $tst->setPermissions($this->getParentObject()->getRefId());
899
900 // apply settings template
901 $this->applySettingsTemplate($tst);
902
903 $tst->setQuestionSetType($form->getInput('qtype'));
904
905 $tst->saveToDb();
906
907 include_once './Modules/Course/classes/Objectives/class.ilLOTestAssignment.php';
908 $assignment = new ilLOTestAssignment();
909 $assignment->setContainerId($this->getParentObject()->getId());
910 $assignment->setAssignmentType($this->getTestType());
911 $assignment->setObjectiveId($form->getInput('objective'));
912 $assignment->setTestRefId($tst->getRefId());
913 $assignment->save();
914 }
915 else
916 {
917 include_once './Modules/Course/classes/Objectives/class.ilLOTestAssignment.php';
918 $assignment = new ilLOTestAssignment();
919 $assignment->setContainerId($this->getParentObject()->getId());
920 $assignment->setAssignmentType($this->getTestType());
921 $assignment->setObjectiveId($form->getInput('objective'));
922 $assignment->setTestRefId($form->getInput('tst'));
923 $assignment->save();
924
925 $tst = new ilObjTest($form->getInput('tst'),true);
926 $this->applySettingsTemplate($tst);
927 $tst->saveToDb();
928 }
929
930 $this->updateStartObjects();
931
932 ilUtil::sendSuccess($this->lng->txt('settings_saved'));
933 $this->ctrl->redirect($this,'testsOverview');
934 }
935
936 // Error
937 ilUtil::sendFailure($this->lng->txt('err_check_input'));
938 $form->setValuesByPost();
939 $this->testAssignment($form);
940 }
updateStartObjects()
Add Test as start object.
testAssignment(ilPropertyFormGUI $form=null)
new test assignment
applySettingsTemplate(ilObjTest $tst)
Apply auto generated setttings template.

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

+ Here is the call graph for this function:

◆ saveObjectiveCreation()

ilLOEditorGUI::saveObjectiveCreation ( )
protected

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

1092 {
1093 $form = $this->initSimpleObjectiveForm();
1094 if($form->checkInput())
1095 {
1096 foreach((array) $form->getInput('objectives') as $idx => $title)
1097 {
1098 include_once './Modules/Course/classes/class.ilCourseObjective.php';
1099 $obj = new ilCourseObjective($this->getParentObject());
1100 $obj->setActive(TRUE);
1101 $obj->setTitle($title);
1102 $obj->add();
1103 }
1104 ilUtil::sendSuccess($this->lng->txt('settings_saved'),true);
1105 $this->ctrl->redirect($this,'');
1106 }
1107
1108 $form->setValuesByPost();
1109 $GLOBALS['ilTabs']->activateSubTab('objectives');
1111 }
initSimpleObjectiveForm()
Show objective creation form.

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

+ Here is the call graph for this function:

◆ saveSettings()

ilLOEditorGUI::saveSettings ( )
protected

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

248 {
249 $form = $this->initSettingsForm();
250 if($form->checkInput())
251 {
253 $settings->setInitialTestType($form->getInput('ittype'));
254 switch($settings->getInitialTestType())
255 {
257 $settings->setInitialTestAsStart($form->getInput('start_ip'));
259 break;
260
262 $settings->setInitialTestAsStart(FALSE);
263 $settings->setInitialTest(0);
264 break;
265
267 $settings->setInitialTestAsStart($form->getInput('start_iq'));
269 break;
270
272 $settings->setInitialTestAsStart(FALSE);
273 $settings->setInitialTest(0);
274 break;
275
277 $settings->setInitialTestAsStart(FALSE);
278 $settings->setInitialTest(0);
280 break;
281 }
282
283 $settings->setQualifyingTestType($form->getInput('qttype'));
284 $settings->resetResults($form->getInput('reset'));
285 $settings->setPassedObjectiveMode($form->getInput('passed_mode'));
286
287 if($form->getInput('qttype') == ilLOSettings::TYPE_QUALIFYING_ALL)
288 {
289 $settings->setQualifyingTestAsStart($form->getInput('start_q'));
290 }
291 if($form->getInput('qttype') == ilLOSettings::TYPE_QUALIFYING_SELECTED)
292 {
293 $settings->setQualifiedTest(0);
294 }
295
296 if(
297 ($settings->getInitialTestType() != ilLOSettings::TYPE_INITIAL_NONE) &&
298 ($settings->isQualifyingTestStart())
299 )
300 {
301 $settings->setQualifyingTestAsStart(FALSE);
302 ilUtil::sendInfo($this->lng->txt('crs_loc_settings_err_qstart'),TRUE);
303 }
304
305 $settings->update();
306 $this->updateStartObjects();
307
308 ilUtil::sendSuccess($this->lng->txt('settings_saved'),true);
309 $this->ctrl->redirect($this,'settings');
310 }
311
312 // Error
313 ilUtil::sendFailure($this->lng->txt('err_check_input'));
314 $form->setValuesByPost();
315 $this->settings($form);
316 }
deleteAssignments($a_type)
Delete assignments.
initSettingsForm()
Init settings form.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.

References $settings, deleteAssignments(), 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, ilLOSettings\TYPE_TEST_INITIAL, and updateStartObjects().

+ Here is the call graph for this function:

◆ saveSorting()

ilLOEditorGUI::saveSorting ( )
protected

save position

@access protected

Returns

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

1120 {
1121 global $ilAccess,$ilErr,$ilObjDataCache;
1122
1123 asort($_POST['position'],SORT_NUMERIC);
1124
1125 $counter = 1;
1126 foreach($_POST['position'] as $objective_id => $position)
1127 {
1128 include_once './Modules/Course/classes/class.ilCourseObjective.php';
1129 $objective = new ilCourseObjective($this->getParentObject(),$objective_id);
1130 $objective->writePosition($counter++);
1131 }
1132 ilUtil::sendSuccess($this->lng->txt('crs_objective_saved_sorting'));
1133 $this->listObjectives();
1134 }

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

+ Here is the call graph for this function:

◆ saveTest()

ilLOEditorGUI::saveTest ( )
protected

Save Test.

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

946 {
947 $this->ctrl->setParameter($this,'tt',(int) $_REQUEST['tt']);
948 $this->setTestType((int) $_REQUEST['tt']);
949
951
952 include_once './Modules/Course/classes/Objectives/class.ilLOTestAssignmentForm.php';
953 $form_helper = new ilLOTestAssignmentForm($this, $this->getParentObject(),$this->getTestType());
954 $form = $form_helper->initForm(FALSE);
955
956 if($form->checkInput())
957 {
958 $mode = $form->getInput('mode');
959
960 if($mode == self::TEST_NEW)
961 {
962 $tst = new ilObjTest();
963 $tst->setType('tst');
964 $tst->setTitle($form->getInput('title'));
965 $tst->setDescription($form->getInput('desc'));
966 $tst->create();
967 $tst->createReference();
968 $tst->putInTree($this->getParentObject()->getRefId());
969 $tst->setPermissions($this->getParentObject()->getRefId());
970
971 // apply settings template
972 $this->applySettingsTemplate($tst);
973
974 $tst->setQuestionSetType($form->getInput('qtype'));
975
976 $tst->saveToDb();
977
978 if($this->getTestType() == self::TEST_TYPE_IT)
979 {
980 $this->getSettings()->setInitialTest($tst->getRefId());
981 }
982 else
983 {
984 $this->getSettings()->setQualifiedTest($tst->getRefId());
985 }
986 $this->getSettings()->update();
987 }
988 else
989 {
990 if($this->getTestType() == self::TEST_TYPE_IT)
991 {
992 $this->getSettings()->setInitialTest($form->getInput('tst'));
993 }
994 else
995 {
996 $this->getSettings()->setQualifiedTest($form->getInput('tst'));
997 }
998
999 $this->getSettings()->update();
1000 $tst = new ilObjTest($settings->getTestByType($this->getTestType()),true);
1001 $this->applySettingsTemplate($tst);
1002 $tst->saveToDb();
1003 }
1004
1005 $this->updateStartObjects();
1006
1007 ilUtil::sendSuccess($this->lng->txt('settings_saved'));
1008 $this->ctrl->redirect($this,'testOverview');
1009 }
1010
1011 // Error
1012 ilUtil::sendFailure($this->lng->txt('err_check_input'));
1013 $form->setValuesByPost();
1014 $this->testSettings($form);
1015 }
testSettings(ilPropertyFormGUI $form=NULL)
Show test settings.

References $_REQUEST, $settings, applySettingsTemplate(), ilLOSettings\getInstanceByObjId(), getParentObject(), getSettings(), getTestType(), ilUtil\sendFailure(), ilUtil\sendSuccess(), setTestType(), testSettings(), 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 1261 of file class.ilLOEditorGUI.php.

1262 {
1263 // objective settings
1264 $GLOBALS['ilTabs']->addSubTab(
1265 'settings',
1266 $this->lng->txt('settings'),
1267 $this->ctrl->getLinkTarget($this,'settings')
1268 );
1269 // learning objectives
1270 $GLOBALS['ilTabs']->addSubTab(
1271 'objectives',
1272 $this->lng->txt('crs_loc_tab_objectives'),
1273 $this->ctrl->getLinkTarget($this,'listObjectives')
1274 );
1275 // materials
1276 /*
1277 $GLOBALS['ilTabs']->addTab(
1278 'materials',
1279 $this->lng->txt('crs_loc_tab_materials'),
1280 $this->ctrl->getLinkTarget($this,'materials')
1281 );
1282 */
1283 // tests
1285 if($settings->worksWithInitialTest())
1286 {
1287 if(
1288 $settings->getInitialTestType() == ilLOSettings::TYPE_INITIAL_PLACEMENT_ALL ||
1290 )
1291 {
1292 $this->ctrl->setParameter($this,'tt', ilLOSettings::TYPE_TEST_INITIAL);
1293 $GLOBALS['ilTabs']->addSubTab(
1294 'itest',
1295 $this->lng->txt('crs_loc_tab_itest'),
1296 $this->ctrl->getLinkTarget($this,'testOverview')
1297 );
1298 }
1299 else
1300 {
1301 $this->ctrl->setParameter($this,'tt', ilLOSettings::TYPE_TEST_INITIAL);
1302 $GLOBALS['ilTabs']->addSubTab(
1303 'itests',
1304 $this->lng->txt('crs_loc_tab_itests'),
1305 $this->ctrl->getLinkTarget($this,'testsOverview')
1306 );
1307 }
1308
1309
1310
1311 }
1312
1313 if($settings->getQualifyingTestType() == ilLOSettings::TYPE_QUALIFYING_ALL)
1314 {
1315 $this->ctrl->setParameter($this,'tt', ilLOSettings::TYPE_TEST_QUALIFIED);
1316 $GLOBALS['ilTabs']->addSubTab(
1317 'qtest',
1318 $this->lng->txt('crs_loc_tab_qtest'),
1319 $this->ctrl->getLinkTarget($this,'testOverview')
1320 );
1321 }
1322 else
1323 {
1324 $this->ctrl->setParameter($this,'tt', ilLOSettings::TYPE_TEST_QUALIFIED);
1325 $GLOBALS['ilTabs']->addSubTab(
1326 'qtests',
1327 $this->lng->txt('crs_loc_tab_qtests'),
1328 $this->ctrl->getLinkTarget($this,'testsOverview')
1329 );
1330 }
1331
1332 if($settings->worksWithStartObjects())
1333 {
1334 $GLOBALS['ilTabs']->addSubTab(
1335 'start',
1336 $this->lng->txt('crs_loc_tab_start'),
1337 $this->ctrl->getLinkTargetByClass('ilcontainerstartobjectsgui','')
1338 );
1339 }
1340
1341 // Member view
1342 #include_once './Services/Container/classes/class.ilMemberViewGUI.php';
1343 #ilMemberViewGUI::showMemberViewSwitch($this->getParentObject()->getRefId());
1344 }

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 201 of file class.ilLOEditorGUI.php.

202 {
203 $this->test_type = $a_type;
204 }

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 215 of file class.ilLOEditorGUI.php.

216 {
217 if(!$form instanceof ilPropertyFormGUI)
218 {
219 $form = $this->initSettingsForm();
220 }
221
222 $GLOBALS['ilTabs']->activateSubTab('settings');
223 $GLOBALS['tpl']->setContent($form->getHTML());
224
226 }

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 1057 of file class.ilLOEditorGUI.php.

1058 {
1059 $GLOBALS['ilTabs']->activateSubTab('objectives');
1060
1061 if(!$form instanceof ilPropertyFormGUI)
1062 {
1063 $form = $this->initSimpleObjectiveForm();
1064 }
1065
1066 $GLOBALS['tpl']->setContent($form->getHTML());
1067
1069 }

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

Referenced by listObjectives().

+ 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 1246 of file class.ilLOEditorGUI.php.

1247 {
1248 include_once './Modules/Course/classes/Objectives/class.ilLOEditorStatus.php';
1249 $status = new ilLOEditorStatus($this->getParentObject());
1250 $status->setSection($a_section);
1251 $status->setCmdClass($this);
1252 $GLOBALS['tpl']->setRightContent($status->getHTML());
1253 }
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 746 of file class.ilLOEditorGUI.php.

747 {
748 $this->setTestType((int) $_REQUEST['tt']);
749 $this->ctrl->setParameter($this,'tt',$this->getTestType());
750
751 switch($this->getTestType())
752 {
754 $GLOBALS['ilTabs']->activateSubTab('itests');
755 break;
756
758 $GLOBALS['ilTabs']->activateSubTab('qtests');
759 break;
760 }
761 if(!$form instanceof ilPropertyFormGUI)
762 {
763 include_once './Modules/Course/classes/Objectives/class.ilLOTestAssignmentForm.php';
764 $form_helper = new ilLOTestAssignmentForm($this,$this->getParentObject(), $this->getTestType());
765 $form = $form_helper->initForm(TRUE);
766 }
767 $GLOBALS['tpl']->setContent($form->getHTML());
768
769 $this->showStatus(
770 ($this->getTestType() == self::TEST_TYPE_IT) ?
773 );
774 }

References $_REQUEST, $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 498 of file class.ilLOEditorGUI.php.

499 {
500 $this->setTestType((int) $_REQUEST['tt']);
501 $this->ctrl->setParameter($this,'tt',$this->getTestType());
502
504 switch($this->getTestType())
505 {
507 $GLOBALS['ilTabs']->activateSubTab('itest');
508 break;
509
511 $GLOBALS['ilTabs']->activateSubTab('qtest');
512 break;
513 }
514
515
516 // Check if test is assigned
517 if(!$settings->getTestByType($this->getTestType()))
518 {
519 return $this->testSettings();
520 }
521
522 try {
523 include_once './Modules/Course/classes/Objectives/class.ilLOTestAssignmentTableGUI.php';
524 $table = new ilLOTestAssignmentTableGUI(
525 $this,
526 'testOverview',
527 $this->getParentObject()->getId(),
528 $this->getTestType()
529 );
530 $table->init();
531 $table->parse(ilLOSettings::getInstanceByObjId($this->getParentObject()->getId())->getTestByType($this->getTestType()));
532 $GLOBALS['tpl']->setContent($table->getHTML());
533
534 $this->showStatus(
538 );
539 }
541 {
542 $GLOBALS['ilLog']->write(__METHOD__.': Show new assignment screen because of : '. $ex->getMessage());
543 $this->testSettings();
544 }
545 }
Class ilLOInvalidConfigurationException.
Class ilLOTestAssignmentTableGUI.

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.

+ Here is the call graph for this function:

◆ testSettings()

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

Show test settings.

Parameters
ilPropertyFormGUI$form

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

781 {
782 $this->ctrl->setParameter($this,'tt',(int) $_REQUEST['tt']);
783 switch($this->getTestType())
784 {
786 $GLOBALS['ilTabs']->activateSubTab('itest');
787 break;
788
790 $GLOBALS['ilTabs']->activateSubTab('qtest');
791 break;
792 }
793
794 if(!$form instanceof ilPropertyFormGUI)
795 {
796 include_once './Modules/Course/classes/Objectives/class.ilLOTestAssignmentForm.php';
797 $form_helper = new ilLOTestAssignmentForm($this, $this->getParentObject(),$this->getTestType());
798 $form = $form_helper->initForm(FALSE);
799 }
800 $GLOBALS['tpl']->setContent($form->getHTML());
801
802 $this->showStatus(
803 ($this->getTestType() == self::TEST_TYPE_IT) ?
806 );
807 }

References $_REQUEST, $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 441 of file class.ilLOEditorGUI.php.

442 {
443 $this->setTestType((int) $_REQUEST['tt']);
444 $this->ctrl->setParameter($this,'tt',$this->getTestType());
445
446 $GLOBALS['ilToolbar']->setFormAction($this->ctrl->getFormAction($this));
447 $GLOBALS['ilToolbar']->addButton(
448 $this->lng->txt('crs_loc_btn_new_assignment'),
449 $this->ctrl->getLinkTarget($this,'testAssignment')
450 );
451
452
454 switch($this->getTestType())
455 {
457 $GLOBALS['ilTabs']->activateSubTab('itests');
458 break;
459
461 $GLOBALS['ilTabs']->activateSubTab('qtests');
462 break;
463 }
464
465 try {
466 include_once './Modules/Course/classes/Objectives/class.ilLOTestAssignmentTableGUI.php';
467 $table = new ilLOTestAssignmentTableGUI(
468 $this,
469 'testsOverview',
470 $this->getParentObject()->getId(),
471 $this->getTestType(),
473 );
474 $table->init();
475 $table->parseMultipleAssignments();
476 $GLOBALS['tpl']->setContent($table->getHTML());
477
478 $this->showStatus(
482 );
483 }
485 {
486 $GLOBALS['ilLog']->write(__METHOD__.': Show new assignment screen because of : '. $ex->getMessage());
487 $this->testSettings();
488 }
489
490
491
492 }

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

◆ updateStartObjects()

ilLOEditorGUI::updateStartObjects ( )
protected

Add Test as start object.

Parameters
ilObjTest$tst

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

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

References 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:

Field Documentation

◆ $ctrl

ilLOEditorGUI::$ctrl = NULL
private

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

◆ $lng

ilLOEditorGUI::$lng = NULL
private

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

◆ $parent_obj

ilLOEditorGUI::$parent_obj
private

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

Referenced by getParentObject().

◆ $settings

◆ $test_type

ilLOEditorGUI::$test_type = 0
private

Definition at line 36 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: