27 include_once
'./Modules/Course/classes/Objectives/class.ilLOSettings.php';
78 include_once
'./Modules/Course/classes/class.ilCourseObjective.php';
88 $ilTabs = $DIC[
'ilTabs'];
91 $this->ctrl->saveParameter($this, array(
"ref_id"));
93 $this->logger =
$GLOBALS[
'DIC']->logger()->crs();
96 $this->lng->loadLanguageModule(
'crs');
99 $this->tabs_gui = $ilTabs;
101 $this->course_id = $a_course_id;
116 $ilTabs = $DIC[
'ilTabs'];
118 $ilTabs->setTabActive(
'crs_objectives');
120 $cmd = $this->ctrl->getCmd();
123 if (!$cmd = $this->ctrl->getCmd()) {
153 $ilAccess = $DIC[
'ilAccess'];
155 $ilObjDataCache = $DIC[
'ilObjDataCache'];
156 $ilToolbar = $DIC[
'ilToolbar'];
158 $_SESSION[
'objective_mode'] = self::MODE_UNDEFINED;
159 if (!$ilAccess->checkAccess(
"write",
'', $this->course_obj->getRefId())) {
160 $this->ilErr->raiseError($this->lng->txt(
"msg_no_perm_write"), $this->ilErr->MESSAGE);
163 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.crs_objectives.html',
'Modules/Course');
165 $ilToolbar->addButton(
166 $this->lng->txt(
'crs_add_objective'),
167 $this->ctrl->getLinkTarget($this,
"'create")
170 include_once(
'./Modules/Course/classes/class.ilCourseObjectivesTableGUI.php');
172 $table->setTitle($this->lng->txt(
'crs_objectives'),
'', $this->lng->txt(
'crs_objectives'));
175 $this->tpl->setVariable(
'OBJECTIVES_TABLE', $table->getHTML());
188 $ilAccess = $DIC[
'ilAccess'];
190 $ilObjDataCache = $DIC[
'ilObjDataCache'];
192 if (!$ilAccess->checkAccess(
"write",
'', $this->course_obj->getRefId())) {
193 $this->ilErr->raiseError($this->lng->txt(
"msg_no_perm_write"), $this->ilErr->MESSAGE);
196 asort(
$_POST[
'position'], SORT_NUMERIC);
199 foreach (
$_POST[
'position'] as $objective_id => $position) {
201 $objective->writePosition($counter++);
203 ilUtil::sendSuccess($this->lng->txt(
'crs_objective_saved_sorting'));
211 $rbacsystem = $DIC[
'rbacsystem'];
214 if (!$rbacsystem->checkAccess(
"write", $this->course_obj->getRefId())) {
215 $this->
ilias->raiseError($this->lng->txt(
"msg_no_perm_write"), $this->ilErr->MESSAGE);
217 if (!count(
$_POST[
'objective'])) {
224 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.crs_objectives.html",
'Modules/Course');
229 $tpl->addBlockfile(
"TBL_CONTENT",
"tbl_content",
"tpl.crs_objectives_delete_row.html",
'Modules/Course');
232 foreach (
$_POST[
'objective'] as $objective_id) {
235 $tpl->setCurrentBlock(
"tbl_content");
237 $tpl->setVariable(
"TITLE", $objective_obj->getTitle());
238 $tpl->setVariable(
"DESCRIPTION", $objective_obj->getDescription());
239 $tpl->parseCurrentBlock();
242 $tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
245 $tpl->setCurrentBlock(
"tbl_action_btn");
246 $tpl->setVariable(
"BTN_NAME",
'deleteObjectives');
247 $tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
'delete'));
248 $tpl->parseCurrentBlock();
250 $tpl->setCurrentBlock(
"tbl_action_btn");
251 $tpl->setVariable(
"BTN_NAME",
'listObjectives');
252 $tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
'cancel'));
253 $tpl->parseCurrentBlock();
255 $tpl->setCurrentBlock(
"tbl_action_row");
256 $tpl->setVariable(
"COLUMN_COUNTS", 1);
258 $tpl->parseCurrentBlock();
263 $tbl->setStyle(
'table',
'std');
266 $tbl->setTitle($this->lng->txt(
"crs_objectives"),
"", $this->lng->txt(
"crs_objectives"));
268 $tbl->setHeaderNames(array($this->lng->txt(
"title")));
271 array(
"ref_id" => $this->course_obj->getRefId(),
272 "cmdClass" =>
"ilcourseobjectivesgui",
273 "cmdNode" =>
$_GET[
"cmdNode"])
275 $tbl->setColumnWidth(array(
"50%"));
277 $tbl->setLimit(
$_GET[
"limit"]);
278 $tbl->setOffset(
$_GET[
"offset"]);
279 $tbl->setMaxCount(count(
$_POST[
'objective']));
282 $tbl->disable(
"footer");
283 $tbl->disable(
'sort');
286 $tbl->setTemplate($tpl);
289 $this->tpl->setVariable(
"OBJECTIVES_TABLE", $tpl->get());
302 $rbacsystem = $DIC[
'rbacsystem'];
305 if (!$rbacsystem->checkAccess(
"write", $this->course_obj->getRefId())) {
306 $this->
ilias->raiseError($this->lng->txt(
"msg_no_perm_write"), $this->ilErr->MESSAGE);
308 if (!count(
$_SESSION[
'crs_delete_objectives'])) {
315 foreach (
$_SESSION[
'crs_delete_objectives'] as $objective_id) {
317 $objective_obj->delete();
320 ilUtil::sendSuccess($this->lng->txt(
'crs_objectives_deleted'));
336 $ilAccess = $DIC[
'ilAccess'];
338 $ilTabs = $DIC[
'ilTabs'];
340 $ilTabs->setSubTabActive(
'crs_objective_overview_question_assignment');
342 if (!$ilAccess->checkAccess(
'write',
'', $this->course_obj->getRefId())) {
343 $ilErr->raiseError($this->lng->txt(
'permission_denied'),
$ilErr->WARNING);
346 include_once(
'./Modules/Course/classes/class.ilCourseObjectiveQuestionsTableGUI.php');
348 $table->setTitle($this->lng->txt(
'crs_objectives_edit_question_assignments'),
'', $this->lng->txt(
'crs_objectives'));
353 $this->tpl->setContent($table->getHTML());
364 include_once(
'./Modules/Course/classes/class.ilCourseObjectiveQuestion.php');
368 $ilAccess = $DIC[
'ilAccess'];
371 if (!$ilAccess->checkAccess(
'write',
'', $this->course_obj->getRefId())) {
372 $ilErr->raiseError($this->lng->txt(
'permission_denied'),
$ilErr->WARNING);
379 foreach (
$_POST[
'self'] as $objective_id => $limit) {
381 $max_points = $qst->getSelfAssessmentPoints();
383 if ($limit < 0 or $limit > $max_points) {
389 foreach (
$_POST[
'final'] as $objective_id => $limit) {
391 $max_points = $qst->getFinalTestPoints();
393 if ($limit < 0 or $limit > $max_points) {
400 foreach (
$_POST[
'self'] as $objective_id => $limit) {
404 foreach (
$_POST[
'final'] as $objective_id => $limit) {
408 ilUtil::sendSuccess($this->lng->txt(
'settings_saved'));
417 $this->ilErr->raiseError(
"ilCourseObjectivesGUI: cannot create course object", $this->ilErr->MESSAGE);
430 include_once
'./Modules/Course/classes/class.ilCourseObjectiveMaterials.php';
444 include_once
'./Modules/Course/classes/class.ilCourseObjectiveQuestion.php';
447 return $this->objectives_qst_obj;
458 $ilTabs = $DIC[
'ilTabs'];
459 $ilHelp = $DIC[
'ilHelp'];
461 if ($a_active !=
"") {
462 $ilHelp->setScreenIdComponent(
"crs");
463 $ilHelp->setScreenId(
"crs_objective");
464 $ilHelp->setSubScreenId($a_active);
474 $ilTabs->addSubTabTarget(
475 "crs_objective_overview_objectives",
476 $this->ctrl->getLinkTarget($this,
"listObjectives"),
477 array(
"listObjectives",
"moveObjectiveUp",
"moveObjectiveDown",
"listAssignedLM"),
482 include_once(
'./Modules/Course/classes/class.ilCourseObjectiveQuestion.php');
485 $ilTabs->addSubTabTarget(
486 "crs_objective_overview_question_assignment",
487 $this->ctrl->getLinkTarget($this,
"questionOverview"),
488 "editQuestionAssignment",
512 $_SESSION[
'objective_mode'] = self::MODE_CREATE;
514 $this->ctrl->saveParameter($this,
'objective_id');
516 if (!is_object($this->objective)) {
523 $GLOBALS[
'DIC'][
'tpl']->setContent($this->form->getHtml());
524 #$w_tpl->setVariable('WIZ_CONTENT',$this->form->getHtml()); 525 #$tpl->setContent($w_tpl->get()); 540 $_SESSION[
'objective_mode'] = self::MODE_UPDATE;
544 $this->ctrl->setParameter($this,
'objective_id', (
int) $_REQUEST[
'objective_id']);
546 if (!$_REQUEST[
'objective_id']) {
548 $this->ctrl->redirect($this,
'listObjectives');
551 if (!is_object($this->objective)) {
552 $this->objective =
new ilCourseObjective($this->course_obj, (
int) $_REQUEST[
'objective_id']);
558 $GLOBALS[
'DIC'][
'tpl']->setContent($this->form->getHtml());
559 #$w_tpl->setVariable('WIZ_CONTENT',$this->form->getHtml()); 560 #$tpl->setContent($w_tpl->get()); 573 $ilAccess = $DIC[
'ilAccess'];
576 if (!$ilAccess->checkAccess(
'write',
'', $this->course_obj->getRefId())) {
577 $ilErr->raiseError($this->lng->txt(
'permission_denied'),
$ilErr->WARNING);
580 $this->ctrl->saveParameter($this,
'objective_id');
582 $this->objective =
new ilCourseObjective($this->course_obj, (
int) $_REQUEST[
'objective_id']);
584 if ($this->form->checkInput()) {
585 $this->objective->setTitle($this->form->getInput(
'title'));
586 $this->objective->setDescription($this->form->getInput(
'description'));
587 $this->objective->setPasses(0);
589 if (!
$_GET[
'objective_id']) {
590 $objective_id = $this->objective->add();
591 ilUtil::sendSuccess($this->lng->txt(
'crs_added_objective'),
true);
593 $this->objective->update();
594 ilUtil::sendSuccess($this->lng->txt(
'crs_objective_modified'),
true);
595 $objective_id =
$_GET[
'objective_id'];
598 if ((
int)
$_GET[
'objective_id']) {
599 $this->form->setValuesByPost();
600 return $this->
edit();
602 $this->form->setValuesByPost();
607 if (
$_SESSION[
'objective_mode'] != self::MODE_CREATE) {
608 $this->ctrl->returnToParent($this);
611 $this->ctrl->setParameter($this,
'objective_id', $objective_id);
612 $this->ctrl->redirect($this,
'materialAssignment');
626 $ilAccess = $DIC[
'ilAccess'];
630 if (!$ilAccess->checkAccess(
'write',
'', $this->course_obj->getRefId())) {
631 $ilErr->raiseError($this->lng->txt(
'permission_denied'),
$ilErr->WARNING);
633 if (!
$_GET[
'objective_id']) {
635 $this->ctrl->redirect($this,
'listObjectives');
640 $this->ctrl->saveParameter($this,
'objective_id');
644 include_once(
'./Modules/Course/classes/class.ilCourseObjectiveMaterialAssignmentTableGUI.php');
647 $this->lng->txt(
'crs_objective_wiz_materials'),
649 $this->lng->txt(
'crs_objectives')
652 include_once(
'Modules/Course/classes/class.ilCourseObjectiveMaterials.php');
656 $this->
initWizard(self::STEP_MATERIAL_ASSIGNMENT);
657 $GLOBALS[
'DIC'][
'tpl']->setContent($table->getHTML());
671 $ilAccess = $DIC[
'ilAccess'];
673 $ilObjDataCache = $DIC[
'ilObjDataCache'];
675 if (!$ilAccess->checkAccess(
'write',
'', $this->course_obj->getRefId())) {
676 $ilErr->raiseError($this->lng->txt(
'permission_denied'),
$ilErr->WARNING);
678 if (!
$_GET[
'objective_id']) {
680 $this->ctrl->redirect($this,
'listObjectives');
684 $this->objectives_lm_obj->deleteAll();
686 if (is_array(
$_POST[
'materials'])) {
687 foreach (
$_POST[
'materials'] as $node_id) {
688 $obj_id = $ilObjDataCache->lookupObjId($node_id);
689 $type = $ilObjDataCache->lookupType($obj_id);
691 $this->objectives_lm_obj->setLMRefId($node_id);
692 $this->objectives_lm_obj->setLMObjId($obj_id);
693 $this->objectives_lm_obj->setType(
$type);
694 $this->objectives_lm_obj->add();
697 if (is_array(
$_POST[
'chapters'])) {
698 foreach (
$_POST[
'chapters'] as $chapter) {
699 include_once(
'./Modules/LearningModule/classes/class.ilLMObject.php');
701 list($ref_id, $chapter_id) = explode(
'_', $chapter);
703 $this->objectives_lm_obj->setLMRefId($ref_id);
704 $this->objectives_lm_obj->setLMObjId($chapter_id);
706 $this->objectives_lm_obj->add();
709 ilUtil::sendSuccess($this->lng->txt(
'crs_objectives_assigned_lm'));
712 if (
$_SESSION[
'objective_mode'] != self::MODE_CREATE) {
713 ilUtil::sendSuccess($this->lng->txt(
'crs_objectives_assigned_lm'),
true);
714 $this->ctrl->returnToParent($this);
718 if ($this->
getSettings()->worksWithInitialTest()) {
736 $ilAccess = $DIC[
'ilAccess'];
740 if (!$ilAccess->checkAccess(
'write',
'', $this->course_obj->getRefId())) {
741 $ilErr->raiseError($this->lng->txt(
'permission_denied'),
$ilErr->WARNING);
743 if (!
$_GET[
'objective_id']) {
745 $this->ctrl->redirect($this,
'listObjectives');
750 $this->ctrl->saveParameter($this,
'objective_id');
762 include_once(
'./Modules/Course/classes/class.ilCourseObjectiveQuestionAssignmentTableGUI.php');
766 (
int) $_GET[
'objective_id'],
770 $this->lng->txt(
'crs_objective_wiz_self'),
772 $this->lng->txt(
'crs_objective')
777 $this->
initWizard(self::STEP_INITIAL_TEST_ASSIGNMENT);
778 $GLOBALS[
'DIC'][
'tpl']->setContent($table->getHTML());
792 $ilAccess = $DIC[
'ilAccess'];
794 $ilObjDataCache = $DIC[
'ilObjDataCache'];
796 $checked_questions =
$_POST[
'questions'] ?
$_POST[
'questions'] : array();
799 if (!$ilAccess->checkAccess(
'write',
'', $this->course_obj->getRefId())) {
800 $ilErr->raiseError($this->lng->txt(
'permission_denied'),
$ilErr->WARNING);
802 if (!
$_GET[
'objective_id']) {
804 $this->ctrl->redirect($this,
'listObjectives');
810 foreach ($this->objectives_qst_obj->getSelfAssessmentQuestions() as $question) {
811 $id = $question[
'ref_id'] .
'_' . $question[
'question_id'];
812 if (!in_array($id, $checked_questions)) {
813 $this->objectives_qst_obj->delete($question[
'qst_ass_id']);
817 foreach ($checked_questions as $question_id) {
818 list($test_ref_id, $qst_id) = explode(
'_', $question_id);
819 $test_obj_id = $ilObjDataCache->lookupObjId($test_ref_id);
821 if ($this->objectives_qst_obj->isSelfAssessmentQuestion($qst_id)) {
825 $this->objectives_qst_obj->setTestRefId($test_ref_id);
826 $this->objectives_qst_obj->setTestObjId($test_obj_id);
827 $this->objectives_qst_obj->setQuestionId($qst_id);
828 $this->objectives_qst_obj->add();
832 include_once
'./Modules/Course/classes/class.ilCourseObjectiveQuestion.php';
837 if ($checked_questions) {
838 ilUtil::sendSuccess($this->lng->txt(
'crs_objectives_assigned_lm'));
843 case self::MODE_CREATE:
847 case self::MODE_UPDATE:
849 ilUtil::sendSuccess($this->lng->txt(
'crs_objectives_assigned_lm'));
866 $ilAccess = $DIC[
'ilAccess'];
870 if (!$ilAccess->checkAccess(
'write',
'', $this->course_obj->getRefId())) {
871 $ilErr->raiseError($this->lng->txt(
'permission_denied'),
$ilErr->WARNING);
873 if (!
$_GET[
'objective_id']) {
875 $this->ctrl->redirect($this,
'listObjectives');
880 $this->ctrl->saveParameter($this,
'objective_id');
884 $this->
initWizard(self::STEP_INITIAL_TEST_LIMIT);
887 $GLOBALS[
'DIC'][
'tpl']->setContent($this->form->getHtml());
888 #$w_tpl->setVariable('WIZ_CONTENT',$this->form->getHtml()); 889 #$tpl->setContent($w_tpl->get()); 903 $ilAccess = $DIC[
'ilAccess'];
905 $ilObjDataCache = $DIC[
'ilObjDataCache'];
907 if (!$ilAccess->checkAccess(
'write',
'', $this->course_obj->getRefId())) {
908 $ilErr->raiseError($this->lng->txt(
'permission_denied'),
$ilErr->WARNING);
910 if (!
$_GET[
'objective_id']) {
912 $this->ctrl->redirect($this,
'listObjectives');
917 if ((
int)
$_POST[
'limit'] < 1 or (
int)
$_POST[
'limit'] > 100) {
923 foreach ($this->objectives_qst_obj->getSelfAssessmentTests() as
$test) {
925 $this->objectives_qst_obj->setTestSuggestedLimit((
int)
$_POST[
'limit']);
926 $this->objectives_qst_obj->updateTest(
$test[
'test_objective_id']);
929 ilUtil::sendSuccess($this->lng->txt(
'settings_saved'),
true);
930 $this->ctrl->returnToParent($this);
945 $ilAccess = $DIC[
'ilAccess'];
949 if (!$ilAccess->checkAccess(
'write',
'', $this->course_obj->getRefId())) {
950 $ilErr->raiseError($this->lng->txt(
'permission_denied'),
$ilErr->WARNING);
952 if (!
$_GET[
'objective_id']) {
954 $this->ctrl->redirect($this,
'listObjectives');
959 $this->ctrl->saveParameter($this,
'objective_id');
970 include_once(
'./Modules/Course/classes/class.ilCourseObjectiveQuestionAssignmentTableGUI.php');
974 (
int) $_GET[
'objective_id'],
979 $this->lng->txt(
'crs_objective_wiz_final'),
981 $this->lng->txt(
'crs_objective')
986 $this->
initWizard(self::STEP_FINAL_TEST_ASSIGNMENT);
987 $GLOBALS[
'DIC'][
'tpl']->setContent($table->getHTML());
997 $tst_ref_id = $this->
getSettings()->getTestByType($a_tst_type);
1001 include_once
'./Modules/Test/classes/class.ilObjTest.php';
1011 $this->ctrl->saveParameter($this,
'objective_id');
1012 $this->ctrl->setParameter($this,
'tt', (
int) $_REQUEST[
'tt']);
1014 $this->test_type = (int) $_REQUEST[
'tt'];
1024 $this->
initWizard(self::STEP_FINAL_TEST_ASSIGNMENT);
1025 $GLOBALS[
'DIC'][
'tpl']->setContent($form->getHTML());
1033 include_once
'./Services/Form/classes/class.ilPropertyFormGUI.php';
1035 $form->setFormAction($this->ctrl->getFormAction($this));
1038 $form->setTitle($this->lng->txt(
'crs_loc_form_random_limits_it'));
1040 $form->setTitle($this->lng->txt(
'crs_loc_form_random_limits_qt'));
1043 $form->addCommandButton(
'saveRandom', $this->lng->txt(
'save'));
1047 $options->setRequired(
true);
1049 $ass_qpl =
new ilRadioOption($this->lng->txt(
'crs_loc_rand_assign_qpl'), 1);
1050 $options->addOption($ass_qpl);
1053 $qpl->setRequired(
true);
1054 $qpl->setMulti(
true,
false);
1055 $qpl->setOptions($this->getRandomTestQplOptions());
1058 $this->course_obj->getId(),
1059 (int) $_REQUEST[
'objective_id'],
1064 $qpl->setValue($sequences[0]);
1065 $qpl->setMultiValues($sequences);
1066 $ass_qpl->addSubItem($qpl);
1072 $this->course_obj->getId(),
1073 (int) $_REQUEST[
'objective_id'],
1078 $per->setMinValue(1);
1079 $per->setMaxValue(100);
1080 $per->setRequired(
true);
1081 $ass_qpl->addSubItem($per);
1083 $form->addItem($options);
1088 protected function getRandomTestQplOptions()
1090 include_once
'./Modules/Test/classes/class.ilTestRandomQuestionSetSourcePoolDefinitionFactory.php';
1091 include_once
'./Modules/Test/classes/class.ilTestRandomQuestionSetSourcePoolDefinitionList.php';
1093 $tst_ref_id = $this->
getSettings()->getTestByType($this->test_type);
1109 $list->loadDefinitions();
1111 include_once
'./Modules/Test/classes/class.ilTestTaxonomyFilterLabelTranslater.php';
1113 $translater->loadLabels($list);
1115 $options[0] = $this->lng->txt(
'select_one');
1116 foreach ($list as $definition) {
1118 $title = $definition->getPoolTitle();
1120 $filterTitle = array();
1121 $filterTitle[] = $translater->getTaxonomyFilterLabel($definition->getMappedTaxonomyFilter());
1122 $filterTitle[] = $translater->getTypeFilterLabel($definition->getTypeFilter());
1123 if (!empty($filterTitle)) {
1124 $title .=
' -> ' . implode(
' / ', $filterTitle);
1126 #$tax_id = $definition->getMappedFilterTaxId(); 1129 # $title .= (' -> '. $translater->getTaxonomyTreeLabel($tax_id)); 1131 #$tax_node = $definition->getMappedFilterTaxNodeId(); 1134 # $title .= (' -> ' .$translater->getTaxonomyNodeLabel($tax_node)); 1137 $options[$definition->getId()] = $title;
1147 $this->ctrl->saveParameter($this,
'objective_id');
1148 $this->ctrl->setParameter($this,
'tt', (
int) $_REQUEST[
'tt']);
1150 $this->test_type = (int) $_REQUEST[
'tt'];
1157 if ($form->checkInput()) {
1159 $this->course_obj->getId(),
1160 (int) $_REQUEST[
'objective_id'],
1165 $qst->deleteByTestType(
1170 $ref_id = $this->
getSettings()->getTestByType($this->test_type);
1171 foreach (array_unique((array) $form->getInput(
'qpl')) as $qpl_id) {
1172 include_once
'./Modules/Course/classes/Objectives/class.ilLORandomTestQuestionPools.php';
1174 $this->course_obj->getId(),
1175 (int) $_REQUEST[
'objective_id'],
1179 $rnd->setLimit($form->getInput(
'per'));
1184 $form->setValuesByPost();
1189 ilUtil::sendSuccess($this->lng->txt(
'settings_saved'),
true);
1191 $this->ctrl->returnToParent($this);
1193 $this->ctrl->redirect($this,
'finalTestAssignment');
1208 $ilAccess = $DIC[
'ilAccess'];
1210 $ilObjDataCache = $DIC[
'ilObjDataCache'];
1212 $checked_questions =
$_POST[
'questions'] ?
$_POST[
'questions'] : array();
1215 if (!$ilAccess->checkAccess(
'write',
'', $this->course_obj->getRefId())) {
1216 $ilErr->raiseError($this->lng->txt(
'permission_denied'),
$ilErr->WARNING);
1218 if (!
$_GET[
'objective_id']) {
1220 $this->ctrl->redirect($this,
'listObjectives');
1226 foreach ($this->objectives_qst_obj->getFinalTestQuestions() as $question) {
1227 $id = $question[
'ref_id'] .
'_' . $question[
'question_id'];
1228 if (!in_array($id, $checked_questions)) {
1229 $this->objectives_qst_obj->delete($question[
'qst_ass_id']);
1233 foreach ($checked_questions as $question_id) {
1234 list($test_ref_id, $qst_id) = explode(
'_', $question_id);
1235 $test_obj_id = $ilObjDataCache->lookupObjId($test_ref_id);
1237 if ($this->objectives_qst_obj->isFinalTestQuestion($qst_id)) {
1242 $this->objectives_qst_obj->setTestRefId($test_ref_id);
1243 $this->objectives_qst_obj->setTestObjId($test_obj_id);
1244 $this->objectives_qst_obj->setQuestionId($qst_id);
1245 $this->objectives_qst_obj->add();
1249 include_once
'./Modules/Course/classes/class.ilCourseObjectiveQuestion.php';
1254 ilUtil::sendSuccess($this->lng->txt(
'crs_objectives_assigned_lm'));
1266 $ilAccess = $DIC[
'ilAccess'];
1269 if (!$ilAccess->checkAccess(
'write',
'', $this->course_obj->getRefId())) {
1270 $ilErr->raiseError($this->lng->txt(
'permission_denied'),
$ilErr->WARNING);
1272 if (!
$_GET[
'objective_id']) {
1274 $this->ctrl->returnToParent($this);
1276 $this->ctrl->saveParameter($this,
'objective_id');
1279 $this->
initWizard(self::STEP_FINAL_TEST_LIMIT);
1280 $form = $this->initFormTestAssignment();
1281 $GLOBALS[
'DIC'][
'tpl']->setContent($form->getHtml());
1295 $ilAccess = $DIC[
'ilAccess'];
1299 if (!$ilAccess->checkAccess(
'write',
'', $this->course_obj->getRefId())) {
1300 $ilErr->raiseError($this->lng->txt(
'permission_denied'),
$ilErr->WARNING);
1302 if (!
$_GET[
'objective_id']) {
1304 $this->ctrl->returnToParent($this);
1309 $this->ctrl->saveParameter($this,
'objective_id');
1313 $this->
initWizard(self::STEP_FINAL_TEST_LIMIT);
1316 $GLOBALS[
'DIC'][
'tpl']->setContent($this->form->getHtml());
1330 $ilAccess = $DIC[
'ilAccess'];
1332 $ilObjDataCache = $DIC[
'ilObjDataCache'];
1334 if (!$ilAccess->checkAccess(
'write',
'', $this->course_obj->getRefId())) {
1335 $ilErr->raiseError($this->lng->txt(
'permission_denied'),
$ilErr->WARNING);
1337 if (!
$_GET[
'objective_id']) {
1339 $this->ctrl->redirect($this,
'listObjectives');
1344 if ((
int)
$_POST[
'limit'] < 1 or (
int)
$_POST[
'limit'] > 100) {
1350 foreach ($this->objectives_qst_obj->getFinalTests() as
$test) {
1352 $this->objectives_qst_obj->setTestSuggestedLimit((
int)
$_POST[
'limit']);
1353 $this->objectives_qst_obj->updateTest(
$test[
'test_objective_id']);
1356 if (
$_SESSION[
'objective_mode'] != self::MODE_CREATE) {
1357 ilUtil::sendSuccess($this->lng->txt(
'settings_saved'),
true);
1359 ilUtil::sendSuccess($this->lng->txt(
'crs_added_objective'),
true);
1361 $this->ctrl->returnToParent($this);
1373 if (!is_object($this->form)) {
1374 include_once(
'./Services/Form/classes/class.ilPropertyFormGUI.php');
1377 $this->form->setFormAction($this->ctrl->getFormAction($this));
1378 $this->form->setTableWidth(
'100%');
1382 case 'selfAssessment':
1383 $this->form->setTitle($this->lng->txt(
'crs_objective_wiz_self_limit'));
1384 $this->form->addCommandButton(
'updateSelfAssessmentLimits', $this->lng->txt(
'crs_wiz_next'));
1386 $tests = $this->objectives_qst_obj->getSelfAssessmentTests();
1387 $max_points = $this->objectives_qst_obj->getSelfAssessmentPoints();
1392 $this->form->setTitle($this->lng->txt(
'crs_objective_wiz_final_limit'));
1393 $this->form->addCommandButton(
'updateFinalTestLimits', $this->lng->txt(
'crs_wiz_next'));
1395 $tests = $this->objectives_qst_obj->getFinalTests();
1396 $max_points = $this->objectives_qst_obj->getFinalTestPoints();
1401 $over =
new ilCustomInputGUI($this->lng->txt(
'crs_objective_qst_summary'),
'');
1403 $tpl =
new ilTemplate(
'tpl.crs_objective_qst_summary.html',
true,
true,
'Modules/Course');
1408 foreach ($tests as
$test) {
1409 $GLOBALS[
'DIC'][
'ilLog']->write(__METHOD__ .
': ' . print_r($test,
true));
1411 $limit = $test[
'limit'];
1413 foreach ($this->objectives_qst_obj->getQuestionsOfTest($test[
'obj_id']) as $question) {
1414 $tpl->setCurrentBlock(
'qst');
1415 $tpl->setVariable(
'QST_TITLE', $question[
'title']);
1416 if (strlen($question[
'description'])) {
1417 $tpl->setVariable(
'QST_DESCRIPTION', $question[
'description']);
1419 $tpl->setVariable(
'QST_POINTS', $question[
'points'] .
' ' .
1420 $this->lng->txt(
'crs_objective_points'));
1421 $tpl->parseCurrentBlock();
1423 $tpl->setCurrentBlock(
'tst');
1426 $tpl->setVariable(
'TST_DESC', $desc);
1429 $tpl->setVariable(
'TST_ALT_IMG', $this->lng->txt(
'obj_tst'));
1430 $tpl->parseCurrentBlock();
1433 $tpl->setVariable(
'TXT_ALL_POINTS', $this->lng->txt(
'crs_objective_all_points'));
1434 $tpl->setVariable(
'TXT_POINTS', $this->lng->txt(
'crs_objective_points'));
1435 $tpl->setVariable(
'POINTS', $max_points);
1438 $this->form->addItem($over);
1442 $req->setValue($limit);
1444 $req->setMinValue(1);
1445 $req->setMaxValue(100);
1446 $req->setRequired(
true);
1448 case 'selfAssessment':
1449 $req->setInfo($this->lng->txt(
'crs_obj_initial_req_info'));
1453 $req->setInfo($this->lng->txt(
'crs_obj_final_req_info'));
1456 $this->form->addItem(
$req);
1468 include_once(
'./Services/Form/classes/class.ilPropertyFormGUI.php');
1473 $this->form =
new ilPropertyFormGUI();
1474 $this->form->setFormAction($this->ctrl->getFormAction($this));
1479 $this->form->setTitle($this->lng->txt(
'crs_objective_wiz_title'));
1480 $this->form->addCommandButton(
'save', $this->lng->txt(
'crs_wiz_next'));
1482 #$this->form->addCommandButton('listObjectives',$this->lng->txt('cancel')); 1491 $title->setValue($this->objective->getTitle());
1492 $title->setRequired(
true);
1493 $title->setSize(40);
1494 $title->setMaxLength(70);
1495 $this->form->addItem($title);
1498 $desc->
setValue($this->objective->getDescription());
1501 $this->form->addItem($desc);
1515 $step_positions = [];
1517 $workflow = $DIC->ui()->factory()->listing()->workflow();
1520 $title = $this->lng->txt(
'crs_objective_wiz_title');
1521 $link = $this->ctrl->getLinkTarget($this,
'edit');
1523 $steps[] = $workflow->step($title,
"", $link);
1524 $step_positions[self::STEP_SETTINGS] = count(
$steps) - 1;
1527 $title = $this->lng->txt(
'crs_objective_wiz_materials');
1528 $link = $this->ctrl->getLinkTarget($this,
'materialAssignment');
1529 $steps[] = $workflow->step($title,
"", $link);
1530 $step_positions[self::STEP_MATERIAL_ASSIGNMENT] = count(
$steps) - 1;
1535 $title = $this->lng->txt(
'crs_objective_wiz_self');
1536 $link = $this->
getSettings()->worksWithInitialTest()
1537 ? $this->ctrl->getLinkTarget($this,
'selfAssessmentAssignment')
1540 $steps[] = $workflow->step($title,
"", $link)
1541 ->withAvailability($link == null ? Step::NOT_AVAILABLE : Step::AVAILABLE);
1542 $step_positions[self::STEP_INITIAL_TEST_ASSIGNMENT] = count(
$steps) - 1;
1546 $title = $this->lng->txt(
'crs_objective_wiz_self_limit');
1547 $link = count($this->objectives_qst_obj->getSelfAssessmentQuestions())
1549 ? $this->ctrl->getLinkTarget($this,
'selfAssessmentLimits')
1551 $steps[] = $workflow->step($title,
"", $link)
1552 ->withAvailability($link == null ? Step::NOT_AVAILABLE : Step::AVAILABLE);
1553 $step_positions[self::STEP_INITIAL_TEST_LIMIT] = count(
$steps) - 1;
1557 if (!$this->
getSettings()->hasSeparateQualifiedTests()) {
1559 $title = $this->lng->txt(
'crs_objective_wiz_final');
1560 $link = $this->ctrl->getLinkTarget($this,
'finalTestAssignment');
1561 $steps[] = $workflow->step($title,
"", $link);
1562 $step_positions[self::STEP_FINAL_TEST_ASSIGNMENT] = count(
$steps) - 1;
1566 $title = $this->lng->txt(
'crs_objective_wiz_final_limit');
1567 $link = count($this->objectives_qst_obj->getFinalTestQuestions())
1568 ? $this->ctrl->getLinkTarget($this,
'finalTestLimits')
1570 $steps[] = $workflow->step($title,
"", $link)
1571 ->withAvailability($link == null ? Step::NOT_AVAILABLE : Step::AVAILABLE);
1572 $step_positions[self::STEP_FINAL_TEST_LIMIT] = count(
$steps) - 1;
1576 $list = $workflow->linear(
1577 $this->lng->txt(
'crs_checklist_objective'),
1580 if(!empty($step_positions[$active_step])) {
1581 $list = $list->withActive($step_positions[$active_step]);
1584 $renderer = $DIC->ui()->renderer();
1586 $DIC[
"tpl"]->setRightContent($renderer->render($list));
initFormRandom()
show random test
saveQuestionOverview()
update question overview
materialAssignment()
material assignment
static getInstanceByObjId($a_obj_id)
get singleton instance
selfAssessmentAssignment()
self assessment assignemnt
This class represents an option in a radio group.
initWizard(int $active_step)
init wizard protected
__construct($a_course_id)
Constructor.
initFormTitle($a_mode, $a_step_number)
init form title
static _lookupType($a_obj_id, $a_lm_id=0)
Lookup type.
const TYPE_SELF_ASSESSMENT
updateMaterialAssignment()
update material assignment
listObjectives()
list objectives
updateSelfAssessmentLimits()
update self assessment limits
questionOverview()
question overiew
static _lookupRandomTest($a_obj_id)
Returns the fact wether the test with passed obj id is a random questions test or not...
static deleteForObjectiveAndTestType($a_course_id, $a_objective_id, $a_tst_type)
Delete assignment for objective id and test type.
saveRandom()
Save random test settings.
updateFinalTestLimits()
update self assessment limits
const STEP_MATERIAL_ASSIGNMENT
const STEP_INITIAL_TEST_ASSIGNMENT
setValue($a_value)
Set Value.
static _getObjectiveIds($course_id, $a_activated_only=false)
executeCommand()
execute command
finalTestLimits()
self assessment limits
static _lookupTitle($a_id)
lookup object title
TableGUI for material assignments of course objectives.
static getTypeIconPath($a_type, $a_obj_id, $a_size='small')
Get type icon path path Return image path for icon_xxx.pngs Or (if enabled) path to custom icon Depre...
isRandomTestType($a_tst_type=0)
static _hasTests($a_course_id)
public
__initQuestionObject($a_objective_id=0)
showRandomTestAssignment(ilPropertyFormGUI $form=null)
finalTestAssignment()
final test assignment
updateFinalTestAssignment()
update self assessment assignment
class ilCourseObjectiveMaterials
updateSelfAssessmentAssignment()
update self assessment assignment
class ilobjcourseobjectivesgui
finalSeparatedTestAssignment(ilPropertyFormGUI $form=null)
Show test assignment form.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static _lookupDescription($a_id)
lookup object description
static _lookupObjId($a_id)
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
redirection script todo: (a better solution should control the processing via a xml file) ...
setSubTabs($a_active="")
set sub tabs
const STEP_INITIAL_TEST_LIMIT
static sendQuestion($a_info="", $a_keep=false)
Send Question to Screen.
initFormLimits($a_mode)
init limit form
static lookupSequencesByType($a_container_id, $a_objective_id, $a_test_id, $a_test_type)
Lookup sequence ids type $ilDB.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
getSettings()
Get settings.
const STEP_FINAL_TEST_LIMIT
static _getAssignableMaterials($a_container_id)
Get an array of course material ids that can be assigned to learning objectives No tst...
const STEP_FINAL_TEST_ASSIGNMENT
saveSorting()
save position
This class represents a text area property in a property form.
static switchColor($a_num, $a_css1, $a_css2)
switches style sheets for each even $a_num (used for changing colors of different result rows) ...
static _updateTestLimits($a_objective_id, $a_status, $a_limit)
update test limits
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
const TYPE_TEST_QUALIFIED
static lookupLimit($a_container_id, $a_objective_id, $a_test_type)
lookup limit type $ilDB
__initLMObject($a_objective_id=0)
TableGUI for question assignments of course objectives.
class ilcourseobjectiveQuestion
__initObjectivesObject($a_id=0)
selfAssessmentLimits()
self assessment limits
static _getAssignableTests($a_container_ref_id)
Get assignable tests.