25include_once 
'./Modules/Course/classes/Objectives/class.ilLOSettings.php';
 
   68        include_once 
'./Modules/Course/classes/class.ilCourseObjective.php';
 
   78        $ilTabs = 
$DIC[
'ilTabs'];
 
   81        $this->ctrl->saveParameter($this, array(
"ref_id"));
 
   83        $this->logger = 
$GLOBALS[
'DIC']->logger()->crs();
 
   86        $this->lng->loadLanguageModule(
'crs');
 
   89        $this->tabs_gui = $ilTabs;
 
   91        $this->course_id = $a_course_id;
 
  106        $ilTabs = 
$DIC[
'ilTabs'];
 
  108        $ilTabs->setTabActive(
'crs_objectives');
 
  110        $cmd = $this->ctrl->getCmd();
 
  113        if (!$cmd = $this->ctrl->getCmd()) {
 
  143        $ilAccess = 
$DIC[
'ilAccess'];
 
  145        $ilObjDataCache = 
$DIC[
'ilObjDataCache'];
 
  146        $ilToolbar = 
$DIC[
'ilToolbar'];
 
  149        if (!$ilAccess->checkAccess(
"write", 
'', $this->course_obj->getRefId())) {
 
  150            $this->ilErr->raiseError($this->lng->txt(
"msg_no_perm_write"), $this->ilErr->MESSAGE);
 
  153        $this->tpl->addBlockFile(
'ADM_CONTENT', 
'adm_content', 
'tpl.crs_objectives.html', 
'Modules/Course');
 
  155        $ilToolbar->addButton(
 
  156            $this->lng->txt(
'crs_add_objective'),
 
  157            $this->ctrl->getLinkTarget($this, 
"'create")
 
  160        include_once(
'./Modules/Course/classes/class.ilCourseObjectivesTableGUI.php');
 
  162        $table->setTitle($this->lng->txt(
'crs_objectives'), 
'', $this->lng->txt(
'crs_objectives'));
 
  165        $this->tpl->setVariable(
'OBJECTIVES_TABLE', 
$table->getHTML());
 
  178        $ilAccess = 
$DIC[
'ilAccess'];
 
  180        $ilObjDataCache = 
$DIC[
'ilObjDataCache'];
 
  182        if (!$ilAccess->checkAccess(
"write", 
'', $this->course_obj->getRefId())) {
 
  183            $this->ilErr->raiseError($this->lng->txt(
"msg_no_perm_write"), $this->ilErr->MESSAGE);
 
  186        asort(
$_POST[
'position'], SORT_NUMERIC);
 
  189        foreach (
$_POST[
'position'] as $objective_id => $position) {
 
  191            $objective->writePosition($counter++);
 
  193        ilUtil::sendSuccess($this->lng->txt(
'crs_objective_saved_sorting'));
 
  201        $rbacsystem = 
$DIC[
'rbacsystem'];
 
  204        if (!$rbacsystem->checkAccess(
"write", $this->course_obj->getRefId())) {
 
  205            $this->
ilias->raiseError($this->lng->txt(
"msg_no_perm_write"), $this->ilErr->MESSAGE);
 
  207        if (!count(
$_POST[
'objective'])) {
 
  214        $this->tpl->addBlockFile(
"ADM_CONTENT", 
"adm_content", 
"tpl.crs_objectives.html", 
'Modules/Course');
 
  219        $tpl->addBlockfile(
"TBL_CONTENT", 
"tbl_content", 
"tpl.crs_objectives_delete_row.html", 
'Modules/Course');
 
  222        foreach (
$_POST[
'objective'] as $objective_id) {
 
  225            $tpl->setCurrentBlock(
"tbl_content");
 
  227            $tpl->setVariable(
"TITLE", $objective_obj->getTitle());
 
  228            $tpl->setVariable(
"DESCRIPTION", $objective_obj->getDescription());
 
  229            $tpl->parseCurrentBlock();
 
  232        $tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
 
  235        $tpl->setCurrentBlock(
"tbl_action_btn");
 
  236        $tpl->setVariable(
"BTN_NAME", 
'deleteObjectives');
 
  237        $tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
'delete'));
 
  238        $tpl->parseCurrentBlock();
 
  240        $tpl->setCurrentBlock(
"tbl_action_btn");
 
  241        $tpl->setVariable(
"BTN_NAME", 
'listObjectives');
 
  242        $tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
'cancel'));
 
  243        $tpl->parseCurrentBlock();
 
  245        $tpl->setCurrentBlock(
"tbl_action_row");
 
  246        $tpl->setVariable(
"COLUMN_COUNTS", 1);
 
  248        $tpl->parseCurrentBlock();
 
  253        $tbl->setStyle(
'table', 
'std');
 
  256        $tbl->setTitle($this->lng->txt(
"crs_objectives"), 
"", $this->lng->txt(
"crs_objectives"));
 
  258        $tbl->setHeaderNames(array($this->lng->txt(
"title")));
 
  261            array(
"ref_id" => $this->course_obj->getRefId(),
 
  262                                  "cmdClass" => 
"ilcourseobjectivesgui",
 
  263                                  "cmdNode" => 
$_GET[
"cmdNode"])
 
  265        $tbl->setColumnWidth(array(
"50%"));
 
  269        $tbl->setMaxCount(count(
$_POST[
'objective']));
 
  272        $tbl->disable(
"footer");
 
  273        $tbl->disable(
'sort');
 
  279        $this->tpl->setVariable(
"OBJECTIVES_TABLE", 
$tpl->get());
 
  292        $rbacsystem = 
$DIC[
'rbacsystem'];
 
  295        if (!$rbacsystem->checkAccess(
"write", $this->course_obj->getRefId())) {
 
  296            $this->
ilias->raiseError($this->lng->txt(
"msg_no_perm_write"), $this->ilErr->MESSAGE);
 
  298        if (!count(
$_SESSION[
'crs_delete_objectives'])) {
 
  305        foreach (
$_SESSION[
'crs_delete_objectives'] as $objective_id) {
 
  307            $objective_obj->delete();
 
  310        ilUtil::sendSuccess($this->lng->txt(
'crs_objectives_deleted'));
 
  326        $ilAccess = 
$DIC[
'ilAccess'];
 
  328        $ilTabs = 
$DIC[
'ilTabs'];
 
  330        $ilTabs->setSubTabActive(
'crs_objective_overview_question_assignment');
 
  332        if (!$ilAccess->checkAccess(
'write', 
'', $this->course_obj->getRefId())) {
 
  333            $ilErr->raiseError($this->lng->txt(
'permission_denied'), 
$ilErr->WARNING);
 
  336        include_once(
'./Modules/Course/classes/class.ilCourseObjectiveQuestionsTableGUI.php');
 
  338        $table->setTitle($this->lng->txt(
'crs_objectives_edit_question_assignments'), 
'', $this->lng->txt(
'crs_objectives'));
 
  343        $this->tpl->setContent(
$table->getHTML());
 
  354        include_once(
'./Modules/Course/classes/class.ilCourseObjectiveQuestion.php');
 
  358        $ilAccess = 
$DIC[
'ilAccess'];
 
  361        if (!$ilAccess->checkAccess(
'write', 
'', $this->course_obj->getRefId())) {
 
  362            $ilErr->raiseError($this->lng->txt(
'permission_denied'), 
$ilErr->WARNING);
 
  369        foreach (
$_POST[
'self'] as $objective_id => $limit) {
 
  371            $max_points = $qst->getSelfAssessmentPoints();
 
  373            if ($limit < 0 or $limit > $max_points) {
 
  379        foreach (
$_POST[
'final'] as $objective_id => $limit) {
 
  381            $max_points = $qst->getFinalTestPoints();
 
  383            if ($limit < 0 or $limit > $max_points) {
 
  390        foreach (
$_POST[
'self'] as $objective_id => $limit) {
 
  394        foreach (
$_POST[
'final'] as $objective_id => $limit) {
 
  398        ilUtil::sendSuccess($this->lng->txt(
'settings_saved'));
 
  407            $this->ilErr->raiseError(
"ilCourseObjectivesGUI: cannot create course object", $this->ilErr->MESSAGE);
 
  420        include_once 
'./Modules/Course/classes/class.ilCourseObjectiveMaterials.php';
 
  434        include_once 
'./Modules/Course/classes/class.ilCourseObjectiveQuestion.php';
 
  437        return $this->objectives_qst_obj;
 
  448        $ilTabs = 
$DIC[
'ilTabs'];
 
  449        $ilHelp = 
$DIC[
'ilHelp'];
 
  451        if ($a_active != 
"") {
 
  452            $ilHelp->setScreenIdComponent(
"crs");
 
  453            $ilHelp->setScreenId(
"crs_objective");
 
  454            $ilHelp->setSubScreenId($a_active);
 
  464        $ilTabs->addSubTabTarget(
 
  465            "crs_objective_overview_objectives",
 
  466            $this->ctrl->getLinkTarget($this, 
"listObjectives"),
 
  467            array(
"listObjectives", 
"moveObjectiveUp", 
"moveObjectiveDown", 
"listAssignedLM"),
 
  472        include_once(
'./Modules/Course/classes/class.ilCourseObjectiveQuestion.php');
 
  475            $ilTabs->addSubTabTarget(
 
  476                "crs_objective_overview_question_assignment",
 
  477                $this->ctrl->getLinkTarget($this, 
"questionOverview"),
 
  478                "editQuestionAssignment",
 
  504        $this->ctrl->saveParameter($this, 
'objective_id');
 
  506        if (!is_object($this->objective)) {
 
  513        $GLOBALS[
'DIC'][
'tpl']->setContent($this->form->getHtml());
 
  514        #$w_tpl->setVariable('WIZ_CONTENT',$this->form->getHtml()); 
  515        #$tpl->setContent($w_tpl->get()); 
  534        $this->ctrl->setParameter($this, 
'objective_id', (
int) $_REQUEST[
'objective_id']);
 
  536        if (!$_REQUEST[
'objective_id']) {
 
  538            $this->ctrl->redirect($this, 
'listObjectives');
 
  541        if (!is_object($this->objective)) {
 
  542            $this->objective = 
new ilCourseObjective($this->course_obj, (
int) $_REQUEST[
'objective_id']);
 
  548        $GLOBALS[
'DIC'][
'tpl']->setContent($this->form->getHtml());
 
  549        #$w_tpl->setVariable('WIZ_CONTENT',$this->form->getHtml()); 
  550        #$tpl->setContent($w_tpl->get()); 
  563        $ilAccess = 
$DIC[
'ilAccess'];
 
  566        if (!$ilAccess->checkAccess(
'write', 
'', $this->course_obj->getRefId())) {
 
  567            $ilErr->raiseError($this->lng->txt(
'permission_denied'), 
$ilErr->WARNING);
 
  570        $this->ctrl->saveParameter($this, 
'objective_id');
 
  572        $this->objective = 
new ilCourseObjective($this->course_obj, (
int) $_REQUEST[
'objective_id']);
 
  574        if ($this->form->checkInput()) {
 
  575            $this->objective->setTitle($this->form->getInput(
'title'));
 
  576            $this->objective->setDescription($this->form->getInput(
'description'));
 
  577            $this->objective->setPasses(0);
 
  579            if (!
$_GET[
'objective_id']) {
 
  580                $objective_id = $this->objective->add();
 
  581                ilUtil::sendSuccess($this->lng->txt(
'crs_added_objective'), 
true);
 
  583                $this->objective->update();
 
  584                ilUtil::sendSuccess($this->lng->txt(
'crs_objective_modified'), 
true);
 
  585                $objective_id = 
$_GET[
'objective_id'];
 
  588            if ((
int) 
$_GET[
'objective_id']) {
 
  589                $this->form->setValuesByPost();
 
  590                return $this->
edit();
 
  592                $this->form->setValuesByPost();
 
  597        if (
$_SESSION[
'objective_mode'] != self::MODE_CREATE) {
 
  598            $this->ctrl->returnToParent($this);
 
  601        $this->ctrl->setParameter($this, 
'objective_id', $objective_id);
 
  602        $this->ctrl->redirect($this, 
'materialAssignment');
 
  616        $ilAccess = 
$DIC[
'ilAccess'];
 
  620        if (!$ilAccess->checkAccess(
'write', 
'', $this->course_obj->getRefId())) {
 
  621            $ilErr->raiseError($this->lng->txt(
'permission_denied'), 
$ilErr->WARNING);
 
  623        if (!
$_GET[
'objective_id']) {
 
  625            $this->ctrl->redirect($this, 
'listObjectives');
 
  630        $this->ctrl->saveParameter($this, 
'objective_id');
 
  634        include_once(
'./Modules/Course/classes/class.ilCourseObjectiveMaterialAssignmentTableGUI.php');
 
  637            $this->lng->txt(
'crs_objective_wiz_materials'),
 
  639            $this->lng->txt(
'crs_objectives')
 
  642        include_once(
'Modules/Course/classes/class.ilCourseObjectiveMaterials.php');
 
  647        #$w_tpl->setVariable('WIZ_CONTENT',$table->getHTML()); 
  649        #$tpl->setContent($w_tpl->get()); 
  663        $ilAccess = 
$DIC[
'ilAccess'];
 
  665        $ilObjDataCache = 
$DIC[
'ilObjDataCache'];
 
  667        if (!$ilAccess->checkAccess(
'write', 
'', $this->course_obj->getRefId())) {
 
  668            $ilErr->raiseError($this->lng->txt(
'permission_denied'), 
$ilErr->WARNING);
 
  670        if (!
$_GET[
'objective_id']) {
 
  672            $this->ctrl->redirect($this, 
'listObjectives');
 
  676        $this->objectives_lm_obj->deleteAll();
 
  678        if (is_array(
$_POST[
'materials'])) {
 
  679            foreach (
$_POST[
'materials'] as $node_id) {
 
  680                $obj_id = $ilObjDataCache->lookupObjId($node_id);
 
  681                $type = $ilObjDataCache->lookupType($obj_id);
 
  683                $this->objectives_lm_obj->setLMRefId($node_id);
 
  684                $this->objectives_lm_obj->setLMObjId($obj_id);
 
  685                $this->objectives_lm_obj->setType(
$type);
 
  686                $this->objectives_lm_obj->add();
 
  689        if (is_array(
$_POST[
'chapters'])) {
 
  690            foreach (
$_POST[
'chapters'] as $chapter) {
 
  691                include_once(
'./Modules/LearningModule/classes/class.ilLMObject.php');
 
  693                list($ref_id, $chapter_id) = explode(
'_', $chapter);
 
  695                $this->objectives_lm_obj->setLMRefId($ref_id);
 
  696                $this->objectives_lm_obj->setLMObjId($chapter_id);
 
  698                $this->objectives_lm_obj->add();
 
  701        ilUtil::sendSuccess($this->lng->txt(
'crs_objectives_assigned_lm'));
 
  704        if (
$_SESSION[
'objective_mode'] != self::MODE_CREATE) {
 
  705            ilUtil::sendSuccess($this->lng->txt(
'crs_objectives_assigned_lm'), 
true);
 
  706            $this->ctrl->returnToParent($this);
 
  710        if ($this->
getSettings()->worksWithInitialTest()) {
 
  728        $ilAccess = 
$DIC[
'ilAccess'];
 
  732        if (!$ilAccess->checkAccess(
'write', 
'', $this->course_obj->getRefId())) {
 
  733            $ilErr->raiseError($this->lng->txt(
'permission_denied'), 
$ilErr->WARNING);
 
  735        if (!
$_GET[
'objective_id']) {
 
  737            $this->ctrl->redirect($this, 
'listObjectives');
 
  742        $this->ctrl->saveParameter($this, 
'objective_id');
 
  754        include_once(
'./Modules/Course/classes/class.ilCourseObjectiveQuestionAssignmentTableGUI.php');
 
  758            (
int) 
$_GET[
'objective_id'],
 
  762            $this->lng->txt(
'crs_objective_wiz_self'),
 
  764            $this->lng->txt(
'crs_objective')
 
  771        #$w_tpl->setVariable('WIZ_CONTENT',$table->getHTML()); 
  772        #$tpl->setContent($w_tpl->get()); 
  786        $ilAccess = 
$DIC[
'ilAccess'];
 
  788        $ilObjDataCache = 
$DIC[
'ilObjDataCache'];
 
  790        $checked_questions = 
$_POST[
'questions'] ? 
$_POST[
'questions'] : array();
 
  793        if (!$ilAccess->checkAccess(
'write', 
'', $this->course_obj->getRefId())) {
 
  794            $ilErr->raiseError($this->lng->txt(
'permission_denied'), 
$ilErr->WARNING);
 
  796        if (!
$_GET[
'objective_id']) {
 
  798            $this->ctrl->redirect($this, 
'listObjectives');
 
  804        foreach ($this->objectives_qst_obj->getSelfAssessmentQuestions() as $question) {
 
  805            $id = $question[
'ref_id'] . 
'_' . $question[
'question_id'];
 
  806            if (!in_array(
$id, $checked_questions)) {
 
  807                $this->objectives_qst_obj->delete($question[
'qst_ass_id']);
 
  811        foreach ($checked_questions as $question_id) {
 
  812            list($test_ref_id, $qst_id) = explode(
'_', $question_id);
 
  813            $test_obj_id = $ilObjDataCache->lookupObjId($test_ref_id);
 
  815            if ($this->objectives_qst_obj->isSelfAssessmentQuestion($qst_id)) {
 
  819            $this->objectives_qst_obj->setTestRefId($test_ref_id);
 
  820            $this->objectives_qst_obj->setTestObjId($test_obj_id);
 
  821            $this->objectives_qst_obj->setQuestionId($qst_id);
 
  822            $this->objectives_qst_obj->add();
 
  826        include_once 
'./Modules/Course/classes/class.ilCourseObjectiveQuestion.php';
 
  831        if ($checked_questions) {
 
  832            ilUtil::sendSuccess($this->lng->txt(
'crs_objectives_assigned_lm'));
 
  843                    ilUtil::sendSuccess($this->lng->txt(
'crs_objectives_assigned_lm'));
 
  860        $ilAccess = 
$DIC[
'ilAccess'];
 
  864        if (!$ilAccess->checkAccess(
'write', 
'', $this->course_obj->getRefId())) {
 
  865            $ilErr->raiseError($this->lng->txt(
'permission_denied'), 
$ilErr->WARNING);
 
  867        if (!
$_GET[
'objective_id']) {
 
  869            $this->ctrl->redirect($this, 
'listObjectives');
 
  874        $this->ctrl->saveParameter($this, 
'objective_id');
 
  881        $GLOBALS[
'DIC'][
'tpl']->setContent($this->form->getHtml());
 
  882        #$w_tpl->setVariable('WIZ_CONTENT',$this->form->getHtml()); 
  883        #$tpl->setContent($w_tpl->get()); 
  897        $ilAccess = 
$DIC[
'ilAccess'];
 
  899        $ilObjDataCache = 
$DIC[
'ilObjDataCache'];
 
  901        if (!$ilAccess->checkAccess(
'write', 
'', $this->course_obj->getRefId())) {
 
  902            $ilErr->raiseError($this->lng->txt(
'permission_denied'), 
$ilErr->WARNING);
 
  904        if (!
$_GET[
'objective_id']) {
 
  906            $this->ctrl->redirect($this, 
'listObjectives');
 
  911        if ((
int) 
$_POST[
'limit'] < 1 or (
int) 
$_POST[
'limit'] > 100) {
 
  917        foreach ($this->objectives_qst_obj->getSelfAssessmentTests() as 
$test) {
 
  919            $this->objectives_qst_obj->setTestSuggestedLimit((
int) 
$_POST[
'limit']);
 
  920            $this->objectives_qst_obj->updateTest(
$test[
'test_objective_id']);
 
  923        ilUtil::sendSuccess($this->lng->txt(
'settings_saved'), 
true);
 
  924        $this->ctrl->returnToParent($this);
 
  939        $ilAccess = 
$DIC[
'ilAccess'];
 
  943        if (!$ilAccess->checkAccess(
'write', 
'', $this->course_obj->getRefId())) {
 
  944            $ilErr->raiseError($this->lng->txt(
'permission_denied'), 
$ilErr->WARNING);
 
  946        if (!
$_GET[
'objective_id']) {
 
  948            $this->ctrl->redirect($this, 
'listObjectives');
 
  953        $this->ctrl->saveParameter($this, 
'objective_id');
 
  964        include_once(
'./Modules/Course/classes/class.ilCourseObjectiveQuestionAssignmentTableGUI.php');
 
  968            (
int) 
$_GET[
'objective_id'],
 
  973            $this->lng->txt(
'crs_objective_wiz_final'),
 
  975            $this->lng->txt(
'crs_objective')
 
  982        #$w_tpl->setVariable('WIZ_CONTENT',$table->getHTML()); 
  983        #$tpl->setContent($w_tpl->get()); 
  993        $tst_ref_id = $this->
getSettings()->getTestByType($a_tst_type);
 
  997        include_once 
'./Modules/Test/classes/class.ilObjTest.php';
 
 1007        $this->ctrl->saveParameter($this, 
'objective_id');
 
 1008        $this->ctrl->setParameter($this, 
'tt', (
int) $_REQUEST[
'tt']);
 
 1010        $this->test_type = (int) $_REQUEST[
'tt'];
 
 1022        #$w_tpl->setVariable('WIZ_CONTENT',$form->getHTML()); 
 1024        #$GLOBALS['DIC']['tpl']->setContent($w_tpl->get()); 
 1032        include_once 
'./Services/Form/classes/class.ilPropertyFormGUI.php';
 
 1034        $form->setFormAction($this->ctrl->getFormAction($this));
 
 1037            $form->setTitle($this->lng->txt(
'crs_loc_form_random_limits_it'));
 
 1039            $form->setTitle($this->lng->txt(
'crs_loc_form_random_limits_qt'));
 
 1042        $form->addCommandButton(
'saveRandom', $this->lng->txt(
'save'));
 
 1048        $ass_qpl = 
new ilRadioOption($this->lng->txt(
'crs_loc_rand_assign_qpl'), 1);
 
 1052        $qpl->setRequired(
true);
 
 1053        $qpl->setMulti(
true, 
false);
 
 1054        $qpl->setOptions($this->getRandomTestQplOptions());
 
 1057            $this->course_obj->getId(),
 
 1058            (
int) $_REQUEST[
'objective_id'],
 
 1063        $qpl->setValue($sequences[0]);
 
 1064        $qpl->setMultiValues($sequences);
 
 1065        $ass_qpl->addSubItem($qpl);
 
 1071                $this->course_obj->getId(),
 
 1072                (
int) $_REQUEST[
'objective_id'],
 
 1077        $per->setMinValue(1);
 
 1078        $per->setMaxValue(100);
 
 1079        $per->setRequired(
true);
 
 1080        $ass_qpl->addSubItem($per);
 
 1087    protected function getRandomTestQplOptions()
 
 1089        include_once 
'./Modules/Test/classes/class.ilTestRandomQuestionSetSourcePoolDefinitionFactory.php';
 
 1090        include_once 
'./Modules/Test/classes/class.ilTestRandomQuestionSetSourcePoolDefinitionList.php';
 
 1092        $tst_ref_id = $this->
getSettings()->getTestByType($this->test_type);
 
 1108        $list->loadDefinitions();
 
 1110        include_once 
'./Modules/Test/classes/class.ilTestTaxonomyFilterLabelTranslater.php';
 
 1112        $translater->loadLabels(
$list);
 
 1114        $options[0] = $this->lng->txt(
'select_one');
 
 1115        foreach (
$list as $definition) {
 
 1117            $title = $definition->getPoolTitle();
 
 1119            $filterTitle = array();
 
 1120            $filterTitle[] = $translater->getTaxonomyFilterLabel($definition->getMappedTaxonomyFilter());
 
 1121            $filterTitle[] = $translater->getTypeFilterLabel($definition->getTypeFilter());
 
 1122            if (!empty($filterTitle)) {
 
 1123                $title .= 
' -> ' . implode(
' / ', $filterTitle);
 
 1125            #$tax_id = $definition->getMappedFilterTaxId(); 
 1128            #   $title .= (' -> '. $translater->getTaxonomyTreeLabel($tax_id)); 
 1130            #$tax_node = $definition->getMappedFilterTaxNodeId(); 
 1133            #   $title .= (' -> ' .$translater->getTaxonomyNodeLabel($tax_node)); 
 1146        $this->ctrl->saveParameter($this, 
'objective_id');
 
 1147        $this->ctrl->setParameter($this, 
'tt', (
int) $_REQUEST[
'tt']);
 
 1149        $this->test_type = (int) $_REQUEST[
'tt'];
 
 1156        if (
$form->checkInput()) {
 
 1158                $this->course_obj->getId(),
 
 1159                (
int) $_REQUEST[
'objective_id'],
 
 1164            $qst->deleteByTestType(
 
 1169            $ref_id = $this->
getSettings()->getTestByType($this->test_type);
 
 1170            foreach (array_unique((array) 
$form->getInput(
'qpl')) as $qpl_id) {
 
 1171                include_once 
'./Modules/Course/classes/Objectives/class.ilLORandomTestQuestionPools.php';
 
 1173                    $this->course_obj->getId(),
 
 1174                    (
int) $_REQUEST[
'objective_id'],
 
 1178                $rnd->setLimit(
$form->getInput(
'per'));
 
 1183            $form->setValuesByPost();
 
 1188        ilUtil::sendSuccess($this->lng->txt(
'settings_saved'), 
true);
 
 1190            $this->ctrl->returnToParent($this);
 
 1192            $this->ctrl->redirect($this, 
'finalTestAssignment');
 
 1207        $ilAccess = 
$DIC[
'ilAccess'];
 
 1209        $ilObjDataCache = 
$DIC[
'ilObjDataCache'];
 
 1211        $checked_questions = 
$_POST[
'questions'] ? 
$_POST[
'questions'] : array();
 
 1214        if (!$ilAccess->checkAccess(
'write', 
'', $this->course_obj->getRefId())) {
 
 1215            $ilErr->raiseError($this->lng->txt(
'permission_denied'), 
$ilErr->WARNING);
 
 1217        if (!
$_GET[
'objective_id']) {
 
 1219            $this->ctrl->redirect($this, 
'listObjectives');
 
 1225        foreach ($this->objectives_qst_obj->getFinalTestQuestions() as $question) {
 
 1226            $id = $question[
'ref_id'] . 
'_' . $question[
'question_id'];
 
 1227            if (!in_array(
$id, $checked_questions)) {
 
 1228                $this->objectives_qst_obj->delete($question[
'qst_ass_id']);
 
 1232        foreach ($checked_questions as $question_id) {
 
 1233            list($test_ref_id, $qst_id) = explode(
'_', $question_id);
 
 1234            $test_obj_id = $ilObjDataCache->lookupObjId($test_ref_id);
 
 1236            if ($this->objectives_qst_obj->isFinalTestQuestion($qst_id)) {
 
 1241            $this->objectives_qst_obj->setTestRefId($test_ref_id);
 
 1242            $this->objectives_qst_obj->setTestObjId($test_obj_id);
 
 1243            $this->objectives_qst_obj->setQuestionId($qst_id);
 
 1244            $this->objectives_qst_obj->add();
 
 1248        include_once 
'./Modules/Course/classes/class.ilCourseObjectiveQuestion.php';
 
 1253        ilUtil::sendSuccess($this->lng->txt(
'crs_objectives_assigned_lm'));
 
 1265        $ilAccess = 
$DIC[
'ilAccess'];
 
 1268        if (!$ilAccess->checkAccess(
'write', 
'', $this->course_obj->getRefId())) {
 
 1269            $ilErr->raiseError($this->lng->txt(
'permission_denied'), 
$ilErr->WARNING);
 
 1271        if (!
$_GET[
'objective_id']) {
 
 1273            $this->ctrl->returnToParent($this);
 
 1275        $this->ctrl->saveParameter($this, 
'objective_id');
 
 1279        $form = $this->initFormTestAssignment();
 
 1294        $ilAccess = 
$DIC[
'ilAccess'];
 
 1298        if (!$ilAccess->checkAccess(
'write', 
'', $this->course_obj->getRefId())) {
 
 1299            $ilErr->raiseError($this->lng->txt(
'permission_denied'), 
$ilErr->WARNING);
 
 1301        if (!
$_GET[
'objective_id']) {
 
 1303            $this->ctrl->returnToParent($this);
 
 1308        $this->ctrl->saveParameter($this, 
'objective_id');
 
 1315        $GLOBALS[
'DIC'][
'tpl']->setContent($this->form->getHtml());
 
 1317        #$w_tpl->setVariable('WIZ_CONTENT',$this->form->getHtml()); 
 1318        #$tpl->setContent($w_tpl->get()); 
 1332        $ilAccess = 
$DIC[
'ilAccess'];
 
 1334        $ilObjDataCache = 
$DIC[
'ilObjDataCache'];
 
 1336        if (!$ilAccess->checkAccess(
'write', 
'', $this->course_obj->getRefId())) {
 
 1337            $ilErr->raiseError($this->lng->txt(
'permission_denied'), 
$ilErr->WARNING);
 
 1339        if (!
$_GET[
'objective_id']) {
 
 1341            $this->ctrl->redirect($this, 
'listObjectives');
 
 1346        if ((
int) 
$_POST[
'limit'] < 1 or (
int) 
$_POST[
'limit'] > 100) {
 
 1352        foreach ($this->objectives_qst_obj->getFinalTests() as 
$test) {
 
 1354            $this->objectives_qst_obj->setTestSuggestedLimit((
int) 
$_POST[
'limit']);
 
 1355            $this->objectives_qst_obj->updateTest(
$test[
'test_objective_id']);
 
 1358        if (
$_SESSION[
'objective_mode'] != self::MODE_CREATE) {
 
 1359            ilUtil::sendSuccess($this->lng->txt(
'settings_saved'), 
true);
 
 1361            ilUtil::sendSuccess($this->lng->txt(
'crs_added_objective'), 
true);
 
 1363        $this->ctrl->returnToParent($this);
 
 1375        if (!is_object($this->form)) {
 
 1376            include_once(
'./Services/Form/classes/class.ilPropertyFormGUI.php');
 
 1379        $this->form->setFormAction($this->ctrl->getFormAction($this));
 
 1380        $this->form->setTableWidth(
'100%');
 
 1384            case 'selfAssessment':
 
 1385                $this->form->setTitle($this->lng->txt(
'crs_objective_wiz_self_limit'));
 
 1386                $this->form->addCommandButton(
'updateSelfAssessmentLimits', $this->lng->txt(
'crs_wiz_next'));
 
 1387                $this->form->addCommandButton(
'selfAssessmentAssignment', $this->lng->txt(
'crs_wiz_back'));
 
 1389                $tests = $this->objectives_qst_obj->getSelfAssessmentTests();
 
 1390                $max_points = $this->objectives_qst_obj->getSelfAssessmentPoints();
 
 1395                $this->form->setTitle($this->lng->txt(
'crs_objective_wiz_final_limit'));
 
 1396                $this->form->addCommandButton(
'updateFinalTestLimits', $this->lng->txt(
'crs_wiz_next'));
 
 1397                $this->form->addCommandButton(
'finalTestAssignment', $this->lng->txt(
'crs_wiz_back'));
 
 1399                $tests = $this->objectives_qst_obj->getFinalTests();
 
 1400                $max_points = $this->objectives_qst_obj->getFinalTestPoints();
 
 1405        $over = 
new ilCustomInputGUI($this->lng->txt(
'crs_objective_qst_summary'), 
'');
 
 1407        $tpl = 
new ilTemplate(
'tpl.crs_objective_qst_summary.html', 
true, 
true, 
'Modules/Course');
 
 1413            $GLOBALS[
'DIC'][
'ilLog']->write(__METHOD__ . 
': ' . print_r(
$test, 
true));
 
 1415            $limit = 
$test[
'limit'];
 
 1417            foreach ($this->objectives_qst_obj->getQuestionsOfTest(
$test[
'obj_id']) as $question) {
 
 1418                $tpl->setCurrentBlock(
'qst');
 
 1419                $tpl->setVariable(
'QST_TITLE', $question[
'title']);
 
 1420                if (strlen($question[
'description'])) {
 
 1421                    $tpl->setVariable(
'QST_DESCRIPTION', $question[
'description']);
 
 1423                $tpl->setVariable(
'QST_POINTS', $question[
'points'] . 
' ' .
 
 1424                    $this->lng->txt(
'crs_objective_points'));
 
 1425                $tpl->parseCurrentBlock();
 
 1427            $tpl->setCurrentBlock(
'tst');
 
 1430                $tpl->setVariable(
'TST_DESC', $desc);
 
 1433            $tpl->setVariable(
'TST_ALT_IMG', $this->lng->txt(
'obj_tst'));
 
 1434            $tpl->parseCurrentBlock();
 
 1437        $tpl->setVariable(
'TXT_ALL_POINTS', $this->lng->txt(
'crs_objective_all_points'));
 
 1438        $tpl->setVariable(
'TXT_POINTS', $this->lng->txt(
'crs_objective_points'));
 
 1439        $tpl->setVariable(
'POINTS', $max_points);
 
 1441        $over->setHtml(
$tpl->get());
 
 1442        $this->form->addItem($over);
 
 1446        $req->setValue($limit);
 
 1448        $req->setMinValue(1);
 
 1449        $req->setMaxValue(100);
 
 1450        $req->setRequired(
true);
 
 1452            case 'selfAssessment':
 
 1453                $req->setInfo($this->lng->txt(
'crs_obj_initial_req_info'));
 
 1457                $req->setInfo($this->lng->txt(
'crs_obj_final_req_info'));
 
 1460        $this->form->addItem(
$req);
 
 1472        include_once(
'./Services/Form/classes/class.ilPropertyFormGUI.php');
 
 1478        $this->form->setFormAction($this->ctrl->getFormAction($this));
 
 1483                $this->form->setTitle($this->lng->txt(
'crs_objective_wiz_title'));
 
 1484                $this->form->addCommandButton(
'save', $this->lng->txt(
'crs_wiz_next'));
 
 1486                #$this->form->addCommandButton('listObjectives',$this->lng->txt('cancel')); 
 1495        $title->setValue($this->objective->getTitle());
 
 1496        $title->setRequired(
true);
 
 1498        $title->setMaxLength(70);
 
 1499        $this->form->addItem(
$title);
 
 1502        $desc->setValue($this->objective->getDescription());
 
 1505        $this->form->addItem($desc);
 
 1519            1 => $this->lng->txt(
'crs_objective_wiz_title'),
 
 1520            2 => $this->lng->txt(
'crs_objective_wiz_materials'),
 
 1521            3 => $this->lng->txt(
'crs_objective_wiz_self'),
 
 1522            4 => $this->lng->txt(
'crs_objective_wiz_self_limit'),
 
 1523            5 => $this->lng->txt(
'crs_objective_wiz_final'),
 
 1524            6 => $this->lng->txt(
'crs_objective_wiz_final_limit'));
 
 1527            1 => $this->lng->txt(
'crs_objective_wiz_title_info'),
 
 1528            2 => $this->lng->txt(
'crs_objective_wiz_materials_info'),
 
 1529            3 => $this->lng->txt(
'crs_objective_wiz_self_info'),
 
 1530            4 => $this->lng->txt(
'crs_objective_wiz_self_limit_info'),
 
 1531            5 => $this->lng->txt(
'crs_objective_wiz_final_info'),
 
 1532            6 => $this->lng->txt(
'crs_objective_wiz_final_limit_info'));
 
 1535            1 => $this->ctrl->getLinkTarget($this, 
'edit'),
 
 1536            2 => $this->ctrl->getLinkTarget($this, 
'materialAssignment'),
 
 1537            3 => $this->ctrl->getLinkTarget($this, 
'selfAssessmentAssignment'),
 
 1538            4 => $this->ctrl->getLinkTarget($this, 
'selfAssessmentLimits'),
 
 1539            5 => $this->ctrl->getLinkTarget($this, 
'finalTestAssignment'),
 
 1540            6 => $this->ctrl->getLinkTarget($this, 
'finalTestLimits'));
 
 1546        include_once(
"./Services/UIComponent/Checklist/classes/class.ilChecklistGUI.php");
 
 1550        if (
$_SESSION[
'objective_mode'] == self::MODE_CREATE) {
 
 1552            $check_list->setHeading($this->lng->txt(
'crs_checklist_objective'));
 
 1556            $check_list->setHeading($this->lng->txt(
'crs_checklist_objective'));
 
 1589            if (
$_SESSION[
'objective_mode'] == self::MODE_UPDATE) {
 
 1591                if (
$step == 4 and !count($this->objectives_qst_obj->getSelfAssessmentQuestions())) {
 
 1594                if (
$step == 6 and !count($this->objectives_qst_obj->getFinalTestQuestions())) {
 
 1617        $GLOBALS[
'DIC'][
"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
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.
static lookupSequencesByType($a_container_id, $a_objective_id, $a_test_id, $a_test_type)
Lookup sequence ids @global type $ilDB.
static lookupLimit($a_container_id, $a_objective_id, $a_test_type)
lookup limit @global type $ilDB
static deleteForObjectiveAndTestType($a_course_id, $a_objective_id, $a_tst_type)
Delete assignment for objective id and test 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 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
if(!array_key_exists('StateId', $_REQUEST)) $id
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
redirection script todo: (a better solution should control the processing via a xml file)
if(empty($password)) $table
if(isset($_POST['submit'])) $form
if(isset($_REQUEST['delete'])) $list