19declare(strict_types=1);
65 $this->main_tpl =
$DIC->ui()->mainTemplate();
70 $cs =
$DIC->contentStyle();
71 $this->content_style_domain = $cs->domain()->styleForRefId($this->parent_obj->getRefId());
73 $this->
lng = $DIC->language();
74 $this->
ctrl = $DIC->ctrl();
75 $this->tpl =
$DIC->ui()->mainTemplate();
76 $this->
tabs = $DIC->tabs();
77 $this->
toolbar = $DIC->toolbar();
78 $this->
logger = $DIC->logger()->crs();
79 $this->
http = $DIC->http();
81 $this->ui_services =
$DIC->ui();
82 $this->db =
$DIC->database();
87 $next_class = $this->
ctrl->getNextClass($this);
88 $cmd = $this->
ctrl->getCmd();
93 switch ($next_class) {
94 case 'ilcourseobjectivesgui':
96 $this->
ctrl->setReturn($this,
'returnFromObjectives');
97 $this->
tabs->clearTargets();
98 $this->
tabs->setBackTarget(
99 $this->
lng->txt(
'back'),
100 $this->ctrl->getLinkTarget($this,
'listObjectives')
104 $this->
ctrl->forwardCommand($reg_gui);
107 case 'ilcontainerstartobjectsgui':
110 $ret = $this->
ctrl->forwardCommand($stgui);
112 $this->
tabs->activateSubTab(
'start');
113 $this->
tabs->removeSubTab(
'manage');
116 case 'ilconditionhandlergui':
118 $this->
ctrl->saveParameterByClass(
'ilconditionhandlergui',
'objective_id');
120 $this->
tabs->clearTargets();
121 $this->
tabs->setBackTarget(
122 $this->
lng->txt(
'back'),
123 $this->ctrl->getLinkTarget($this,
'listObjectives')
127 $cond->setBackButtons(array());
128 $cond->setAutomaticValidation(
false);
129 $cond->setTargetType(
"lobj");
135 $cond->setTargetTitle($obj->getTitle());
136 $this->
ctrl->forwardCommand($cond);
140 $this->
ctrl->saveParameterByClass(
'illopagegui',
'objective_id');
142 $this->
tabs->clearTargets();
143 $this->
tabs->setBackTarget(
144 $this->
lng->txt(
'back'),
145 $this->ctrl->getLinkTarget($this,
'listObjectives')
153 $new_page_object->setParentId($objtv_id);
154 $new_page_object->setId($objtv_id);
155 $new_page_object->createFromXML();
156 unset($new_page_object);
159 $this->
ctrl->setReturn($this,
'listObjectives');
163 $pgui->setStyleId($this->content_style_domain->getEffectiveStyleId());
166 $this->tpl->setCurrentBlock(
"ContentStyle");
167 $this->tpl->setVariable(
168 "LOCATION_CONTENT_STYLESHEET",
171 $this->tpl->parseCurrentBlock();
173 $ret = $this->
ctrl->forwardCommand($pgui);
175 $this->tpl->setContent($ret);
192 if ($this->
http->wrapper()->query()->has(
'objective_id')) {
193 return $this->
http->wrapper()->query()->retrieve(
203 if ($this->
http->wrapper()->post()->has(
'objective')) {
204 return $this->
http->wrapper()->post()->retrieve(
206 $this->
refinery->kindlyTo()->listOf(
207 $this->refinery->kindlyTo()->int()
216 if ($this->
http->wrapper()->query()->has(
'tt')) {
217 return $this->
http->wrapper()->query()->retrieve(
248 $this->test_type = $a_type;
261 $this->
tabs->activateSubTab(
'settings');
262 $this->tpl->setContent($form->getHTML());
269 foreach ($assignments->getAssignmentsByType($a_type) as $assignment) {
270 $assignment->delete();
309 if ($form->checkInput()) {
353 $this->main_tpl->setOnScreenMessage(
'info', $this->
lng->txt(
'crs_loc_settings_err_qstart'),
true);
362 $this->main_tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'settings_saved'),
true);
363 $this->
ctrl->redirect($this,
'settings');
367 $this->main_tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'err_check_input'));
368 $form->setValuesByPost();
378 $form->setFormAction($this->
ctrl->getFormAction($this));
379 $form->setTitle($this->
lng->txt(
'crs_loc_settings_tbl'));
383 $type_selector->setRequired(
true);
384 $type_selector->setValue((
string) $this->
getSettings()->getInitialTestType());
387 $this->
lng->txt(
'crs_loc_settings_type_it_placement_all'),
390 $type_ipa->setInfo($this->
lng->txt(
'crs_loc_settings_type_it_placement_all_info'));
391 $type_selector->addOption($type_ipa);
394 $start_ip->setValue((
string) 1);
395 $start_ip->setChecked($this->
getSettings()->isInitialTestStart());
396 $type_ipa->addSubItem($start_ip);
399 $this->
lng->txt(
'crs_loc_settings_type_it_placement_sel'),
402 $type_ips->setInfo($this->
lng->txt(
'crs_loc_settings_type_it_placement_sel_info'));
403 $type_selector->addOption($type_ips);
406 $this->
lng->txt(
'crs_loc_settings_type_it_qualifying_all'),
409 $type_iqa->setInfo($this->
lng->txt(
'crs_loc_settings_type_it_qualifying_all_info'));
410 $type_selector->addOption($type_iqa);
413 $start_iq->setValue(
'1');
414 $start_iq->setChecked($this->
getSettings()->isInitialTestStart());
415 $type_iqa->addSubItem($start_iq);
418 $this->
lng->txt(
'crs_loc_settings_type_it_qualifying_sel'),
421 $type_iqs->setInfo($this->
lng->txt(
'crs_loc_settings_type_it_qualifying_sel_info'));
422 $type_selector->addOption($type_iqs);
425 $this->
lng->txt(
'crs_loc_settings_type_it_none'),
428 $type_ino->setInfo($this->
lng->txt(
'crs_loc_settings_type_it_none_info'));
429 $type_selector->addOption($type_ino);
431 $form->addItem($type_selector);
435 $qt_selector->setRequired(
true);
436 $qt_selector->setValue((
string) $this->
getSettings()->getQualifyingTestType());
439 $this->
lng->txt(
'crs_loc_settings_type_q_all'),
442 $type_qa->setInfo($this->
lng->txt(
'crs_loc_settings_type_q_all_info'));
443 $qt_selector->addOption($type_qa);
446 $start_q->setValue(
'1');
447 $start_q->setChecked($this->
getSettings()->isQualifyingTestStart());
448 $type_qa->addSubItem($start_q);
451 $passed_mode->setValue(
455 $passed_mode->addOption(
457 $this->
lng->txt(
'crs_loc_settings_passed_mode_hide'),
461 $passed_mode->addOption(
463 $this->
lng->txt(
'crs_loc_settings_passed_mode_mark'),
467 $type_qa->addSubItem($passed_mode);
470 $this->
lng->txt(
'crs_loc_settings_type_q_selected'),
473 $type_qs->setInfo($this->
lng->txt(
'crs_loc_settings_type_q_selected_info'));
474 $qt_selector->addOption($type_qs);
476 $form->addItem($qt_selector);
480 $reset->setValue(
'1');
481 $reset->setChecked($this->
getSettings()->isResetResultsEnabled());
482 $reset->setOptionTitle($this->
lng->txt(
'crs_loc_settings_reset_enable'));
483 $reset->setInfo($this->
lng->txt(
'crs_loc_settings_reset_enable_info'));
484 $form->addItem($reset);
486 $form->addCommandButton(
'saveSettings', $this->
lng->txt(
'save'));
492 $this->
tabs->activateSubTab(
'materials');
494 $this->parent_gui->renderAddNewItem(
'itgr');
496 $this->tpl->setOnScreenMessage(
498 $this->
lng->txt(
'crs_objective_status_materials_info')
511 $this->
toolbar->setFormAction($this->
ctrl->getFormAction($this));
513 $this->
lng->txt(
'crs_loc_btn_new_assignment'),
514 $this->ctrl->getLinkTarget($this,
'testAssignment')
520 $this->
tabs->activateSubTab(
'itests');
524 $this->
tabs->activateSubTab(
'qtests');
536 $data_retrieval->parseMultipleAssignments(
552 $table->handleCommands();
553 $this->tpl->setContent($table->getHTML());
560 $this->
logger->debug(
': Show new assignment screen because of : ' . $ex->getMessage());
590 $this->
tabs->activateSubTab(
'itest');
594 $this->
tabs->activateSubTab(
'qtest');
612 $data_retrieval->parseSingleAssignment(
627 $table->handleCommands();
628 $this->tpl->setContent($table->getHTML());
635 $this->
logger->debug(
': Show new assignment screen because of : ' . $ex->getMessage());
661 $this->
tabs->activateSubTab(
'itests');
665 $this->
tabs->activateSubTab(
'qtests');
670 $form = $form_helper->initForm(
true);
672 $this->tpl->setContent($form->getHTML());
686 $this->
tabs->activateSubTab(
'itest');
690 $this->
tabs->activateSubTab(
'qtest');
696 $form = $form_helper->initForm(
false);
698 $this->tpl->setContent($form->getHTML());
721 $form = $form_helper->initForm(
true);
723 if ($form->checkInput()) {
724 $mode = $form->getInput(
'mode');
726 if ($mode == self::TEST_NEW) {
728 $tst->setType(
'tst');
729 $tst->setTitle($form->getInput(
'title'));
730 $tst->setDescription($form->getInput(
'desc'));
733 $tst->createReference();
736 $general_settings = $tst->getMainSettings()->getGeneralSettings()->withQuestionSetType($form->getInput(
'qtype'));
737 $tst->getMainSettingsRepository()->store(
738 $tst->getMainSettings()->withGeneralSettings($general_settings)
743 $assignment->setAssignmentType($this->
getTestType());
744 $assignment->setObjectiveId((
int) $form->getInput(
'objective'));
745 $assignment->setTestRefId($tst->getRefId());
750 $assignment->setAssignmentType($this->
getTestType());
751 $assignment->setObjectiveId((
int) $form->getInput(
'objective'));
752 $assignment->setTestRefId((
int) $form->getInput(
'tst'));
755 $tst =
new ilObjTest((
int) $form->getInput(
'tst'),
true);
765 $this->main_tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'settings_saved'));
766 $this->
ctrl->redirect($this,
'testsOverview');
770 $this->main_tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'err_check_input'));
771 $form->setValuesByPost();
779 foreach ($materials->getMaterials() as $material) {
780 if ($material[
'ref_id'] == $test->
getRefId()) {
781 $materials->delete($material[
'lm_ass_id']);
795 $form = $form_helper->initForm(
false);
797 if ($form->checkInput()) {
798 $mode = $form->getInput(
'mode');
800 if ($mode == self::TEST_NEW) {
802 $tst->setType(
'tst');
803 $tst->setTitle($form->getInput(
'title'));
804 $tst->setDescription($form->getInput(
'desc'));
807 $tst->createReference();
810 $general_settings = $tst->getMainSettings()->getGeneralSettings()->withQuestionSetType($form->getInput(
'qtype'));
811 $tst->getMainSettingsRepository()->store(
812 $tst->getMainSettings()->withGeneralSettings($general_settings)
816 $this->
getSettings()->setInitialTest($tst->getRefId());
818 $this->
getSettings()->setQualifiedTest($tst->getRefId());
823 $this->
getSettings()->setInitialTest((
int) $form->getInput(
'tst'));
825 $this->
getSettings()->setQualifiedTest((
int) $form->getInput(
'tst'));
839 $this->main_tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'settings_saved'));
840 $this->
ctrl->redirect($this,
'testOverview');
844 $this->main_tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'err_check_input'));
845 $form->setValuesByPost();
852 $this->
tabs->activateSubTab(
'objectives');
865 $this->
lng->txt(
'crs_add_objective'),
866 $this->ctrl->getLinkTargetByClass(
'ilcourseobjectivesgui',
"create")
870 $table->setTitle($this->
lng->txt(
'crs_objectives'),
'', $this->lng->txt(
'crs_objectives'));
872 $this->tpl->setContent($table->getHTML());
879 $this->
tabs->activateSubTab(
'objectives');
883 $this->tpl->setContent($form->getHTML());
890 $form->setTitle($this->
lng->txt(
'crs_loc_form_create_objectives'));
891 $form->setFormAction($this->
ctrl->getFormAction($this));
894 $txt->setValues(array(0 =>
''));
895 $txt->setRequired(
true);
896 $form->addItem($txt);
898 $form->addCommandButton(
'saveObjectiveCreation', $this->
lng->txt(
'save'));
905 if ($form->checkInput()) {
906 foreach ((array) $form->getInput(
'objectives') as $title) {
908 $obj->setActive(
true);
909 $obj->setTitle($title);
912 $this->main_tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'settings_saved'),
true);
913 $this->
ctrl->redirect($this,
'');
916 $form->setValuesByPost();
917 $this->
tabs->activateSubTab(
'objectives');
924 $post_position = $this->
http->wrapper()->post()->retrieve(
926 $this->
refinery->kindlyTo()->dictOf(
927 $this->refinery->kindlyTo()->string()
930 asort($post_position, SORT_NUMERIC);
932 foreach ($post_position as $objective_id => $position) {
934 $objective->writePosition(
$counter++);
936 $this->main_tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'crs_objective_saved_sorting'));
942 $this->
tabs->activateSubTab(
'objectives');
945 $confirm->setFormAction($this->
ctrl->getFormAction($this));
946 $confirm->setHeaderText($this->
lng->txt(
'crs_delete_objectve_sure'));
947 $confirm->setConfirm($this->
lng->txt(
'delete'),
'deleteObjectives');
948 $confirm->setCancel($this->
lng->txt(
'cancel'),
'listObjectives');
951 if ($this->
http->wrapper()->post()->has(
'objective')) {
952 $objective_ids = $this->
http->wrapper()->post()->retrieve(
954 $this->
refinery->kindlyTo()->dictOf(
955 $this->refinery->kindlyTo()->int()
959 foreach ($objective_ids as $objective_id) {
961 $name = $obj->getTitle();
965 (
string) $objective_id,
969 $this->tpl->setContent($confirm->getHTML());
979 if (in_array($objective_id, $enabled)) {
980 $objective->setActive(
true);
981 $objective->update();
985 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'settings_saved'),
true);
986 $this->
ctrl->redirect($this,
'listObjectives');
995 if (in_array($objective_id, $disabled)) {
996 $objective->setActive(
false);
997 $objective->update();
1001 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'settings_saved'),
true);
1002 $this->
ctrl->redirect($this,
'listObjectives');
1007 $objective_ids = [];
1008 if ($this->
http->wrapper()->post()->has(
'objective_ids')) {
1009 $objective_ids = $this->
http->wrapper()->post()->retrieve(
1011 $this->
refinery->kindlyTo()->dictOf(
1012 $this->refinery->kindlyTo()->int()
1016 foreach ($objective_ids as $objective_id) {
1018 $objective_obj->delete();
1021 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'crs_objectives_deleted'),
true);
1022 $this->
ctrl->redirect($this,
'listObjectives');
1028 $status->setSection($a_section);
1029 $status->setCmdClass($this);
1030 $this->tpl->setRightContent($status->getHTML());
1033 protected function setTabs(
string $a_section =
''): void
1036 $this->
tabs->addSubTab(
1038 $this->
lng->txt(
'settings'),
1039 $this->ctrl->getLinkTarget($this,
'settings')
1042 $this->
tabs->addSubTab(
1044 $this->
lng->txt(
'crs_loc_tab_objectives'),
1045 $this->ctrl->getLinkTarget($this,
'listObjectives')
1056 $this->
tabs->addSubTab(
1058 $this->
lng->txt(
'crs_loc_tab_itest'),
1059 $this->ctrl->getLinkTarget($this,
'testOverview')
1063 $this->
tabs->addSubTab(
1065 $this->
lng->txt(
'crs_loc_tab_itests'),
1066 $this->ctrl->getLinkTarget($this,
'testsOverview')
1073 $this->
tabs->addSubTab(
1075 $this->
lng->txt(
'crs_loc_tab_qtest'),
1076 $this->ctrl->getLinkTarget($this,
'testOverview')
1080 $this->
tabs->addSubTab(
1082 $this->
lng->txt(
'crs_loc_tab_qtests'),
1083 $this->ctrl->getLinkTarget($this,
'testsOverview')
1088 $this->
tabs->addSubTab(
1090 $this->
lng->txt(
'crs_loc_tab_start'),
1091 $this->ctrl->getLinkTargetByClass(
'ilcontainerstartobjectsgui',
'')
1096 #ilMemberViewGUI::showMemberViewSwitch($this->getParentObject()->getRefId());
Provides fluid interface to RBAC services.
External facade for object content styles.
class ilConditionHandlerGUI
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilContainerStartObjectsGUI.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
class ilCourseObjectiveMaterials
static lookupObjectiveTitle(int $a_objective_id, bool $a_add_description=false)
static _getObjectiveIds(int $course_id, bool $a_activated_only=false)
class ilobjcourseobjectivesgui
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
testOverview()
Show test overview.
showObjectiveCreation(?ilPropertyFormGUI $form=null)
showStatus(int $a_section)
updateTestAssignments(ilLOSettings $settings)
saveMultiTestAssignment()
ilGlobalTemplateInterface $tpl
const int TEST_TYPE_UNDEFINED
ilUIServices $ui_services
initSimpleObjectiveForm()
settings(?ilPropertyFormGUI $form=null)
ObjectFacade $content_style_domain
__construct(ilObjCourseGUI $parent_gui)
initObjectiveIdsFromPost()
initSettingsForm()
Init settings form.
testSettings(?ilPropertyFormGUI $form=null)
updateMaterialAssignments(ilObjTest $test)
ilGlobalTemplateInterface $main_tpl
ilObjCourseGUI $parent_gui
initObjectiveIdFromQuery()
deleteAssignments(int $a_type)
testAssignment(?ilPropertyFormGUI $form=null)
setTabs(string $a_section='')
Presentation of the status of single steps during the configuration process.
const SECTION_OBJECTIVES_NEW
static getInstance(ilObject $a_parent)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
(Course) learning objective page GUI class
(Course) learning objective page object
const TYPE_INITIAL_QUALIFYING_ALL
const TYPE_TEST_QUALIFIED
const TYPE_INITIAL_PLACEMENT_SELECTED
static getInstanceByObjId(int $a_obj_id)
const HIDE_PASSED_OBJECTIVE_QST
setQualifyingTestAsStart(bool $a_type)
setQualifyingTestType(int $a_type)
const TYPE_QUALIFYING_ALL
const TYPE_INITIAL_PLACEMENT_ALL
worksWithStartObjects()
Check if start objects are enabled.
getTestByType(int $a_type)
const MARK_PASSED_OBJECTIVE_QST
resetResults(bool $a_status)
worksWithInitialTest()
Check if the loc is configured for initial tests.
setInitialTest(int $a_id)
setQualifiedTest(int $a_id)
const TYPE_QUALIFYING_SELECTED
const TYPE_TEST_UNDEFINED
const TYPE_INITIAL_QUALIFYING_SELECTED
setInitialTestType(int $a_type)
setInitialTestAsStart(bool $a_type)
setPassedObjectiveMode(int $a_mode)
Class ilLOTestAssignmentTableGUI.
const int TYPE_MULTIPLE_ASSIGNMENTS
const int TYPE_SINGLE_ASSIGNMENTS
static getInstance(int $a_container_id)
static _refreshStatus(int $a_obj_id, ?array $a_users=null)
Component logger with individual log levels by component id.
static getContentStylePath(int $a_style_id, bool $add_random=true, bool $add_token=true)
get content style path static (to avoid full reading)
Class ilObject Basic functions for all objects.
static _exists(string $a_parent_type, int $a_id, string $a_lang="", bool $a_no_cache=false)
Checks whether page exists.
This class represents an option in a radio group.
static set(string $a_var, $a_val)
Set a value.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class represents a text wizard property in a property form.
Interface GlobalHttpState.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static http()
Fetches the global http state from ILIAS.