25include_once 
'./Modules/Course/classes/Objectives/class.ilLOSettings.php';
 
   59                include_once 
'./Modules/Course/classes/class.ilCourseObjective.php';
 
   64                $this->ctrl->saveParameter($this,array(
"ref_id"));
 
   68                $this->lng->loadLanguageModule(
'crs');
 
   71                $this->tabs_gui =& $ilTabs;
 
   73                $this->course_id = $a_course_id;
 
   89                $ilTabs->setTabActive(
'crs_objectives');
 
   91                $cmd = $this->ctrl->getCmd();
 
   94                if (!
$cmd = $this->ctrl->getCmd())
 
  123                global $ilAccess,
$ilErr,$ilObjDataCache,$ilToolbar;
 
  126                if(!$ilAccess->checkAccess(
"write",
'',$this->course_obj->getRefId()))
 
  128                        $this->ilErr->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilErr->MESSAGE);
 
  131                $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.crs_objectives.html',
'Modules/Course');
 
  133                $ilToolbar->addButton($this->lng->txt(
'crs_add_objective'),
 
  134                        $this->ctrl->getLinkTarget($this, 
"'create"));
 
  136                include_once(
'./Modules/Course/classes/class.ilCourseObjectivesTableGUI.php');
 
  138                $table->setTitle($this->lng->txt(
'crs_objectives'),
'',$this->lng->txt(
'crs_objectives'));
 
  141                $this->tpl->setVariable(
'OBJECTIVES_TABLE',$table->getHTML());
 
  152                global $ilAccess,
$ilErr,$ilObjDataCache;
 
  154                if(!$ilAccess->checkAccess(
"write",
'',$this->course_obj->getRefId()))
 
  156                        $this->ilErr->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilErr->MESSAGE);
 
  159                asort(
$_POST[
'position'],SORT_NUMERIC);
 
  162                foreach(
$_POST[
'position'] as $objective_id => $position)
 
  165                        $objective->writePosition($counter++);
 
  176                if(!$rbacsystem->checkAccess(
"write", $this->course_obj->getRefId()))
 
  178                        $this->
ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilErr->MESSAGE);
 
  180                if(!count(
$_POST[
'objective']))
 
  188                $this->tpl->addBlockFile(
"ADM_CONTENT", 
"adm_content", 
"tpl.crs_objectives.html",
'Modules/Course');
 
  193                $tpl->addBlockfile(
"TBL_CONTENT", 
"tbl_content", 
"tpl.crs_objectives_delete_row.html",
'Modules/Course');
 
  196                foreach(
$_POST[
'objective'] as $objective_id)
 
  200                        $tpl->setCurrentBlock(
"tbl_content");
 
  202                        $tpl->setVariable(
"TITLE",$objective_obj->getTitle());
 
  203                        $tpl->setVariable(
"DESCRIPTION",$objective_obj->getDescription());
 
  204                        $tpl->parseCurrentBlock();
 
  207                $tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
 
  210                $tpl->setCurrentBlock(
"tbl_action_btn");
 
  211                $tpl->setVariable(
"BTN_NAME",
'deleteObjectives');
 
  212                $tpl->setVariable(
"BTN_VALUE",$this->lng->txt(
'delete'));
 
  213                $tpl->parseCurrentBlock();
 
  215                $tpl->setCurrentBlock(
"tbl_action_btn");
 
  216                $tpl->setVariable(
"BTN_NAME",
'listObjectives');
 
  217                $tpl->setVariable(
"BTN_VALUE",$this->lng->txt(
'cancel'));
 
  218                $tpl->parseCurrentBlock();
 
  220                $tpl->setCurrentBlock(
"tbl_action_row");
 
  221                $tpl->setVariable(
"COLUMN_COUNTS",1);
 
  223                $tpl->parseCurrentBlock();
 
  228                $tbl->setStyle(
'table',
'std');
 
  231                $tbl->setTitle($this->lng->txt(
"crs_objectives"),
"",$this->lng->txt(
"crs_objectives"));
 
  233                $tbl->setHeaderNames(array($this->lng->txt(
"title")));
 
  234                $tbl->setHeaderVars(array(
"title"), 
 
  235                                                        array(
"ref_id" => $this->course_obj->getRefId(),
 
  236                                                                  "cmdClass" => 
"ilcourseobjectivesgui",
 
  237                                                                  "cmdNode" => 
$_GET[
"cmdNode"]));
 
  238                $tbl->setColumnWidth(array(
"50%"));
 
  240                $tbl->setLimit(
$_GET[
"limit"]);
 
  241                $tbl->setOffset(
$_GET[
"offset"]);
 
  242                $tbl->setMaxCount(count(
$_POST[
'objective']));
 
  245                $tbl->disable(
"footer");
 
  246                $tbl->disable(
'sort');
 
  249                $tbl->setTemplate(
$tpl);
 
  252                $this->tpl->setVariable(
"OBJECTIVES_TABLE", 
$tpl->get());
 
  266                if(!$rbacsystem->checkAccess(
"write", $this->course_obj->getRefId()))
 
  268                        $this->
ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilErr->MESSAGE);
 
  270                if(!count(
$_SESSION[
'crs_delete_objectives']))
 
  278                foreach(
$_SESSION[
'crs_delete_objectives'] as $objective_id)
 
  281                        $objective_obj->delete();
 
  298                global $ilAccess,
$ilErr,$ilTabs;
 
  300                $ilTabs->setSubTabActive(
'crs_objective_overview_question_assignment');
 
  302                if(!$ilAccess->checkAccess(
'write',
'',$this->course_obj->getRefId()))
 
  304                        $ilErr->raiseError($this->lng->txt(
'permission_denied'),
$ilErr->WARNING);
 
  307                include_once(
'./Modules/Course/classes/class.ilCourseObjectiveQuestionsTableGUI.php');
 
  309                $table->setTitle($this->lng->txt(
'crs_objectives_edit_question_assignments'),
'',$this->lng->txt(
'crs_objectives'));
 
  314                $this->tpl->setContent($table->getHTML());
 
  325                include_once(
'./Modules/Course/classes/class.ilCourseObjectiveQuestion.php');
 
  329                if(!$ilAccess->checkAccess(
'write',
'',$this->course_obj->getRefId()))
 
  331                        $ilErr->raiseError($this->lng->txt(
'permission_denied'),
$ilErr->WARNING);
 
  338                foreach(
$_POST[
'self'] as $objective_id => $limit)
 
  341                        $max_points = $qst->getSelfAssessmentPoints();
 
  343                        if($limit < 0 or $limit > $max_points)
 
  350                foreach(
$_POST[
'final'] as $objective_id => $limit)
 
  353                        $max_points = $qst->getFinalTestPoints();
 
  355                        if($limit < 0 or $limit > $max_points)
 
  363                foreach(
$_POST[
'self'] as $objective_id => $limit)
 
  368                foreach(
$_POST[
'final'] as $objective_id => $limit)
 
  383                        $this->ilErr->raiseError(
"ilCourseObjectivesGUI: cannot create course object",$this->ilErr->MESSAGE);
 
  396                include_once 
'./Modules/Course/classes/class.ilCourseObjectiveMaterials.php';
 
  410                include_once 
'./Modules/Course/classes/class.ilCourseObjectiveQuestion.php';
 
  413                return $this->objectives_qst_obj;
 
  422                global $ilTabs, $ilHelp;
 
  426                        $ilHelp->setScreenIdComponent(
"crs");
 
  427                        $ilHelp->setScreenId(
"crs_objective");
 
  428                        $ilHelp->setSubScreenId($a_active);
 
  438                $ilTabs->addSubTabTarget(
"crs_objective_overview_objectives",
 
  439                                                                 $this->ctrl->getLinkTarget($this, 
"listObjectives"),
 
  440                                                                 array(
"listObjectives", 
"moveObjectiveUp", 
"moveObjectiveDown", 
"listAssignedLM"),
 
  444                include_once(
'./Modules/Course/classes/class.ilCourseObjectiveQuestion.php');
 
  448                        $ilTabs->addSubTabTarget(
"crs_objective_overview_question_assignment",
 
  449                                                                         $this->ctrl->getLinkTarget($this, 
"questionOverview"),
 
  450                                                                         "editQuestionAssignment",
 
  473                $this->ctrl->saveParameter($this,
'objective_id');
 
  475                if(!is_object($this->objective))
 
  483                $GLOBALS[
'tpl']->setContent($this->form->getHtml());
 
  484                #$w_tpl->setVariable('WIZ_CONTENT',$this->form->getHtml()); 
  485                #$tpl->setContent($w_tpl->get()); 
  502                $this->ctrl->setParameter($this,
'objective_id',(
int) 
$_REQUEST[
'objective_id']);
 
  507                        $this->ctrl->redirect($this,
'listObjectives');
 
  510                if(!is_object($this->objective))
 
  518                $GLOBALS[
'tpl']->setContent($this->form->getHtml());
 
  519                #$w_tpl->setVariable('WIZ_CONTENT',$this->form->getHtml()); 
  520                #$tpl->setContent($w_tpl->get()); 
  533                if(!$ilAccess->checkAccess(
'write',
'',$this->course_obj->getRefId()))
 
  535                        $ilErr->raiseError($this->lng->txt(
'permission_denied'),
$ilErr->WARNING);
 
  538                $this->ctrl->saveParameter($this,
'objective_id');
 
  542                if($this->form->checkInput())
 
  544                        $this->objective->setTitle($this->form->getInput(
'title'));
 
  545                        $this->objective->setDescription($this->form->getInput(
'description'));
 
  546                        $this->objective->setPasses(0);
 
  548                        if(!
$_GET[
'objective_id'])
 
  550                                $objective_id = $this->objective->add();
 
  555                                $this->objective->update();
 
  557                                $objective_id = 
$_GET[
'objective_id'];
 
  562                        $this->form->setValuesByPost();
 
  563                        return $this->
edit();
 
  566                if(
$_SESSION[
'objective_mode'] != self::MODE_CREATE)
 
  568                        $this->ctrl->returnToParent($this);
 
  571                $this->ctrl->setParameter($this,
'objective_id',$objective_id);
 
  572                $this->ctrl->redirect($this,
'materialAssignment');
 
  586                if(!$ilAccess->checkAccess(
'write',
'',$this->course_obj->getRefId()))
 
  588                        $ilErr->raiseError($this->lng->txt(
'permission_denied'),
$ilErr->WARNING);
 
  590                if(!
$_GET[
'objective_id'])
 
  593                        $this->ctrl->redirect($this,
'listObjectives');
 
  598                $this->ctrl->saveParameter($this,
'objective_id');
 
  602                include_once(
'./Modules/Course/classes/class.ilCourseObjectiveMaterialAssignmentTableGUI.php');
 
  604                $table->setTitle($this->lng->txt(
'crs_objective_wiz_materials'),
 
  605                        '',$this->lng->txt(
'crs_objectives'));
 
  607                include_once(
'Modules/Course/classes/class.ilCourseObjectiveMaterials.php');
 
  612                #$w_tpl->setVariable('WIZ_CONTENT',$table->getHTML()); 
  613                $GLOBALS[
'tpl']->setContent($table->getHTML());
 
  614                #$tpl->setContent($w_tpl->get()); 
  626                global $ilAccess,
$ilErr,$ilObjDataCache;
 
  628                if(!$ilAccess->checkAccess(
'write',
'',$this->course_obj->getRefId()))
 
  630                        $ilErr->raiseError($this->lng->txt(
'permission_denied'),
$ilErr->WARNING);
 
  632                if(!
$_GET[
'objective_id'])
 
  635                        $this->ctrl->redirect($this,
'listObjectives');
 
  639                $this->objectives_lm_obj->deleteAll();
 
  641                if(is_array(
$_POST[
'materials']))
 
  643                        foreach(
$_POST[
'materials'] as $node_id)
 
  645                                $obj_id = $ilObjDataCache->lookupObjId($node_id);
 
  646                                $type = $ilObjDataCache->lookupType($obj_id);
 
  648                                $this->objectives_lm_obj->setLMRefId($node_id);
 
  649                                $this->objectives_lm_obj->setLMObjId($obj_id);
 
  650                                $this->objectives_lm_obj->setType($type);
 
  651                                $this->objectives_lm_obj->add();
 
  654                if(is_array(
$_POST[
'chapters']))
 
  656                        foreach(
$_POST[
'chapters'] as $chapter)
 
  658                                include_once(
'./Modules/LearningModule/classes/class.ilLMObject.php');
 
  660                                list(
$ref_id,$chapter_id) = explode(
'_',$chapter);
 
  662                                $this->objectives_lm_obj->setLMRefId(
$ref_id);
 
  663                                $this->objectives_lm_obj->setLMObjId($chapter_id);
 
  665                                $this->objectives_lm_obj->add();
 
  671                if(
$_SESSION[
'objective_mode'] != self::MODE_CREATE)
 
  674                        $this->ctrl->returnToParent($this);
 
  699                if(!$ilAccess->checkAccess(
'write',
'',$this->course_obj->getRefId()))
 
  701                        $ilErr->raiseError($this->lng->txt(
'permission_denied'),
$ilErr->WARNING);
 
  703                if(!
$_GET[
'objective_id'])
 
  706                        $this->ctrl->redirect($this,
'listObjectives');
 
  711                $this->ctrl->saveParameter($this,
'objective_id');
 
  724                include_once(
'./Modules/Course/classes/class.ilCourseObjectiveQuestionAssignmentTableGUI.php');
 
  727                        (
int) 
$_GET[
'objective_id'],
 
  729                $table->setTitle($this->lng->txt(
'crs_objective_wiz_self'),
 
  730                        '',$this->lng->txt(
'crs_objective'));
 
  735                $GLOBALS[
'tpl']->setContent($table->getHTML());
 
  736                #$w_tpl->setVariable('WIZ_CONTENT',$table->getHTML()); 
  737                #$tpl->setContent($w_tpl->get()); 
  749                global $ilAccess,
$ilErr,$ilObjDataCache;
 
  751                $checked_questions = 
$_POST[
'questions'] ? 
$_POST[
'questions'] : array();
 
  754                if(!$ilAccess->checkAccess(
'write',
'',$this->course_obj->getRefId()))
 
  756                        $ilErr->raiseError($this->lng->txt(
'permission_denied'),
$ilErr->WARNING);
 
  758                if(!
$_GET[
'objective_id'])
 
  761                        $this->ctrl->redirect($this,
'listObjectives');
 
  767                foreach($this->objectives_qst_obj->getSelfAssessmentQuestions() as $question)
 
  769                        $id = $question[
'ref_id'].
'_'.$question[
'question_id'];
 
  770                        if(!in_array($id,$checked_questions))
 
  772                                $this->objectives_qst_obj->delete($question[
'qst_ass_id']);
 
  776                foreach($checked_questions as $question_id)
 
  778                        list($test_ref_id,$qst_id) = explode(
'_',$question_id);
 
  779                        $test_obj_id = $ilObjDataCache->lookupObjId($test_ref_id);
 
  781                        if($this->objectives_qst_obj->isSelfAssessmentQuestion($qst_id))
 
  786                        $this->objectives_qst_obj->setTestRefId($test_ref_id);
 
  787                        $this->objectives_qst_obj->setTestObjId($test_obj_id);
 
  788                        $this->objectives_qst_obj->setQuestionId($qst_id);
 
  789                        $this->objectives_qst_obj->add();
 
  793                include_once 
'./Modules/Course/classes/class.ilCourseObjectiveQuestion.php';
 
  798                if($checked_questions)
 
  831                if(!$ilAccess->checkAccess(
'write',
'',$this->course_obj->getRefId()))
 
  833                        $ilErr->raiseError($this->lng->txt(
'permission_denied'),
$ilErr->WARNING);
 
  835                if(!
$_GET[
'objective_id'])
 
  838                        $this->ctrl->redirect($this,
'listObjectives');
 
  843                $this->ctrl->saveParameter($this,
'objective_id');
 
  850                $GLOBALS[
'tpl']->setContent($this->form->getHtml());
 
  851                #$w_tpl->setVariable('WIZ_CONTENT',$this->form->getHtml()); 
  852                #$tpl->setContent($w_tpl->get()); 
  864                global $ilAccess,
$ilErr,$ilObjDataCache;
 
  866                if(!$ilAccess->checkAccess(
'write',
'',$this->course_obj->getRefId()))
 
  868                        $ilErr->raiseError($this->lng->txt(
'permission_denied'),
$ilErr->WARNING);
 
  870                if(!
$_GET[
'objective_id'])
 
  873                        $this->ctrl->redirect($this,
'listObjectives');
 
  878                if((
int) 
$_POST[
'limit'] < 1 or (
int) 
$_POST[
'limit'] > 100)
 
  885                foreach($this->objectives_qst_obj->getSelfAssessmentTests() as 
$test)
 
  888                        $this->objectives_qst_obj->setTestSuggestedLimit((
int) 
$_POST[
'limit']);
 
  889                        $this->objectives_qst_obj->updateTest(
$test[
'test_objective_id']);
 
  909                if(!$ilAccess->checkAccess(
'write',
'',$this->course_obj->getRefId()))
 
  911                        $ilErr->raiseError($this->lng->txt(
'permission_denied'),
$ilErr->WARNING);
 
  913                if(!
$_GET[
'objective_id'])
 
  916                        $this->ctrl->redirect($this,
'listObjectives');
 
  921                $this->ctrl->saveParameter($this,
'objective_id');
 
  933                include_once(
'./Modules/Course/classes/class.ilCourseObjectiveQuestionAssignmentTableGUI.php');
 
  936                        (
int) 
$_GET[
'objective_id'],
 
  939                $table->setTitle($this->lng->txt(
'crs_objective_wiz_final'),
 
  940                        '',$this->lng->txt(
'crs_objective'));
 
  945                $GLOBALS[
'tpl']->setContent($table->getHTML());
 
  946                #$w_tpl->setVariable('WIZ_CONTENT',$table->getHTML()); 
  947                #$tpl->setContent($w_tpl->get()); 
  958                $tst_ref_id = $this->
getSettings()->getTestByType($a_tst_type);
 
  963                include_once 
'./Modules/Test/classes/class.ilObjTest.php';
 
  973                $this->ctrl->saveParameter($this,
'objective_id');
 
  974                $this->ctrl->setParameter($this,
'tt',  (
int) 
$_REQUEST[
'tt']);
 
  976                $this->test_type = (int) 
$_REQUEST[
'tt'];
 
  988                $GLOBALS[
'tpl']->setContent($form->getHTML());
 
  989                #$w_tpl->setVariable('WIZ_CONTENT',$form->getHTML()); 
  991                #$GLOBALS['tpl']->setContent($w_tpl->get()); 
  999                include_once 
'./Modules/Course/classes/Objectives/class.ilLORandomTestQuestionPools.php';
 
 1001                                $this->course_obj->getId(),
 
 1006                include_once 
'./Services/Form/classes/class.ilPropertyFormGUI.php';
 
 1008                $form->setFormAction($this->ctrl->getFormAction($this));
 
 1012                        $form->setTitle($this->lng->txt(
'crs_loc_form_random_limits_it'));
 
 1016                        $form->setTitle($this->lng->txt(
'crs_loc_form_random_limits_qt'));
 
 1019                $form->addCommandButton(
'saveRandom', $this->lng->txt(
'save'));
 
 1025                $ass_qpl = 
new ilRadioOption($this->lng->txt(
'crs_loc_rand_assign_qpl'),1);
 
 1030                $qpl->setValue($rnd->getQplSequence());
 
 1031                $ass_qpl->addSubItem($qpl);
 
 1033                #$num = new ilNumberInputGUI($this->lng->txt('crs_loc_num_qst'),'num_qst'); 
 1035                #$num->setMinValue(1); 
 1036                #$num->setRequired(true); 
 1037                #$ass_qpl->addSubItem($num); 
 1041                $per->setValue($rnd->getLimit());
 
 1043                $per->setMinValue(1);
 
 1044                $per->setMaxValue(100);
 
 1045                $per->setRequired(
true);
 
 1046                $ass_qpl->addSubItem($per);
 
 1055                include_once 
'./Modules/Test/classes/class.ilTestRandomQuestionSetSourcePoolDefinitionFactory.php';
 
 1056                include_once 
'./Modules/Test/classes/class.ilTestRandomQuestionSetSourcePoolDefinitionList.php';
 
 1058                $tst_ref_id = $this->
getSettings()->getTestByType($this->test_type);
 
 1076                $list->loadDefinitions();
 
 1078                include_once 
'./Modules/Test/classes/class.ilTestTaxonomyFilterLabelTranslater.php';
 
 1080                $translater->loadLabels($list);
 
 1082                $options[0] = $this->lng->txt(
'select_one');
 
 1083                foreach ($list as $definition)
 
 1085                        $title = $definition->getPoolTitle();
 
 1086                        $tax_id = $definition->getMappedFilterTaxId();
 
 1089                                $title .= (
' -> '. $translater->getTaxonomyTreeLabel($tax_id));
 
 1091                        $tax_node = $definition->getMappedFilterTaxNodeId();
 
 1094                                $title .= (
' -> ' .$translater->getTaxonomyNodeLabel($tax_node));
 
 1096                        $options[$definition->getId()] = $title;
 
 1106                $this->ctrl->saveParameter($this,
'objective_id');
 
 1107                $this->ctrl->setParameter($this,
'tt',(
int) 
$_REQUEST[
'tt']);
 
 1109                $this->test_type = (int) 
$_REQUEST[
'tt'];
 
 1112                if($form->checkInput())
 
 1115                        $qst->deleteByTestType(
 
 1122                        include_once 
'./Modules/Course/classes/Objectives/class.ilLORandomTestQuestionPools.php';
 
 1124                                        $this->course_obj->getId(),
 
 1129                        $rnd->setLimit($form->getInput(
'per'));
 
 1130                        $rnd->setQplSequence($form->getInput(
'qpl'));
 
 1136                        $form->setValuesByPost();
 
 1144                        $this->ctrl->returnToParent($this);
 
 1148                        $this->ctrl->redirect($this,
'finalTestAssignment');
 
 1161                global $ilAccess,
$ilErr,$ilObjDataCache;
 
 1163                $checked_questions = 
$_POST[
'questions'] ? 
$_POST[
'questions'] : array();
 
 1166                if(!$ilAccess->checkAccess(
'write',
'',$this->course_obj->getRefId()))
 
 1168                        $ilErr->raiseError($this->lng->txt(
'permission_denied'),
$ilErr->WARNING);
 
 1170                if(!
$_GET[
'objective_id'])
 
 1173                        $this->ctrl->redirect($this,
'listObjectives');
 
 1179                foreach($this->objectives_qst_obj->getFinalTestQuestions() as $question)
 
 1181                        $id = $question[
'ref_id'].
'_'.$question[
'question_id'];
 
 1182                        if(!in_array($id,$checked_questions))
 
 1184                                $this->objectives_qst_obj->delete($question[
'qst_ass_id']);
 
 1188                foreach($checked_questions as $question_id)
 
 1190                        list($test_ref_id,$qst_id) = explode(
'_',$question_id);
 
 1191                        $test_obj_id = $ilObjDataCache->lookupObjId($test_ref_id);
 
 1193                        if($this->objectives_qst_obj->isFinalTestQuestion($qst_id))
 
 1199                        $this->objectives_qst_obj->setTestRefId($test_ref_id);
 
 1200                        $this->objectives_qst_obj->setTestObjId($test_obj_id);
 
 1201                        $this->objectives_qst_obj->setQuestionId($qst_id);
 
 1202                        $this->objectives_qst_obj->add();
 
 1206                include_once 
'./Modules/Course/classes/class.ilCourseObjectiveQuestion.php';
 
 1226                if(!$ilAccess->checkAccess(
'write',
'',$this->course_obj->getRefId()))
 
 1228                        $ilErr->raiseError($this->lng->txt(
'permission_denied'),
$ilErr->WARNING);
 
 1230                if(!
$_GET[
'objective_id'])
 
 1233                        $this->ctrl->redirect($this,
'listObjectives');
 
 1238                $this->ctrl->saveParameter($this,
'objective_id');
 
 1245                $GLOBALS[
'tpl']->setContent($this->form->getHtml());
 
 1247                #$w_tpl->setVariable('WIZ_CONTENT',$this->form->getHtml()); 
 1248                #$tpl->setContent($w_tpl->get()); 
 1260                global $ilAccess,
$ilErr,$ilObjDataCache;
 
 1262                if(!$ilAccess->checkAccess(
'write',
'',$this->course_obj->getRefId()))
 
 1264                        $ilErr->raiseError($this->lng->txt(
'permission_denied'),
$ilErr->WARNING);
 
 1266                if(!
$_GET[
'objective_id'])
 
 1269                        $this->ctrl->redirect($this,
'listObjectives');
 
 1274                if((
int) 
$_POST[
'limit'] < 1 or (
int) 
$_POST[
'limit'] > 100)
 
 1281                foreach($this->objectives_qst_obj->getFinalTests() as 
$test)
 
 1284                        $this->objectives_qst_obj->setTestSuggestedLimit((
int) 
$_POST[
'limit']);
 
 1285                        $this->objectives_qst_obj->updateTest(
$test[
'test_objective_id']);
 
 1288                if(
$_SESSION[
'objective_mode'] != self::MODE_CREATE)
 
 1296                $this->ctrl->returnToParent($this);
 
 1308                if(!is_object($this->form))
 
 1310                        include_once(
'./Services/Form/classes/class.ilPropertyFormGUI.php');
 
 1313                $this->form->setFormAction($this->ctrl->getFormAction($this));
 
 1314                $this->form->setTableWidth(
'100%');
 
 1319                        case 'selfAssessment':
 
 1320                                $this->form->setTitle($this->lng->txt(
'crs_objective_wiz_self_limit'));
 
 1321                                $this->form->addCommandButton(
'updateSelfAssessmentLimits',$this->lng->txt(
'crs_wiz_next'));
 
 1322                                $this->form->addCommandButton(
'selfAssessmentAssignment',$this->lng->txt(
'crs_wiz_back'));
 
 1324                                $tests = $this->objectives_qst_obj->getSelfAssessmentTests();
 
 1325                                $max_points = $this->objectives_qst_obj->getSelfAssessmentPoints();
 
 1330                                $this->form->setTitle($this->lng->txt(
'crs_objective_wiz_final_limit'));
 
 1331                                $this->form->addCommandButton(
'updateFinalTestLimits',$this->lng->txt(
'crs_wiz_next'));
 
 1332                                $this->form->addCommandButton(
'finalTestAssignment',$this->lng->txt(
'crs_wiz_back'));
 
 1334                                $tests = $this->objectives_qst_obj->getFinalTests();
 
 1335                                $max_points = $this->objectives_qst_obj->getFinalTestPoints();
 
 1340                $over = 
new ilCustomInputGUI($this->lng->txt(
'crs_objective_qst_summary'),
'');
 
 1342                $tpl = 
new ilTemplate(
'tpl.crs_objective_qst_summary.html',
true,
true,
'Modules/Course');
 
 1349                        $GLOBALS[
'ilLog']->write(__METHOD__.
': '.print_r(
$test,TRUE));
 
 1351                        $limit = 
$test[
'limit'];
 
 1353                        foreach($this->objectives_qst_obj->getQuestionsOfTest(
$test[
'obj_id']) as $question)
 
 1355                                $tpl->setCurrentBlock(
'qst');
 
 1356                                $tpl->setVariable(
'QST_TITLE',$question[
'title']);
 
 1357                                if(strlen($question[
'description']))
 
 1359                                        $tpl->setVariable(
'QST_DESCRIPTION',$question[
'description']);
 
 1361                                $tpl->setVariable(
'QST_POINTS',$question[
'points'].
' '.
 
 1362                                        $this->lng->txt(
'crs_objective_points'));
 
 1363                                $tpl->parseCurrentBlock();
 
 1365                        $tpl->setCurrentBlock(
'tst');
 
 1369                                $tpl->setVariable(
'TST_DESC',$desc);
 
 1372                        $tpl->setVariable(
'TST_ALT_IMG',$this->lng->txt(
'obj_tst'));
 
 1373                        $tpl->parseCurrentBlock();
 
 1376                $tpl->setVariable(
'TXT_ALL_POINTS',$this->lng->txt(
'crs_objective_all_points'));
 
 1377                $tpl->setVariable(
'TXT_POINTS',$this->lng->txt(
'crs_objective_points'));
 
 1378                $tpl->setVariable(
'POINTS',$max_points);
 
 1380                $over->setHtml(
$tpl->get());
 
 1381                $this->form->addItem($over);
 
 1385                $req->setValue($limit);
 
 1387                $req->setMinValue(1);
 
 1388                $req->setMaxValue(100);
 
 1389                $req->setRequired(
true);
 
 1392                        case 'selfAssessment':
 
 1393                                $req->setInfo($this->lng->txt(
'crs_obj_initial_req_info'));
 
 1397                                $req->setInfo($this->lng->txt(
'crs_obj_final_req_info'));
 
 1400                $this->form->addItem($req);
 
 1412                include_once(
'./Services/Form/classes/class.ilPropertyFormGUI.php');
 
 1419                $this->form->setFormAction($this->ctrl->getFormAction($this));
 
 1425                                $this->form->setTitle($this->lng->txt(
'crs_objective_wiz_title'));
 
 1426                                $this->form->addCommandButton(
'save',$this->lng->txt(
'crs_wiz_next'));
 
 1428                                #$this->form->addCommandButton('listObjectives',$this->lng->txt('cancel')); 
 1437                $title->setValue($this->objective->getTitle());
 
 1438                $title->setRequired(
true);
 
 1439                $title->setSize(40);
 
 1440                $title->setMaxLength(70);
 
 1441                $this->form->addItem($title);
 
 1444                $desc->setValue($this->objective->getDescription());
 
 1447                $this->form->addItem($desc);
 
 1462                        1 => $this->lng->txt(
'crs_objective_wiz_title'),
 
 1463                        2 => $this->lng->txt(
'crs_objective_wiz_materials'),
 
 1464                        3 => $this->lng->txt(
'crs_objective_wiz_self'),
 
 1465                        4 => $this->lng->txt(
'crs_objective_wiz_self_limit'),
 
 1466                        5 => $this->lng->txt(
'crs_objective_wiz_final'),
 
 1467                        6 => $this->lng->txt(
'crs_objective_wiz_final_limit'));
 
 1470                        1 => $this->lng->txt(
'crs_objective_wiz_title_info'),
 
 1471                        2 => $this->lng->txt(
'crs_objective_wiz_materials_info'),
 
 1472                        3 => $this->lng->txt(
'crs_objective_wiz_self_info'),
 
 1473                        4 => $this->lng->txt(
'crs_objective_wiz_self_limit_info'),
 
 1474                        5 => $this->lng->txt(
'crs_objective_wiz_final_info'),
 
 1475                        6 => $this->lng->txt(
'crs_objective_wiz_final_limit_info'));
 
 1478                        1 => $this->ctrl->getLinkTarget($this,
'edit'),
 
 1479                        2 => $this->ctrl->getLinkTarget($this,
'materialAssignment'),
 
 1480                        3 => $this->ctrl->getLinkTarget($this,
'selfAssessmentAssignment'),
 
 1481                        4 => $this->ctrl->getLinkTarget($this,
'selfAssessmentLimits'),
 
 1482                        5 => $this->ctrl->getLinkTarget($this,
'finalTestAssignment'),
 
 1483                        6 => $this->ctrl->getLinkTarget($this,
'finalTestLimits'));
 
 1489                include_once(
"./Services/UIComponent/Checklist/classes/class.ilChecklistGUI.php");
 
 1493                if(
$_SESSION[
'objective_mode'] == self::MODE_CREATE)
 
 1496                        $check_list->setHeading($this->lng->txt(
'crs_add_objective'));
 
 1502                        $check_list->setHeading($this->lng->txt(
'crs_update_objective'));
 
 1508                foreach(
$options as $step => $title)
 
 1515                        if($step == 3 and !$this->
getSettings()->worksWithInitialTest())
 
 1519                        if($step == 4 and !$this->
getSettings()->worksWithInitialTest())
 
 1534                        if(
$_SESSION[
'objective_mode'] == self::MODE_UPDATE)
 
 1537                                if($step == 4 and !count($this->objectives_qst_obj->getSelfAssessmentQuestions()))
 
 1541                                if($step == 6 and !count($this->objectives_qst_obj->getFinalTestQuestions()))
 
 1546                                if($step == 3 and !$this->
getSettings()->worksWithInitialTest())
 
 1550                                if($step == 4 and !$this->
getSettings()->worksWithInitialTest())
 
 1557                                        $item_link = $links[$step];
 
 1568                $GLOBALS[
"tpl"]->setRightContent($check_list->getHTML());
 
TableGUI for material assignments of course objectives.
class ilCourseObjectiveMaterials
static _getAssignableMaterials($a_container_id)
Get an array of course material ids that can be assigned to learning objectives No tst,...
TableGUI for question assignments of course objectives.
class ilcourseobjectiveQuestion
_hasTests($a_course_id)
@access public
static _updateTestLimits($a_objective_id, $a_status, $a_limit)
update test limits
static _getAssignableTests($a_container_ref_id)
Get assignable tests.
const TYPE_SELF_ASSESSMENT
static _getObjectiveIds($course_id, $a_activated_only=false)
class ilobjcourseobjectivesgui
updateMaterialAssignment()
update material assignment
getRandomTestQplOptions()
saveRandom()
Save random test settings.
saveSorting()
save position
__initQuestionObject($a_objective_id=0)
finalTestAssignment()
final test assignment
__initObjectivesObject($a_id=0)
getSettings()
Get settings.
initFormTitle($a_mode, $a_step_number)
init form title
setSubTabs($a_active="")
set sub tabs
updateSelfAssessmentLimits()
update self assessment limits
selfAssessmentLimits()
self assessment limits
updateFinalTestLimits()
update self assessment limits
__initLMObject($a_objective_id=0)
initWizard($a_step_number)
init wizard
updateFinalTestAssignment()
update self assessment assignment
questionOverview()
question overiew
listObjectives()
list objectives
isRandomTestType($a_tst_type=0)
initFormRandom()
show random test
saveQuestionOverview()
update question overview
selfAssessmentAssignment()
self assessment assignemnt
showRandomTestAssignment(ilPropertyFormGUI $form=null)
updateSelfAssessmentAssignment()
update self assessment assignment
ilCourseObjectivesGUI($a_course_id)
initFormLimits($a_mode)
init limit form
finalTestLimits()
self assessment limits
materialAssignment()
material assignment
& executeCommand()
execute command
static _lookupType($a_obj_id, $a_lm_id=0)
Lookup type.
const TYPE_TEST_QUALIFIED
static getInstanceByObjId($a_obj_id)
get singleton instance
static _lookupRandomTest($a_obj_id)
Returns the fact wether the test with passed obj id is a random questions test or not.
getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
static _lookupObjId($a_id)
static _lookupTitle($a_id)
lookup object title
static _lookupDescription($a_id)
lookup object description
This class represents an option in a radio group.
special template class to simplify handling of ITX/PEAR
This class represents a text area property in a property form.
This class represents a text property in a property form.
static sendQuestion($a_info="", $a_keep=false)
Send Question to Screen.
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
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 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...
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
redirection script todo: (a better solution should control the processing via a xml file)
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
if(!is_array($argv)) $options