ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 1189 of file class.ilLOEditorGUI.php.

1190 {
1191 $enabled = (array) $_REQUEST['objective'];
1192
1193 include_once './Modules/Course/classes/class.ilCourseObjective.php';
1194 $objectives = ilCourseObjective::_getObjectiveIds($this->getParentObject()->getId(), false);
1195 foreach ((array) $objectives as $objective_id) {
1196 $objective = new ilCourseObjective($this->getParentObject(), $objective_id);
1197 if (in_array($objective_id, $enabled)) {
1198 $objective->setActive(true);
1199 $objective->update();
1200 }
1201 }
1202
1203 include_once './Services/Tracking/classes/class.ilLPStatusWrapper.php';
1205
1206 ilUtil::sendSuccess($this->lng->txt('settings_saved'), true);
1207 $this->ctrl->redirect($this, 'listObjectives');
1208 }
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 834 of file class.ilLOEditorGUI.php.

835 {
836 include_once "Services/Administration/classes/class.ilSettingsTemplate.php";
837 include_once './Modules/Test/classes/class.ilObjAssessmentFolderGUI.php';
838
839 $tpl_id = 0;
840 foreach (ilSettingsTemplate::getAllSettingsTemplates('tst', true) as $nr => $template) {
841 switch ($this->getTestType()) {
843 if ($template['title'] == self::SETTINGS_TEMPLATE_IT) {
844 $tpl_id = $template['id'];
845 }
846 break;
848 if ($template['title'] == self::SETTINGS_TEMPLATE_QT) {
849 $tpl_id = $template['id'];
850 }
851 break;
852 }
853 if ($tpl_id) {
854 break;
855 }
856 }
857
858 if (!$tpl_id) {
859 return false;
860 }
861
862 include_once "Services/Administration/classes/class.ilSettingsTemplate.php";
863 include_once './Modules/Test/classes/class.ilObjAssessmentFolderGUI.php';
865 $template_settings = $template->getSettings();
866 if ($template_settings) {
867 include_once './Modules/Test/classes/class.ilObjTestGUI.php';
868 $tst_gui = new ilObjTestGUI();
869 $tst_gui->applyTemplate($template_settings, $tst);
870 }
871 $tst->setTemplate($tpl_id);
872 return true;
873 }
Class ilObjTestGUI.
setTemplate($template_id)
Settings template application class.
static getAllSettingsTemplates($a_type, $a_include_auto_generated=false)
Get all settings templates of type.
$template

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

1161 {
1162 $GLOBALS['ilTabs']->activateSubTab('objectives');
1163
1164 include_once './Services/Utilities/classes/class.ilConfirmationGUI.php';
1165 $confirm = new ilConfirmationGUI();
1166 $confirm->setFormAction($this->ctrl->getFormAction($this));
1167 $confirm->setHeaderText($this->lng->txt('crs_delete_objectve_sure'));
1168 $confirm->setConfirm($this->lng->txt('delete'), 'deleteObjectives');
1169 $confirm->setCancel($this->lng->txt('cancel'), 'listObjectives');
1170
1171 foreach ($_POST['objective'] as $objective_id) {
1172 include_once './Modules/Course/classes/class.ilCourseObjective.php';
1173 $obj = new ilCourseObjective($this->getParentObject(), $objective_id);
1174 $name = $obj->getTitle();
1175
1176 $confirm->addItem(
1177 'objective_ids[]',
1178 $objective_id,
1179 $name
1180 );
1181 }
1182 $GLOBALS['tpl']->setContent($confirm->getHTML());
1184 }
$_POST["username"]
Confirmation screen class.
showStatus($a_section)
Show status panel.
if($format !==null) $name
Definition: metadata.php:146

References $_POST, $GLOBALS, $name, 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 635 of file class.ilLOEditorGUI.php.

636 {
637 $this->setTestType((int) $_REQUEST['tt']);
638 $this->ctrl->setParameter($this, 'tt', $this->getTestType());
639
641 switch ($this->getTestType()) {
643 $GLOBALS['ilTabs']->activateSubTab('itest');
644 break;
645
647 $GLOBALS['ilTabs']->activateSubTab('qtest');
648 break;
649 }
650
651 if (!(int) $_REQUEST['tst']) {
652 ilUtil::sendFailure($this->lng->txt('select_one'), true);
653 $this->ctrl->redirect($this, 'testOverview');
654 }
655
656 include_once './Services/Utilities/classes/class.ilConfirmationGUI.php';
657 $confirm = new ilConfirmationGUI();
658 $confirm->setHeaderText($this->lng->txt('crs_loc_confirm_delete_tst'));
659 $confirm->setFormAction($this->ctrl->getFormAction($this));
660 $confirm->setConfirm($this->lng->txt('crs_loc_delete_assignment'), 'deleteTest');
661 $confirm->setCancel($this->lng->txt('cancel'), 'testOverview');
662
663 foreach ((array) $_REQUEST['tst'] as $tst_id) {
664 $obj_id = ilObject::_lookupObjId($tst_id);
665 $confirm->addItem('tst[]', $tst_id, ilObject::_lookupTitle($obj_id));
666 }
667
668 $GLOBALS['tpl']->setContent($confirm->getHTML());
669
670 $this->showStatus(
674 );
675 }
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 586 of file class.ilLOEditorGUI.php.

587 {
588 $this->setTestType((int) $_REQUEST['tt']);
589 $this->ctrl->setParameter($this, 'tt', $this->getTestType());
590
592 switch ($this->getTestType()) {
594 $GLOBALS['ilTabs']->activateSubTab('itests');
595 break;
596
598 $GLOBALS['ilTabs']->activateSubTab('qtests');
599 break;
600 }
601
602 if (!(int) $_REQUEST['tst']) {
603 ilUtil::sendFailure($this->lng->txt('select_one'), true);
604 $this->ctrl->redirect($this, 'testsOverview');
605 }
606
607 include_once './Services/Utilities/classes/class.ilConfirmationGUI.php';
608 $confirm = new ilConfirmationGUI();
609 $confirm->setHeaderText($this->lng->txt('crs_loc_confirm_delete_tst'));
610 $confirm->setFormAction($this->ctrl->getFormAction($this));
611 $confirm->setConfirm($this->lng->txt('crs_loc_delete_assignment'), 'deleteTests');
612 $confirm->setCancel($this->lng->txt('cancel'), 'testsOverview');
613
614 foreach ((array) $_REQUEST['tst'] as $assign_id) {
615 include_once './Modules/Course/classes/Objectives/class.ilLOTestAssignment.php';
616 $assignment = new ilLOTestAssignment($assign_id);
617
618
619 $obj_id = ilObject::_lookupObjId($assignment->getTestRefId());
620 $confirm->addItem('tst[]', $assign_id, ilObject::_lookupTitle($obj_id));
621 }
622
623 $GLOBALS['tpl']->setContent($confirm->getHTML());
624
625 $this->showStatus(
629 );
630 }
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 1213 of file class.ilLOEditorGUI.php.

1214 {
1215 $disabled = (array) $_REQUEST['objective'];
1216
1217 include_once './Modules/Course/classes/class.ilCourseObjective.php';
1218 $objectives = ilCourseObjective::_getObjectiveIds($this->getParentObject()->getId(), false);
1219 foreach ((array) $objectives as $objective_id) {
1220 $objective = new ilCourseObjective($this->getParentObject(), $objective_id);
1221 if (in_array($objective_id, $disabled)) {
1222 $objective->setActive(false);
1223 $objective->update();
1224 }
1225 }
1226
1227 include_once './Services/Tracking/classes/class.ilLPStatusWrapper.php';
1229
1230 ilUtil::sendSuccess($this->lng->txt('settings_saved'), true);
1231 $this->ctrl->redirect($this, 'listObjectives');
1232 }

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

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

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

1240 {
1241 global $rbacsystem;
1242
1243 foreach ($_POST['objective_ids'] as $objective_id) {
1244 include_once './Modules/Course/classes/class.ilCourseObjective.php';
1245 $objective_obj = new ilCourseObjective($this->getParentObject(), $objective_id);
1246 $objective_obj->delete();
1247 }
1248
1249 include_once './Services/Tracking/classes/class.ilLPStatusWrapper.php';
1251
1252 ilUtil::sendSuccess($this->lng->txt('crs_objectives_deleted'), true);
1253 $this->ctrl->redirect($this, 'listObjectives');
1254
1255 return true;
1256 }

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

723 {
724 $this->setTestType((int) $_REQUEST['tt']);
725 $this->ctrl->setParameter($this, 'tt', $this->getTestType());
726
728 switch ($this->getTestType()) {
730 $GLOBALS['ilTabs']->activateSubTab('itest');
731 break;
732
734 $GLOBALS['ilTabs']->activateSubTab('qtest');
735 break;
736 }
737
738 foreach ((array) $_REQUEST['tst'] as $tst_id) {
739 switch ($this->getTestType()) {
741 $settings->setInitialTest(0);
742 break;
743
745 $settings->setQualifiedTest(0);
746 break;
747 }
748 $settings->update();
749
750 // finally delete start object assignment
751 include_once './Services/Container/classes/class.ilContainerStartObjects.php';
752 $start = new ilContainerStartObjects(
753 $this->getParentObject()->getRefId(),
754 $this->getParentObject()->getId()
755 );
756 $start->deleteItem($tst_id);
757
758 // ... and assigned questions
759 include_once './Modules/Course/classes/class.ilCourseObjectiveQuestion.php';
761 }
762
763
764 ilUtil::sendSuccess($this->lng->txt('settings_saved'), true);
765 $this->ctrl->redirect($this, 'testOverview');
766 }

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

681 {
682 $this->setTestType((int) $_REQUEST['tt']);
683 $this->ctrl->setParameter($this, 'tt', $this->getTestType());
684
686 switch ($this->getTestType()) {
688 $GLOBALS['ilTabs']->activateSubTab('itests');
689 break;
690
692 $GLOBALS['ilTabs']->activateSubTab('qtests');
693 break;
694 }
695
696 foreach ((array) $_REQUEST['tst'] as $assign_id) {
697 include_once './Modules/Course/classes/Objectives/class.ilLOTestAssignment.php';
698 $assignment = new ilLOTestAssignment($assign_id);
699 $assignment->delete();
700
701 // finally delete start object assignment
702 include_once './Services/Container/classes/class.ilContainerStartObjects.php';
703 $start = new ilContainerStartObjects(
704 $this->getParentObject()->getRefId(),
705 $this->getParentObject()->getId()
706 );
707 $start->deleteItem($assignment->getTestRefId());
708
709 // ... and assigned questions
710 include_once './Modules/Course/classes/class.ilCourseObjectiveQuestion.php';
711 ilCourseObjectiveQuestion::deleteTest($assignment->getTestRefId());
712 }
713
714
715 ilUtil::sendSuccess($this->lng->txt('settings_saved'), true);
716 $this->ctrl->redirect($this, 'testsOverview');
717 }

References $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 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 case 'ilcourseobjectivesgui':
73
74 $this->ctrl->setReturn($this, 'returnFromObjectives');
75 $GLOBALS['ilTabs']->clearTargets();
76 $GLOBALS['ilTabs']->setBackTarget(
77 $this->lng->txt('back'),
78 $this->ctrl->getLinkTarget($this, 'listObjectives')
79 );
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
108 include_once './Services/AccessControl/classes/class.ilConditionHandlerInterface.php';
109 $cond = new ilConditionHandlerGUI($this);
110 $cond->setBackButtons(array());
111 $cond->setAutomaticValidation(false);
112 $cond->setTargetType("lobj");
113 $cond->setTargetRefId($this->getParentObject()->getRefId());
114
115 $cond->setTargetId((int) $_REQUEST['objective_id']);
116
117 // objecitve
118 include_once './Modules/Course/classes/class.ilCourseObjective.php';
119 $obj = new ilCourseObjective($this->getParentObject(), (int) $_REQUEST['objective_id']);
120 $cond->setTargetTitle($obj->getTitle());
121 $this->ctrl->forwardCommand($cond);
122 break;
123
124 case 'illopagegui':
125 $this->ctrl->saveParameterByClass('illopagegui', 'objective_id');
126
127 $GLOBALS['ilTabs']->clearTargets();
128 $GLOBALS['ilTabs']->setBackTarget(
129 $this->lng->txt('back'),
130 $this->ctrl->getLinkTarget($this, 'listObjectives')
131 );
132
133 $objtv_id = (int) $_REQUEST['objective_id'];
134
135 include_once 'Modules/Course/classes/Objectives/class.ilLOPage.php';
136 if (!ilLOPage::_exists('lobj', $objtv_id)) {
137 // doesn't exist -> create new one
138 $new_page_object = new ilLOPage();
139 $new_page_object->setParentId($objtv_id);
140 $new_page_object->setId($objtv_id);
141 $new_page_object->createFromXML();
142 unset($new_page_object);
143 }
144
145 $this->ctrl->setReturn($this, 'listObjectives');
146 include_once 'Modules/Course/classes/Objectives/class.ilLOPageGUI.php';
147 $pgui = new ilLOPageGUI($objtv_id);
148 $pgui->setPresentationTitle(ilCourseObjective::lookupObjectiveTitle($objtv_id));
149
150 include_once('./Services/Style/Content/classes/class.ilObjStyleSheet.php');
152 $this->parent_obj->getStyleSheetId(),
153 $this->parent_obj->getType()
154 ));
155
156 // #14895
157 $GLOBALS['tpl']->setCurrentBlock("ContentStyle");
158 $GLOBALS['tpl']->setVariable(
159 "LOCATION_CONTENT_STYLESHEET",
161 $this->parent_obj->getStyleSheetId(),
162 $this->parent_obj->getType()
163 ))
164 );
165 $GLOBALS['tpl']->parseCurrentBlock();
166
167 $ret = $this->ctrl->forwardCommand($pgui);
168 if ($ret) {
169 $GLOBALS['tpl']->setContent($ret);
170 }
171 break;
172
173 default:
174 if (!$cmd) {
175 // get first unaccomplished step
176 include_once './Modules/Course/classes/Objectives/class.ilLOEditorStatus.php';
177 $cmd = ilLOEditorStatus::getInstance($this->getParentObject())->getFirstFailedStep();
178 }
179 $this->$cmd();
180
181 break;
182 }
183 return true;
184 }
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, $add_random=true)
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

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

210 {
211 return $this->settings;
212 }

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

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

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

1098 {
1099 include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
1100 $form = new ilPropertyFormGUI();
1101 $form->setTitle($this->lng->txt('crs_loc_form_create_objectives'));
1102 $form->setFormAction($this->ctrl->getFormAction($this));
1103
1104 $txt = new ilTextWizardInputGUI($this->lng->txt('crs_objectives'), 'objectives');
1105 $txt->setValues(array(0 => ''));
1106 $txt->setRequired(true);
1107 $form->addItem($txt);
1108
1109 $form->addCommandButton('saveObjectiveCreation', $this->lng->txt('save'));
1110
1111 return $form;
1112 }
This class represents a text wizard property in a property form.
$txt
Definition: error.php:11

References $form, and $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 1044 of file class.ilLOEditorGUI.php.

1045 {
1046 global $ilToolbar;
1047
1048 include_once './Modules/Course/classes/class.ilCourseObjectivesGUI.php';
1050
1051
1052 $GLOBALS['ilTabs']->activateSubTab('objectives');
1053
1055 $this->getParentObject()->getId(),
1056 false
1057 );
1058
1059 if (!count($objectives)) {
1060 return $this->showObjectiveCreation();
1061 }
1062
1063 $ilToolbar->addButton(
1064 $this->lng->txt('crs_add_objective'),
1065 $this->ctrl->getLinkTargetByClass('ilcourseobjectivesgui', "create")
1066 );
1067
1068 include_once('./Modules/Course/classes/class.ilCourseObjectivesTableGUI.php');
1069 $table = new ilCourseObjectivesTableGUI($this, $this->getParentObject());
1070 $table->setTitle($this->lng->txt('crs_objectives'), '', $this->lng->txt('crs_objectives'));
1071 $table->parse($objectives);
1072 $GLOBALS['tpl']->setContent($table->getHTML());
1073
1075 }
$_SESSION["AccountId"]
showObjectiveCreation(ilPropertyFormGUI $form=null)
Show objective creation form.
if(empty($password)) $table
Definition: pwgen.php:24

References $_SESSION, $GLOBALS, $table, 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 460 of file class.ilLOEditorGUI.php.

461 {
462 $GLOBALS['ilTabs']->activateSubTab('materials');
463
464 include_once "Services/Object/classes/class.ilObjectAddNewItemGUI.php";
465 $gui = new ilObjectAddNewItemGUI($this->getParentObject()->getRefId());
466 $gui->setDisabledObjectTypes(array("itgr"));
467 #$gui->setAfterCreationCallback($this->getParentObject()->getRefId());
468 $gui->render();
469
470 include_once './Services/Object/classes/class.ilObjectTableGUI.php';
471 $obj_table = new ilObjectTableGUI(
472 $this,
473 'materials',
474 $this->getParentObject()->getRefId()
475 );
476 $obj_table->init();
477 $obj_table->setObjects($GLOBALS['tree']->getChildIds($this->getParentObject()->getRefId()));
478 $obj_table->parse();
479 $GLOBALS['tpl']->setContent($obj_table->getHTML());
480
482 }
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 190 of file class.ilLOEditorGUI.php.

191 {
192 include_once './Modules/Course/classes/class.ilCourseObjectivesGUI.php';
194 return $this->listObjectives();
195 }
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 887 of file class.ilLOEditorGUI.php.

888 {
889 $this->ctrl->setParameter($this, 'tt', (int) $_REQUEST['tt']);
890 $this->setTestType((int) $_REQUEST['tt']);
891
893
894 include_once './Modules/Course/classes/Objectives/class.ilLOTestAssignmentForm.php';
895 $form_helper = new ilLOTestAssignmentForm($this, $this->getParentObject(), $this->getTestType());
896 $form = $form_helper->initForm(true);
897
898 if ($form->checkInput()) {
899 $mode = $form->getInput('mode');
900
901 if ($mode == self::TEST_NEW) {
902 $tst = new ilObjTest();
903 $tst->setType('tst');
904 $tst->setTitle($form->getInput('title'));
905 $tst->setDescription($form->getInput('desc'));
906 $tst->create();
907 $tst->createReference();
908 $tst->putInTree($this->getParentObject()->getRefId());
909 $tst->setPermissions($this->getParentObject()->getRefId());
910
911 // apply settings template
912 $this->applySettingsTemplate($tst);
913
914 $tst->setQuestionSetType($form->getInput('qtype'));
915
916 $tst->saveToDb();
917
918 include_once './Modules/Course/classes/Objectives/class.ilLOTestAssignment.php';
919 $assignment = new ilLOTestAssignment();
920 $assignment->setContainerId($this->getParentObject()->getId());
921 $assignment->setAssignmentType($this->getTestType());
922 $assignment->setObjectiveId($form->getInput('objective'));
923 $assignment->setTestRefId($tst->getRefId());
924 $assignment->save();
925 } else {
926 include_once './Modules/Course/classes/Objectives/class.ilLOTestAssignment.php';
927 $assignment = new ilLOTestAssignment();
928 $assignment->setContainerId($this->getParentObject()->getId());
929 $assignment->setAssignmentType($this->getTestType());
930 $assignment->setObjectiveId($form->getInput('objective'));
931 $assignment->setTestRefId($form->getInput('tst'));
932 $assignment->save();
933
934 $tst = new ilObjTest($form->getInput('tst'), true);
935 $this->applySettingsTemplate($tst);
936 $tst->saveToDb();
937 }
938
939 // deassign as objective material
940 if ($tst instanceof ilObjTest) {
941 $this->updateMaterialAssignments($tst);
942 }
943 $this->updateStartObjects();
944
945 ilUtil::sendSuccess($this->lng->txt('settings_saved'));
946 $this->ctrl->redirect($this, 'testsOverview');
947 }
948
949 // Error
950 ilUtil::sendFailure($this->lng->txt('err_check_input'));
951 $form->setValuesByPost();
952 $this->testAssignment($form);
953 }
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 $form, $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 1114 of file class.ilLOEditorGUI.php.

1115 {
1116 $form = $this->initSimpleObjectiveForm();
1117 if ($form->checkInput()) {
1118 foreach ((array) $form->getInput('objectives') as $idx => $title) {
1119 include_once './Modules/Course/classes/class.ilCourseObjective.php';
1120 $obj = new ilCourseObjective($this->getParentObject());
1121 $obj->setActive(true);
1122 $obj->setTitle($title);
1123 $obj->add();
1124 }
1125 ilUtil::sendSuccess($this->lng->txt('settings_saved'), true);
1126 $this->ctrl->redirect($this, '');
1127 }
1128
1129 $form->setValuesByPost();
1130 $GLOBALS['ilTabs']->activateSubTab('objectives');
1133 }
initSimpleObjectiveForm()
Show objective creation form.

References $form, $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()) {
299 $settings->setInitialTestType($form->getInput('ittype'));
300 switch ($settings->getInitialTestType()) {
302 $settings->setInitialTestAsStart($form->getInput('start_ip'));
303 break;
304
306 $settings->setInitialTestAsStart(false);
307 break;
308
310 $settings->setInitialTestAsStart($form->getInput('start_iq'));
311 break;
312
314 $settings->setInitialTestAsStart(false);
315 break;
316
318 $settings->setInitialTestAsStart(false);
319 break;
320 }
321
322 $settings->setQualifyingTestType($form->getInput('qttype'));
323 switch ($settings->getQualifyingTestType()) {
325 $settings->setQualifyingTestAsStart($form->getInput('start_q'));
326 break;
327
329 $settings->setQualifyingTestAsStart(false);
330 break;
331 }
332
333
334 $settings->resetResults($form->getInput('reset'));
335 $settings->setPassedObjectiveMode($form->getInput('passed_mode'));
336
337 if (
338 ($settings->getInitialTestType() != ilLOSettings::TYPE_INITIAL_NONE) &&
339 ($settings->isQualifyingTestStart())
340 ) {
341 $settings->setQualifyingTestAsStart(false);
342 ilUtil::sendInfo($this->lng->txt('crs_loc_settings_err_qstart'), true);
343 }
344
345 $settings->update();
346 $this->updateStartObjects();
348
349 include_once './Services/Tracking/classes/class.ilLPStatusWrapper.php';
351
352 ilUtil::sendSuccess($this->lng->txt('settings_saved'), true);
353 $this->ctrl->redirect($this, 'settings');
354 }
355
356 // Error
357 ilUtil::sendFailure($this->lng->txt('err_check_input'));
358 $form->setValuesByPost();
359 $this->settings($form);
360 }
updateTestAssignments(ilLOSettings $settings)
Update Test assignments.
initSettingsForm()
Init settings form.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.

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

1142 {
1143 global $ilAccess,$ilErr,$ilObjDataCache;
1144
1145 asort($_POST['position'], SORT_NUMERIC);
1146
1147 $counter = 1;
1148 foreach ($_POST['position'] as $objective_id => $position) {
1149 include_once './Modules/Course/classes/class.ilCourseObjective.php';
1150 $objective = new ilCourseObjective($this->getParentObject(), $objective_id);
1151 $objective->writePosition($counter++);
1152 }
1153 ilUtil::sendSuccess($this->lng->txt('crs_objective_saved_sorting'));
1154 $this->listObjectives();
1155 }
$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 975 of file class.ilLOEditorGUI.php.

976 {
977 $this->ctrl->setParameter($this, 'tt', (int) $_REQUEST['tt']);
978 $this->setTestType((int) $_REQUEST['tt']);
979
981
982 include_once './Modules/Course/classes/Objectives/class.ilLOTestAssignmentForm.php';
983 $form_helper = new ilLOTestAssignmentForm($this, $this->getParentObject(), $this->getTestType());
984 $form = $form_helper->initForm(false);
985
986 if ($form->checkInput()) {
987 $mode = $form->getInput('mode');
988
989 if ($mode == self::TEST_NEW) {
990 $tst = new ilObjTest();
991 $tst->setType('tst');
992 $tst->setTitle($form->getInput('title'));
993 $tst->setDescription($form->getInput('desc'));
994 $tst->create();
995 $tst->createReference();
996 $tst->putInTree($this->getParentObject()->getRefId());
997 $tst->setPermissions($this->getParentObject()->getRefId());
998
999 // apply settings template
1000 $this->applySettingsTemplate($tst);
1001
1002 $tst->setQuestionSetType($form->getInput('qtype'));
1003
1004 $tst->saveToDb();
1005
1006 if ($this->getTestType() == self::TEST_TYPE_IT) {
1007 $this->getSettings()->setInitialTest($tst->getRefId());
1008 } else {
1009 $this->getSettings()->setQualifiedTest($tst->getRefId());
1010 }
1011 $this->getSettings()->update();
1012 } else {
1013 if ($this->getTestType() == self::TEST_TYPE_IT) {
1014 $this->getSettings()->setInitialTest($form->getInput('tst'));
1015 } else {
1016 $this->getSettings()->setQualifiedTest($form->getInput('tst'));
1017 }
1018
1019 $this->getSettings()->update();
1020 $tst = new ilObjTest($settings->getTestByType($this->getTestType()), true);
1021 $this->applySettingsTemplate($tst);
1022 $tst->saveToDb();
1023 }
1024
1025 // deassign as objective material
1026 if ($tst instanceof ilObjTest) {
1027 $this->updateMaterialAssignments($tst);
1028 }
1029 $this->updateStartObjects();
1030
1031 ilUtil::sendSuccess($this->lng->txt('settings_saved'));
1032 $this->ctrl->redirect($this, 'testOverview');
1033 }
1034
1035 // Error
1036 ilUtil::sendFailure($this->lng->txt('err_check_input'));
1037 $form->setValuesByPost();
1038 $this->testSettings($form);
1039 }
testSettings(ilPropertyFormGUI $form=null)
Show test settings.

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

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

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

215 {
216 $this->test_type = $a_type;
217 }

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

229 {
230 if (!$form instanceof ilPropertyFormGUI) {
231 $form = $this->initSettingsForm();
232 }
233
234 $GLOBALS['ilTabs']->activateSubTab('settings');
235 $GLOBALS['tpl']->setContent($form->getHTML());
236
238 }

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

1082 {
1083 $GLOBALS['ilTabs']->activateSubTab('objectives');
1084
1085 if (!$form instanceof ilPropertyFormGUI) {
1086 $form = $this->initSimpleObjectiveForm();
1087 }
1088
1089 $GLOBALS['tpl']->setContent($form->getHTML());
1090
1092 }

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

1262 {
1263 include_once './Modules/Course/classes/Objectives/class.ilLOEditorStatus.php';
1264 $status = new ilLOEditorStatus($this->getParentObject());
1265 $status->setSection($a_section);
1266 $status->setCmdClass($this);
1267 $GLOBALS['tpl']->setRightContent($status->getHTML());
1268 }
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 771 of file class.ilLOEditorGUI.php.

772 {
773 $this->setTestType((int) $_REQUEST['tt']);
774 $this->ctrl->setParameter($this, 'tt', $this->getTestType());
775
776 switch ($this->getTestType()) {
778 $GLOBALS['ilTabs']->activateSubTab('itests');
779 break;
780
782 $GLOBALS['ilTabs']->activateSubTab('qtests');
783 break;
784 }
785 if (!$form instanceof ilPropertyFormGUI) {
786 include_once './Modules/Course/classes/Objectives/class.ilLOTestAssignmentForm.php';
787 $form_helper = new ilLOTestAssignmentForm($this, $this->getParentObject(), $this->getTestType());
788 $form = $form_helper->initForm(true);
789 }
790 $GLOBALS['tpl']->setContent($form->getHTML());
791
792 $this->showStatus(
793 ($this->getTestType() == self::TEST_TYPE_IT) ?
796 );
797 }

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

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

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

804 {
805 $this->ctrl->setParameter($this, 'tt', (int) $_REQUEST['tt']);
806 switch ($this->getTestType()) {
808 $GLOBALS['ilTabs']->activateSubTab('itest');
809 break;
810
812 $GLOBALS['ilTabs']->activateSubTab('qtest');
813 break;
814 }
815
816 if (!$form instanceof ilPropertyFormGUI) {
817 include_once './Modules/Course/classes/Objectives/class.ilLOTestAssignmentForm.php';
818 $form_helper = new ilLOTestAssignmentForm($this, $this->getParentObject(), $this->getTestType());
819 $form = $form_helper->initForm(false);
820 }
821 $GLOBALS['tpl']->setContent($form->getHTML());
822
823 $this->showStatus(
824 ($this->getTestType() == self::TEST_TYPE_IT) ?
827 );
828 }

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

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

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

959 {
960 include_once './Modules/Course/classes/class.ilCourseObjective.php';
961 foreach (ilCourseObjective::_getObjectiveIds($this->getParentObject()->getId()) as $objective_id) {
962 include_once './Modules/Course/classes/class.ilCourseObjectiveMaterials.php';
963 $materials = new ilCourseObjectiveMaterials($objective_id);
964 foreach ($materials->getMaterials() as $key => $material) {
965 if ($material['ref_id'] == $test->getRefId()) {
966 $materials->delete($material['lm_ass_id']);
967 }
968 }
969 }
970 }
$test
Definition: Utf8Test.php:84
class ilCourseObjectiveMaterials
$key
Definition: croninfo.php:18

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

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

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:

◆ updateTestAssignments()

ilLOEditorGUI::updateTestAssignments ( ilLOSettings  $settings)
protected

Update Test assignments.

Parameters
ilLOSettings$settings

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

259 {
260 switch ($settings->getInitialTestType()) {
262 $settings->setInitialTest(0);
264
265 // no break
269
270 break;
271
274 $settings->setInitialTest(0);
275 break;
276 }
277
278 switch ($settings->getQualifyingTestType()) {
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: