25include_once 
'./Modules/Course/classes/Objectives/class.ilLOSettings.php';
 
   63                include_once 
'./Modules/Course/classes/class.ilCourseObjective.php';
 
   68                $this->ctrl->saveParameter($this,array(
"ref_id"));
 
   72                $this->lng->loadLanguageModule(
'crs');
 
   75                $this->tabs_gui = $ilTabs;
 
   77                $this->course_id = $a_course_id;
 
   93                $ilTabs->setTabActive(
'crs_objectives');
 
   95                $cmd = $this->ctrl->getCmd();
 
   98                if (!
$cmd = $this->ctrl->getCmd())
 
  127                global $ilAccess,
$ilErr,$ilObjDataCache,$ilToolbar;
 
  130                if(!$ilAccess->checkAccess(
"write",
'',$this->course_obj->getRefId()))
 
  132                        $this->ilErr->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilErr->MESSAGE);
 
  135                $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.crs_objectives.html',
'Modules/Course');
 
  137                $ilToolbar->addButton($this->lng->txt(
'crs_add_objective'),
 
  138                        $this->ctrl->getLinkTarget($this, 
"'create"));
 
  140                include_once(
'./Modules/Course/classes/class.ilCourseObjectivesTableGUI.php');
 
  142                $table->setTitle($this->lng->txt(
'crs_objectives'),
'',$this->lng->txt(
'crs_objectives'));
 
  145                $this->tpl->setVariable(
'OBJECTIVES_TABLE',$table->getHTML());
 
  156                global $ilAccess,
$ilErr,$ilObjDataCache;
 
  158                if(!$ilAccess->checkAccess(
"write",
'',$this->course_obj->getRefId()))
 
  160                        $this->ilErr->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilErr->MESSAGE);
 
  163                asort(
$_POST[
'position'],SORT_NUMERIC);
 
  166                foreach(
$_POST[
'position'] as $objective_id => $position)
 
  169                        $objective->writePosition(
$counter++);
 
  180                if(!$rbacsystem->checkAccess(
"write", $this->course_obj->getRefId()))
 
  182                        $this->
ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilErr->MESSAGE);
 
  184                if(!count(
$_POST[
'objective']))
 
  192                $this->tpl->addBlockFile(
"ADM_CONTENT", 
"adm_content", 
"tpl.crs_objectives.html",
'Modules/Course');
 
  197                $tpl->addBlockfile(
"TBL_CONTENT", 
"tbl_content", 
"tpl.crs_objectives_delete_row.html",
'Modules/Course');
 
  200                foreach(
$_POST[
'objective'] as $objective_id)
 
  204                        $tpl->setCurrentBlock(
"tbl_content");
 
  206                        $tpl->setVariable(
"TITLE",$objective_obj->getTitle());
 
  207                        $tpl->setVariable(
"DESCRIPTION",$objective_obj->getDescription());
 
  208                        $tpl->parseCurrentBlock();
 
  211                $tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
 
  214                $tpl->setCurrentBlock(
"tbl_action_btn");
 
  215                $tpl->setVariable(
"BTN_NAME",
'deleteObjectives');
 
  216                $tpl->setVariable(
"BTN_VALUE",$this->lng->txt(
'delete'));
 
  217                $tpl->parseCurrentBlock();
 
  219                $tpl->setCurrentBlock(
"tbl_action_btn");
 
  220                $tpl->setVariable(
"BTN_NAME",
'listObjectives');
 
  221                $tpl->setVariable(
"BTN_VALUE",$this->lng->txt(
'cancel'));
 
  222                $tpl->parseCurrentBlock();
 
  224                $tpl->setCurrentBlock(
"tbl_action_row");
 
  225                $tpl->setVariable(
"COLUMN_COUNTS",1);
 
  227                $tpl->parseCurrentBlock();
 
  232                $tbl->setStyle(
'table',
'std');
 
  235                $tbl->setTitle($this->lng->txt(
"crs_objectives"),
"",$this->lng->txt(
"crs_objectives"));
 
  237                $tbl->setHeaderNames(array($this->lng->txt(
"title")));
 
  238                $tbl->setHeaderVars(array(
"title"), 
 
  239                                                        array(
"ref_id" => $this->course_obj->getRefId(),
 
  240                                                                  "cmdClass" => 
"ilcourseobjectivesgui",
 
  241                                                                  "cmdNode" => 
$_GET[
"cmdNode"]));
 
  242                $tbl->setColumnWidth(array(
"50%"));
 
  246                $tbl->setMaxCount(count(
$_POST[
'objective']));
 
  249                $tbl->disable(
"footer");
 
  250                $tbl->disable(
'sort');
 
  256                $this->tpl->setVariable(
"OBJECTIVES_TABLE", 
$tpl->get());
 
  270                if(!$rbacsystem->checkAccess(
"write", $this->course_obj->getRefId()))
 
  272                        $this->
ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilErr->MESSAGE);
 
  274                if(!count(
$_SESSION[
'crs_delete_objectives']))
 
  282                foreach(
$_SESSION[
'crs_delete_objectives'] as $objective_id)
 
  285                        $objective_obj->delete();
 
  302                global $ilAccess,
$ilErr,$ilTabs;
 
  304                $ilTabs->setSubTabActive(
'crs_objective_overview_question_assignment');
 
  306                if(!$ilAccess->checkAccess(
'write',
'',$this->course_obj->getRefId()))
 
  308                        $ilErr->raiseError($this->lng->txt(
'permission_denied'),
$ilErr->WARNING);
 
  311                include_once(
'./Modules/Course/classes/class.ilCourseObjectiveQuestionsTableGUI.php');
 
  313                $table->setTitle($this->lng->txt(
'crs_objectives_edit_question_assignments'),
'',$this->lng->txt(
'crs_objectives'));
 
  318                $this->tpl->setContent($table->getHTML());
 
  329                include_once(
'./Modules/Course/classes/class.ilCourseObjectiveQuestion.php');
 
  333                if(!$ilAccess->checkAccess(
'write',
'',$this->course_obj->getRefId()))
 
  335                        $ilErr->raiseError($this->lng->txt(
'permission_denied'),
$ilErr->WARNING);
 
  342                foreach(
$_POST[
'self'] as $objective_id => $limit)
 
  345                        $max_points = $qst->getSelfAssessmentPoints();
 
  347                        if($limit < 0 or $limit > $max_points)
 
  354                foreach(
$_POST[
'final'] as $objective_id => $limit)
 
  357                        $max_points = $qst->getFinalTestPoints();
 
  359                        if($limit < 0 or $limit > $max_points)
 
  367                foreach(
$_POST[
'self'] as $objective_id => $limit)
 
  372                foreach(
$_POST[
'final'] as $objective_id => $limit)
 
  387                        $this->ilErr->raiseError(
"ilCourseObjectivesGUI: cannot create course object",$this->ilErr->MESSAGE);
 
  400                include_once 
'./Modules/Course/classes/class.ilCourseObjectiveMaterials.php';
 
  414                include_once 
'./Modules/Course/classes/class.ilCourseObjectiveQuestion.php';
 
  417                return $this->objectives_qst_obj;
 
  426                global $ilTabs, $ilHelp;
 
  430                        $ilHelp->setScreenIdComponent(
"crs");
 
  431                        $ilHelp->setScreenId(
"crs_objective");
 
  432                        $ilHelp->setSubScreenId($a_active);
 
  442                $ilTabs->addSubTabTarget(
"crs_objective_overview_objectives",
 
  443                                                                 $this->ctrl->getLinkTarget($this, 
"listObjectives"),
 
  444                                                                 array(
"listObjectives", 
"moveObjectiveUp", 
"moveObjectiveDown", 
"listAssignedLM"),
 
  448                include_once(
'./Modules/Course/classes/class.ilCourseObjectiveQuestion.php');
 
  452                        $ilTabs->addSubTabTarget(
"crs_objective_overview_question_assignment",
 
  453                                                                         $this->ctrl->getLinkTarget($this, 
"questionOverview"),
 
  454                                                                         "editQuestionAssignment",
 
  477                $this->ctrl->saveParameter($this,
'objective_id');
 
  479                if(!is_object($this->objective))
 
  487                $GLOBALS[
'tpl']->setContent($this->form->getHtml());
 
  488                #$w_tpl->setVariable('WIZ_CONTENT',$this->form->getHtml()); 
  489                #$tpl->setContent($w_tpl->get()); 
  506                $this->ctrl->setParameter($this,
'objective_id',(
int) $_REQUEST[
'objective_id']);
 
  508                if(!$_REQUEST[
'objective_id'])
 
  511                        $this->ctrl->redirect($this,
'listObjectives');
 
  514                if(!is_object($this->objective))
 
  516                        $this->objective = 
new ilCourseObjective($this->course_obj,(
int) $_REQUEST[
'objective_id']);
 
  522                $GLOBALS[
'tpl']->setContent($this->form->getHtml());
 
  523                #$w_tpl->setVariable('WIZ_CONTENT',$this->form->getHtml()); 
  524                #$tpl->setContent($w_tpl->get()); 
  537                if(!$ilAccess->checkAccess(
'write',
'',$this->course_obj->getRefId()))
 
  539                        $ilErr->raiseError($this->lng->txt(
'permission_denied'),
$ilErr->WARNING);
 
  542                $this->ctrl->saveParameter($this,
'objective_id');
 
  544                $this->objective = 
new ilCourseObjective($this->course_obj,(
int) $_REQUEST[
'objective_id']);
 
  546                if($this->form->checkInput())
 
  548                        $this->objective->setTitle($this->form->getInput(
'title'));
 
  549                        $this->objective->setDescription($this->form->getInput(
'description'));
 
  550                        $this->objective->setPasses(0);
 
  552                        if(!
$_GET[
'objective_id'])
 
  554                                $objective_id = $this->objective->add();
 
  559                                $this->objective->update();
 
  561                                $objective_id = 
$_GET[
'objective_id'];
 
  566                        $this->form->setValuesByPost();
 
  567                        return $this->
edit();
 
  570                if(
$_SESSION[
'objective_mode'] != self::MODE_CREATE)
 
  572                        $this->ctrl->returnToParent($this);
 
  575                $this->ctrl->setParameter($this,
'objective_id',$objective_id);
 
  576                $this->ctrl->redirect($this,
'materialAssignment');
 
  590                if(!$ilAccess->checkAccess(
'write',
'',$this->course_obj->getRefId()))
 
  592                        $ilErr->raiseError($this->lng->txt(
'permission_denied'),
$ilErr->WARNING);
 
  594                if(!
$_GET[
'objective_id'])
 
  597                        $this->ctrl->redirect($this,
'listObjectives');
 
  602                $this->ctrl->saveParameter($this,
'objective_id');
 
  606                include_once(
'./Modules/Course/classes/class.ilCourseObjectiveMaterialAssignmentTableGUI.php');
 
  608                $table->setTitle($this->lng->txt(
'crs_objective_wiz_materials'),
 
  609                        '',$this->lng->txt(
'crs_objectives'));
 
  611                include_once(
'Modules/Course/classes/class.ilCourseObjectiveMaterials.php');
 
  616                #$w_tpl->setVariable('WIZ_CONTENT',$table->getHTML()); 
  617                $GLOBALS[
'tpl']->setContent($table->getHTML());
 
  618                #$tpl->setContent($w_tpl->get()); 
  630                global $ilAccess,
$ilErr,$ilObjDataCache;
 
  632                if(!$ilAccess->checkAccess(
'write',
'',$this->course_obj->getRefId()))
 
  634                        $ilErr->raiseError($this->lng->txt(
'permission_denied'),
$ilErr->WARNING);
 
  636                if(!
$_GET[
'objective_id'])
 
  639                        $this->ctrl->redirect($this,
'listObjectives');
 
  643                $this->objectives_lm_obj->deleteAll();
 
  645                if(is_array(
$_POST[
'materials']))
 
  647                        foreach(
$_POST[
'materials'] as $node_id)
 
  649                                $obj_id = $ilObjDataCache->lookupObjId($node_id);
 
  650                                $type = $ilObjDataCache->lookupType($obj_id);
 
  652                                $this->objectives_lm_obj->setLMRefId($node_id);
 
  653                                $this->objectives_lm_obj->setLMObjId($obj_id);
 
  654                                $this->objectives_lm_obj->setType($type);
 
  655                                $this->objectives_lm_obj->add();
 
  658                if(is_array(
$_POST[
'chapters']))
 
  660                        foreach(
$_POST[
'chapters'] as $chapter)
 
  662                                include_once(
'./Modules/LearningModule/classes/class.ilLMObject.php');
 
  664                                list(
$ref_id,$chapter_id) = explode(
'_',$chapter);
 
  666                                $this->objectives_lm_obj->setLMRefId(
$ref_id);
 
  667                                $this->objectives_lm_obj->setLMObjId($chapter_id);
 
  669                                $this->objectives_lm_obj->add();
 
  675                if(
$_SESSION[
'objective_mode'] != self::MODE_CREATE)
 
  678                        $this->ctrl->returnToParent($this);
 
  703                if(!$ilAccess->checkAccess(
'write',
'',$this->course_obj->getRefId()))
 
  705                        $ilErr->raiseError($this->lng->txt(
'permission_denied'),
$ilErr->WARNING);
 
  707                if(!
$_GET[
'objective_id'])
 
  710                        $this->ctrl->redirect($this,
'listObjectives');
 
  715                $this->ctrl->saveParameter($this,
'objective_id');
 
  728                include_once(
'./Modules/Course/classes/class.ilCourseObjectiveQuestionAssignmentTableGUI.php');
 
  731                        (
int) 
$_GET[
'objective_id'],
 
  733                $table->setTitle($this->lng->txt(
'crs_objective_wiz_self'),
 
  734                        '',$this->lng->txt(
'crs_objective'));
 
  739                $GLOBALS[
'tpl']->setContent($table->getHTML());
 
  740                #$w_tpl->setVariable('WIZ_CONTENT',$table->getHTML()); 
  741                #$tpl->setContent($w_tpl->get()); 
  753                global $ilAccess,
$ilErr,$ilObjDataCache;
 
  755                $checked_questions = 
$_POST[
'questions'] ? 
$_POST[
'questions'] : array();
 
  758                if(!$ilAccess->checkAccess(
'write',
'',$this->course_obj->getRefId()))
 
  760                        $ilErr->raiseError($this->lng->txt(
'permission_denied'),
$ilErr->WARNING);
 
  762                if(!
$_GET[
'objective_id'])
 
  765                        $this->ctrl->redirect($this,
'listObjectives');
 
  771                foreach($this->objectives_qst_obj->getSelfAssessmentQuestions() as $question)
 
  773                        $id = $question[
'ref_id'].
'_'.$question[
'question_id'];
 
  774                        if(!in_array($id,$checked_questions))
 
  776                                $this->objectives_qst_obj->delete($question[
'qst_ass_id']);
 
  780                foreach($checked_questions as $question_id)
 
  782                        list($test_ref_id,$qst_id) = explode(
'_',$question_id);
 
  783                        $test_obj_id = $ilObjDataCache->lookupObjId($test_ref_id);
 
  785                        if($this->objectives_qst_obj->isSelfAssessmentQuestion($qst_id))
 
  790                        $this->objectives_qst_obj->setTestRefId($test_ref_id);
 
  791                        $this->objectives_qst_obj->setTestObjId($test_obj_id);
 
  792                        $this->objectives_qst_obj->setQuestionId($qst_id);
 
  793                        $this->objectives_qst_obj->add();
 
  797                include_once 
'./Modules/Course/classes/class.ilCourseObjectiveQuestion.php';
 
  802                if($checked_questions)
 
  835                if(!$ilAccess->checkAccess(
'write',
'',$this->course_obj->getRefId()))
 
  837                        $ilErr->raiseError($this->lng->txt(
'permission_denied'),
$ilErr->WARNING);
 
  839                if(!
$_GET[
'objective_id'])
 
  842                        $this->ctrl->redirect($this,
'listObjectives');
 
  847                $this->ctrl->saveParameter($this,
'objective_id');
 
  854                $GLOBALS[
'tpl']->setContent($this->form->getHtml());
 
  855                #$w_tpl->setVariable('WIZ_CONTENT',$this->form->getHtml()); 
  856                #$tpl->setContent($w_tpl->get()); 
  868                global $ilAccess,
$ilErr,$ilObjDataCache;
 
  870                if(!$ilAccess->checkAccess(
'write',
'',$this->course_obj->getRefId()))
 
  872                        $ilErr->raiseError($this->lng->txt(
'permission_denied'),
$ilErr->WARNING);
 
  874                if(!
$_GET[
'objective_id'])
 
  877                        $this->ctrl->redirect($this,
'listObjectives');
 
  882                if((
int) 
$_POST[
'limit'] < 1 or (
int) 
$_POST[
'limit'] > 100)
 
  889                foreach($this->objectives_qst_obj->getSelfAssessmentTests() as 
$test)
 
  892                        $this->objectives_qst_obj->setTestSuggestedLimit((
int) 
$_POST[
'limit']);
 
  893                        $this->objectives_qst_obj->updateTest(
$test[
'test_objective_id']);
 
  897                $this->ctrl->returnToParent($this);
 
  912                if(!$ilAccess->checkAccess(
'write',
'',$this->course_obj->getRefId()))
 
  914                        $ilErr->raiseError($this->lng->txt(
'permission_denied'),
$ilErr->WARNING);
 
  916                if(!
$_GET[
'objective_id'])
 
  919                        $this->ctrl->redirect($this,
'listObjectives');
 
  924                $this->ctrl->saveParameter($this,
'objective_id');
 
  936                include_once(
'./Modules/Course/classes/class.ilCourseObjectiveQuestionAssignmentTableGUI.php');
 
  939                        (
int) 
$_GET[
'objective_id'],
 
  942                $table->setTitle($this->lng->txt(
'crs_objective_wiz_final'),
 
  943                        '',$this->lng->txt(
'crs_objective'));
 
  948                $GLOBALS[
'tpl']->setContent($table->getHTML());
 
  949                #$w_tpl->setVariable('WIZ_CONTENT',$table->getHTML()); 
  950                #$tpl->setContent($w_tpl->get()); 
  961                $tst_ref_id = $this->
getSettings()->getTestByType($a_tst_type);
 
  966                include_once 
'./Modules/Test/classes/class.ilObjTest.php';
 
  976                $this->ctrl->saveParameter($this,
'objective_id');
 
  977                $this->ctrl->setParameter($this,
'tt',  (
int) $_REQUEST[
'tt']);
 
  979                $this->test_type = (int) $_REQUEST[
'tt'];
 
  991                $GLOBALS[
'tpl']->setContent($form->getHTML());
 
  992                #$w_tpl->setVariable('WIZ_CONTENT',$form->getHTML()); 
  994                #$GLOBALS['tpl']->setContent($w_tpl->get()); 
 1002                include_once 
'./Modules/Course/classes/Objectives/class.ilLORandomTestQuestionPools.php';
 
 1004                                $this->course_obj->getId(),
 
 1005                                (
int) $_REQUEST[
'objective_id'],
 
 1009                include_once 
'./Services/Form/classes/class.ilPropertyFormGUI.php';
 
 1011                $form->setFormAction($this->ctrl->getFormAction($this));
 
 1015                        $form->setTitle($this->lng->txt(
'crs_loc_form_random_limits_it'));
 
 1019                        $form->setTitle($this->lng->txt(
'crs_loc_form_random_limits_qt'));
 
 1022                $form->addCommandButton(
'saveRandom', $this->lng->txt(
'save'));
 
 1028                $ass_qpl = 
new ilRadioOption($this->lng->txt(
'crs_loc_rand_assign_qpl'),1);
 
 1033                $qpl->setValue($rnd->getQplSequence());
 
 1034                $ass_qpl->addSubItem($qpl);
 
 1036                #$num = new ilNumberInputGUI($this->lng->txt('crs_loc_num_qst'),'num_qst'); 
 1038                #$num->setMinValue(1); 
 1039                #$num->setRequired(true); 
 1040                #$ass_qpl->addSubItem($num); 
 1044                $per->setValue($rnd->getLimit());
 
 1046                $per->setMinValue(1);
 
 1047                $per->setMaxValue(100);
 
 1048                $per->setRequired(
true);
 
 1049                $ass_qpl->addSubItem($per);
 
 1058                include_once 
'./Modules/Test/classes/class.ilTestRandomQuestionSetSourcePoolDefinitionFactory.php';
 
 1059                include_once 
'./Modules/Test/classes/class.ilTestRandomQuestionSetSourcePoolDefinitionList.php';
 
 1061                $tst_ref_id = $this->
getSettings()->getTestByType($this->test_type);
 
 1079                $list->loadDefinitions();
 
 1081                include_once 
'./Modules/Test/classes/class.ilTestTaxonomyFilterLabelTranslater.php';
 
 1083                $translater->loadLabels($list);
 
 1085                $options[0] = $this->lng->txt(
'select_one');
 
 1086                foreach ($list as $definition)
 
 1088                        $title = $definition->getPoolTitle();
 
 1089                        $tax_id = $definition->getMappedFilterTaxId();
 
 1092                                $title .= (
' -> '. $translater->getTaxonomyTreeLabel($tax_id));
 
 1094                        $tax_node = $definition->getMappedFilterTaxNodeId();
 
 1097                                $title .= (
' -> ' .$translater->getTaxonomyNodeLabel($tax_node));
 
 1109                $this->ctrl->saveParameter($this,
'objective_id');
 
 1110                $this->ctrl->setParameter($this,
'tt',(
int) $_REQUEST[
'tt']);
 
 1112                $this->test_type = (int) $_REQUEST[
'tt'];
 
 1115                if($form->checkInput())
 
 1118                        $qst->deleteByTestType(
 
 1125                        include_once 
'./Modules/Course/classes/Objectives/class.ilLORandomTestQuestionPools.php';
 
 1127                                        $this->course_obj->getId(),
 
 1128                                        (
int) $_REQUEST[
'objective_id'],
 
 1132                        $rnd->setLimit($form->getInput(
'per'));
 
 1133                        $rnd->setQplSequence($form->getInput(
'qpl'));
 
 1139                        $form->setValuesByPost();
 
 1147                        $this->ctrl->returnToParent($this);
 
 1151                        $this->ctrl->redirect($this,
'finalTestAssignment');
 
 1164                global $ilAccess,
$ilErr,$ilObjDataCache;
 
 1166                $checked_questions = 
$_POST[
'questions'] ? 
$_POST[
'questions'] : array();
 
 1169                if(!$ilAccess->checkAccess(
'write',
'',$this->course_obj->getRefId()))
 
 1171                        $ilErr->raiseError($this->lng->txt(
'permission_denied'),
$ilErr->WARNING);
 
 1173                if(!
$_GET[
'objective_id'])
 
 1176                        $this->ctrl->redirect($this,
'listObjectives');
 
 1182                foreach($this->objectives_qst_obj->getFinalTestQuestions() as $question)
 
 1184                        $id = $question[
'ref_id'].
'_'.$question[
'question_id'];
 
 1185                        if(!in_array($id,$checked_questions))
 
 1187                                $this->objectives_qst_obj->delete($question[
'qst_ass_id']);
 
 1191                foreach($checked_questions as $question_id)
 
 1193                        list($test_ref_id,$qst_id) = explode(
'_',$question_id);
 
 1194                        $test_obj_id = $ilObjDataCache->lookupObjId($test_ref_id);
 
 1196                        if($this->objectives_qst_obj->isFinalTestQuestion($qst_id))
 
 1202                        $this->objectives_qst_obj->setTestRefId($test_ref_id);
 
 1203                        $this->objectives_qst_obj->setTestObjId($test_obj_id);
 
 1204                        $this->objectives_qst_obj->setQuestionId($qst_id);
 
 1205                        $this->objectives_qst_obj->add();
 
 1209                include_once 
'./Modules/Course/classes/class.ilCourseObjectiveQuestion.php';
 
 1224                global $ilAccess, 
$ilErr;
 
 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->returnToParent($this);
 
 1235                $this->ctrl->saveParameter($this,
'objective_id');
 
 1239                $form = $this->initFormTestAssignment();
 
 1240                $GLOBALS[
'tpl']->setContent($form->getHtml());
 
 1254                if(!$ilAccess->checkAccess(
'write',
'',$this->course_obj->getRefId()))
 
 1256                        $ilErr->raiseError($this->lng->txt(
'permission_denied'),
$ilErr->WARNING);
 
 1258                if(!
$_GET[
'objective_id'])
 
 1261                        $this->ctrl->returnToParent($this);
 
 1266                $this->ctrl->saveParameter($this,
'objective_id');
 
 1273                $GLOBALS[
'tpl']->setContent($this->form->getHtml());
 
 1275                #$w_tpl->setVariable('WIZ_CONTENT',$this->form->getHtml()); 
 1276                #$tpl->setContent($w_tpl->get()); 
 1288                global $ilAccess,
$ilErr,$ilObjDataCache;
 
 1290                if(!$ilAccess->checkAccess(
'write',
'',$this->course_obj->getRefId()))
 
 1292                        $ilErr->raiseError($this->lng->txt(
'permission_denied'),
$ilErr->WARNING);
 
 1294                if(!
$_GET[
'objective_id'])
 
 1297                        $this->ctrl->redirect($this,
'listObjectives');
 
 1302                if((
int) 
$_POST[
'limit'] < 1 or (
int) 
$_POST[
'limit'] > 100)
 
 1309                foreach($this->objectives_qst_obj->getFinalTests() as 
$test)
 
 1312                        $this->objectives_qst_obj->setTestSuggestedLimit((
int) 
$_POST[
'limit']);
 
 1313                        $this->objectives_qst_obj->updateTest(
$test[
'test_objective_id']);
 
 1316                if(
$_SESSION[
'objective_mode'] != self::MODE_CREATE)
 
 1324                $this->ctrl->returnToParent($this);
 
 1336                if(!is_object($this->form))
 
 1338                        include_once(
'./Services/Form/classes/class.ilPropertyFormGUI.php');
 
 1341                $this->form->setFormAction($this->ctrl->getFormAction($this));
 
 1342                $this->form->setTableWidth(
'100%');
 
 1347                        case 'selfAssessment':
 
 1348                                $this->form->setTitle($this->lng->txt(
'crs_objective_wiz_self_limit'));
 
 1349                                $this->form->addCommandButton(
'updateSelfAssessmentLimits',$this->lng->txt(
'crs_wiz_next'));
 
 1350                                $this->form->addCommandButton(
'selfAssessmentAssignment',$this->lng->txt(
'crs_wiz_back'));
 
 1352                                $tests = $this->objectives_qst_obj->getSelfAssessmentTests();
 
 1353                                $max_points = $this->objectives_qst_obj->getSelfAssessmentPoints();
 
 1358                                $this->form->setTitle($this->lng->txt(
'crs_objective_wiz_final_limit'));
 
 1359                                $this->form->addCommandButton(
'updateFinalTestLimits',$this->lng->txt(
'crs_wiz_next'));
 
 1360                                $this->form->addCommandButton(
'finalTestAssignment',$this->lng->txt(
'crs_wiz_back'));
 
 1362                                $tests = $this->objectives_qst_obj->getFinalTests();
 
 1363                                $max_points = $this->objectives_qst_obj->getFinalTestPoints();
 
 1368                $over = 
new ilCustomInputGUI($this->lng->txt(
'crs_objective_qst_summary'),
'');
 
 1370                $tpl = 
new ilTemplate(
'tpl.crs_objective_qst_summary.html',
true,
true,
'Modules/Course');
 
 1375                foreach($tests as 
$test)
 
 1377                        $GLOBALS[
'ilLog']->write(__METHOD__.
': '.print_r(
$test,TRUE));
 
 1379                        $limit = 
$test[
'limit'];
 
 1381                        foreach($this->objectives_qst_obj->getQuestionsOfTest(
$test[
'obj_id']) as $question)
 
 1383                                $tpl->setCurrentBlock(
'qst');
 
 1384                                $tpl->setVariable(
'QST_TITLE',$question[
'title']);
 
 1385                                if(strlen($question[
'description']))
 
 1387                                        $tpl->setVariable(
'QST_DESCRIPTION',$question[
'description']);
 
 1389                                $tpl->setVariable(
'QST_POINTS',$question[
'points'].
' '.
 
 1390                                        $this->lng->txt(
'crs_objective_points'));
 
 1391                                $tpl->parseCurrentBlock();
 
 1393                        $tpl->setCurrentBlock(
'tst');
 
 1397                                $tpl->setVariable(
'TST_DESC',$desc);
 
 1400                        $tpl->setVariable(
'TST_ALT_IMG',$this->lng->txt(
'obj_tst'));
 
 1401                        $tpl->parseCurrentBlock();
 
 1404                $tpl->setVariable(
'TXT_ALL_POINTS',$this->lng->txt(
'crs_objective_all_points'));
 
 1405                $tpl->setVariable(
'TXT_POINTS',$this->lng->txt(
'crs_objective_points'));
 
 1406                $tpl->setVariable(
'POINTS',$max_points);
 
 1408                $over->setHtml(
$tpl->get());
 
 1409                $this->form->addItem($over);
 
 1413                $req->setValue($limit);
 
 1415                $req->setMinValue(1);
 
 1416                $req->setMaxValue(100);
 
 1417                $req->setRequired(
true);
 
 1420                        case 'selfAssessment':
 
 1421                                $req->setInfo($this->lng->txt(
'crs_obj_initial_req_info'));
 
 1425                                $req->setInfo($this->lng->txt(
'crs_obj_final_req_info'));
 
 1428                $this->form->addItem($req);
 
 1440                include_once(
'./Services/Form/classes/class.ilPropertyFormGUI.php');
 
 1447                $this->form->setFormAction($this->ctrl->getFormAction($this));
 
 1453                                $this->form->setTitle($this->lng->txt(
'crs_objective_wiz_title'));
 
 1454                                $this->form->addCommandButton(
'save',$this->lng->txt(
'crs_wiz_next'));
 
 1456                                #$this->form->addCommandButton('listObjectives',$this->lng->txt('cancel')); 
 1465                $title->setValue($this->objective->getTitle());
 
 1466                $title->setRequired(
true);
 
 1468                $title->setMaxLength(70);
 
 1469                $this->form->addItem(
$title);
 
 1472                $desc->setValue($this->objective->getDescription());
 
 1475                $this->form->addItem($desc);
 
 1490                        1 => $this->lng->txt(
'crs_objective_wiz_title'),
 
 1491                        2 => $this->lng->txt(
'crs_objective_wiz_materials'),
 
 1492                        3 => $this->lng->txt(
'crs_objective_wiz_self'),
 
 1493                        4 => $this->lng->txt(
'crs_objective_wiz_self_limit'),
 
 1494                        5 => $this->lng->txt(
'crs_objective_wiz_final'),
 
 1495                        6 => $this->lng->txt(
'crs_objective_wiz_final_limit'));
 
 1498                        1 => $this->lng->txt(
'crs_objective_wiz_title_info'),
 
 1499                        2 => $this->lng->txt(
'crs_objective_wiz_materials_info'),
 
 1500                        3 => $this->lng->txt(
'crs_objective_wiz_self_info'),
 
 1501                        4 => $this->lng->txt(
'crs_objective_wiz_self_limit_info'),
 
 1502                        5 => $this->lng->txt(
'crs_objective_wiz_final_info'),
 
 1503                        6 => $this->lng->txt(
'crs_objective_wiz_final_limit_info'));
 
 1506                        1 => $this->ctrl->getLinkTarget($this,
'edit'),
 
 1507                        2 => $this->ctrl->getLinkTarget($this,
'materialAssignment'),
 
 1508                        3 => $this->ctrl->getLinkTarget($this,
'selfAssessmentAssignment'),
 
 1509                        4 => $this->ctrl->getLinkTarget($this,
'selfAssessmentLimits'),
 
 1510                        5 => $this->ctrl->getLinkTarget($this,
'finalTestAssignment'),
 
 1511                        6 => $this->ctrl->getLinkTarget($this,
'finalTestLimits'));
 
 1517                include_once(
"./Services/UIComponent/Checklist/classes/class.ilChecklistGUI.php");
 
 1521                if(
$_SESSION[
'objective_mode'] == self::MODE_CREATE)
 
 1524                        $check_list->setHeading($this->lng->txt(
'crs_checklist_objective'));
 
 1530                        $check_list->setHeading($this->lng->txt(
'crs_checklist_objective'));
 
 1570                        if(
$_SESSION[
'objective_mode'] == self::MODE_UPDATE)
 
 1573                                if(
$step == 4 and !count($this->objectives_qst_obj->getSelfAssessmentQuestions()))
 
 1577                                if(
$step == 6 and !count($this->objectives_qst_obj->getFinalTestQuestions()))
 
 1593                                        $item_link = $links[
$step];
 
 1604                $GLOBALS[
"tpl"]->setRightContent($check_list->getHTML());
 
An exception for terminatinating execution or to throw for unit testing.
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
static _updateTestLimits($a_objective_id, $a_status, $a_limit)
update test limits
static _hasTests($a_course_id)
@access public
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
finalSeparatedTestAssignment(ilPropertyFormGUI $form=null)
Show test assignment form.
__initLMObject($a_objective_id=0)
initWizard($a_step_number)
init wizard
__construct($a_course_id)
Constructor.
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
executeCommand()
execute command
initFormLimits($a_mode)
init limit form
finalTestLimits()
self assessment limits
materialAssignment()
material assignment
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.
static 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)
foreach($_REQUEST as $var) foreach(array('_POST'=> 'HTTP_POST_VARS', '_GET'=> 'HTTP_GET_VARS', '_COOKIE'=> 'HTTP_COOKIE_VARS', '_SERVER'=> 'HTTP_SERVER_VARS', '_ENV'=> 'HTTP_ENV_VARS', '_FILES'=> 'HTTP_POST_FILES') as $array=> $other) $step
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
redirection script todo: (a better solution should control the processing via a xml file)
if(!is_array($argv)) $options