ILIAS  release_8 Revision v8.24
ilLOEditorGUI Class Reference

Class ilLOEditorGUI. More...

+ Collaboration diagram for ilLOEditorGUI:

Public Member Functions

 __construct (ilObject $a_parent_obj)
 
 executeCommand ()
 
 getParentObject ()
 
 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
 
const SETTINGS_TEMPLATE_IT = 'il_astpl_loc_initial'
 
const SETTINGS_TEMPLATE_QT = 'il_astpl_loc_qualified'
 

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)
 
 applySettingsTemplate (ilObjTest $tst)
 
 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
 
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 ( ilObject  $a_parent_obj)

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

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

References $DIC, ILIAS\Repository\ctrl(), ILIAS\Survey\Mode\getId(), ilLOSettings\getInstanceByObjId(), 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 1181 of file class.ilLOEditorGUI.php.

1181 : void
1182 {
1185 foreach ($objectives as $objective_id) {
1186 $objective = new ilCourseObjective($this->getParentObject(), $objective_id);
1187 if (in_array($objective_id, $enabled)) {
1188 $objective->setActive(true);
1189 $objective->update();
1190 }
1191 }
1193 $this->tpl->setOnScreenMessage('success', $this->lng->txt('settings_saved'), true);
1194 $this->ctrl->redirect($this, 'listObjectives');
1195 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _getObjectiveIds(int $course_id, bool $a_activated_only=false)
static _refreshStatus(int $a_obj_id, ?array $a_users=null)
bool $enabled
Whether the system instance is enabled to accept connection requests.
Definition: System.php:123
$objectives

References ILIAS\LTI\ToolProvider\$enabled, $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:

◆ applySettingsTemplate()

ilLOEditorGUI::applySettingsTemplate ( ilObjTest  $tst)
protected

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

872 : bool
873 {
874 $tpl_id = 0;
875 foreach (ilSettingsTemplate::getAllSettingsTemplates('tst', true) as $nr => $template) {
876 switch ($this->getTestType()) {
878 if ($template['title'] == self::SETTINGS_TEMPLATE_IT) {
879 $tpl_id = $template['id'];
880 }
881 break;
883 if ($template['title'] == self::SETTINGS_TEMPLATE_QT) {
884 $tpl_id = $template['id'];
885 }
886 break;
887 }
888 if ($tpl_id) {
889 break;
890 }
891 }
892
893 if (!$tpl_id) {
894 return false;
895 }
896
898 $template_settings = $template->getSettings();
899 if ($template_settings !== []) {
900 $tst_gui = new ilObjTestGUI();
901 $tst_gui->applyTemplate($template_settings, $tst);
902 }
903 $tst->setTemplate($tpl_id);
904 return true;
905 }
Class ilObjTestGUI.
setTemplate($template_id)
Settings template application class.
static getAllSettingsTemplates(string $a_type, bool $a_include_auto_generated=false)
Get all settings templates of type.

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

Referenced by saveMultiTestAssignment(), and saveTest().

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

◆ askDeleteObjectives()

ilLOEditorGUI::askDeleteObjectives ( )
protected

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

1148 : void
1149 {
1150 $this->tabs->activateSubTab('objectives');
1151
1152 $confirm = new ilConfirmationGUI();
1153 $confirm->setFormAction($this->ctrl->getFormAction($this));
1154 $confirm->setHeaderText($this->lng->txt('crs_delete_objectve_sure'));
1155 $confirm->setConfirm($this->lng->txt('delete'), 'deleteObjectives');
1156 $confirm->setCancel($this->lng->txt('cancel'), 'listObjectives');
1157
1158 $objective_ids = [];
1159 if ($this->http->wrapper()->post()->has('objective')) {
1160 $objective_ids = $this->http->wrapper()->post()->retrieve(
1161 'objective',
1162 $this->refinery->kindlyTo()->dictOf(
1163 $this->refinery->kindlyTo()->int()
1164 )
1165 );
1166 }
1167 foreach ($objective_ids as $objective_id) {
1168 $obj = new ilCourseObjective($this->getParentObject(), $objective_id);
1169 $name = $obj->getTitle();
1170
1171 $confirm->addItem(
1172 'objective_ids[]',
1173 $objective_id,
1174 $name
1175 );
1176 }
1177 $this->tpl->setContent($confirm->getHTML());
1179 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
showStatus(int $a_section)
if($format !==null) $name
Definition: metadata.php:247

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

672 : void
673 {
674 $this->setTestType($this->initTestTypeFromQuery());
675 $this->ctrl->setParameter($this, 'tt', $this->getTestType());
676
678 switch ($this->getTestType()) {
680 $this->tabs->activateSubTab('itest');
681 break;
682
684 $this->tabs->activateSubTab('qtest');
685 break;
686 }
687
688 $tests = [];
689 if ($this->http->wrapper()->post()->has('tst')) {
690 $tests = $this->http->wrapper()->post()->retrieve(
691 'tst',
692 $this->refinery->kindlyTo()->listOf(
693 $this->refinery->kindlyTo()->int()
694 )
695 );
696 }
697 if (count($tests) === 0) {
698 $this->main_tpl->setOnScreenMessage('failure', $this->lng->txt('select_one'), true);
699 $this->ctrl->redirect($this, 'testOverview');
700 }
701
702 $confirm = new ilConfirmationGUI();
703 $confirm->setHeaderText($this->lng->txt('crs_loc_confirm_delete_tst'));
704 $confirm->setFormAction($this->ctrl->getFormAction($this));
705 $confirm->setConfirm($this->lng->txt('crs_loc_delete_assignment'), 'deleteTest');
706 $confirm->setCancel($this->lng->txt('cancel'), 'testOverview');
707
708 foreach ($tests as $tst_id) {
709 $obj_id = ilObject::_lookupObjId($tst_id);
710 $confirm->addItem('tst[]', $tst_id, ilObject::_lookupTitle($obj_id));
711 }
712 $this->tpl->setContent($confirm->getHTML());
713
714 $this->showStatus(
718 );
719 }
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 619 of file class.ilLOEditorGUI.php.

619 : void
620 {
621 $this->setTestType($this->initTestTypeFromQuery());
622 $this->ctrl->setParameter($this, 'tt', $this->getTestType());
623
625 switch ($this->getTestType()) {
627 $this->tabs->activateSubTab('itests');
628 break;
629
631 $this->tabs->activateSubTab('qtests');
632 break;
633 }
634
635 $tests = [];
636 if ($this->http->wrapper()->post()->has('tst')) {
637 $tests = $this->http->wrapper()->post()->retrieve(
638 'tst',
639 $this->refinery->kindlyTo()->listOf(
640 $this->refinery->kindlyTo()->int()
641 )
642 );
643 }
644 if (!count($tests)) {
645 $this->main_tpl->setOnScreenMessage('failure', $this->lng->txt('select_one'), true);
646 $this->ctrl->redirect($this, 'testsOverview');
647 }
648 $confirm = new ilConfirmationGUI();
649 $confirm->setHeaderText($this->lng->txt('crs_loc_confirm_delete_tst'));
650 $confirm->setFormAction($this->ctrl->getFormAction($this));
651 $confirm->setConfirm($this->lng->txt('crs_loc_delete_assignment'), 'deleteTests');
652 $confirm->setCancel($this->lng->txt('cancel'), 'testsOverview');
653 foreach ($tests as $assign_id) {
654 $assignment = new ilLOTestAssignment($assign_id);
655
656 $obj_id = ilObject::_lookupObjId($assignment->getTestRefId());
657 $confirm->addItem('tst[]', $assign_id, ilObject::_lookupTitle($obj_id));
658 }
659
660 $this->tpl->setContent($confirm->getHTML());
661
662 $this->showStatus(
666 );
667 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

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

1197 : void
1198 {
1199 $disabled = $this->initObjectiveIdsFromPost();
1201 foreach ($objectives as $objective_id) {
1202 $objective = new ilCourseObjective($this->getParentObject(), $objective_id);
1203 if (in_array($objective_id, $disabled)) {
1204 $objective->setActive(false);
1205 $objective->update();
1206 }
1207 }
1209 $this->tpl->setOnScreenMessage('success', $this->lng->txt('settings_saved'), true);
1210 $this->ctrl->redirect($this, 'listObjectives');
1211 }

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

255 : void
256 {
257 $assignments = ilLOTestAssignments::getInstance($this->getParentObject()->getId());
258 foreach ($assignments->getAssignmentsByType($a_type) as $assignment) {
259 $assignment->delete();
260 }
261 }
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 1213 of file class.ilLOEditorGUI.php.

1213 : void
1214 {
1215 $objective_ids = [];
1216 if ($this->http->wrapper()->post()->has('objective_ids')) {
1217 $objective_ids = $this->http->wrapper()->post()->retrieve(
1218 'objective_ids',
1219 $this->refinery->kindlyTo()->dictOf(
1220 $this->refinery->kindlyTo()->int()
1221 )
1222 );
1223 }
1224 foreach ($objective_ids as $objective_id) {
1225 $objective_obj = new ilCourseObjective($this->getParentObject(), $objective_id);
1226 $objective_obj->delete();
1227 }
1229 $this->tpl->setOnScreenMessage('success', $this->lng->txt('crs_objectives_deleted'), true);
1230 $this->ctrl->redirect($this, 'listObjectives');
1231 }

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

765 : void
766 {
767 $this->setTestType($this->initTestTypeFromQuery());
768 $this->ctrl->setParameter($this, 'tt', $this->getTestType());
769
771 switch ($this->getTestType()) {
773 $this->tabs->activateSubTab('itest');
774 break;
775
777 $this->tabs->activateSubTab('qtest');
778 break;
779 }
780
781 $tests = [];
782 if ($this->http->wrapper()->post()->has('tst')) {
783 $tests = $this->http->wrapper()->post()->retrieve(
784 'tst',
785 $this->refinery->kindlyTo()->listOf(
786 $this->refinery->kindlyTo()->int()
787 )
788 );
789 }
790 foreach ($tests as $tst_id) {
791 switch ($this->getTestType()) {
794 break;
795
798 break;
799 }
800 $settings->update();
801
802 // finally delete start object assignment
803 $start = new ilContainerStartObjects(
804 $this->getParentObject()->getRefId(),
805 $this->getParentObject()->getId()
806 );
807 $start->deleteItem($tst_id);
808
809 // ... and assigned questions
811 }
812
813 $this->main_tpl->setOnScreenMessage('success', $this->lng->txt('settings_saved'), true);
814 $this->ctrl->redirect($this, 'testOverview');
815 }
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 721 of file class.ilLOEditorGUI.php.

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

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

81 : void
82 {
83 $next_class = $this->ctrl->getNextClass($this);
84 $cmd = $this->ctrl->getCmd();
85
86 $this->setTabs();
87 switch ($next_class) {
88 case 'ilcourseobjectivesgui':
89
90 $this->ctrl->setReturn($this, 'returnFromObjectives');
91 $this->tabs->clearTargets();
92 $this->tabs->setBackTarget(
93 $this->lng->txt('back'),
94 $this->ctrl->getLinkTarget($this, 'listObjectives')
95 );
96
97 $reg_gui = new ilCourseObjectivesGUI($this->getParentObject()->getRefId());
98 $this->ctrl->forwardCommand($reg_gui);
99 break;
100
101 case 'ilcontainerstartobjectsgui':
102
103 $stgui = new ilContainerStartObjectsGUI($this->getParentObject());
104 $ret = $this->ctrl->forwardCommand($stgui);
105
106 $this->tabs->activateSubTab('start');
107 $this->tabs->removeSubTab('manage');
108 break;
109
110 case 'ilconditionhandlergui':
111
112 $this->ctrl->saveParameterByClass('ilconditionhandlergui', 'objective_id');
113
114 $this->tabs->clearTargets();
115 $this->tabs->setBackTarget(
116 $this->lng->txt('back'),
117 $this->ctrl->getLinkTarget($this, 'listObjectives')
118 );
119
120 $cond = new ilConditionHandlerGUI();
121 $cond->setBackButtons(array());
122 $cond->setAutomaticValidation(false);
123 $cond->setTargetType("lobj");
124 $cond->setTargetRefId($this->getParentObject()->getRefId());
125 $cond->setTargetId($this->initObjectiveIdFromQuery());
126
127 // objective
128 $obj = new ilCourseObjective($this->getParentObject(), $this->initObjectiveIdFromQuery());
129 $cond->setTargetTitle($obj->getTitle());
130 $this->ctrl->forwardCommand($cond);
131 break;
132
133 case 'illopagegui':
134 $this->ctrl->saveParameterByClass('illopagegui', 'objective_id');
135
136 $this->tabs->clearTargets();
137 $this->tabs->setBackTarget(
138 $this->lng->txt('back'),
139 $this->ctrl->getLinkTarget($this, 'listObjectives')
140 );
141
142 $objtv_id = $this->initObjectiveIdFromQuery();
143
144 if (!ilLOPage::_exists('lobj', $objtv_id)) {
145 // doesn't exist -> create new one
146 $new_page_object = new ilLOPage();
147 $new_page_object->setParentId($objtv_id);
148 $new_page_object->setId($objtv_id);
149 $new_page_object->createFromXML();
150 unset($new_page_object);
151 }
152
153 $this->ctrl->setReturn($this, 'listObjectives');
154 $pgui = new ilLOPageGUI($objtv_id);
155 $pgui->setPresentationTitle(ilCourseObjective::lookupObjectiveTitle($objtv_id));
156
157 $pgui->setStyleId($this->content_style_domain->getEffectiveStyleId());
158
159 // #14895
160 $this->tpl->setCurrentBlock("ContentStyle");
161 $this->tpl->setVariable(
162 "LOCATION_CONTENT_STYLESHEET",
163 ilObjStyleSheet::getContentStylePath($this->content_style_domain->getEffectiveStyleId())
164 );
165 $this->tpl->parseCurrentBlock();
166
167 $ret = $this->ctrl->forwardCommand($pgui);
168 if ($ret) {
169 $this->tpl->setContent($ret);
170 }
171 break;
172
173 default:
174 if (!$cmd) {
175 // get first unaccomplished step
176 $cmd = ilLOEditorStatus::getInstance($this->getParentObject())->getFirstFailedStep();
177 }
178 $this->$cmd();
179
180 break;
181 }
182 }
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)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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:

◆ getParentObject()

◆ getSettings()

ilLOEditorGUI::getSettings ( )

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

231 {
232 return $this->settings;
233 }
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 240 of file class.ilLOEditorGUI.php.

240 : int
241 {
242 return $this->test_type;
243 }

References $test_type.

Referenced by applySettingsTemplate(), 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 184 of file class.ilLOEditorGUI.php.

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

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

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

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

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

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

1096 {
1097 $form = new ilPropertyFormGUI();
1098 $form->setTitle($this->lng->txt('crs_loc_form_create_objectives'));
1099 $form->setFormAction($this->ctrl->getFormAction($this));
1100
1101 $txt = new ilTextWizardInputGUI($this->lng->txt('crs_objectives'), 'objectives');
1102 $txt->setValues(array(0 => ''));
1103 $txt->setRequired(true);
1104 $form->addItem($txt);
1105
1106 $form->addCommandButton('saveObjectiveCreation', $this->lng->txt('save'));
1107 return $form;
1108 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$txt
Definition: error.php:13

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

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

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

1057 : void
1058 {
1060 $this->tabs->activateSubTab('objectives');
1061
1063 $this->getParentObject()->getId(),
1064 false
1065 );
1066
1067 if ($objectives === []) {
1068 $this->showObjectiveCreation();
1069 return;
1070 }
1071
1072 $this->toolbar->addButton(
1073 $this->lng->txt('crs_add_objective'),
1074 $this->ctrl->getLinkTargetByClass('ilcourseobjectivesgui', "create")
1075 );
1076
1077 $table = new ilCourseObjectivesTableGUI($this, $this->getParentObject());
1078 $table->setTitle($this->lng->txt('crs_objectives'), '', $this->lng->txt('crs_objectives'));
1079 $table->parse($objectives);
1080 $this->tpl->setContent($table->getHTML());
1081
1083 }
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 479 of file class.ilLOEditorGUI.php.

479 : void
480 {
481 $this->tabs->activateSubTab('materials');
482
483 $gui = new ilObjectAddNewItemGUI($this->getParentObject()->getRefId());
484 $gui->setDisabledObjectTypes(array("itgr"));
485 #$gui->setAfterCreationCallback($this->getParentObject()->getRefId());
486 $gui->render();
487
488 $this->tpl->setOnScreenMessage(
489 'info',
490 $this->lng->txt('crs_objective_status_materials_info')
491 );
492
494 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References getParentObject(), 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 219 of file class.ilLOEditorGUI.php.

219 : void
220 {
222 $this->listObjectives();
223 }

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

+ Here is the call graph for this function:

◆ saveMultiTestAssignment()

ilLOEditorGUI::saveMultiTestAssignment ( )
protected

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

913 : void
914 {
915 $this->ctrl->setParameter($this, 'tt', $this->initTestTypeFromQuery());
916 $this->setTestType($this->initTestTypeFromQuery());
917
919
920 $form_helper = new ilLOTestAssignmentForm($this, $this->getParentObject(), $this->getTestType());
921 $form = $form_helper->initForm(true);
922
923 if ($form->checkInput()) {
924 $mode = $form->getInput('mode');
925
926 if ($mode == self::TEST_NEW) {
927 $tst = new ilObjTest();
928 $tst->setType('tst');
929 $tst->setTitle($form->getInput('title'));
930 $tst->setDescription($form->getInput('desc'));
931 $tst->create();
932 $tst->saveToDb();
933 $tst->createReference();
934 $tst->putInTree($this->getParentObject()->getRefId());
935 $tst->setPermissions($this->getParentObject()->getRefId());
936
937 // apply settings template
938 $this->applySettingsTemplate($tst);
939
940 $tst->setQuestionSetType($form->getInput('qtype'));
941
942 $tst->saveToDb();
943
944 $assignment = new ilLOTestAssignment();
945 $assignment->setContainerId($this->getParentObject()->getId());
946 $assignment->setAssignmentType($this->getTestType());
947 $assignment->setObjectiveId($form->getInput('objective'));
948 $assignment->setTestRefId($tst->getRefId());
949 $assignment->save();
950 } else {
951 $assignment = new ilLOTestAssignment();
952 $assignment->setContainerId($this->getParentObject()->getId());
953 $assignment->setAssignmentType($this->getTestType());
954 $assignment->setObjectiveId($form->getInput('objective'));
955 $assignment->setTestRefId($form->getInput('tst'));
956 $assignment->save();
957
958 $tst = new ilObjTest($form->getInput('tst'), true);
959 $this->applySettingsTemplate($tst);
960 $tst->saveToDb();
961 }
962
963 // deassign as objective material
964 if ($tst instanceof ilObjTest) {
965 $this->updateMaterialAssignments($tst);
966 }
967 $this->updateStartObjects();
968
969 $this->main_tpl->setOnScreenMessage('success', $this->lng->txt('settings_saved'));
970 $this->ctrl->redirect($this, 'testsOverview');
971 }
972
973 // Error
974 $this->main_tpl->setOnScreenMessage('failure', $this->lng->txt('err_check_input'));
975 $form->setValuesByPost();
976 $this->testAssignment($form);
977 }
updateMaterialAssignments(ilObjTest $test)
testAssignment(ilPropertyFormGUI $form=null)
applySettingsTemplate(ilObjTest $tst)

References applySettingsTemplate(), 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 1110 of file class.ilLOEditorGUI.php.

1110 : void
1111 {
1112 $form = $this->initSimpleObjectiveForm();
1113 if ($form->checkInput()) {
1114 foreach ((array) $form->getInput('objectives') as $title) {
1115 $obj = new ilCourseObjective($this->getParentObject());
1116 $obj->setActive(true);
1117 $obj->setTitle($title);
1118 $obj->add();
1119 }
1120 $this->main_tpl->setOnScreenMessage('success', $this->lng->txt('settings_saved'), true);
1121 $this->ctrl->redirect($this, '');
1122 }
1123
1124 $form->setValuesByPost();
1125 $this->tabs->activateSubTab('objectives');
1127 $this->showObjectiveCreation($form);
1128 }

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

295 : void
296 {
297 $form = $this->initSettingsForm();
298 if ($form->checkInput()) {
300 $settings->setInitialTestType($form->getInput('ittype'));
301 switch ($settings->getInitialTestType()) {
303 $settings->setInitialTestAsStart($form->getInput('start_ip'));
304 break;
305
308 break;
309
311 $settings->setInitialTestAsStart($form->getInput('start_iq'));
312 break;
313
316 break;
317
320 break;
321 }
322
323 $settings->setQualifyingTestType($form->getInput('qttype'));
324 switch ($settings->getQualifyingTestType()) {
326 $settings->setQualifyingTestAsStart($form->getInput('start_q'));
327 break;
328
331 break;
332 }
333
334 $settings->resetResults($form->getInput('reset'));
335 $settings->setPassedObjectiveMode($form->getInput('passed_mode'));
336
337 if (
340 ) {
342 $this->main_tpl->setOnScreenMessage('info', $this->lng->txt('crs_loc_settings_err_qstart'), true);
343 }
344
345 $settings->update();
346 $this->updateStartObjects();
348
350
351 $this->main_tpl->setOnScreenMessage('success', $this->lng->txt('settings_saved'), true);
352 $this->ctrl->redirect($this, 'settings');
353 }
354
355 // Error
356 $this->main_tpl->setOnScreenMessage('failure', $this->lng->txt('err_check_input'));
357 $form->setValuesByPost();
358 $this->settings($form);
359 }
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 1130 of file class.ilLOEditorGUI.php.

1130 : void
1131 {
1132 $post_position = $this->http->wrapper()->post()->retrieve(
1133 'position',
1134 $this->refinery->kindlyTo()->dictOf(
1135 $this->refinery->kindlyTo()->string()
1136 )
1137 );
1138 asort($post_position, SORT_NUMERIC);
1139 $counter = 1;
1140 foreach ($post_position as $objective_id => $position) {
1141 $objective = new ilCourseObjective($this->getParentObject(), $objective_id);
1142 $objective->writePosition($counter++);
1143 }
1144 $this->main_tpl->setOnScreenMessage('success', $this->lng->txt('crs_objective_saved_sorting'));
1145 $this->listObjectives();
1146 }

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

991 : void
992 {
993 $this->ctrl->setParameter($this, 'tt', $this->initTestTypeFromQuery());
994 $this->setTestType($this->initTestTypeFromQuery());
995
997
998 $form_helper = new ilLOTestAssignmentForm($this, $this->getParentObject(), $this->getTestType());
999 $form = $form_helper->initForm(false);
1000
1001 if ($form->checkInput()) {
1002 $mode = $form->getInput('mode');
1003
1004 if ($mode == self::TEST_NEW) {
1005 $tst = new ilObjTest();
1006 $tst->setType('tst');
1007 $tst->setTitle($form->getInput('title'));
1008 $tst->setDescription($form->getInput('desc'));
1009 $tst->create();
1010 $tst->saveToDb();
1011 $tst->createReference();
1012 $tst->putInTree($this->getParentObject()->getRefId());
1013 $tst->setPermissions($this->getParentObject()->getRefId());
1014
1015 // apply settings template
1016 $this->applySettingsTemplate($tst);
1017
1018 $tst->setQuestionSetType($form->getInput('qtype'));
1019
1020 $tst->saveToDb();
1021
1022 if ($this->getTestType() == self::TEST_TYPE_IT) {
1023 $this->getSettings()->setInitialTest($tst->getRefId());
1024 } else {
1025 $this->getSettings()->setQualifiedTest($tst->getRefId());
1026 }
1027 $this->getSettings()->update();
1028 } else {
1029 if ($this->getTestType() == self::TEST_TYPE_IT) {
1030 $this->getSettings()->setInitialTest($form->getInput('tst'));
1031 } else {
1032 $this->getSettings()->setQualifiedTest($form->getInput('tst'));
1033 }
1034
1035 $this->getSettings()->update();
1036 $tst = new ilObjTest($settings->getTestByType($this->getTestType()), true);
1037 $this->applySettingsTemplate($tst);
1038 $tst->saveToDb();
1039 }
1040
1041 // deassign as objective material
1042 if ($tst instanceof ilObjTest) {
1043 $this->updateMaterialAssignments($tst);
1044 }
1045 $this->updateStartObjects();
1046
1047 $this->main_tpl->setOnScreenMessage('success', $this->lng->txt('settings_saved'));
1048 $this->ctrl->redirect($this, 'testOverview');
1049 }
1050
1051 // Error
1052 $this->main_tpl->setOnScreenMessage('failure', $this->lng->txt('err_check_input'));
1053 $form->setValuesByPost();
1054 $this->testSettings($form);
1055 }
testSettings(ilPropertyFormGUI $form=null)
getTestByType(int $a_type)

References $settings, applySettingsTemplate(), 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 1241 of file class.ilLOEditorGUI.php.

1241 : void
1242 {
1243 // objective settings
1244 $this->tabs->addSubTab(
1245 'settings',
1246 $this->lng->txt('settings'),
1247 $this->ctrl->getLinkTarget($this, 'settings')
1248 );
1249 // learning objectives
1250 $this->tabs->addSubTab(
1251 'objectives',
1252 $this->lng->txt('crs_loc_tab_objectives'),
1253 $this->ctrl->getLinkTarget($this, 'listObjectives')
1254 );
1255 // materials
1256 // tests
1259 if (
1262 ) {
1263 $this->ctrl->setParameter($this, 'tt', ilLOSettings::TYPE_TEST_INITIAL);
1264 $this->tabs->addSubTab(
1265 'itest',
1266 $this->lng->txt('crs_loc_tab_itest'),
1267 $this->ctrl->getLinkTarget($this, 'testOverview')
1268 );
1269 } else {
1270 $this->ctrl->setParameter($this, 'tt', ilLOSettings::TYPE_TEST_INITIAL);
1271 $this->tabs->addSubTab(
1272 'itests',
1273 $this->lng->txt('crs_loc_tab_itests'),
1274 $this->ctrl->getLinkTarget($this, 'testsOverview')
1275 );
1276 }
1277 }
1278
1280 $this->ctrl->setParameter($this, 'tt', ilLOSettings::TYPE_TEST_QUALIFIED);
1281 $this->tabs->addSubTab(
1282 'qtest',
1283 $this->lng->txt('crs_loc_tab_qtest'),
1284 $this->ctrl->getLinkTarget($this, 'testOverview')
1285 );
1286 } else {
1287 $this->ctrl->setParameter($this, 'tt', ilLOSettings::TYPE_TEST_QUALIFIED);
1288 $this->tabs->addSubTab(
1289 'qtests',
1290 $this->lng->txt('crs_loc_tab_qtests'),
1291 $this->ctrl->getLinkTarget($this, 'testsOverview')
1292 );
1293 }
1294
1296 $this->tabs->addSubTab(
1297 'start',
1298 $this->lng->txt('crs_loc_tab_start'),
1299 $this->ctrl->getLinkTargetByClass('ilcontainerstartobjectsgui', '')
1300 );
1301 }
1302
1303 // Member view
1304 #ilMemberViewGUI::showMemberViewSwitch($this->getParentObject()->getRefId());
1305 }
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 235 of file class.ilLOEditorGUI.php.

235 : void
236 {
237 $this->test_type = $a_type;
238 }

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

245 : void
246 {
247 if (!$form instanceof ilPropertyFormGUI) {
248 $form = $this->initSettingsForm();
249 }
250 $this->tabs->activateSubTab('settings');
251 $this->tpl->setContent($form->getHTML());
253 }

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

1085 : void
1086 {
1087 $this->tabs->activateSubTab('objectives');
1088 if (!$form instanceof ilPropertyFormGUI) {
1089 $form = $this->initSimpleObjectiveForm();
1090 }
1091 $this->tpl->setContent($form->getHTML());
1093 }

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

1233 : void
1234 {
1235 $status = new ilLOEditorStatus($this->getParentObject());
1236 $status->setSection($a_section);
1237 $status->setCmdClass($this);
1238 $this->tpl->setRightContent($status->getHTML());
1239 }
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 817 of file class.ilLOEditorGUI.php.

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

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

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

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

604 : void
605 {
607 $this->testOverview();
608 }
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 610 of file class.ilLOEditorGUI.php.

610 : void
611 {
613 $this->testOverview();
614 }

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

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

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

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

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

543 : void
544 {
546 $this->testsOverview();
547 }

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

+ Here is the call graph for this function:

◆ testsOverviewQualified()

ilLOEditorGUI::testsOverviewQualified ( )
protected

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

549 : void
550 {
552 $this->testsOverview();
553 }

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

979 : void
980 {
981 foreach (ilCourseObjective::_getObjectiveIds($this->getParentObject()->getId()) as $objective_id) {
982 $materials = new ilCourseObjectiveMaterials($objective_id);
983 foreach ($materials->getMaterials() as $material) {
984 if ($material['ref_id'] == $test->getRefId()) {
985 $materials->delete($material['lm_ass_id']);
986 }
987 }
988 }
989 }
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 907 of file class.ilLOEditorGUI.php.

907 : void
908 {
909 $start = new ilContainerStartObjects(0, $this->getParentObject()->getId());
910 $this->getSettings()->updateStartObjects($start);
911 }

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

◆ $ctrl

ilCtrlInterface ilLOEditorGUI::$ctrl
private

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

◆ $http

GlobalHttpState ilLOEditorGUI::$http
protected

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

◆ $lng

ilLanguage ilLOEditorGUI::$lng
private

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

◆ $logger

ilLogger ilLOEditorGUI::$logger
private

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

◆ $main_tpl

ilGlobalTemplateInterface ilLOEditorGUI::$main_tpl
protected

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

◆ $parent_obj

ilObject ilLOEditorGUI::$parent_obj
private

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

Referenced by getParentObject().

◆ $refinery

Factory ilLOEditorGUI::$refinery
protected

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

◆ $settings

ilLOSettings ilLOEditorGUI::$settings
private

◆ $tabs

ilTabsGUI ilLOEditorGUI::$tabs
private

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

◆ $test_type

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

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

Referenced by getTestType().

◆ $toolbar

ilToolbarGUI ilLOEditorGUI::$toolbar
protected

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

◆ $tpl

ilGlobalTemplateInterface ilLOEditorGUI::$tpl
private

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

◆ SETTINGS_TEMPLATE_IT

const ilLOEditorGUI::SETTINGS_TEMPLATE_IT = 'il_astpl_loc_initial'

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

◆ SETTINGS_TEMPLATE_QT

const ilLOEditorGUI::SETTINGS_TEMPLATE_QT = 'il_astpl_loc_qualified'

Definition at line 42 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

◆ TEST_TYPE_QT

const ilLOEditorGUI::TEST_TYPE_QT = 2

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

Referenced by applySettingsTemplate().

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