27 include_once
'./Modules/Course/classes/Objectives/class.ilLOSettings.php';
83 include_once
'./Modules/Course/classes/class.ilCourseObjective.php';
87 $ilCtrl = $DIC[
'ilCtrl'];
93 $ilTabs = $DIC[
'ilTabs'];
95 $this->ctrl = $ilCtrl;
96 $this->ctrl->saveParameter($this, array(
"ref_id"));
98 $this->logger =
$GLOBALS[
'DIC']->logger()->crs();
101 $this->lng->loadLanguageModule(
'crs');
104 $this->tabs_gui = $ilTabs;
106 $this->course_id = $a_course_id;
121 $ilTabs = $DIC[
'ilTabs'];
123 $ilTabs->setTabActive(
'crs_objectives');
125 $cmd = $this->ctrl->getCmd();
128 if (!$cmd = $this->ctrl->getCmd()) {
158 $ilAccess = $DIC[
'ilAccess'];
160 $ilObjDataCache = $DIC[
'ilObjDataCache'];
161 $ilToolbar = $DIC[
'ilToolbar'];
163 $_SESSION[
'objective_mode'] = self::MODE_UNDEFINED;
164 if (!$ilAccess->checkAccess(
"write",
'', $this->course_obj->getRefId())) {
165 $this->ilErr->raiseError($this->lng->txt(
"msg_no_perm_write"), $this->ilErr->MESSAGE);
168 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.crs_objectives.html',
'Modules/Course');
170 $ilToolbar->addButton(
171 $this->lng->txt(
'crs_add_objective'),
172 $this->ctrl->getLinkTarget($this,
"'create")
175 include_once(
'./Modules/Course/classes/class.ilCourseObjectivesTableGUI.php');
177 $table->setTitle($this->lng->txt(
'crs_objectives'),
'', $this->lng->txt(
'crs_objectives'));
180 $this->tpl->setVariable(
'OBJECTIVES_TABLE', $table->getHTML());
193 $ilAccess = $DIC[
'ilAccess'];
195 $ilObjDataCache = $DIC[
'ilObjDataCache'];
197 if (!$ilAccess->checkAccess(
"write",
'', $this->course_obj->getRefId())) {
198 $this->ilErr->raiseError($this->lng->txt(
"msg_no_perm_write"), $this->ilErr->MESSAGE);
201 asort(
$_POST[
'position'], SORT_NUMERIC);
204 foreach (
$_POST[
'position'] as $objective_id => $position) {
206 $objective->writePosition($counter++);
208 ilUtil::sendSuccess($this->lng->txt(
'crs_objective_saved_sorting'));
216 $rbacsystem = $DIC[
'rbacsystem'];
219 if (!$rbacsystem->checkAccess(
"write", $this->course_obj->getRefId())) {
220 $this->
ilias->raiseError($this->lng->txt(
"msg_no_perm_write"), $this->ilErr->MESSAGE);
222 if (!count(
$_POST[
'objective'])) {
229 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.crs_objectives.html",
'Modules/Course');
234 $tpl->addBlockfile(
"TBL_CONTENT",
"tbl_content",
"tpl.crs_objectives_delete_row.html",
'Modules/Course');
237 foreach (
$_POST[
'objective'] as $objective_id) {
240 $tpl->setCurrentBlock(
"tbl_content");
242 $tpl->setVariable(
"TITLE", $objective_obj->getTitle());
243 $tpl->setVariable(
"DESCRIPTION", $objective_obj->getDescription());
244 $tpl->parseCurrentBlock();
247 $tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
250 $tpl->setCurrentBlock(
"tbl_action_btn");
251 $tpl->setVariable(
"BTN_NAME",
'deleteObjectives');
252 $tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
'delete'));
253 $tpl->parseCurrentBlock();
255 $tpl->setCurrentBlock(
"tbl_action_btn");
256 $tpl->setVariable(
"BTN_NAME",
'listObjectives');
257 $tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
'cancel'));
258 $tpl->parseCurrentBlock();
260 $tpl->setCurrentBlock(
"tbl_action_row");
261 $tpl->setVariable(
"COLUMN_COUNTS", 1);
263 $tpl->parseCurrentBlock();
268 $tbl->setStyle(
'table',
'std');
271 $tbl->setTitle($this->lng->txt(
"crs_objectives"),
"", $this->lng->txt(
"crs_objectives"));
273 $tbl->setHeaderNames(array($this->lng->txt(
"title")));
276 array(
"ref_id" => $this->course_obj->getRefId(),
277 "cmdClass" =>
"ilcourseobjectivesgui",
278 "cmdNode" =>
$_GET[
"cmdNode"])
280 $tbl->setColumnWidth(array(
"50%"));
282 $tbl->setLimit(
$_GET[
"limit"]);
283 $tbl->setOffset(
$_GET[
"offset"]);
284 $tbl->setMaxCount(count(
$_POST[
'objective']));
287 $tbl->disable(
"footer");
288 $tbl->disable(
'sort');
291 $tbl->setTemplate($tpl);
294 $this->tpl->setVariable(
"OBJECTIVES_TABLE", $tpl->get());
307 $rbacsystem = $DIC[
'rbacsystem'];
310 if (!$rbacsystem->checkAccess(
"write", $this->course_obj->getRefId())) {
311 $this->
ilias->raiseError($this->lng->txt(
"msg_no_perm_write"), $this->ilErr->MESSAGE);
313 if (!count(
$_SESSION[
'crs_delete_objectives'])) {
320 foreach (
$_SESSION[
'crs_delete_objectives'] as $objective_id) {
322 $objective_obj->delete();
325 ilUtil::sendSuccess($this->lng->txt(
'crs_objectives_deleted'));
341 $ilAccess = $DIC[
'ilAccess'];
343 $ilTabs = $DIC[
'ilTabs'];
345 $ilTabs->setSubTabActive(
'crs_objective_overview_question_assignment');
347 if (!$ilAccess->checkAccess(
'write',
'', $this->course_obj->getRefId())) {
348 $ilErr->raiseError($this->lng->txt(
'permission_denied'),
$ilErr->WARNING);
351 include_once(
'./Modules/Course/classes/class.ilCourseObjectiveQuestionsTableGUI.php');
353 $table->setTitle($this->lng->txt(
'crs_objectives_edit_question_assignments'),
'', $this->lng->txt(
'crs_objectives'));
358 $this->tpl->setContent($table->getHTML());
369 include_once(
'./Modules/Course/classes/class.ilCourseObjectiveQuestion.php');
373 $ilAccess = $DIC[
'ilAccess'];
376 if (!$ilAccess->checkAccess(
'write',
'', $this->course_obj->getRefId())) {
377 $ilErr->raiseError($this->lng->txt(
'permission_denied'),
$ilErr->WARNING);
384 foreach (
$_POST[
'self'] as $objective_id => $limit) {
386 $max_points = $qst->getSelfAssessmentPoints();
388 if ($limit < 0 or $limit > $max_points) {
394 foreach (
$_POST[
'final'] as $objective_id => $limit) {
396 $max_points = $qst->getFinalTestPoints();
398 if ($limit < 0 or $limit > $max_points) {
405 foreach (
$_POST[
'self'] as $objective_id => $limit) {
409 foreach (
$_POST[
'final'] as $objective_id => $limit) {
413 ilUtil::sendSuccess($this->lng->txt(
'settings_saved'));
422 $this->ilErr->raiseError(
"ilCourseObjectivesGUI: cannot create course object", $this->ilErr->MESSAGE);
435 include_once
'./Modules/Course/classes/class.ilCourseObjectiveMaterials.php';
449 include_once
'./Modules/Course/classes/class.ilCourseObjectiveQuestion.php';
452 return $this->objectives_qst_obj;
463 $ilTabs = $DIC[
'ilTabs'];
464 $ilHelp = $DIC[
'ilHelp'];
466 if ($a_active !=
"") {
467 $ilHelp->setScreenIdComponent(
"crs");
468 $ilHelp->setScreenId(
"crs_objective");
469 $ilHelp->setSubScreenId($a_active);
479 $ilTabs->addSubTabTarget(
480 "crs_objective_overview_objectives",
481 $this->ctrl->getLinkTarget($this,
"listObjectives"),
482 array(
"listObjectives",
"moveObjectiveUp",
"moveObjectiveDown",
"listAssignedLM"),
487 include_once(
'./Modules/Course/classes/class.ilCourseObjectiveQuestion.php');
490 $ilTabs->addSubTabTarget(
491 "crs_objective_overview_question_assignment",
492 $this->ctrl->getLinkTarget($this,
"questionOverview"),
493 "editQuestionAssignment",
517 $_SESSION[
'objective_mode'] = self::MODE_CREATE;
519 $this->ctrl->saveParameter($this,
'objective_id');
521 if (!is_object($this->objective)) {
528 $GLOBALS[
'DIC'][
'tpl']->setContent($this->form->getHtml());
529 #$w_tpl->setVariable('WIZ_CONTENT',$this->form->getHtml()); 530 #$tpl->setContent($w_tpl->get()); 545 $_SESSION[
'objective_mode'] = self::MODE_UPDATE;
549 $this->ctrl->setParameter($this,
'objective_id', (
int) $_REQUEST[
'objective_id']);
551 if (!$_REQUEST[
'objective_id']) {
553 $this->ctrl->redirect($this,
'listObjectives');
556 if (!is_object($this->objective)) {
557 $this->objective =
new ilCourseObjective($this->course_obj, (
int) $_REQUEST[
'objective_id']);
563 $GLOBALS[
'DIC'][
'tpl']->setContent($this->form->getHtml());
564 #$w_tpl->setVariable('WIZ_CONTENT',$this->form->getHtml()); 565 #$tpl->setContent($w_tpl->get()); 578 $ilAccess = $DIC[
'ilAccess'];
581 if (!$ilAccess->checkAccess(
'write',
'', $this->course_obj->getRefId())) {
582 $ilErr->raiseError($this->lng->txt(
'permission_denied'),
$ilErr->WARNING);
585 $this->ctrl->saveParameter($this,
'objective_id');
587 $this->objective =
new ilCourseObjective($this->course_obj, (
int) $_REQUEST[
'objective_id']);
589 if ($this->form->checkInput()) {
590 $this->objective->setTitle($this->form->getInput(
'title'));
591 $this->objective->setDescription($this->form->getInput(
'description'));
592 $this->objective->setPasses(0);
594 if (!
$_GET[
'objective_id']) {
595 $objective_id = $this->objective->add();
596 ilUtil::sendSuccess($this->lng->txt(
'crs_added_objective'),
true);
598 $this->objective->update();
599 ilUtil::sendSuccess($this->lng->txt(
'crs_objective_modified'),
true);
600 $objective_id =
$_GET[
'objective_id'];
603 if ((
int)
$_GET[
'objective_id']) {
604 $this->form->setValuesByPost();
605 return $this->
edit();
607 $this->form->setValuesByPost();
612 if (
$_SESSION[
'objective_mode'] != self::MODE_CREATE) {
613 $this->ctrl->returnToParent($this);
616 $this->ctrl->setParameter($this,
'objective_id', $objective_id);
617 $this->ctrl->redirect($this,
'materialAssignment');
631 $ilAccess = $DIC[
'ilAccess'];
635 if (!$ilAccess->checkAccess(
'write',
'', $this->course_obj->getRefId())) {
636 $ilErr->raiseError($this->lng->txt(
'permission_denied'),
$ilErr->WARNING);
638 if (!
$_GET[
'objective_id']) {
640 $this->ctrl->redirect($this,
'listObjectives');
645 $this->ctrl->saveParameter($this,
'objective_id');
649 include_once(
'./Modules/Course/classes/class.ilCourseObjectiveMaterialAssignmentTableGUI.php');
652 $this->lng->txt(
'crs_objective_wiz_materials'),
654 $this->lng->txt(
'crs_objectives')
657 include_once(
'Modules/Course/classes/class.ilCourseObjectiveMaterials.php');
661 $this->
initWizard(self::STEP_MATERIAL_ASSIGNMENT);
662 $GLOBALS[
'DIC'][
'tpl']->setContent($table->getHTML());
676 $ilAccess = $DIC[
'ilAccess'];
678 $ilObjDataCache = $DIC[
'ilObjDataCache'];
680 if (!$ilAccess->checkAccess(
'write',
'', $this->course_obj->getRefId())) {
681 $ilErr->raiseError($this->lng->txt(
'permission_denied'),
$ilErr->WARNING);
683 if (!
$_GET[
'objective_id']) {
685 $this->ctrl->redirect($this,
'listObjectives');
690 $visibleMaterials = is_array(
$_POST[
'visible_materials']) ?
$_POST[
'visible_materials'] : [];
691 $visibleChapters = is_array(
$_POST[
'visible_chapters']) ?
$_POST[
'visible_chapters'] : [];
692 $materials = is_array(
$_POST[
'materials']) ?
$_POST[
'materials'] : [];
693 $chapters = is_array(
$_POST[
'chapters']) ?
$_POST[
'chapters'] : [];
695 foreach ($visibleMaterials as $node_id) {
696 $obj_id = $ilObjDataCache->lookupObjId($node_id);
697 if (!in_array($node_id, $materials)) {
698 $this->objectives_lm_obj->deleteMaterial($node_id, $obj_id);
701 if ($this->objectives_lm_obj->isMaterialAssigned($node_id, $obj_id)) {
704 $this->objectives_lm_obj->setLMRefId($node_id);
705 $this->objectives_lm_obj->setLMObjId($obj_id);
706 $this->objectives_lm_obj->setType($ilObjDataCache->lookupType($obj_id));
707 $this->objectives_lm_obj->add();
710 foreach ($visibleChapters as $chapter) {
711 list($ref_id, $chapter_id) = explode(
'_', $chapter);
712 if (!in_array($chapter, $chapters)) {
713 $this->objectives_lm_obj->deleteMaterial($ref_id, $chapter_id);
716 if ($this->objectives_lm_obj->isMaterialAssigned($ref_id, $chapter_id)) {
719 $this->objectives_lm_obj->setLMRefId($ref_id);
720 $this->objectives_lm_obj->setLMObjId($chapter_id);
722 $this->objectives_lm_obj->add();
724 ilUtil::sendSuccess($this->lng->txt(
'crs_objectives_assigned_lm'));
727 if (
$_SESSION[
'objective_mode'] != self::MODE_CREATE) {
728 ilUtil::sendSuccess($this->lng->txt(
'crs_objectives_assigned_lm'),
true);
729 $this->ctrl->returnToParent($this);
733 if ($this->
getSettings()->worksWithInitialTest()) {
751 $ilAccess = $DIC[
'ilAccess'];
755 if (!$ilAccess->checkAccess(
'write',
'', $this->course_obj->getRefId())) {
756 $ilErr->raiseError($this->lng->txt(
'permission_denied'),
$ilErr->WARNING);
758 if (!
$_GET[
'objective_id']) {
760 $this->ctrl->redirect($this,
'listObjectives');
765 $this->ctrl->saveParameter($this,
'objective_id');
777 include_once(
'./Modules/Course/classes/class.ilCourseObjectiveQuestionAssignmentTableGUI.php');
781 (
int) $_GET[
'objective_id'],
785 $this->lng->txt(
'crs_objective_wiz_self'),
787 $this->lng->txt(
'crs_objective')
792 $this->
initWizard(self::STEP_INITIAL_TEST_ASSIGNMENT);
793 $GLOBALS[
'DIC'][
'tpl']->setContent($table->getHTML());
807 $ilAccess = $DIC[
'ilAccess'];
809 $ilObjDataCache = $DIC[
'ilObjDataCache'];
811 $checked_questions =
$_POST[
'questions'] ?
$_POST[
'questions'] : array();
814 if (!$ilAccess->checkAccess(
'write',
'', $this->course_obj->getRefId())) {
815 $ilErr->raiseError($this->lng->txt(
'permission_denied'),
$ilErr->WARNING);
817 if (!
$_GET[
'objective_id']) {
819 $this->ctrl->redirect($this,
'listObjectives');
825 foreach ($this->objectives_qst_obj->getSelfAssessmentQuestions() as $question) {
826 $id = $question[
'ref_id'] .
'_' . $question[
'question_id'];
827 if (!in_array($id, $checked_questions)) {
828 $this->objectives_qst_obj->delete($question[
'qst_ass_id']);
832 foreach ($checked_questions as $question_id) {
833 list($test_ref_id, $qst_id) = explode(
'_', $question_id);
834 $test_obj_id = $ilObjDataCache->lookupObjId($test_ref_id);
836 if ($this->objectives_qst_obj->isSelfAssessmentQuestion($qst_id)) {
840 $this->objectives_qst_obj->setTestRefId($test_ref_id);
841 $this->objectives_qst_obj->setTestObjId($test_obj_id);
842 $this->objectives_qst_obj->setQuestionId($qst_id);
843 $this->objectives_qst_obj->add();
847 include_once
'./Modules/Course/classes/class.ilCourseObjectiveQuestion.php';
852 if ($checked_questions) {
853 ilUtil::sendSuccess($this->lng->txt(
'crs_objectives_assigned_lm'));
858 case self::MODE_CREATE:
862 case self::MODE_UPDATE:
864 ilUtil::sendSuccess($this->lng->txt(
'crs_objectives_assigned_lm'));
881 $ilAccess = $DIC[
'ilAccess'];
885 if (!$ilAccess->checkAccess(
'write',
'', $this->course_obj->getRefId())) {
886 $ilErr->raiseError($this->lng->txt(
'permission_denied'),
$ilErr->WARNING);
888 if (!
$_GET[
'objective_id']) {
890 $this->ctrl->redirect($this,
'listObjectives');
895 $this->ctrl->saveParameter($this,
'objective_id');
899 $this->
initWizard(self::STEP_INITIAL_TEST_LIMIT);
902 $GLOBALS[
'DIC'][
'tpl']->setContent($this->form->getHtml());
903 #$w_tpl->setVariable('WIZ_CONTENT',$this->form->getHtml()); 904 #$tpl->setContent($w_tpl->get()); 918 $ilAccess = $DIC[
'ilAccess'];
920 $ilObjDataCache = $DIC[
'ilObjDataCache'];
922 if (!$ilAccess->checkAccess(
'write',
'', $this->course_obj->getRefId())) {
923 $ilErr->raiseError($this->lng->txt(
'permission_denied'),
$ilErr->WARNING);
925 if (!
$_GET[
'objective_id']) {
927 $this->ctrl->redirect($this,
'listObjectives');
932 if ((
int)
$_POST[
'limit'] < 1 or (
int)
$_POST[
'limit'] > 100) {
938 foreach ($this->objectives_qst_obj->getSelfAssessmentTests() as
$test) {
940 $this->objectives_qst_obj->setTestSuggestedLimit((
int)
$_POST[
'limit']);
941 $this->objectives_qst_obj->updateTest(
$test[
'test_objective_id']);
944 ilUtil::sendSuccess($this->lng->txt(
'settings_saved'),
true);
945 $this->ctrl->returnToParent($this);
960 $ilAccess = $DIC[
'ilAccess'];
964 if (!$ilAccess->checkAccess(
'write',
'', $this->course_obj->getRefId())) {
965 $ilErr->raiseError($this->lng->txt(
'permission_denied'),
$ilErr->WARNING);
967 if (!
$_GET[
'objective_id']) {
969 $this->ctrl->redirect($this,
'listObjectives');
974 $this->ctrl->saveParameter($this,
'objective_id');
985 include_once(
'./Modules/Course/classes/class.ilCourseObjectiveQuestionAssignmentTableGUI.php');
989 (
int) $_GET[
'objective_id'],
994 $this->lng->txt(
'crs_objective_wiz_final'),
996 $this->lng->txt(
'crs_objective')
1001 $this->
initWizard(self::STEP_FINAL_TEST_ASSIGNMENT);
1002 $GLOBALS[
'DIC'][
'tpl']->setContent($table->getHTML());
1012 $tst_ref_id = $this->
getSettings()->getTestByType($a_tst_type);
1016 include_once
'./Modules/Test/classes/class.ilObjTest.php';
1026 $this->ctrl->saveParameter($this,
'objective_id');
1027 $this->ctrl->setParameter($this,
'tt', (
int) $_REQUEST[
'tt']);
1029 $this->test_type = (int) $_REQUEST[
'tt'];
1039 $this->
initWizard(self::STEP_FINAL_TEST_ASSIGNMENT);
1040 $GLOBALS[
'DIC'][
'tpl']->setContent($form->getHTML());
1048 include_once
'./Services/Form/classes/class.ilPropertyFormGUI.php';
1050 $form->setFormAction($this->ctrl->getFormAction($this));
1053 $form->setTitle($this->lng->txt(
'crs_loc_form_random_limits_it'));
1055 $form->setTitle($this->lng->txt(
'crs_loc_form_random_limits_qt'));
1058 $form->addCommandButton(
'saveRandom', $this->lng->txt(
'save'));
1062 $options->setRequired(
true);
1064 $ass_qpl =
new ilRadioOption($this->lng->txt(
'crs_loc_rand_assign_qpl'), 1);
1065 $options->addOption($ass_qpl);
1068 $qpl->setRequired(
true);
1069 $qpl->setMulti(
true,
false);
1070 $qpl->setOptions($this->getRandomTestQplOptions());
1073 $this->course_obj->getId(),
1074 (int) $_REQUEST[
'objective_id'],
1079 $qpl->setValue($sequences[0]);
1080 $qpl->setMultiValues($sequences);
1081 $ass_qpl->addSubItem($qpl);
1087 $this->course_obj->getId(),
1088 (int) $_REQUEST[
'objective_id'],
1093 $per->setMinValue(1);
1094 $per->setMaxValue(100);
1095 $per->setRequired(
true);
1096 $ass_qpl->addSubItem($per);
1098 $form->addItem($options);
1103 protected function getRandomTestQplOptions()
1105 include_once
'./Modules/Test/classes/class.ilTestRandomQuestionSetSourcePoolDefinitionFactory.php';
1106 include_once
'./Modules/Test/classes/class.ilTestRandomQuestionSetSourcePoolDefinitionList.php';
1108 $tst_ref_id = $this->
getSettings()->getTestByType($this->test_type);
1124 $list->loadDefinitions();
1126 include_once
'./Modules/Test/classes/class.ilTestTaxonomyFilterLabelTranslater.php';
1128 $translater->loadLabels($list);
1130 $options[0] = $this->lng->txt(
'select_one');
1131 foreach ($list as $definition) {
1133 $title = $definition->getPoolTitle();
1135 $filterTitle = array();
1136 $filterTitle[] = $translater->getTaxonomyFilterLabel($definition->getMappedTaxonomyFilter());
1137 $filterTitle[] = $translater->getTypeFilterLabel($definition->getTypeFilter());
1138 if (!empty($filterTitle)) {
1139 $title .=
' -> ' . implode(
' / ', $filterTitle);
1141 #$tax_id = $definition->getMappedFilterTaxId(); 1144 # $title .= (' -> '. $translater->getTaxonomyTreeLabel($tax_id)); 1146 #$tax_node = $definition->getMappedFilterTaxNodeId(); 1149 # $title .= (' -> ' .$translater->getTaxonomyNodeLabel($tax_node)); 1152 $options[$definition->getId()] = $title;
1162 $this->ctrl->saveParameter($this,
'objective_id');
1163 $this->ctrl->setParameter($this,
'tt', (
int) $_REQUEST[
'tt']);
1165 $this->test_type = (int) $_REQUEST[
'tt'];
1172 if ($form->checkInput()) {
1174 $this->course_obj->getId(),
1175 (int) $_REQUEST[
'objective_id'],
1180 $qst->deleteByTestType(
1185 $ref_id = $this->
getSettings()->getTestByType($this->test_type);
1186 foreach (array_unique((array) $form->getInput(
'qpl')) as $qpl_id) {
1187 include_once
'./Modules/Course/classes/Objectives/class.ilLORandomTestQuestionPools.php';
1189 $this->course_obj->getId(),
1190 (int) $_REQUEST[
'objective_id'],
1194 $rnd->setLimit($form->getInput(
'per'));
1199 $form->setValuesByPost();
1204 ilUtil::sendSuccess($this->lng->txt(
'settings_saved'),
true);
1206 $this->ctrl->returnToParent($this);
1208 $this->ctrl->redirect($this,
'finalTestAssignment');
1223 $ilAccess = $DIC[
'ilAccess'];
1225 $ilObjDataCache = $DIC[
'ilObjDataCache'];
1227 $checked_questions =
$_POST[
'questions'] ?
$_POST[
'questions'] : array();
1230 if (!$ilAccess->checkAccess(
'write',
'', $this->course_obj->getRefId())) {
1231 $ilErr->raiseError($this->lng->txt(
'permission_denied'),
$ilErr->WARNING);
1233 if (!
$_GET[
'objective_id']) {
1235 $this->ctrl->redirect($this,
'listObjectives');
1241 foreach ($this->objectives_qst_obj->getFinalTestQuestions() as $question) {
1242 $id = $question[
'ref_id'] .
'_' . $question[
'question_id'];
1243 if (!in_array($id, $checked_questions)) {
1244 $this->objectives_qst_obj->delete($question[
'qst_ass_id']);
1248 foreach ($checked_questions as $question_id) {
1249 list($test_ref_id, $qst_id) = explode(
'_', $question_id);
1250 $test_obj_id = $ilObjDataCache->lookupObjId($test_ref_id);
1252 if ($this->objectives_qst_obj->isFinalTestQuestion($qst_id)) {
1257 $this->objectives_qst_obj->setTestRefId($test_ref_id);
1258 $this->objectives_qst_obj->setTestObjId($test_obj_id);
1259 $this->objectives_qst_obj->setQuestionId($qst_id);
1260 $this->objectives_qst_obj->add();
1264 include_once
'./Modules/Course/classes/class.ilCourseObjectiveQuestion.php';
1269 ilUtil::sendSuccess($this->lng->txt(
'crs_objectives_assigned_lm'));
1281 $ilAccess = $DIC[
'ilAccess'];
1284 if (!$ilAccess->checkAccess(
'write',
'', $this->course_obj->getRefId())) {
1285 $ilErr->raiseError($this->lng->txt(
'permission_denied'),
$ilErr->WARNING);
1287 if (!
$_GET[
'objective_id']) {
1289 $this->ctrl->returnToParent($this);
1291 $this->ctrl->saveParameter($this,
'objective_id');
1294 $this->
initWizard(self::STEP_FINAL_TEST_LIMIT);
1295 $form = $this->initFormTestAssignment();
1296 $GLOBALS[
'DIC'][
'tpl']->setContent($form->getHtml());
1310 $ilAccess = $DIC[
'ilAccess'];
1314 if (!$ilAccess->checkAccess(
'write',
'', $this->course_obj->getRefId())) {
1315 $ilErr->raiseError($this->lng->txt(
'permission_denied'),
$ilErr->WARNING);
1317 if (!
$_GET[
'objective_id']) {
1319 $this->ctrl->returnToParent($this);
1324 $this->ctrl->saveParameter($this,
'objective_id');
1328 $this->
initWizard(self::STEP_FINAL_TEST_LIMIT);
1331 $GLOBALS[
'DIC'][
'tpl']->setContent($this->form->getHtml());
1345 $ilAccess = $DIC[
'ilAccess'];
1347 $ilObjDataCache = $DIC[
'ilObjDataCache'];
1349 if (!$ilAccess->checkAccess(
'write',
'', $this->course_obj->getRefId())) {
1350 $ilErr->raiseError($this->lng->txt(
'permission_denied'),
$ilErr->WARNING);
1352 if (!
$_GET[
'objective_id']) {
1354 $this->ctrl->redirect($this,
'listObjectives');
1359 if ((
int)
$_POST[
'limit'] < 1 or (
int)
$_POST[
'limit'] > 100) {
1365 foreach ($this->objectives_qst_obj->getFinalTests() as
$test) {
1367 $this->objectives_qst_obj->setTestSuggestedLimit((
int)
$_POST[
'limit']);
1368 $this->objectives_qst_obj->updateTest(
$test[
'test_objective_id']);
1371 if (
$_SESSION[
'objective_mode'] != self::MODE_CREATE) {
1372 ilUtil::sendSuccess($this->lng->txt(
'settings_saved'),
true);
1374 ilUtil::sendSuccess($this->lng->txt(
'crs_added_objective'),
true);
1376 $this->ctrl->returnToParent($this);
1388 if (!is_object($this->form)) {
1389 include_once(
'./Services/Form/classes/class.ilPropertyFormGUI.php');
1392 $this->form->setFormAction($this->ctrl->getFormAction($this));
1393 $this->form->setTableWidth(
'100%');
1397 case 'selfAssessment':
1398 $this->form->setTitle($this->lng->txt(
'crs_objective_wiz_self_limit'));
1399 $this->form->addCommandButton(
'updateSelfAssessmentLimits', $this->lng->txt(
'crs_wiz_next'));
1401 $tests = $this->objectives_qst_obj->getSelfAssessmentTests();
1402 $max_points = $this->objectives_qst_obj->getSelfAssessmentPoints();
1407 $this->form->setTitle($this->lng->txt(
'crs_objective_wiz_final_limit'));
1408 $this->form->addCommandButton(
'updateFinalTestLimits', $this->lng->txt(
'crs_wiz_next'));
1410 $tests = $this->objectives_qst_obj->getFinalTests();
1411 $max_points = $this->objectives_qst_obj->getFinalTestPoints();
1416 $over =
new ilCustomInputGUI($this->lng->txt(
'crs_objective_qst_summary'),
'');
1418 $tpl =
new ilTemplate(
'tpl.crs_objective_qst_summary.html',
true,
true,
'Modules/Course');
1423 foreach ($tests as
$test) {
1424 $GLOBALS[
'DIC'][
'ilLog']->write(__METHOD__ .
': ' . print_r($test,
true));
1426 $limit = $test[
'limit'];
1428 foreach ($this->objectives_qst_obj->getQuestionsOfTest($test[
'obj_id']) as $question) {
1429 $tpl->setCurrentBlock(
'qst');
1430 $tpl->setVariable(
'QST_TITLE', $question[
'title']);
1431 if (strlen($question[
'description'])) {
1432 $tpl->setVariable(
'QST_DESCRIPTION', $question[
'description']);
1434 $tpl->setVariable(
'QST_POINTS', $question[
'points'] .
' ' .
1435 $this->lng->txt(
'crs_objective_points'));
1436 $tpl->parseCurrentBlock();
1438 $tpl->setCurrentBlock(
'tst');
1441 $tpl->setVariable(
'TST_DESC', $desc);
1444 $tpl->setVariable(
'TST_ALT_IMG', $this->lng->txt(
'obj_tst'));
1445 $tpl->parseCurrentBlock();
1448 $tpl->setVariable(
'TXT_ALL_POINTS', $this->lng->txt(
'crs_objective_all_points'));
1449 $tpl->setVariable(
'TXT_POINTS', $this->lng->txt(
'crs_objective_points'));
1450 $tpl->setVariable(
'POINTS', $max_points);
1453 $this->form->addItem($over);
1457 $req->setValue($limit);
1459 $req->setMinValue(1);
1460 $req->setMaxValue(100);
1461 $req->setRequired(
true);
1463 case 'selfAssessment':
1464 $req->setInfo($this->lng->txt(
'crs_obj_initial_req_info'));
1468 $req->setInfo($this->lng->txt(
'crs_obj_final_req_info'));
1471 $this->form->addItem(
$req);
1483 include_once(
'./Services/Form/classes/class.ilPropertyFormGUI.php');
1488 $this->form =
new ilPropertyFormGUI();
1489 $this->form->setFormAction($this->ctrl->getFormAction($this));
1494 $this->form->setTitle($this->lng->txt(
'crs_objective_wiz_title'));
1495 $this->form->addCommandButton(
'save', $this->lng->txt(
'crs_wiz_next'));
1497 #$this->form->addCommandButton('listObjectives',$this->lng->txt('cancel')); 1506 $title->setValue($this->objective->getTitle());
1507 $title->setRequired(
true);
1508 $title->setSize(40);
1509 $title->setMaxLength(70);
1510 $this->form->addItem($title);
1513 $desc->
setValue($this->objective->getDescription());
1516 $this->form->addItem($desc);
1530 $step_positions = [];
1532 $workflow = $DIC->ui()->factory()->listing()->workflow();
1535 $title = $this->lng->txt(
'crs_objective_wiz_title');
1536 $link = $this->ctrl->getLinkTarget($this,
'edit');
1538 $steps[] = $workflow->step($title,
"", $link);
1539 $step_positions[self::STEP_SETTINGS] = count(
$steps) - 1;
1542 $title = $this->lng->txt(
'crs_objective_wiz_materials');
1543 $link = $this->ctrl->getLinkTarget($this,
'materialAssignment');
1544 $steps[] = $workflow->step($title,
"", $link);
1545 $step_positions[self::STEP_MATERIAL_ASSIGNMENT] = count(
$steps) - 1;
1550 $title = $this->lng->txt(
'crs_objective_wiz_self');
1551 $link = $this->
getSettings()->worksWithInitialTest()
1552 ? $this->ctrl->getLinkTarget($this,
'selfAssessmentAssignment')
1555 $steps[] = $workflow->step($title,
"", $link)
1556 ->withAvailability($link == null ? Step::NOT_AVAILABLE : Step::AVAILABLE);
1557 $step_positions[self::STEP_INITIAL_TEST_ASSIGNMENT] = count(
$steps) - 1;
1561 $title = $this->lng->txt(
'crs_objective_wiz_self_limit');
1562 $link = count($this->objectives_qst_obj->getSelfAssessmentQuestions())
1564 ? $this->ctrl->getLinkTarget($this,
'selfAssessmentLimits')
1566 $steps[] = $workflow->step($title,
"", $link)
1567 ->withAvailability($link == null ? Step::NOT_AVAILABLE : Step::AVAILABLE);
1568 $step_positions[self::STEP_INITIAL_TEST_LIMIT] = count(
$steps) - 1;
1572 if (!$this->
getSettings()->hasSeparateQualifiedTests()) {
1574 $title = $this->lng->txt(
'crs_objective_wiz_final');
1575 $link = $this->ctrl->getLinkTarget($this,
'finalTestAssignment');
1576 $steps[] = $workflow->step($title,
"", $link);
1577 $step_positions[self::STEP_FINAL_TEST_ASSIGNMENT] = count(
$steps) - 1;
1581 $title = $this->lng->txt(
'crs_objective_wiz_final_limit');
1582 $link = count($this->objectives_qst_obj->getFinalTestQuestions())
1583 ? $this->ctrl->getLinkTarget($this,
'finalTestLimits')
1585 $steps[] = $workflow->step($title,
"", $link)
1586 ->withAvailability($link == null ? Step::NOT_AVAILABLE : Step::AVAILABLE);
1587 $step_positions[self::STEP_FINAL_TEST_LIMIT] = count(
$steps) - 1;
1591 $list = $workflow->linear(
1592 $this->lng->txt(
'crs_checklist_objective'),
1595 if (!empty($step_positions[$active_step])) {
1596 $list = $list->withActive($step_positions[$active_step]);
1599 $renderer = $DIC->ui()->renderer();
1601 $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.