ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilLOEditorGUI Class Reference

Class ilLOEditorGUI. More...

+ Collaboration diagram for ilLOEditorGUI:

Public Member Functions

 __construct (ilObjCourseGUI $parent_gui)
 
 executeCommand ()
 
 getParentObject ()
 
 getParentGUI ()
 
 getSettings ()
 
 setTestType (int $a_type)
 
 getTestType ()
 

Data Fields

const TEST_TYPE_UNDEFINED = 0
 
const TEST_TYPE_IT = 1
 
const TEST_TYPE_QT = 2
 
const TEST_NEW = 1
 
const TEST_ASSIGN = 2
 

Protected Member Functions

 initObjectiveIdFromQuery ()
 
 initObjectiveIdsFromPost ()
 
 initTestTypeFromQuery ()
 
 returnFromObjectives ()
 
 settings (?ilPropertyFormGUI $form=null)
 
 deleteAssignments (int $a_type)
 
 updateTestAssignments (ilLOSettings $settings)
 
 saveSettings ()
 
 initSettingsForm ()
 Init settings form. More...
 
 materials ()
 
 testsOverview ()
 
 testsOverviewInitial ()
 
 testsOverviewQualified ()
 
 testOverview ()
 Show test overview. More...
 
 testOverviewInitial ()
 
 testOverviewQualified ()
 
 confirmDeleteTests ()
 Show delete test confirmation. More...
 
 confirmDeleteTest ()
 Show delete confirmation screen. More...
 
 deleteTests ()
 
 deleteTest ()
 
 testAssignment (?ilPropertyFormGUI $form=null)
 
 testSettings (?ilPropertyFormGUI $form=null)
 
 updateStartObjects ()
 
 saveMultiTestAssignment ()
 
 updateMaterialAssignments (ilObjTest $test)
 
 saveTest ()
 
 listObjectives ()
 
 showObjectiveCreation (?ilPropertyFormGUI $form=null)
 
 initSimpleObjectiveForm ()
 
 saveObjectiveCreation ()
 
 saveSorting ()
 
 askDeleteObjectives ()
 
 activateObjectives ()
 
 deactivateObjectives ()
 
 deleteObjectives ()
 
 showStatus (int $a_section)
 
 setTabs (string $a_section='')
 

Protected Attributes

ilGlobalTemplateInterface $main_tpl
 
ilToolbarGUI $toolbar
 
GlobalHttpState $http
 
Factory $refinery
 

Private Attributes

ilLogger $logger
 
ilObject $parent_obj
 
ilObjCourseGUI $parent_gui
 
ilLOSettings $settings
 
ilLanguage $lng
 
ilCtrlInterface $ctrl
 
ilTabsGUI $tabs
 
ilGlobalTemplateInterface $tpl
 
ObjectFacade $content_style_domain
 
int $test_type = self::TEST_TYPE_UNDEFINED
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilLOEditorGUI::__construct ( ilObjCourseGUI  $parent_gui)

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

59 {
60 global $DIC;
61
62 $this->main_tpl = $DIC->ui()->mainTemplate();
63 $this->parent_obj = $parent_gui->getObject();
64 $this->parent_gui = $parent_gui;
66
67 $cs = $DIC->contentStyle();
68 $this->content_style_domain = $cs->domain()->styleForRefId($this->parent_obj->getRefId());
69
70 $this->lng = $DIC->language();
71 $this->ctrl = $DIC->ctrl();
72 $this->tpl = $DIC->ui()->mainTemplate();
73 $this->tabs = $DIC->tabs();
74 $this->toolbar = $DIC->toolbar();
75 $this->logger = $DIC->logger()->crs();
76 $this->http = $DIC->http();
77 $this->refinery = $DIC->refinery();
78 }
settings(?ilPropertyFormGUI $form=null)
ilObjCourseGUI $parent_gui
static getInstanceByObjId(int $a_obj_id)
static http()
Fetches the global http state from ILIAS.
global $DIC
Definition: shib_login.php:26

References $DIC, $parent_gui, ILIAS\Repository\ctrl(), ILIAS\Survey\Mode\getId(), ilLOSettings\getInstanceByObjId(), ilObjectGUI\getObject(), getParentObject(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), ILIAS\Repository\logger(), ILIAS\Repository\refinery(), settings(), ILIAS\Repository\tabs(), and ILIAS\Repository\toolbar().

+ Here is the call graph for this function:

Member Function Documentation

◆ activateObjectives()

ilLOEditorGUI::activateObjectives ( )
protected

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

1139 : void
1140 {
1141 $enabled = $this->initObjectiveIdsFromPost();
1143 foreach ($objectives as $objective_id) {
1144 $objective = new ilCourseObjective($this->getParentObject(), $objective_id);
1145 if (in_array($objective_id, $enabled)) {
1146 $objective->setActive(true);
1147 $objective->update();
1148 }
1149 }
1151 $this->tpl->setOnScreenMessage('success', $this->lng->txt('settings_saved'), true);
1152 $this->ctrl->redirect($this, 'listObjectives');
1153 }
class ilcourseobjective
static _getObjectiveIds(int $course_id, bool $a_activated_only=false)
static _refreshStatus(int $a_obj_id, ?array $a_users=null)
$objectives

References $objectives, ilCourseObjective\_getObjectiveIds(), ilLPStatusWrapper\_refreshStatus(), ILIAS\Repository\ctrl(), ILIAS\Survey\Mode\getId(), getParentObject(), initObjectiveIdsFromPost(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ askDeleteObjectives()

ilLOEditorGUI::askDeleteObjectives ( )
protected

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

1106 : void
1107 {
1108 $this->tabs->activateSubTab('objectives');
1109
1110 $confirm = new ilConfirmationGUI();
1111 $confirm->setFormAction($this->ctrl->getFormAction($this));
1112 $confirm->setHeaderText($this->lng->txt('crs_delete_objectve_sure'));
1113 $confirm->setConfirm($this->lng->txt('delete'), 'deleteObjectives');
1114 $confirm->setCancel($this->lng->txt('cancel'), 'listObjectives');
1115
1116 $objective_ids = [];
1117 if ($this->http->wrapper()->post()->has('objective')) {
1118 $objective_ids = $this->http->wrapper()->post()->retrieve(
1119 'objective',
1120 $this->refinery->kindlyTo()->dictOf(
1121 $this->refinery->kindlyTo()->int()
1122 )
1123 );
1124 }
1125 foreach ($objective_ids as $objective_id) {
1126 $obj = new ilCourseObjective($this->getParentObject(), $objective_id);
1127 $name = $obj->getTitle();
1128
1129 $confirm->addItem(
1130 'objective_ids[]',
1131 (string) $objective_id,
1132 $name
1133 );
1134 }
1135 $this->tpl->setContent($confirm->getHTML());
1137 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
showStatus(int $a_section)

References ILIAS\Repository\ctrl(), getParentObject(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), ILIAS\Repository\refinery(), ilLOEditorStatus\SECTION_OBJECTIVES, showStatus(), and ILIAS\Repository\tabs().

+ Here is the call graph for this function:

◆ confirmDeleteTest()

ilLOEditorGUI::confirmDeleteTest ( )
protected

Show delete confirmation screen.

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

673 : void
674 {
675 $this->setTestType($this->initTestTypeFromQuery());
676 $this->ctrl->setParameter($this, 'tt', $this->getTestType());
677
679 switch ($this->getTestType()) {
681 $this->tabs->activateSubTab('itest');
682 break;
683
685 $this->tabs->activateSubTab('qtest');
686 break;
687 }
688
689 $tests = [];
690 if ($this->http->wrapper()->post()->has('tst')) {
691 $tests = $this->http->wrapper()->post()->retrieve(
692 'tst',
693 $this->refinery->kindlyTo()->listOf(
694 $this->refinery->kindlyTo()->int()
695 )
696 );
697 }
698 if (count($tests) === 0) {
699 $this->main_tpl->setOnScreenMessage('failure', $this->lng->txt('select_one'), true);
700 $this->ctrl->redirect($this, 'testOverview');
701 }
702
703 $confirm = new ilConfirmationGUI();
704 $confirm->setHeaderText($this->lng->txt('crs_loc_confirm_delete_tst'));
705 $confirm->setFormAction($this->ctrl->getFormAction($this));
706 $confirm->setConfirm($this->lng->txt('crs_loc_delete_assignment'), 'deleteTest');
707 $confirm->setCancel($this->lng->txt('cancel'), 'testOverview');
708
709 foreach ($tests as $tst_id) {
710 $obj_id = ilObject::_lookupObjId($tst_id);
711 $confirm->addItem('tst[]', (string) $tst_id, ilObject::_lookupTitle($obj_id));
712 }
713 $this->tpl->setContent($confirm->getHTML());
714
715 $this->showStatus(
719 );
720 }
ilLOSettings $settings
setTestType(int $a_type)
static _lookupObjId(int $ref_id)
static _lookupTitle(int $obj_id)

References ilObject\_lookupObjId(), ilObject\_lookupTitle(), ILIAS\Repository\ctrl(), ILIAS\Survey\Mode\getId(), ilLOSettings\getInstanceByObjId(), getParentObject(), getTestType(), ILIAS\FileDelivery\http(), initTestTypeFromQuery(), ILIAS\Repository\lng(), ILIAS\Repository\refinery(), ilLOEditorStatus\SECTION_ITES, ilLOEditorStatus\SECTION_QTEST, setTestType(), showStatus(), ILIAS\Repository\tabs(), 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 620 of file class.ilLOEditorGUI.php.

620 : void
621 {
622 $this->setTestType($this->initTestTypeFromQuery());
623 $this->ctrl->setParameter($this, 'tt', $this->getTestType());
624
626 switch ($this->getTestType()) {
628 $this->tabs->activateSubTab('itests');
629 break;
630
632 $this->tabs->activateSubTab('qtests');
633 break;
634 }
635
636 $tests = [];
637 if ($this->http->wrapper()->post()->has('tst')) {
638 $tests = $this->http->wrapper()->post()->retrieve(
639 'tst',
640 $this->refinery->kindlyTo()->listOf(
641 $this->refinery->kindlyTo()->int()
642 )
643 );
644 }
645 if (!count($tests)) {
646 $this->main_tpl->setOnScreenMessage('failure', $this->lng->txt('select_one'), true);
647 $this->ctrl->redirect($this, 'testsOverview');
648 }
649 $confirm = new ilConfirmationGUI();
650 $confirm->setHeaderText($this->lng->txt('crs_loc_confirm_delete_tst'));
651 $confirm->setFormAction($this->ctrl->getFormAction($this));
652 $confirm->setConfirm($this->lng->txt('crs_loc_delete_assignment'), 'deleteTests');
653 $confirm->setCancel($this->lng->txt('cancel'), 'testsOverview');
654 foreach ($tests as $assign_id) {
655 $assignment = new ilLOTestAssignment($assign_id);
656
657 $obj_id = ilObject::_lookupObjId($assignment->getTestRefId());
658 $confirm->addItem('tst[]', (string) $assign_id, ilObject::_lookupTitle($obj_id));
659 }
660
661 $this->tpl->setContent($confirm->getHTML());
662
663 $this->showStatus(
667 );
668 }
Settings for LO courses.

References ilObject\_lookupObjId(), ilObject\_lookupTitle(), ILIAS\Repository\ctrl(), ILIAS\Survey\Mode\getId(), ilLOSettings\getInstanceByObjId(), getParentObject(), getTestType(), ILIAS\FileDelivery\http(), initTestTypeFromQuery(), ILIAS\Repository\lng(), ILIAS\Repository\refinery(), ilLOEditorStatus\SECTION_ITES, ilLOEditorStatus\SECTION_QTEST, setTestType(), showStatus(), ILIAS\Repository\tabs(), ilLOSettings\TYPE_TEST_INITIAL, and ilLOSettings\TYPE_TEST_QUALIFIED.

+ Here is the call graph for this function:

◆ deactivateObjectives()

ilLOEditorGUI::deactivateObjectives ( )
protected

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

1155 : void
1156 {
1157 $disabled = $this->initObjectiveIdsFromPost();
1159 foreach ($objectives as $objective_id) {
1160 $objective = new ilCourseObjective($this->getParentObject(), $objective_id);
1161 if (in_array($objective_id, $disabled)) {
1162 $objective->setActive(false);
1163 $objective->update();
1164 }
1165 }
1167 $this->tpl->setOnScreenMessage('success', $this->lng->txt('settings_saved'), true);
1168 $this->ctrl->redirect($this, 'listObjectives');
1169 }

References $objectives, ilCourseObjective\_getObjectiveIds(), ilLPStatusWrapper\_refreshStatus(), ILIAS\Repository\ctrl(), ILIAS\Survey\Mode\getId(), getParentObject(), initObjectiveIdsFromPost(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ deleteAssignments()

ilLOEditorGUI::deleteAssignments ( int  $a_type)
protected

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

259 : void
260 {
261 $assignments = ilLOTestAssignments::getInstance($this->getParentObject()->getId());
262 foreach ($assignments->getAssignmentsByType($a_type) as $assignment) {
263 $assignment->delete();
264 }
265 }
static getInstance(int $a_container_id)

References ILIAS\Survey\Mode\getId(), 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

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

1171 : void
1172 {
1173 $objective_ids = [];
1174 if ($this->http->wrapper()->post()->has('objective_ids')) {
1175 $objective_ids = $this->http->wrapper()->post()->retrieve(
1176 'objective_ids',
1177 $this->refinery->kindlyTo()->dictOf(
1178 $this->refinery->kindlyTo()->int()
1179 )
1180 );
1181 }
1182 foreach ($objective_ids as $objective_id) {
1183 $objective_obj = new ilCourseObjective($this->getParentObject(), $objective_id);
1184 $objective_obj->delete();
1185 }
1187 $this->tpl->setOnScreenMessage('success', $this->lng->txt('crs_objectives_deleted'), true);
1188 $this->ctrl->redirect($this, 'listObjectives');
1189 }

References ilLPStatusWrapper\_refreshStatus(), ILIAS\Repository\ctrl(), ILIAS\Survey\Mode\getId(), getParentObject(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), and ILIAS\Repository\refinery().

+ Here is the call graph for this function:

◆ deleteTest()

ilLOEditorGUI::deleteTest ( )
protected

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

766 : void
767 {
768 $this->setTestType($this->initTestTypeFromQuery());
769 $this->ctrl->setParameter($this, 'tt', $this->getTestType());
770
772 switch ($this->getTestType()) {
774 $this->tabs->activateSubTab('itest');
775 break;
776
778 $this->tabs->activateSubTab('qtest');
779 break;
780 }
781
782 $tests = [];
783 if ($this->http->wrapper()->post()->has('tst')) {
784 $tests = $this->http->wrapper()->post()->retrieve(
785 'tst',
786 $this->refinery->kindlyTo()->listOf(
787 $this->refinery->kindlyTo()->int()
788 )
789 );
790 }
791 foreach ($tests as $tst_id) {
792 switch ($this->getTestType()) {
795 break;
796
799 break;
800 }
801 $settings->update();
802
803 // finally delete start object assignment
804 $start = new ilContainerStartObjects(
805 $this->getParentObject()->getRefId(),
806 $this->getParentObject()->getId()
807 );
808 $start->deleteItem($tst_id);
809
810 // ... and assigned questions
812 }
813
814 $this->main_tpl->setOnScreenMessage('success', $this->lng->txt('settings_saved'), true);
815 $this->ctrl->redirect($this, 'testOverview');
816 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setInitialTest(int $a_id)
setQualifiedTest(int $a_id)

References $settings, ILIAS\Repository\ctrl(), ilCourseObjectiveQuestion\deleteTest(), ILIAS\Survey\Mode\getId(), ilLOSettings\getInstanceByObjId(), getParentObject(), getTestType(), ILIAS\FileDelivery\http(), initTestTypeFromQuery(), ILIAS\Repository\lng(), ILIAS\Repository\refinery(), ilLOSettings\setInitialTest(), ilLOSettings\setQualifiedTest(), setTestType(), ILIAS\Repository\tabs(), ilLOSettings\TYPE_TEST_INITIAL, ilLOSettings\TYPE_TEST_QUALIFIED, and ilLOSettings\update().

+ Here is the call graph for this function:

◆ deleteTests()

ilLOEditorGUI::deleteTests ( )
protected

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

722 : void
723 {
724 $this->setTestType($this->initTestTypeFromQuery());
725 $this->ctrl->setParameter($this, 'tt', $this->getTestType());
726
728 switch ($this->getTestType()) {
730 $this->tabs->activateSubTab('itests');
731 break;
732
734 $this->tabs->activateSubTab('qtests');
735 break;
736 }
737
738 $tests = [];
739 if ($this->http->wrapper()->post()->has('tst')) {
740 $tests = $this->http->wrapper()->post()->retrieve(
741 'tst',
742 $this->refinery->kindlyTo()->listOf(
743 $this->refinery->kindlyTo()->int()
744 )
745 );
746 }
747 foreach ($tests as $assign_id) {
748 $assignment = new ilLOTestAssignment($assign_id);
749 $assignment->delete();
750
751 // finally delete start object assignment
752 $start = new ilContainerStartObjects(
753 $this->getParentObject()->getRefId(),
754 $this->getParentObject()->getId()
755 );
756 $start->deleteItem($assignment->getTestRefId());
757
758 // ... and assigned questions
759 ilCourseObjectiveQuestion::deleteTest($assignment->getTestRefId());
760 }
761
762 $this->main_tpl->setOnScreenMessage('success', $this->lng->txt('settings_saved'), true);
763 $this->ctrl->redirect($this, 'testsOverview');
764 }

References ILIAS\Repository\ctrl(), ilCourseObjectiveQuestion\deleteTest(), ILIAS\Survey\Mode\getId(), ilLOSettings\getInstanceByObjId(), getParentObject(), getTestType(), ILIAS\FileDelivery\http(), initTestTypeFromQuery(), ILIAS\Repository\lng(), ILIAS\Repository\refinery(), setTestType(), ILIAS\Repository\tabs(), ilLOSettings\TYPE_TEST_INITIAL, and ilLOSettings\TYPE_TEST_QUALIFIED.

+ Here is the call graph for this function:

◆ executeCommand()

ilLOEditorGUI::executeCommand ( )

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

80 : void
81 {
82 $next_class = $this->ctrl->getNextClass($this);
83 $cmd = $this->ctrl->getCmd();
84
85 $this->setTabs();
86 switch ($next_class) {
87 case 'ilcourseobjectivesgui':
88
89 $this->ctrl->setReturn($this, 'returnFromObjectives');
90 $this->tabs->clearTargets();
91 $this->tabs->setBackTarget(
92 $this->lng->txt('back'),
93 $this->ctrl->getLinkTarget($this, 'listObjectives')
94 );
95
96 $reg_gui = new ilCourseObjectivesGUI($this->getParentObject()->getRefId());
97 $this->ctrl->forwardCommand($reg_gui);
98 break;
99
100 case 'ilcontainerstartobjectsgui':
101
102 $stgui = new ilContainerStartObjectsGUI($this->getParentObject());
103 $ret = $this->ctrl->forwardCommand($stgui);
104
105 $this->tabs->activateSubTab('start');
106 $this->tabs->removeSubTab('manage');
107 break;
108
109 case 'ilconditionhandlergui':
110
111 $this->ctrl->saveParameterByClass('ilconditionhandlergui', 'objective_id');
112
113 $this->tabs->clearTargets();
114 $this->tabs->setBackTarget(
115 $this->lng->txt('back'),
116 $this->ctrl->getLinkTarget($this, 'listObjectives')
117 );
118
119 $cond = new ilConditionHandlerGUI();
120 $cond->setBackButtons(array());
121 $cond->setAutomaticValidation(false);
122 $cond->setTargetType("lobj");
123 $cond->setTargetRefId($this->getParentObject()->getRefId());
124 $cond->setTargetId($this->initObjectiveIdFromQuery());
125
126 // objective
127 $obj = new ilCourseObjective($this->getParentObject(), $this->initObjectiveIdFromQuery());
128 $cond->setTargetTitle($obj->getTitle());
129 $this->ctrl->forwardCommand($cond);
130 break;
131
132 case 'illopagegui':
133 $this->ctrl->saveParameterByClass('illopagegui', 'objective_id');
134
135 $this->tabs->clearTargets();
136 $this->tabs->setBackTarget(
137 $this->lng->txt('back'),
138 $this->ctrl->getLinkTarget($this, 'listObjectives')
139 );
140
141 $objtv_id = $this->initObjectiveIdFromQuery();
142
143 if (!ilLOPage::_exists('lobj', $objtv_id)) {
144 // doesn't exist -> create new one
145 $new_page_object = new ilLOPage();
146 $new_page_object->setParentId($objtv_id);
147 $new_page_object->setId($objtv_id);
148 $new_page_object->createFromXML();
149 unset($new_page_object);
150 }
151
152 $this->ctrl->setReturn($this, 'listObjectives');
153 $pgui = new ilLOPageGUI($objtv_id);
154 $pgui->setPresentationTitle(ilCourseObjective::lookupObjectiveTitle($objtv_id));
155
156 $pgui->setStyleId($this->content_style_domain->getEffectiveStyleId());
157
158 // #14895
159 $this->tpl->setCurrentBlock("ContentStyle");
160 $this->tpl->setVariable(
161 "LOCATION_CONTENT_STYLESHEET",
162 ilObjStyleSheet::getContentStylePath($this->content_style_domain->getEffectiveStyleId())
163 );
164 $this->tpl->parseCurrentBlock();
165
166 $ret = $this->ctrl->forwardCommand($pgui);
167 if ($ret) {
168 $this->tpl->setContent($ret);
169 }
170 break;
171
172 default:
173 if (!$cmd) {
174 // get first unaccomplished step
175 $cmd = ilLOEditorStatus::getInstance($this->getParentObject())->getFirstFailedStep();
176 }
177 $this->$cmd();
178
179 break;
180 }
181 }
class ilConditionHandlerGUI
Class ilContainerStartObjectsGUI.
static lookupObjectiveTitle(int $a_objective_id, bool $a_add_description=false)
class ilobjcourseobjectivesgui
setTabs(string $a_section='')
static getInstance(ilObject $a_parent)
(Course) learning objective page GUI class
(Course) learning objective page object
static getContentStylePath(int $a_style_id, bool $add_random=true, bool $add_token=true)
get content style path static (to avoid full reading)
static _exists(string $a_parent_type, int $a_id, string $a_lang="", bool $a_no_cache=false)
Checks whether page exists.

References ilPageObject\_exists(), ILIAS\Repository\ctrl(), ilObjStyleSheet\getContentStylePath(), ilLOEditorStatus\getInstance(), getParentObject(), initObjectiveIdFromQuery(), ILIAS\Repository\lng(), ilCourseObjective\lookupObjectiveTitle(), setTabs(), and ILIAS\Repository\tabs().

+ Here is the call graph for this function:

◆ getParentGUI()

ilLOEditorGUI::getParentGUI ( )

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

230 {
231 return $this->parent_gui;
232 }
Class ilObjCourseGUI.

References $parent_gui.

◆ getParentObject()

◆ getSettings()

ilLOEditorGUI::getSettings ( )

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

235 {
236 return $this->settings;
237 }
Settings for LO courses.

References $settings.

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

+ Here is the caller graph for this function:

◆ getTestType()

ilLOEditorGUI::getTestType ( )

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

244 : int
245 {
246 return $this->test_type;
247 }

References $test_type.

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

+ Here is the caller graph for this function:

◆ initObjectiveIdFromQuery()

ilLOEditorGUI::initObjectiveIdFromQuery ( )
protected

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

183 : int
184 {
185 if ($this->http->wrapper()->query()->has('objective_id')) {
186 return $this->http->wrapper()->query()->retrieve(
187 'objective_id',
188 $this->refinery->kindlyTo()->int()
189 );
190 }
191 return 0;
192 }

References ILIAS\FileDelivery\http(), and ILIAS\Repository\refinery().

Referenced by executeCommand().

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

◆ initObjectiveIdsFromPost()

ilLOEditorGUI::initObjectiveIdsFromPost ( )
protected

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

194 : array
195 {
196 if ($this->http->wrapper()->post()->has('objective')) {
197 return $this->http->wrapper()->post()->retrieve(
198 'objective',
199 $this->refinery->kindlyTo()->listOf(
200 $this->refinery->kindlyTo()->int()
201 )
202 );
203 }
204 return [];
205 }

References ILIAS\FileDelivery\http(), and ILIAS\Repository\refinery().

Referenced by activateObjectives(), and deactivateObjectives().

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

◆ initSettingsForm()

ilLOEditorGUI::initSettingsForm ( )
protected

Init settings form.

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

369 {
370 $form = new ilPropertyFormGUI();
371 $form->setFormAction($this->ctrl->getFormAction($this));
372 $form->setTitle($this->lng->txt('crs_loc_settings_tbl'));
373
374 // initial test
375 $type_selector = new ilRadioGroupInputGUI($this->lng->txt('crs_loc_settings_it_type'), 'ittype');
376 $type_selector->setRequired(true);
377 $type_selector->setValue((string) $this->getSettings()->getInitialTestType());
378
379 $type_ipa = new ilRadioOption(
380 $this->lng->txt('crs_loc_settings_type_it_placement_all'),
382 );
383 $type_ipa->setInfo($this->lng->txt('crs_loc_settings_type_it_placement_all_info'));
384 $type_selector->addOption($type_ipa);
385
386 $start_ip = new ilCheckboxInputGUI($this->lng->txt('crs_loc_settings_it_start_object'), 'start_ip');
387 $start_ip->setValue((string) 1);
388 $start_ip->setChecked($this->getSettings()->isInitialTestStart());
389 $type_ipa->addSubItem($start_ip);
390
391 $type_ips = new ilRadioOption(
392 $this->lng->txt('crs_loc_settings_type_it_placement_sel'),
394 );
395 $type_ips->setInfo($this->lng->txt('crs_loc_settings_type_it_placement_sel_info'));
396 $type_selector->addOption($type_ips);
397
398 $type_iqa = new ilRadioOption(
399 $this->lng->txt('crs_loc_settings_type_it_qualifying_all'),
401 );
402 $type_iqa->setInfo($this->lng->txt('crs_loc_settings_type_it_qualifying_all_info'));
403 $type_selector->addOption($type_iqa);
404
405 $start_iq = new ilCheckboxInputGUI($this->lng->txt('crs_loc_settings_it_start_object'), 'start_iq');
406 $start_iq->setValue('1');
407 $start_iq->setChecked($this->getSettings()->isInitialTestStart());
408 $type_iqa->addSubItem($start_iq);
409
410 $type_iqs = new ilRadioOption(
411 $this->lng->txt('crs_loc_settings_type_it_qualifying_sel'),
413 );
414 $type_iqs->setInfo($this->lng->txt('crs_loc_settings_type_it_qualifying_sel_info'));
415 $type_selector->addOption($type_iqs);
416
417 $type_ino = new ilRadioOption(
418 $this->lng->txt('crs_loc_settings_type_it_none'),
420 );
421 $type_ino->setInfo($this->lng->txt('crs_loc_settings_type_it_none_info'));
422 $type_selector->addOption($type_ino);
423
424 $form->addItem($type_selector);
425
426 // qualifying test
427 $qt_selector = new ilRadioGroupInputGUI($this->lng->txt('crs_loc_settings_qt_all'), 'qttype');
428 $qt_selector->setRequired(true);
429 $qt_selector->setValue((string) $this->getSettings()->getQualifyingTestType());
430
431 $type_qa = new ilRadioOption(
432 $this->lng->txt('crs_loc_settings_type_q_all'),
434 );
435 $type_qa->setInfo($this->lng->txt('crs_loc_settings_type_q_all_info'));
436 $qt_selector->addOption($type_qa);
437
438 $start_q = new ilCheckboxInputGUI($this->lng->txt('crs_loc_settings_qt_start_object'), 'start_q');
439 $start_q->setValue('1');
440 $start_q->setChecked($this->getSettings()->isQualifyingTestStart());
441 $type_qa->addSubItem($start_q);
442
443 $passed_mode = new ilRadioGroupInputGUI($this->lng->txt('crs_loc_settings_passed_mode'), 'passed_mode');
444 $passed_mode->setValue(
445 (string) ($this->getSettings()->getPassedObjectiveMode() ?: ilLOSettings::HIDE_PASSED_OBJECTIVE_QST)
446 );
447
448 $passed_mode->addOption(
449 new ilRadioOption(
450 $this->lng->txt('crs_loc_settings_passed_mode_hide'),
452 )
453 );
454 $passed_mode->addOption(
455 new ilRadioOption(
456 $this->lng->txt('crs_loc_settings_passed_mode_mark'),
458 )
459 );
460 $type_qa->addSubItem($passed_mode);
461
462 $type_qs = new ilRadioOption(
463 $this->lng->txt('crs_loc_settings_type_q_selected'),
465 );
466 $type_qs->setInfo($this->lng->txt('crs_loc_settings_type_q_selected_info'));
467 $qt_selector->addOption($type_qs);
468
469 $form->addItem($qt_selector);
470
471 // reset results
472 $reset = new ilCheckboxInputGUI($this->lng->txt('crs_loc_settings_reset'), 'reset');
473 $reset->setValue('1');
474 $reset->setChecked($this->getSettings()->isResetResultsEnabled());
475 $reset->setOptionTitle($this->lng->txt('crs_loc_settings_reset_enable'));
476 $reset->setInfo($this->lng->txt('crs_loc_settings_reset_enable_info'));
477 $form->addItem($reset);
478
479 $form->addCommandButton('saveSettings', $this->lng->txt('save'));
480 return $form;
481 }
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 ILIAS\Repository\ctrl(), getSettings(), ilLOSettings\HIDE_PASSED_OBJECTIVE_QST, ILIAS\Repository\lng(), 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

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

1054 {
1055 $form = new ilPropertyFormGUI();
1056 $form->setTitle($this->lng->txt('crs_loc_form_create_objectives'));
1057 $form->setFormAction($this->ctrl->getFormAction($this));
1058
1059 $txt = new ilTextWizardInputGUI($this->lng->txt('crs_objectives'), 'objectives');
1060 $txt->setValues(array(0 => ''));
1061 $txt->setRequired(true);
1062 $form->addItem($txt);
1063
1064 $form->addCommandButton('saveObjectiveCreation', $this->lng->txt('save'));
1065 return $form;
1066 }
This class represents a text wizard property in a property form.
$txt
Definition: error.php:31

References $txt, ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

Referenced by saveObjectiveCreation(), and showObjectiveCreation().

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

◆ initTestTypeFromQuery()

ilLOEditorGUI::initTestTypeFromQuery ( )
protected

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

207 : int
208 {
209 if ($this->http->wrapper()->query()->has('tt')) {
210 return $this->http->wrapper()->query()->retrieve(
211 'tt',
212 $this->refinery->kindlyTo()->int()
213 );
214 }
215 return 0;
216 }

References ILIAS\FileDelivery\http(), and ILIAS\Repository\refinery().

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

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

◆ listObjectives()

ilLOEditorGUI::listObjectives ( )
protected

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

1015 : void
1016 {
1018 $this->tabs->activateSubTab('objectives');
1019
1021 $this->getParentObject()->getId(),
1022 false
1023 );
1024
1025 if ($objectives === []) {
1026 $this->showObjectiveCreation();
1027 return;
1028 }
1029
1030 $this->toolbar->addButton(
1031 $this->lng->txt('crs_add_objective'),
1032 $this->ctrl->getLinkTargetByClass('ilcourseobjectivesgui', "create")
1033 );
1034
1035 $table = new ilCourseObjectivesTableGUI($this, $this->getParentObject());
1036 $table->setTitle($this->lng->txt('crs_objectives'), '', $this->lng->txt('crs_objectives'));
1037 $table->parse($objectives);
1038 $this->tpl->setContent($table->getHTML());
1039
1041 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
showObjectiveCreation(?ilPropertyFormGUI $form=null)
static set(string $a_var, $a_val)
Set a value.

References $objectives, ilCourseObjective\_getObjectiveIds(), ILIAS\Survey\Mode\getId(), getParentObject(), ILIAS\Repository\lng(), ilCourseObjectivesGUI\MODE_UNDEFINED, ilLOEditorStatus\SECTION_OBJECTIVES, ilSession\set(), showObjectiveCreation(), showStatus(), ILIAS\Repository\tabs(), and ILIAS\Repository\toolbar().

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

483 : void
484 {
485 $this->tabs->activateSubTab('materials');
486
487 $this->parent_gui->renderAddNewItem('itgr');
488
489 $this->tpl->setOnScreenMessage(
490 'info',
491 $this->lng->txt('crs_objective_status_materials_info')
492 );
493
495 }

References ILIAS\Repository\lng(), ilLOEditorStatus\SECTION_MATERIALS, showStatus(), and ILIAS\Repository\tabs().

+ Here is the call graph for this function:

◆ returnFromObjectives()

ilLOEditorGUI::returnFromObjectives ( )
protected

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

218 : void
219 {
221 $this->listObjectives();
222 }

References listObjectives(), ilCourseObjectivesGUI\MODE_UNDEFINED, and ilSession\set().

+ Here is the call graph for this function:

◆ saveMultiTestAssignment()

ilLOEditorGUI::saveMultiTestAssignment ( )
protected

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

879 : void
880 {
881 $this->ctrl->setParameter($this, 'tt', $this->initTestTypeFromQuery());
882 $this->setTestType($this->initTestTypeFromQuery());
883
885
886 $form_helper = new ilLOTestAssignmentForm($this, $this->getParentObject(), $this->getTestType());
887 $form = $form_helper->initForm(true);
888
889 if ($form->checkInput()) {
890 $mode = $form->getInput('mode');
891
892 if ($mode == self::TEST_NEW) {
893 $tst = new ilObjTest();
894 $tst->setType('tst');
895 $tst->setTitle($form->getInput('title'));
896 $tst->setDescription($form->getInput('desc'));
897 $tst->create();
898 $tst->saveToDb();
899 $tst->createReference();
900 $tst->putInTree($this->getParentObject()->getRefId());
901 $tst->setPermissions($this->getParentObject()->getRefId());
902 $general_settings = $tst->getMainSettings()->getGeneralSettings()->withQuestionSetType($form->getInput('qtype'));
903 $tst->getMainSettingsRepository()->store(
904 $tst->getMainSettings()->withGeneralSettings($general_settings)
905 );
906
907 $assignment = new ilLOTestAssignment();
908 $assignment->setContainerId($this->getParentObject()->getId());
909 $assignment->setAssignmentType($this->getTestType());
910 $assignment->setObjectiveId((int) $form->getInput('objective'));
911 $assignment->setTestRefId($tst->getRefId());
912 $assignment->save();
913 } else {
914 $assignment = new ilLOTestAssignment();
915 $assignment->setContainerId($this->getParentObject()->getId());
916 $assignment->setAssignmentType($this->getTestType());
917 $assignment->setObjectiveId((int) $form->getInput('objective'));
918 $assignment->setTestRefId((int) $form->getInput('tst'));
919 $assignment->save();
920
921 $tst = new ilObjTest((int) $form->getInput('tst'), true);
922 $tst->saveToDb();
923 }
924
925 // deassign as objective material
926 if ($tst instanceof ilObjTest) {
927 $this->updateMaterialAssignments($tst);
928 }
929 $this->updateStartObjects();
930
931 $this->main_tpl->setOnScreenMessage('success', $this->lng->txt('settings_saved'));
932 $this->ctrl->redirect($this, 'testsOverview');
933 }
934
935 // Error
936 $this->main_tpl->setOnScreenMessage('failure', $this->lng->txt('err_check_input'));
937 $form->setValuesByPost();
938 $this->testAssignment($form);
939 }
updateMaterialAssignments(ilObjTest $test)
testAssignment(?ilPropertyFormGUI $form=null)

References ILIAS\Repository\ctrl(), ILIAS\Survey\Mode\getId(), ilLOSettings\getInstanceByObjId(), getParentObject(), getTestType(), initTestTypeFromQuery(), ILIAS\Repository\lng(), setTestType(), testAssignment(), updateMaterialAssignments(), and updateStartObjects().

+ Here is the call graph for this function:

◆ saveObjectiveCreation()

ilLOEditorGUI::saveObjectiveCreation ( )
protected

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

1068 : void
1069 {
1070 $form = $this->initSimpleObjectiveForm();
1071 if ($form->checkInput()) {
1072 foreach ((array) $form->getInput('objectives') as $title) {
1073 $obj = new ilCourseObjective($this->getParentObject());
1074 $obj->setActive(true);
1075 $obj->setTitle($title);
1076 $obj->add();
1077 }
1078 $this->main_tpl->setOnScreenMessage('success', $this->lng->txt('settings_saved'), true);
1079 $this->ctrl->redirect($this, '');
1080 }
1081
1082 $form->setValuesByPost();
1083 $this->tabs->activateSubTab('objectives');
1085 $this->showObjectiveCreation($form);
1086 }

References ILIAS\Repository\ctrl(), getParentObject(), initSimpleObjectiveForm(), ILIAS\Repository\lng(), ilLOEditorStatus\SECTION_OBJECTIVES, showObjectiveCreation(), showStatus(), and ILIAS\Repository\tabs().

+ Here is the call graph for this function:

◆ saveSettings()

ilLOEditorGUI::saveSettings ( )
protected

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

299 : void
300 {
301 $form = $this->initSettingsForm();
302 if ($form->checkInput()) {
304 $settings->setInitialTestType((int) $form->getInput('ittype'));
305 switch ($settings->getInitialTestType()) {
307 $settings->setInitialTestAsStart((bool) $form->getInput('start_ip'));
308 break;
309
312 break;
313
315 $settings->setInitialTestAsStart((bool) $form->getInput('start_iq'));
316 break;
317
320 break;
321
324 break;
325 }
326
327 $settings->setQualifyingTestType((int) $form->getInput('qttype'));
328 switch ($settings->getQualifyingTestType()) {
330 $settings->setQualifyingTestAsStart((bool) $form->getInput('start_q'));
331 break;
332
335 break;
336 }
337
338 $settings->resetResults((bool) $form->getInput('reset'));
339 $settings->setPassedObjectiveMode((int) $form->getInput('passed_mode'));
340
341 if (
344 ) {
346 $this->main_tpl->setOnScreenMessage('info', $this->lng->txt('crs_loc_settings_err_qstart'), true);
347 }
348
349 $settings->update();
350 $this->updateStartObjects();
352
354
355 $this->main_tpl->setOnScreenMessage('success', $this->lng->txt('settings_saved'), true);
356 $this->ctrl->redirect($this, 'settings');
357 }
358
359 // Error
360 $this->main_tpl->setOnScreenMessage('failure', $this->lng->txt('err_check_input'));
361 $form->setValuesByPost();
362 $this->settings($form);
363 }
updateTestAssignments(ilLOSettings $settings)
initSettingsForm()
Init settings form.
setQualifyingTestAsStart(bool $a_type)
setQualifyingTestType(int $a_type)
resetResults(bool $a_status)
setInitialTestType(int $a_type)
setInitialTestAsStart(bool $a_type)
setPassedObjectiveMode(int $a_mode)

References $settings, ilLPStatusWrapper\_refreshStatus(), ILIAS\Repository\ctrl(), ILIAS\Survey\Mode\getId(), ilLOSettings\getInitialTestType(), ilLOSettings\getInstanceByObjId(), getParentObject(), ilLOSettings\getQualifyingTestType(), initSettingsForm(), ilLOSettings\isQualifyingTestStart(), ILIAS\Repository\lng(), ilLOSettings\resetResults(), ilLOSettings\setInitialTestAsStart(), ilLOSettings\setInitialTestType(), ilLOSettings\setPassedObjectiveMode(), ilLOSettings\setQualifyingTestAsStart(), ilLOSettings\setQualifyingTestType(), 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\update(), updateStartObjects(), and updateTestAssignments().

+ Here is the call graph for this function:

◆ saveSorting()

ilLOEditorGUI::saveSorting ( )
protected

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

1088 : void
1089 {
1090 $post_position = $this->http->wrapper()->post()->retrieve(
1091 'position',
1092 $this->refinery->kindlyTo()->dictOf(
1093 $this->refinery->kindlyTo()->string()
1094 )
1095 );
1096 asort($post_position, SORT_NUMERIC);
1097 $counter = 1;
1098 foreach ($post_position as $objective_id => $position) {
1099 $objective = new ilCourseObjective($this->getParentObject(), $objective_id);
1100 $objective->writePosition($counter++);
1101 }
1102 $this->main_tpl->setOnScreenMessage('success', $this->lng->txt('crs_objective_saved_sorting'));
1103 $this->listObjectives();
1104 }
$counter

References $counter, getParentObject(), ILIAS\FileDelivery\http(), listObjectives(), ILIAS\Repository\lng(), and ILIAS\Repository\refinery().

+ Here is the call graph for this function:

◆ saveTest()

ilLOEditorGUI::saveTest ( )
protected

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

953 : void
954 {
955 $this->ctrl->setParameter($this, 'tt', $this->initTestTypeFromQuery());
956 $this->setTestType($this->initTestTypeFromQuery());
957
959
960 $form_helper = new ilLOTestAssignmentForm($this, $this->getParentObject(), $this->getTestType());
961 $form = $form_helper->initForm(false);
962
963 if ($form->checkInput()) {
964 $mode = $form->getInput('mode');
965
966 if ($mode == self::TEST_NEW) {
967 $tst = new ilObjTest();
968 $tst->setType('tst');
969 $tst->setTitle($form->getInput('title'));
970 $tst->setDescription($form->getInput('desc'));
971 $tst->create();
972 $tst->saveToDb();
973 $tst->createReference();
974 $tst->putInTree($this->getParentObject()->getRefId());
975 $tst->setPermissions($this->getParentObject()->getRefId());
976 $general_settings = $tst->getMainSettings()->getGeneralSettings()->withQuestionSetType($form->getInput('qtype'));
977 $tst->getMainSettingsRepository()->store(
978 $tst->getMainSettings()->withGeneralSettings($general_settings)
979 );
980
981 if ($this->getTestType() == self::TEST_TYPE_IT) {
982 $this->getSettings()->setInitialTest($tst->getRefId());
983 } else {
984 $this->getSettings()->setQualifiedTest($tst->getRefId());
985 }
986 $this->getSettings()->update();
987 } else {
988 if ($this->getTestType() == self::TEST_TYPE_IT) {
989 $this->getSettings()->setInitialTest((int) $form->getInput('tst'));
990 } else {
991 $this->getSettings()->setQualifiedTest((int) $form->getInput('tst'));
992 }
993
994 $this->getSettings()->update();
995 $tst = new ilObjTest($settings->getTestByType($this->getTestType()), true);
996 $tst->saveToDb();
997 }
998
999 // deassign as objective material
1000 if ($tst instanceof ilObjTest) {
1001 $this->updateMaterialAssignments($tst);
1002 }
1003 $this->updateStartObjects();
1004
1005 $this->main_tpl->setOnScreenMessage('success', $this->lng->txt('settings_saved'));
1006 $this->ctrl->redirect($this, 'testOverview');
1007 }
1008
1009 // Error
1010 $this->main_tpl->setOnScreenMessage('failure', $this->lng->txt('err_check_input'));
1011 $form->setValuesByPost();
1012 $this->testSettings($form);
1013 }
testSettings(?ilPropertyFormGUI $form=null)
getTestByType(int $a_type)

References $settings, ILIAS\Repository\ctrl(), ILIAS\Survey\Mode\getId(), ilLOSettings\getInstanceByObjId(), getParentObject(), getSettings(), ilLOSettings\getTestByType(), getTestType(), initTestTypeFromQuery(), ILIAS\Repository\lng(), setTestType(), testSettings(), updateMaterialAssignments(), and updateStartObjects().

+ Here is the call graph for this function:

◆ setTabs()

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

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

1199 : void
1200 {
1201 // objective settings
1202 $this->tabs->addSubTab(
1203 'settings',
1204 $this->lng->txt('settings'),
1205 $this->ctrl->getLinkTarget($this, 'settings')
1206 );
1207 // learning objectives
1208 $this->tabs->addSubTab(
1209 'objectives',
1210 $this->lng->txt('crs_loc_tab_objectives'),
1211 $this->ctrl->getLinkTarget($this, 'listObjectives')
1212 );
1213 // materials
1214 // tests
1217 if (
1220 ) {
1221 $this->ctrl->setParameter($this, 'tt', ilLOSettings::TYPE_TEST_INITIAL);
1222 $this->tabs->addSubTab(
1223 'itest',
1224 $this->lng->txt('crs_loc_tab_itest'),
1225 $this->ctrl->getLinkTarget($this, 'testOverview')
1226 );
1227 } else {
1228 $this->ctrl->setParameter($this, 'tt', ilLOSettings::TYPE_TEST_INITIAL);
1229 $this->tabs->addSubTab(
1230 'itests',
1231 $this->lng->txt('crs_loc_tab_itests'),
1232 $this->ctrl->getLinkTarget($this, 'testsOverview')
1233 );
1234 }
1235 }
1236
1238 $this->ctrl->setParameter($this, 'tt', ilLOSettings::TYPE_TEST_QUALIFIED);
1239 $this->tabs->addSubTab(
1240 'qtest',
1241 $this->lng->txt('crs_loc_tab_qtest'),
1242 $this->ctrl->getLinkTarget($this, 'testOverview')
1243 );
1244 } else {
1245 $this->ctrl->setParameter($this, 'tt', ilLOSettings::TYPE_TEST_QUALIFIED);
1246 $this->tabs->addSubTab(
1247 'qtests',
1248 $this->lng->txt('crs_loc_tab_qtests'),
1249 $this->ctrl->getLinkTarget($this, 'testsOverview')
1250 );
1251 }
1252
1254 $this->tabs->addSubTab(
1255 'start',
1256 $this->lng->txt('crs_loc_tab_start'),
1257 $this->ctrl->getLinkTargetByClass('ilcontainerstartobjectsgui', '')
1258 );
1259 }
1260
1261 // Member view
1262 #ilMemberViewGUI::showMemberViewSwitch($this->getParentObject()->getRefId());
1263 }
worksWithStartObjects()
Check if start objects are enabled.
worksWithInitialTest()
Check if the loc is configured for initial tests.

References $settings, ILIAS\Repository\ctrl(), ILIAS\Survey\Mode\getId(), ilLOSettings\getInitialTestType(), ilLOSettings\getInstanceByObjId(), getParentObject(), ilLOSettings\getQualifyingTestType(), ILIAS\Repository\lng(), ILIAS\Repository\tabs(), ilLOSettings\TYPE_INITIAL_PLACEMENT_ALL, ilLOSettings\TYPE_INITIAL_QUALIFYING_ALL, ilLOSettings\TYPE_QUALIFYING_ALL, ilLOSettings\TYPE_TEST_INITIAL, ilLOSettings\TYPE_TEST_QUALIFIED, ilLOSettings\worksWithInitialTest(), and ilLOSettings\worksWithStartObjects().

Referenced by executeCommand().

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

◆ setTestType()

ilLOEditorGUI::setTestType ( int  $a_type)

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

239 : void
240 {
241 $this->test_type = $a_type;
242 }

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

+ Here is the caller graph for this function:

◆ settings()

ilLOEditorGUI::settings ( ?ilPropertyFormGUI  $form = null)
protected

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

249 : void
250 {
251 if (!$form instanceof ilPropertyFormGUI) {
252 $form = $this->initSettingsForm();
253 }
254 $this->tabs->activateSubTab('settings');
255 $this->tpl->setContent($form->getHTML());
257 }

References initSettingsForm(), ilLOEditorStatus\SECTION_SETTINGS, showStatus(), and ILIAS\Repository\tabs().

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

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

1043 : void
1044 {
1045 $this->tabs->activateSubTab('objectives');
1046 if (!$form instanceof ilPropertyFormGUI) {
1047 $form = $this->initSimpleObjectiveForm();
1048 }
1049 $this->tpl->setContent($form->getHTML());
1051 }

References initSimpleObjectiveForm(), ilLOEditorStatus\SECTION_OBJECTIVES_NEW, showStatus(), and ILIAS\Repository\tabs().

Referenced by listObjectives(), and saveObjectiveCreation().

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

◆ showStatus()

ilLOEditorGUI::showStatus ( int  $a_section)
protected

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

1191 : void
1192 {
1193 $status = new ilLOEditorStatus($this->getParentObject());
1194 $status->setSection($a_section);
1195 $status->setCmdClass($this);
1196 $this->tpl->setRightContent($status->getHTML());
1197 }
Presentation of the status of single steps during the configuration process.

References 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

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

818 : void
819 {
821 $this->setTestType($this->initTestTypeFromQuery());
822 }
823 $this->ctrl->setParameter($this, 'tt', $this->getTestType());
824
825 switch ($this->getTestType()) {
827 $this->tabs->activateSubTab('itests');
828 break;
829
831 $this->tabs->activateSubTab('qtests');
832 break;
833 }
834 if (!$form instanceof ilPropertyFormGUI) {
835 $form_helper = new ilLOTestAssignmentForm($this, $this->getParentObject(), $this->getTestType());
836 $form = $form_helper->initForm(true);
837 }
838 $this->tpl->setContent($form->getHTML());
839
840 $this->showStatus(
841 ($this->getTestType() == self::TEST_TYPE_IT) ?
844 );
845 }

References ILIAS\Repository\ctrl(), getParentObject(), getTestType(), initTestTypeFromQuery(), ilLOEditorStatus\SECTION_ITES, ilLOEditorStatus\SECTION_QTEST, setTestType(), showStatus(), ILIAS\Repository\tabs(), ilLOSettings\TYPE_TEST_INITIAL, ilLOSettings\TYPE_TEST_QUALIFIED, and ilLOSettings\TYPE_TEST_UNDEFINED.

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

559 : void
560 {
562 $this->setTestType($this->initTestTypeFromQuery());
563 }
564 $this->ctrl->setParameter($this, 'tt', $this->getTestType());
565
567 switch ($this->getTestType()) {
569 $this->tabs->activateSubTab('itest');
570 break;
571
573 $this->tabs->activateSubTab('qtest');
574 break;
575 }
576
577 // Check if test is assigned
578 if (!$settings->getTestByType($this->getTestType())) {
579 $this->testSettings();
580 return;
581 }
582
583 try {
584 $table = new ilLOTestAssignmentTableGUI(
585 $this,
586 'testOverview',
587 $this->getParentObject()->getId(),
588 $this->getTestType()
589 );
590 $table->init();
591 $table->parse(ilLOSettings::getInstanceByObjId($this->getParentObject()->getId())->getTestByType($this->getTestType()));
592 $this->tpl->setContent($table->getHTML());
593
594 $this->showStatus(
598 );
600 $this->logger->debug(': Show new assignment screen because of : ' . $ex->getMessage());
601 $this->testSettings();
602 }
603 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilLOTestAssignmentTableGUI.

References ILIAS\Repository\ctrl(), ILIAS\Survey\Mode\getId(), ilLOSettings\getInstanceByObjId(), getParentObject(), ilLOSettings\getTestByType(), getTestType(), initTestTypeFromQuery(), ILIAS\Repository\logger(), ilLOEditorStatus\SECTION_ITES, ilLOEditorStatus\SECTION_QTEST, setTestType(), showStatus(), ILIAS\Repository\tabs(), TEST_TYPE_IT, testSettings(), ilLOSettings\TYPE_TEST_INITIAL, ilLOSettings\TYPE_TEST_QUALIFIED, and ilLOSettings\TYPE_TEST_UNDEFINED.

Referenced by testOverviewInitial(), and testOverviewQualified().

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

◆ testOverviewInitial()

ilLOEditorGUI::testOverviewInitial ( )
protected

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

605 : void
606 {
608 $this->testOverview();
609 }
testOverview()
Show test overview.

References setTestType(), testOverview(), and ilLOSettings\TYPE_TEST_INITIAL.

+ Here is the call graph for this function:

◆ testOverviewQualified()

ilLOEditorGUI::testOverviewQualified ( )
protected

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

611 : void
612 {
614 $this->testOverview();
615 }

References setTestType(), testOverview(), and ilLOSettings\TYPE_TEST_QUALIFIED.

+ Here is the call graph for this function:

◆ testSettings()

ilLOEditorGUI::testSettings ( ?ilPropertyFormGUI  $form = null)
protected

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

847 : void
848 {
849 $this->ctrl->setParameter($this, 'tt', $this->getTestType());
850 switch ($this->getTestType()) {
852 $this->tabs->activateSubTab('itest');
853 break;
854
856 $this->tabs->activateSubTab('qtest');
857 break;
858 }
859
860 if (!$form instanceof ilPropertyFormGUI) {
861 $form_helper = new ilLOTestAssignmentForm($this, $this->getParentObject(), $this->getTestType());
862 $form = $form_helper->initForm(false);
863 }
864 $this->tpl->setContent($form->getHTML());
865
866 $this->showStatus(
867 ($this->getTestType() == self::TEST_TYPE_IT) ?
870 );
871 }

References ILIAS\Repository\ctrl(), getParentObject(), getTestType(), ilLOEditorStatus\SECTION_ITES, ilLOEditorStatus\SECTION_QTEST, showStatus(), ILIAS\Repository\tabs(), 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

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

497 : void
498 {
500 $this->setTestType($this->initTestTypeFromQuery());
501 }
502 $this->ctrl->setParameter($this, 'tt', $this->getTestType());
503
504 $this->toolbar->setFormAction($this->ctrl->getFormAction($this));
505 $this->toolbar->addButton(
506 $this->lng->txt('crs_loc_btn_new_assignment'),
507 $this->ctrl->getLinkTarget($this, 'testAssignment')
508 );
509
511 switch ($this->getTestType()) {
513 $this->tabs->activateSubTab('itests');
514 break;
515
517 $this->tabs->activateSubTab('qtests');
518 break;
519 }
520
521 try {
522 $table = new ilLOTestAssignmentTableGUI(
523 $this,
524 'testsOverview',
525 $this->getParentObject()->getId(),
526 $this->getTestType(),
528 );
529 $table->init();
530 $table->parseMultipleAssignments();
531 $this->tpl->setContent($table->getHTML());
532
533 $this->showStatus(
537 );
539 $this->logger->debug(': Show new assignment screen because of : ' . $ex->getMessage());
540 $this->testSettings();
541 }
542 }

References $settings, ILIAS\Repository\ctrl(), ILIAS\Survey\Mode\getId(), ilLOSettings\getInstanceByObjId(), getParentObject(), getTestType(), initTestTypeFromQuery(), ILIAS\Repository\lng(), ILIAS\Repository\logger(), ilLOEditorStatus\SECTION_ITES, ilLOEditorStatus\SECTION_QTEST, setTestType(), showStatus(), ILIAS\Repository\tabs(), TEST_TYPE_IT, testSettings(), ILIAS\Repository\toolbar(), ilLOTestAssignmentTableGUI\TYPE_MULTIPLE_ASSIGNMENTS, ilLOSettings\TYPE_TEST_INITIAL, ilLOSettings\TYPE_TEST_QUALIFIED, and ilLOSettings\TYPE_TEST_UNDEFINED.

Referenced by testsOverviewInitial(), and testsOverviewQualified().

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

◆ testsOverviewInitial()

ilLOEditorGUI::testsOverviewInitial ( )
protected

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

544 : void
545 {
547 $this->testsOverview();
548 }

References setTestType(), testsOverview(), and ilLOSettings\TYPE_TEST_INITIAL.

+ Here is the call graph for this function:

◆ testsOverviewQualified()

ilLOEditorGUI::testsOverviewQualified ( )
protected

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

550 : void
551 {
553 $this->testsOverview();
554 }

References setTestType(), testsOverview(), and ilLOSettings\TYPE_TEST_QUALIFIED.

+ Here is the call graph for this function:

◆ updateMaterialAssignments()

ilLOEditorGUI::updateMaterialAssignments ( ilObjTest  $test)
protected

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

941 : void
942 {
943 foreach (ilCourseObjective::_getObjectiveIds($this->getParentObject()->getId()) as $objective_id) {
944 $materials = new ilCourseObjectiveMaterials($objective_id);
945 foreach ($materials->getMaterials() as $material) {
946 if ($material['ref_id'] == $test->getRefId()) {
947 $materials->delete($material['lm_ass_id']);
948 }
949 }
950 }
951 }
class ilCourseObjectiveMaterials

References ilCourseObjective\_getObjectiveIds(), ILIAS\Survey\Mode\getId(), getParentObject(), and ilObject\getRefId().

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

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

873 : void
874 {
875 $start = new ilContainerStartObjects(0, $this->getParentObject()->getId());
876 $this->getSettings()->updateStartObjects($start);
877 }

References ILIAS\Survey\Mode\getId(), 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

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

References $settings, deleteAssignments(), ilLOSettings\getInitialTestType(), ilLOSettings\getQualifyingTestType(), 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, ilLOSettings\TYPE_TEST_QUALIFIED, and ilLOSettings\update().

Referenced by saveSettings().

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

Field Documentation

◆ $content_style_domain

ObjectFacade ilLOEditorGUI::$content_style_domain
private

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

◆ $ctrl

ilCtrlInterface ilLOEditorGUI::$ctrl
private

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

◆ $http

GlobalHttpState ilLOEditorGUI::$http
protected

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

◆ $lng

ilLanguage ilLOEditorGUI::$lng
private

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

◆ $logger

ilLogger ilLOEditorGUI::$logger
private

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

◆ $main_tpl

ilGlobalTemplateInterface ilLOEditorGUI::$main_tpl
protected

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

◆ $parent_gui

ilObjCourseGUI ilLOEditorGUI::$parent_gui
private

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

Referenced by __construct(), and getParentGUI().

◆ $parent_obj

ilObject ilLOEditorGUI::$parent_obj
private

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

Referenced by getParentObject().

◆ $refinery

Factory ilLOEditorGUI::$refinery
protected

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

◆ $settings

ilLOSettings ilLOEditorGUI::$settings
private

◆ $tabs

ilTabsGUI ilLOEditorGUI::$tabs
private

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

◆ $test_type

int ilLOEditorGUI::$test_type = self::TEST_TYPE_UNDEFINED
private

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

Referenced by getTestType().

◆ $toolbar

ilToolbarGUI ilLOEditorGUI::$toolbar
protected

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

◆ $tpl

ilGlobalTemplateInterface ilLOEditorGUI::$tpl
private

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

◆ TEST_ASSIGN

const ilLOEditorGUI::TEST_ASSIGN = 2

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

◆ TEST_NEW

const ilLOEditorGUI::TEST_NEW = 1

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

◆ TEST_TYPE_IT

const ilLOEditorGUI::TEST_TYPE_IT = 1

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

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

◆ TEST_TYPE_QT

const ilLOEditorGUI::TEST_TYPE_QT = 2

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

◆ TEST_TYPE_UNDEFINED

const ilLOEditorGUI::TEST_TYPE_UNDEFINED = 0

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


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