Public Member Functions | Data Fields

ilCourseObjectivesGUI Class Reference

class ilobjcourseobjectivesgui More...

Inheritance diagram for ilCourseObjectivesGUI:
Collaboration diagram for ilCourseObjectivesGUI:

Public Member Functions

 ilCourseObjectivesGUI ($a_course_id)
executeCommand ()
 execute command
 listQuestionAssignment ()
 List question assignent.
 assignQuestions ()
 Assign materials.
 listMaterialAssignment ()
 Show assignment of course materials.
 assignMaterials ()
 Assign materials.
 listObjectives ()
 Show objectives.
 moveObjectiveUp ()
 moveObjectiveDown ()
 addObjective ()
 editObjective ()
 updateObjective ()
 askDeleteObjective ()
 deleteObjectives ()
 saveObjective ()
 listAssignedQuestions ()
 __sortQuestions ($a_qst_ids)
 editQuestionAssignment ()
 updateQuestionAssignment ()
 __initCourseObject ()
__initObjectivesObject ($a_id=0)
 __initLMObject ($a_objective_id=0)
 __initQuestionObject ($a_objective_id=0)
 __showButton ($a_cmd, $a_text, $a_target= '')
 __getAllChapters ($a_ref_id)
 setSubTabs ()
 set sub tabs

Data Fields

 $ctrl
 $ilias
 $ilErr
 $lng
 $tpl
 $course_obj
 $course_id

Detailed Description

class ilobjcourseobjectivesgui

Author:
Stefan Meyer <smeyer@databay.de>
Version:
Id:
class.ilCourseObjectivesGUI.php 14109 2007-06-12 11:49:37Z smeyer

Definition at line 34 of file class.ilCourseObjectivesGUI.php.


Member Function Documentation

ilCourseObjectivesGUI::__getAllChapters ( a_ref_id  ) 

Definition at line 1172 of file class.ilCourseObjectivesGUI.php.

References ilObjectFactory::getInstanceByRefId().

Referenced by listMaterialAssignment().

        {
                $tmp_lm =& ilObjectFactory::getInstanceByRefId($a_ref_id);

                $tree = new ilTree($tmp_lm->getId());
                $tree->setTableNames('lm_tree','lm_data');
                $tree->setTreeTablePK("lm_id");

                foreach($tree->getSubTree($tree->getNodeData($tree->getRootId())) as $node)
                {
                
                        if($node['type'] == 'st')
                        {
                                $depth = $node['depth'] - 1;
                                $child = $node['child'];
                                $chapter[$child] = $depth;
                        }
                }

                return $chapter ? $chapter : array();
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilCourseObjectivesGUI::__initCourseObject (  ) 

Definition at line 1119 of file class.ilCourseObjectivesGUI.php.

References exit, and ilObjectFactory::getInstanceByRefId().

Referenced by ilCourseObjectivesGUI().

        {
                if(!$this->course_obj =& ilObjectFactory::getInstanceByRefId($this->course_id,false))
                {
                        $this->ilErr->raiseError("ilCourseObjectivesGUI: cannot create course object",$this->ilErr->MESSAGE);
                        exit;
                }
                // do i need members?
                $this->course_obj->initCourseMemberObject();

                return true;
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilCourseObjectivesGUI::__initLMObject ( a_objective_id = 0  ) 

Definition at line 1137 of file class.ilCourseObjectivesGUI.php.

Referenced by assignMaterials(), listMaterialAssignment(), and listObjectives().

        {
                include_once './Modules/Course/classes/class.ilCourseObjectiveMaterials.php';
                $this->objectives_lm_obj =& new ilCourseObjectiveMaterials($a_objective_id);

                return true;
        }

Here is the caller graph for this function:

& ilCourseObjectivesGUI::__initObjectivesObject ( a_id = 0  ) 
ilCourseObjectivesGUI::__initQuestionObject ( a_objective_id = 0  ) 

Definition at line 1145 of file class.ilCourseObjectivesGUI.php.

Referenced by assignQuestions(), editQuestionAssignment(), listAssignedQuestions(), listObjectives(), listQuestionAssignment(), and updateQuestionAssignment().

        {
                include_once './Modules/Course/classes/class.ilCourseObjectiveQuestion.php';
                $this->objectives_qst_obj =& new ilCourseObjectiveQuestion($a_objective_id);

                return true;
        }

Here is the caller graph for this function:

ilCourseObjectivesGUI::__showButton ( a_cmd,
a_text,
a_target = '' 
)

Definition at line 1153 of file class.ilCourseObjectivesGUI.php.

Referenced by listAssignedQuestions(), listMaterialAssignment(), and listQuestionAssignment().

        {
                $this->tpl->addBlockfile("BUTTONS", "buttons", "tpl.buttons.html");
                
                // display button
                $this->tpl->setCurrentBlock("btn_cell");
                $this->tpl->setVariable("BTN_LINK",$this->ctrl->getLinkTarget($this,$a_cmd));
                $this->tpl->setVariable("BTN_TXT",$a_text);

                if($a_target)
                {
                        $this->tpl->setVariable("BTN_TARGET",$a_target);
                }

                $this->tpl->parseCurrentBlock();
        }

Here is the caller graph for this function:

ilCourseObjectivesGUI::__sortQuestions ( a_qst_ids  ) 

Definition at line 962 of file class.ilCourseObjectivesGUI.php.

References ilUtil::sortArray().

Referenced by listAssignedQuestions(), and listQuestionAssignment().

        {
                return ilUtil::sortArray($a_qst_ids,'title','asc');
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilCourseObjectivesGUI::addObjective (  ) 

Definition at line 588 of file class.ilCourseObjectivesGUI.php.

References ilUtil::getImagePath().

Referenced by saveObjective().

        {
                global $rbacsystem;

                // MINIMUM ACCESS LEVEL = 'write'
                if(!$rbacsystem->checkAccess("write", $this->course_obj->getRefId()))
                {
                        $this->ilias->raiseError($this->lng->txt("msg_no_perm_write"),$this->ilErr->MESSAGE);
                }
                $this->tpl->addBlockFile("ADM_CONTENT","adm_content","tpl.crs_add_objective.html",'Modules/Course');
                
                $this->tpl->setVariable('TBL_TITLE_IMG',ilUtil::getImagePath('icon_lobj.gif'));
                $this->tpl->setVariable('TBL_TITLE_IMG_ALT',$this->lng->txt('crs_objectives'));

                $this->tpl->setVariable("FORMACTION",$this->ctrl->getFormAction($this));
                $this->tpl->setVariable("TXT_HEADER",$this->lng->txt('crs_add_objective'));
                $this->tpl->setVariable("TXT_TITLE",$this->lng->txt('title'));
                $this->tpl->setVariable("TXT_DESC",$this->lng->txt('description'));
                $this->tpl->setVariable("TXT_REQUIRED_FLD",$this->lng->txt('required_field'));
                $this->tpl->setVariable("CMD_SUBMIT",'saveObjective');
                $this->tpl->setVariable("TXT_SUBMIT",$this->lng->txt('add'));
                $this->tpl->setVariable("TXT_CANCEL",$this->lng->txt('cancel'));

                return true;
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilCourseObjectivesGUI::askDeleteObjective (  ) 

Definition at line 693 of file class.ilCourseObjectivesGUI.php.

References $_GET, $_SESSION, $tbl, $tpl, __initObjectivesObject(), ilUtil::getImagePath(), listObjectives(), ilUtil::sendInfo(), and ilUtil::switchColor().

        {
                global $rbacsystem;

                // MINIMUM ACCESS LEVEL = 'write'
                if(!$rbacsystem->checkAccess("write", $this->course_obj->getRefId()))
                {
                        $this->ilias->raiseError($this->lng->txt("msg_no_perm_write"),$this->ilErr->MESSAGE);
                }
                if(!count($_POST['objective']))
                {
                        ilUtil::sendInfo($this->lng->txt('crs_no_objective_selected'));
                        $this->listObjectives();
                        
                        return true;
                }

                $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.crs_objectives.html",'Modules/Course');

                ilUtil::sendInfo($this->lng->txt('crs_delete_objectve_sure'));

                $tpl =& new ilTemplate("tpl.table.html", true, true);
                $tpl->addBlockfile("TBL_CONTENT", "tbl_content", "tpl.crs_objectives_delete_row.html",'Modules/Course');

                $counter = 0;
                foreach($_POST['objective'] as $objective_id)
                {
                        $objective_obj =& $this->__initObjectivesObject($objective_id);

                        $tpl->setCurrentBlock("tbl_content");
                        $tpl->setVariable("ROWCOL",ilUtil::switchColor(++$counter,"tblrow2","tblrow1"));
                        $tpl->setVariable("TITLE",$objective_obj->getTitle());
                        $tpl->setVariable("DESCRIPTION",$objective_obj->getDescription());
                        $tpl->parseCurrentBlock();
                }

                $tpl->setVariable("FORMACTION",$this->ctrl->getFormAction($this));

                // Show action row
                $tpl->setCurrentBlock("tbl_action_btn");
                $tpl->setVariable("BTN_NAME",'deleteObjectives');
                $tpl->setVariable("BTN_VALUE",$this->lng->txt('delete'));
                $tpl->parseCurrentBlock();

                $tpl->setCurrentBlock("tbl_action_btn");
                $tpl->setVariable("BTN_NAME",'listObjectives');
                $tpl->setVariable("BTN_VALUE",$this->lng->txt('cancel'));
                $tpl->parseCurrentBlock();

                $tpl->setCurrentBlock("tbl_action_row");
                $tpl->setVariable("COLUMN_COUNTS",1);
                $tpl->setVariable("IMG_ARROW",ilUtil::getImagePath('arrow_downright.gif'));
                $tpl->parseCurrentBlock();


                // create table
                $tbl = new ilTableGUI();
                $tbl->setStyle('table','std');

                // title & header columns
                $tbl->setTitle($this->lng->txt("crs_objectives"),"icon_lobj.gif",$this->lng->txt("crs_objectives"));

                $tbl->setHeaderNames(array($this->lng->txt("title")));
                $tbl->setHeaderVars(array("title"), 
                                                        array("ref_id" => $this->course_obj->getRefId(),
                                                                  "cmdClass" => "ilcourseobjectivesgui",
                                                                  "cmdNode" => $_GET["cmdNode"]));
                $tbl->setColumnWidth(array("50%"));

                $tbl->setLimit($_GET["limit"]);
                $tbl->setOffset($_GET["offset"]);
                $tbl->setMaxCount(count($_POST['objective']));

                // footer
                $tbl->disable("footer");
                $tbl->disable('sort');

                // render table
                $tbl->setTemplate($tpl);
                $tbl->render();

                $this->tpl->setVariable("OBJECTIVES_TABLE", $tpl->get());
                

                // Save marked objectives
                $_SESSION['crs_delete_objectives'] = $_POST['objective'];

                return true;
        }

Here is the call graph for this function:

ilCourseObjectivesGUI::assignMaterials (  ) 

Assign materials.

public

Definition at line 351 of file class.ilCourseObjectivesGUI.php.

References $_GET, $ref_id, __initLMObject(), listObjectives(), and ilUtil::sendInfo().

        {
                global $ilAccess,$ilObjDataCache;

                // MINIMUM ACCESS LEVEL = 'write'
                if(!$ilAccess->checkAccess("write",'',$this->course_obj->getRefId()))
                {
                        $this->ilErr->raiseError($this->lng->txt("msg_no_perm_write"),$this->ilErr->MESSAGE);
                }
                if(!isset($_GET['objective_id']))
                {
                        ilUtil::sendInfo($this->lng->txt('crs_no_objective_selected'));
                        $this->listObjectives();
                        return false;
                }

                $this->__initLMObject((int) $_GET['objective_id']);
                $this->objectives_lm_obj->deleteAll();
                
                if(is_array($_POST['materials']))
                {
                        foreach($_POST['materials'] as $node_id)
                        {
                                $obj_id = $ilObjDataCache->lookupObjId($node_id);
                                $type = $ilObjDataCache->lookupType($obj_id);
                                
                                $this->objectives_lm_obj->setLMRefId($node_id);
                                $this->objectives_lm_obj->setLMObjId($obj_id);
                                $this->objectives_lm_obj->setType($type);
                                $this->objectives_lm_obj->add();
                        }
                }
                if(is_array($_POST['chapters']))
                {
                        foreach($_POST['chapters'] as $chapter)
                        {
                                list($ref_id,$chapter_id) = explode('_',$chapter);
                                
                                $this->objectives_lm_obj->setLMRefId($ref_id);
                                $this->objectives_lm_obj->setLMObjId($chapter_id);
                                $this->objectives_lm_obj->setType('st');
                                $this->objectives_lm_obj->add();
                        }
                }
                ilUtil::sendInfo($this->lng->txt('crs_objectives_assigned_lm'));
                $this->listObjectives();
        }

Here is the call graph for this function:

ilCourseObjectivesGUI::assignQuestions (  ) 

Assign materials.

public

Definition at line 186 of file class.ilCourseObjectivesGUI.php.

References $_GET, __initQuestionObject(), ilCourseObjectiveQuestion::_isAssigned(), listObjectives(), and ilUtil::sendInfo().

        {
                global $ilAccess,$ilObjDataCache;

                // MINIMUM ACCESS LEVEL = 'write'
                if(!$ilAccess->checkAccess("write",'',$this->course_obj->getRefId()))
                {
                        $this->ilErr->raiseError($this->lng->txt("msg_no_perm_write"),$this->ilErr->MESSAGE);
                }
                if(!isset($_GET['objective_id']))
                {
                        ilUtil::sendInfo($this->lng->txt('crs_no_objective_selected'));
                        $this->listObjectives();
                        return false;
                }

                $this->__initQuestionObject((int) $_GET['objective_id']);
                
                if(!is_array($_POST['questions']))
                {
                        $this->objectives_qst_obj->deleteAll();
                }
                else
                {
                        // Delete unchecked
                        foreach($this->objectives_qst_obj->getQuestions() as $question)
                        {
                                $id = $question['ref_id'].'_'.$question['question_id'];
                                if(!in_array($id,$_POST['questions']))
                                {
                                        $this->objectives_qst_obj->delete($question['qst_ass_id']);
                                }
                        }
                        // Add checked
                        foreach($_POST['questions'] as $question_id)
                        {
                                list($test_ref_id,$qst_id) = explode('_',$question_id);
                                $test_obj_id = $ilObjDataCache->lookupObjId($test_ref_id);

                                if(ilCourseObjectiveQuestion::_isAssigned((int) $_GET['objective_id'],$test_ref_id,$qst_id))
                                {
                                        continue;
                                }
                                
                                $this->objectives_qst_obj->setTestRefId($test_ref_id);
                                $this->objectives_qst_obj->setTestObjId($test_obj_id);
                                $this->objectives_qst_obj->setQuestionId($qst_id);
                                $this->objectives_qst_obj->add();
                        }
                }
                
                ilUtil::sendInfo($this->lng->txt('crs_objectives_assigned_lm'));
                $this->listObjectives();
        }

Here is the call graph for this function:

ilCourseObjectivesGUI::deleteObjectives (  ) 

Definition at line 783 of file class.ilCourseObjectivesGUI.php.

References $_SESSION, __initObjectivesObject(), listObjectives(), and ilUtil::sendInfo().

        {
                global $rbacsystem;

                // MINIMUM ACCESS LEVEL = 'write'
                if(!$rbacsystem->checkAccess("write", $this->course_obj->getRefId()))
                {
                        $this->ilias->raiseError($this->lng->txt("msg_no_perm_write"),$this->ilErr->MESSAGE);
                }
                if(!count($_SESSION['crs_delete_objectives']))
                {
                        ilUtil::sendInfo($this->lng->txt('crs_no_objective_selected'));
                        $this->listObjectives();
                        
                        return true;
                }

                foreach($_SESSION['crs_delete_objectives'] as $objective_id)
                {
                        $objective_obj =& $this->__initObjectivesObject($objective_id);
                        $objective_obj->delete();
                }

                ilUtil::sendInfo($this->lng->txt('crs_objectives_deleted'));
                $this->listObjectives();

                return true;
        }

Here is the call graph for this function:

ilCourseObjectivesGUI::editObjective (  ) 

Definition at line 614 of file class.ilCourseObjectivesGUI.php.

References $_GET, __initObjectivesObject(), ilUtil::getImagePath(), listObjectives(), and ilUtil::sendInfo().

Referenced by updateObjective().

        {
                global $rbacsystem;

                // MINIMUM ACCESS LEVEL = 'write'
                if(!$rbacsystem->checkAccess("write", $this->course_obj->getRefId()))
                {
                        $this->ilias->raiseError($this->lng->txt("msg_no_perm_write"),$this->ilErr->MESSAGE);
                }
                if(!isset($_GET['objective_id']))
                {
                        ilUtil::sendInfo($this->lng->txt('crs_no_objective_selected'));
                        $this->listObjectives();

                        return false;
                }

                $this->tpl->addBlockFile("ADM_CONTENT","adm_content","tpl.crs_add_objective.html",'Modules/Course');

                $this->ctrl->setParameter($this,'objective_id',(int) $_GET['objective_id']);
                $this->tpl->setVariable("FORMACTION",$this->ctrl->getFormAction($this));
                $this->tpl->setVariable("TXT_HEADER",$this->lng->txt('crs_update_objective'));
                $this->tpl->setVariable("TXT_TITLE",$this->lng->txt('title'));
                $this->tpl->setVariable('TBL_TITLE_IMG',ilUtil::getImagePath('icon_lobj.gif'));
                $this->tpl->setVariable('TBL_TITLE_IMG_ALT',$this->lng->txt('crs_objectives'));
                $this->tpl->setVariable("TXT_DESC",$this->lng->txt('description'));
                $this->tpl->setVariable("TXT_REQUIRED_FLD",$this->lng->txt('required_field'));
                $this->tpl->setVariable("CMD_SUBMIT",'updateObjective');
                $this->tpl->setVariable("TXT_SUBMIT",$this->lng->txt('save'));
                $this->tpl->setVariable("TXT_CANCEL",$this->lng->txt('cancel'));

                $objective_obj =& $this->__initObjectivesObject((int) $_GET['objective_id']);

                $this->tpl->setVariable("TITLE",$objective_obj->getTitle());
                $this->tpl->setVariable("DESC",$objective_obj->getDescription());

                return true;
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilCourseObjectivesGUI::editQuestionAssignment (  ) 

Definition at line 968 of file class.ilCourseObjectivesGUI.php.

References $title, __initObjectivesObject(), __initQuestionObject(), ilCourseObjective::_getObjectiveIds(), ilUtil::formCheckbox(), ilUtil::getImagePath(), and ilObjectFactory::getInstanceByRefId().

Referenced by updateQuestionAssignment().

        {
                global $rbacsystem;

                $this->tabs_gui->setSubTabActive('crs_objective_overview_question_assignment');

                // MINIMUM ACCESS LEVEL = 'write'
                if(!$rbacsystem->checkAccess("write", $this->course_obj->getRefId()))
                {
                        $this->ilias->raiseError($this->lng->txt("msg_no_perm_write"),$this->ilErr->MESSAGE);
                }

                $this->tpl->addBlockfile('ADM_CONTENT','adm_content','tpl.crs_objectives_edit_question_assignments.html','Modules/Course');

                #$this->__showButton('listObjectives',$this->lng->txt('crs_objective_overview_objectives'));

                $this->tpl->setVariable("FORMACTION",$this->ctrl->getFormAction($this));
                $this->tpl->setVariable("CSS_TABLE",'fullwidth');
                $this->tpl->setVariable("WIDTH",'80%');
                $this->tpl->setVariable("COLUMN_COUNT",5);
                $this->tpl->setVariable("TBL_TITLE_IMG",ilUtil::getImagePath('icon_lobj.gif'));
                $this->tpl->setVariable("TBL_TITLE_IMG_ALT",$this->lng->txt('crs_objectives'));
                $this->tpl->setVariable("TBL_TITLE",$this->lng->txt('crs_objectives_edit_question_assignments'));
                
                $head_titles = array(array($this->lng->txt('title'),"35%"),
                                                         array($this->lng->txt('crs_objectives_nr_questions'),"10%"),
                                                         array($this->lng->txt('crs_objectives_max_points'),"10%"),
                                                         array($this->lng->txt('options'),"35%"));

                $counter = 0;
                foreach($head_titles as $title)
                {
                        $this->tpl->setCurrentBlock("tbl_header_no_link");

                        if(!$counter)
                        {
                                $this->tpl->setVariable("TBL_HEADER_COLSPAN",' colspan="2"');
                                ++$counter;
                        }
                        $this->tpl->setVariable("TBL_HEADER_CELL_NO_LINK",$title[0]);
                        $this->tpl->setVariable("TBL_COLUMN_WIDTH_NO_LINK",$title[1]);
                        $this->tpl->parseCurrentBlock();
                }

                foreach(ilCourseObjective::_getObjectiveIds($this->course_obj->getId()) as $objective_id)
                {
                        $tmp_objective_obj =& $this->__initObjectivesObject($objective_id);
                        
                        $this->__initQuestionObject($objective_id);

                        $counter = 1;
                        foreach($this->objectives_qst_obj->getTests() as $test_data)
                        {
                                $show_buttons = true;

                                $tmp_test =& ilObjectFactory::getInstanceByRefId($test_data['ref_id']);

                                $this->tpl->setCurrentBlock("test_row");
                                $this->tpl->setVariable("TEST_TITLE",$tmp_test->getTitle());
                                $this->tpl->setVariable("TEST_QST",$this->objectives_qst_obj->getNumberOfQuestionsByTest($test_data['ref_id']));
                                $this->tpl->setVariable("TEST_POINTS",$this->objectives_qst_obj->getMaxPointsByTest($test_data['ref_id']));

                                // Options
                                $this->tpl->setVariable("TXT_CHANGE_STATUS",$this->lng->txt('crs_change_status'));
                                $this->tpl->setVariable("CHECK_CHANGE_STATUS",ilUtil::formCheckbox((int) $test_data['tst_status'],
                                                                                                                                                                   'test['.$test_data['test_objective_id'].'][status]'
                                                                                                                                                                   ,1));
                                $this->tpl->setVariable("TXT_SUGGEST",$this->lng->txt('crs_suggest_lm'));
                                $this->tpl->setVariable("SUGGEST_NAME",'test['.$test_data['test_objective_id'].'][limit]');
                                $this->tpl->setVariable("SUGGEST_VALUE",(int) $test_data['tst_limit']);

                                $this->tpl->parseCurrentBlock();



                                ++$counter;
                        }
                        $this->tpl->setCurrentBlock("objective_row");
                        $this->tpl->setVariable("OBJ_TITLE",$tmp_objective_obj->getTitle());
                        $this->tpl->setVariable("OBJ_DESCRIPTION",$tmp_objective_obj->getDescription());
                        $this->tpl->setVariable("OBJ_QST",count($this->objectives_qst_obj->getQuestions()));
                        $this->tpl->setVariable("OBJ_POINTS",$this->objectives_qst_obj->getMaxPointsByObjective());
                        $this->tpl->setVariable("ROWSPAN",$counter);
                        $this->tpl->parseCurrentBlock();
                        
                        // Options
                        unset($tmp_objective_obj);
                }
                // Buttons
                if($show_buttons)
                {
                        $this->tpl->setCurrentBlock("edit_footer");
                        $this->tpl->setVariable("TXT_RESET",$this->lng->txt('reset'));
                        $this->tpl->setVariable("TXT_UPDATE",$this->lng->txt('save'));
                        $this->tpl->setVariable("CMD_UPDATE",'updateQuestionAssignment');
                        $this->tpl->parseCurrentBlock();
                }
        }

Here is the call graph for this function:

Here is the caller graph for this function:

& ilCourseObjectivesGUI::executeCommand (  ) 

execute command

Definition at line 67 of file class.ilCourseObjectivesGUI.php.

References $cmd, and setSubTabs().

        {
                global $ilTabs;

                $ilTabs->setTabActive('crs_objectives');
                
                $cmd = $this->ctrl->getCmd();


                if (!$cmd = $this->ctrl->getCmd())
                {
                        $cmd = "list";
                }
                
                $this->setSubTabs();
                $this->$cmd();
        }

Here is the call graph for this function:

ilCourseObjectivesGUI::ilCourseObjectivesGUI ( a_course_id  ) 

Definition at line 45 of file class.ilCourseObjectivesGUI.php.

References $ilCtrl, $ilErr, $ilias, $lng, $tpl, and __initCourseObject().

        {
                include_once './Modules/Course/classes/class.ilCourseObjective.php';

                global $ilCtrl,$lng,$ilErr,$ilias,$tpl,$tree,$ilTabs;

                $this->ctrl =& $ilCtrl;
                $this->ctrl->saveParameter($this,array("ref_id"));

                $this->ilErr =& $ilErr;
                $this->lng =& $lng;
                $this->tpl =& $tpl;
                $this->tree =& $tree;
                $this->tabs_gui =& $ilTabs;

                $this->course_id = $a_course_id;
                $this->__initCourseObject();
        }

Here is the call graph for this function:

ilCourseObjectivesGUI::listAssignedQuestions (  ) 

Definition at line 843 of file class.ilCourseObjectivesGUI.php.

References $_GET, $tbl, $tpl, __initObjectivesObject(), __initQuestionObject(), __showButton(), __sortQuestions(), ilObjTest::_instanciateQuestion(), ilUtil::formCheckbox(), ilUtil::getImagePath(), listObjectives(), ilUtil::sendInfo(), and ilUtil::switchColor().

        {
                global $rbacsystem;

                // MINIMUM ACCESS LEVEL = 'write'
                if(!$rbacsystem->checkAccess("write", $this->course_obj->getRefId()))
                {
                        $this->ilias->raiseError($this->lng->txt("msg_no_perm_write"),$this->ilErr->MESSAGE);
                }
                if(!isset($_GET['objective_id']))
                {
                        ilUtil::sendInfo($this->lng->txt('crs_no_objective_selected'));
                        $this->listObjectives();

                        return false;
                }

                $this->ctrl->setParameter($this,'objective_id',(int) $_GET['objective_id']);
                $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.crs_objectives_list_qst.html",'Modules/Course');

                if(!count($this->__getAllTests()))
                {
                        #$this->__showButton('listObjectives',$this->lng->txt('crs_objective_overview_objectives'));
                        ilUtil::sendInfo($this->lng->txt('crs_no_tests_inside_crs'));
                        
                        return true;
                }

                $this->__initQuestionObject((int) $_GET['objective_id']);
                if(!count($questions = $this->objectives_qst_obj->getQuestions()))
                {
                        ilUtil::sendInfo($this->lng->txt('crs_no_questions_assigned'));
                        #$this->__showButton('listObjectives',$this->lng->txt('crs_objective_overview_objectives'));
                        $this->__showButton('assignTestSelect',$this->lng->txt('crs_objective_assign_question'));

                        return true;
                }

                $tpl =& new ilTemplate("tpl.table.html", true, true);
                $tpl->addBlockfile("TBL_CONTENT", "tbl_content", "tpl.crs_objectives_list_qst_row.html",'Modules/Course');

                #$this->__showButton('listObjectives',$this->lng->txt('crs_objective_overview_objectives'));

                $counter = 0;
                foreach($this->__sortQuestions($questions) as $question)
                {
                        ++$counter;

                        include_once './Modules/Test/classes/class.ilObjTest.php';

                        $tmp_question =& ilObjTest::_instanciateQuestion($question['question_id']);

                        $tpl->setCurrentBlock("tbl_content");
                        $tpl->setVariable("ROWCOL",ilUtil::switchColor($counter,"tblrow2","tblrow1"));
                        $tpl->setVariable("CHECK_OBJECTIVE",ilUtil::formCheckbox(0,'question[]',$question['qst_ass_id']));
                        $tpl->setVariable("TITLE",$tmp_question->getTitle());
                        $tpl->setVariable("DESCRIPTION",$tmp_question->getComment());
                        $tpl->parseCurrentBlock();

                        unset($tmp_question);
                }

                $tpl->setVariable("FORMACTION",$this->ctrl->getFormAction($this));
                // Show action row

                $tpl->setCurrentBlock("tbl_action_btn");
                $tpl->setVariable("BTN_NAME",'askDeassignQuestion');
                $tpl->setVariable("BTN_VALUE",$this->lng->txt('crs_objective_deassign_question'));
                $tpl->parseCurrentBlock();

                // Show add button
                $tpl->setCurrentBlock("plain_button");
                $tpl->setVariable("PBTN_NAME",'assignTestSelect');
                $tpl->setVariable("PBTN_VALUE",$this->lng->txt('crs_objective_assign_question'));
                $tpl->parseCurrentBlock();


                $tpl->setCurrentBlock("tbl_action_row");
                $tpl->setVariable("COLUMN_COUNTS",2);
                $tpl->setVariable("WIDTH","width=\"50%\"");
                $tpl->setVariable("IMG_ARROW",ilUtil::getImagePath('arrow_downright.gif'));
                $tpl->parseCurrentBlock();

                // create table
                $tbl = new ilTableGUI();
                $tbl->setStyle('table','std');

                // title & header columns
                $objectives_obj =& $this->__initObjectivesObject((int) $_GET['objective_id']);
                $header_title = $this->lng->txt("crs_objectives_assigned_questions").' ('.$objectives_obj->getTitle().')';

                $tbl->setTitle($header_title,"icon_lobj.gif",$this->lng->txt("crs_objectives"));

                $tbl->setHeaderNames(array('',$this->lng->txt("title")));
                $tbl->setHeaderVars(array("","title"), 
                                                        array("ref_id" => $this->course_obj->getRefId(),
                                                                  "objective_id" => (int) $_GET['objective_id'],
                                                                  "cmdClass" => "ilcourseobjectivesgui",
                                                                  "cmdNode" => $_GET["cmdNode"]));
                $tbl->setColumnWidth(array("1%","99%"));

                $tbl->setLimit($_GET["limit"]);
                $tbl->setOffset($_GET["offset"]);
                $tbl->setMaxCount(0);

                // footer
                $tbl->disable("footer");
                $tbl->disable('sort');

                // render table
                $tbl->setTemplate($tpl);
                $tbl->render();

                $this->tpl->setVariable("OBJECTIVES_TABLE", $tpl->get());

                return true;
        }

Here is the call graph for this function:

ilCourseObjectivesGUI::listMaterialAssignment (  ) 

Show assignment of course materials.

public

Definition at line 248 of file class.ilCourseObjectivesGUI.php.

References $_GET, __getAllChapters(), __initLMObject(), __initObjectivesObject(), __showButton(), ilCourseObjectiveMaterials::_getAssignableMaterials(), ilLMObject::_lookupTitle(), ilUtil::formCheckbox(), ilUtil::getImagePath(), listObjectives(), ilUtil::sendInfo(), and ilUtil::switchColor().

        {
                global $ilAccess, $objDefinition;
                
                if(!$ilAccess->checkAccess('write','',$this->course_obj->getRefId()))
                {
                        $this->ilErr->raiseError($this->lng->txt('msg_no_perm_write',$this->ilErr->MESSAGE));
                }
                if(!isset($_GET['objective_id']))
                {
                        ilUtil::sendInfo($this->lng->txt('crs_no_objective_selected'));
                        $this->listObjectives();
                        return false;
                }
                include_once('Modules/Course/classes/class.ilCourseObjectiveMaterials.php');
                if(!$assignable = ilCourseObjectiveMaterials::_getAssignableMaterials($this->course_obj->getRefId()))
                {
                        ilUtil::sendInfo($this->lng->txt('crs_no_objective_lms_found'));
                        $this->listObjectives();
                        return false;
                }
                
                $this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.crs_objective_list_materials.html','Modules/Course');
                $this->tpl->setVariable('TABLE_TITLE',$this->lng->txt('crs_objectives'));
                $this->tpl->setVariable('TBL_TITLE_IMG',ilUtil::getImagePath('icon_lobj.gif'));
                
                $this->ctrl->setParameter($this,'objective_id',(int) $_GET['objective_id']);
                $this->tpl->setVariable('FORMACTION',$this->ctrl->getFormAction($this));
                
                // Back button
                $this->__showButton('listObjectives',$this->lng->txt('back'));
                
                // Title
                $this->__initObjectivesObject((int) $_GET['objective_id']);
                $this->__initLMObject((int) $_GET['objective_id']);
                $this->tpl->setVariable('TABLE_TITLE',$this->lng->txt('crs_objectives_lm_assignment'));
                $this->tpl->setVariable('OBJECTIVE_TITLE',$this->objectives_obj->getTitle());
                
                // Footer
                $this->tpl->setVariable('DOWNRIGHT',ilUtil::getImagePath('arrow_downright.gif'));
                $this->tpl->setVariable('BTN_ASSIGN',$this->lng->txt('crs_objective_assign_lm'));
                $this->tpl->setVariable('BTN_CANCEL',$this->lng->txt('cancel'));
                
                $counter = 0;
                foreach($assignable as $node)
                {
                        // no side blocks here
                        if($objDefinition->isSideBlock($node['type']))
                        {
                                continue;
                        }
                        
                        if($node['type'] == 'lm')
                        {
                                include_once('Modules/LearningModule/classes/class.ilLMObject.php');
                                foreach($chapters = $this->__getAllChapters($node['child']) as $chapter => $depth)
                                {
                                        for($i = $depth;$i > 1;$i--)
                                        {
                                                $this->tpl->touchBlock('begin_depth');
                                                $this->tpl->touchBlock('end_depth');
                                        }
                                
                                        $this->tpl->setCurrentBlock('chapter');
                                        $this->tpl->setVariable('CHAPTER_TITLE',ilLMObject::_lookupTitle($chapter));
                                        $this->tpl->setVariable('CHECK_CHAPTER',ilUtil::formCheckbox(
                                                $this->objectives_lm_obj->isChapterAssigned($node['ref_id'],$chapter) ? 1 : 0,
                                                'chapters[]',$node['child'].'_'.$chapter));
                                        $this->tpl->parseCurrentBlock();
                                }
                                if(count($chapters))
                                {
                                        $this->tpl->setCurrentBlock('chapters');
                                        $this->tpl->setVariable('TXT_CHAPTER',$this->lng->txt('objs_st'));
                                        $this->tpl->parseCurrentBlock();
                                }                       
                        }
                        if(strlen($node['description']))
                        {
                                $this->tpl->setCurrentBlock('row_desc');
                                $this->tpl->setVariable('DESCRIPTION',$node['description']);
                                $this->tpl->parseCurrentBlock();
                        }
                        
                        $this->tpl->setCurrentBlock('table_content');
                        $this->tpl->setVariable('ROWCOL',ilUtil::switchColor($counter++,'tblrow1','tblrow2'));
                        $this->tpl->setVariable('CHECK_MAT',ilUtil::formCheckbox($this->objectives_lm_obj->isAssigned($node['child']) ? 1 : 0,
                                'materials[]',$node['child']));
                        $this->tpl->setVariable('TYPE_IMG',ilUtil::getImagePath('icon_'.$node['type'].'.gif'));
                        $this->tpl->setVariable('TYPE_ALT',$this->lng->txt('obj_'.$node['type']));
                        $this->tpl->setVariable('MAT_TITLE',$node['title']);
                        $this->tpl->parseCurrentBlock();
                }
                

                
        }

Here is the call graph for this function:

ilCourseObjectivesGUI::listObjectives (  ) 

Show objectives.

public

Definition at line 406 of file class.ilCourseObjectivesGUI.php.

References $ilErr, $img, $title, __initLMObject(), __initObjectivesObject(), __initQuestionObject(), ilCourseObjective::_getObjectiveIds(), ilUtil::formCheckbox(), ilUtil::getImagePath(), and ilUtil::switchColor().

Referenced by askDeleteObjective(), assignMaterials(), assignQuestions(), deleteObjectives(), editObjective(), listAssignedQuestions(), listMaterialAssignment(), listQuestionAssignment(), moveObjectiveDown(), moveObjectiveUp(), saveObjective(), and updateObjective().

        {
                global $ilAccess,$ilErr,$ilObjDataCache;
                
                if(!$ilAccess->checkAccess("write",'',$this->course_obj->getRefId()))
                {
                        $this->ilErr->raiseError($this->lng->txt("msg_no_perm_write"),$this->ilErr->MESSAGE);
                }
                $this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.crs_show_objectives.html','Modules/Course');
                $this->tpl->setVariable('FORMACTION',$this->ctrl->getFormAction($this));
                $this->tpl->setVariable('TABLE_TITLE',$this->lng->txt('crs_objectives'));
                $this->tpl->setVariable('TBL_TITLE_IMG',ilUtil::getImagePath('icon_lobj.gif'));
                $this->tpl->setVariable('TBL_TITLE_IMG_ALT',$this->lng->txt('crs_objectives'));
                $this->tpl->setVariable('HEAD_TITLE',$this->lng->txt('title'));
                $this->tpl->setVariable('HEAD_MATERIALS',$this->lng->txt('crs_objective_assigned_materials'));
                $this->tpl->setVariable('HEAD_QUESTIONS',$this->lng->txt('crs_objective_assigned_qst'));
                $this->tpl->setVariable('DOWNRIGHT',ilUtil::getImagePath('arrow_downright.gif'));
                $this->tpl->setVariable('BTN_DELETE',$this->lng->txt('delete'));
                $this->tpl->setVariable('BTN_ADD',$this->lng->txt('crs_add_objective'));
                
                if(!count($objectives = ilCourseObjective::_getObjectiveIds($this->course_obj->getId())))
                {
                        $this->tpl->setCurrentBlock('table_empty');
                        $this->tpl->setVariable('EMPTY_TXT',$this->lng->txt('crs_no_objectives_created'));
                        $this->tpl->parseCurrentBlock();
                        return true;
                }
                
                $counter = 0;
                foreach($objectives as $objective)
                {
                        $objective_obj = $this->__initObjectivesObject($objective);
        
                        // Up down links
                        ++$counter;
                        if(count($objectives) > 1)
                        {
                                if($counter == 1)
                                {
                                        $this->tpl->setVariable("NO_IMG_PRE_TYPE",ilUtil::getImagePath('empty.gif'));
                                }                                       
                                if($counter > 1) 
                                {
                                        $this->tpl->setCurrentBlock("img");
                                        $this->ctrl->setParameter($this,'objective_id',$objective_obj->getObjectiveId());
                                        $this->tpl->setVariable("IMG_LINK",$this->ctrl->getLinkTarget($this,'moveObjectiveUp'));
                                        $this->tpl->setVariable("IMG_TYPE",ilUtil::getImagePath('a_up.gif'));
                                        $this->tpl->setVariable("IMG_ALT",$this->lng->txt('crs_move_up'));
                                        $this->tpl->parseCurrentBlock();
                                }
                                if($counter < count($objectives))
                                {
                                        $this->tpl->setCurrentBlock("img");
                                        $this->ctrl->setParameter($this,'objective_id',$objective_obj->getObjectiveId());
                                        $this->tpl->setVariable("IMG_LINK",$this->ctrl->getLinkTarget($this,'moveObjectiveDown'));
                                        $this->tpl->setVariable("IMG_TYPE",ilUtil::getImagePath('a_down.gif'));
                                        $this->tpl->setVariable("IMG_ALT",$this->lng->txt('crs_move_down'));
                                        $this->tpl->parseCurrentBlock();
                                }
                                if($counter == count($objectives))
                                {
                                        $this->tpl->setCurrentBlock("no_img_post");
                                        $this->tpl->setVariable("NO_IMG_POST_TYPE",ilUtil::getImagePath('empty.gif'));
                                        $this->tpl->parseCurrentBlock();
                                }                                       
                        }
                        
                        // Assigned Tests
                        $this->__initQuestionObject($objective_obj->getObjectiveId());
                        foreach($this->objectives_qst_obj->getTests() as $tst)
                        {
                                foreach($this->objectives_qst_obj->getQuestionsOfTest($tst['obj_id']) as $qst)
                                {
                                        $this->tpl->setCurrentBlock('qst_row');
                                        $this->tpl->setVariable('QST_TITLE',$qst['title']);
                                        $this->tpl->parseCurrentBlock();
                                }
                                $this->tpl->setCurrentBlock('test_row');
                                $this->tpl->setVariable('TST_IMG',ilUtil::getImagePath('icon_tst_s.gif'));
                                $this->tpl->setVariable('TST_ALT',$this->lng->txt('obj_tst'));
                                $this->tpl->setVariable('TST_TITLE',$tst['title']);
                                $this->tpl->parseCurrentBlock();
                        }

                        // Assigned Materials
                        $this->__initLMObject($objective_obj->getObjectiveId());
                        foreach($this->objectives_lm_obj->getMaterials() as $material)
                        {
                                $this->tpl->setCurrentBlock('material_row');
                
                                $container_obj_id = $ilObjDataCache->lookupObjId($material['ref_id']);
                                $title = $ilObjDataCache->lookupTitle($container_obj_id);
                                switch($material['type'])
                                {
                                        case 'st':
                                                include_once('Modules/LearningModule/classes/class.ilLMObject.php');
                                                $img = ilUtil::getImagePath('icon_lm_s.gif');
                                                $alt = $this->lng->txt('obj_'.$material['type']);
                                                $chapter_title = 
                                                $title .= (' -> '.ilLMObject::_lookupTitle($material['obj_id'])); 
                                                break;
                                        default: 
                                                $img = ilUtil::getImagePath('icon_'.$material['type'].'_s.gif');
                                                $alt = $this->lng->txt('obj_'.$material['type']);
                                                break;
                                }
                                $this->tpl->setVariable('MAT_IMG',$img);
                                $this->tpl->setVariable('MAT_ALT',$alt);
                                $this->tpl->setVariable('MAT_TITLE',$title);
                                $this->tpl->parseCurrentBlock();
                        }
                        $this->tpl->setCurrentBlock("table_content");
                        $this->tpl->setVariable('LABEL_ID',$objective_obj->getObjectiveId());
                        $this->tpl->setVariable("ROWCOL",ilUtil::switchColor($counter,"tblrow2","tblrow1"));
                        $this->tpl->setVariable("CHECK_OBJECTIVE",ilUtil::formCheckbox(0,'objective[]',$objective_obj->getObjectiveId()));
                        $this->tpl->setVariable("TITLE",$objective_obj->getTitle());
                        $this->tpl->setVariable("DESCRIPTION",$objective_obj->getDescription());
                        
                        $this->ctrl->setParameter($this,'objective_id',$objective_obj->getObjectiveId());
                        $this->tpl->setVariable('LINK_MAT',$this->ctrl->getLinkTarget($this,'listMaterialAssignment'));
                        $this->tpl->setVariable('ADD_MAT',$this->lng->txt('crs_objective_add_mat'));
                        $this->tpl->setVariable('LINK_QST',$this->ctrl->getLinkTarget($this,'listQuestionAssignment'));
                        $this->tpl->setVariable('ADD_QST',$this->lng->txt('crs_objective_add_qst'));
                        $this->tpl->setVariable('LINK_EDIT',$this->ctrl->getLinkTarget($this,'editObjective'));
                        $this->tpl->setVariable('EDIT',$this->lng->txt('edit'));
                        $this->tpl->parseCurrentBlock();
                }
                
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilCourseObjectivesGUI::listQuestionAssignment (  ) 

List question assignent.

public

Definition at line 91 of file class.ilCourseObjectivesGUI.php.

References $_GET, __initObjectivesObject(), __initQuestionObject(), __showButton(), __sortQuestions(), ilCourseObjectiveQuestion::_getAssignableTests(), ilObjTest::_instanciateQuestion(), ilCourseObjectiveQuestion::_isAssigned(), ilUtil::formCheckbox(), ilUtil::getImagePath(), ilObjectFactory::getInstanceByRefId(), listObjectives(), ilUtil::sendInfo(), and ilUtil::switchColor().

        {
                global $ilAccess;
                
                if(!$ilAccess->checkAccess('write','',$this->course_obj->getRefId()))
                {
                        $this->ilErr->raiseError($this->lng->txt('msg_no_perm_write',$this->ilErr->MESSAGE));
                }
                if(!isset($_GET['objective_id']))
                {
                        ilUtil::sendInfo($this->lng->txt('crs_no_objective_selected'));
                        $this->listObjectives();
                        return false;
                }
                include_once('Modules/Course/classes/class.ilCourseObjectiveQuestion.php');
                if(!$assignable = ilCourseObjectiveQuestion::_getAssignableTests($this->course_obj->getRefId()))
                {
                        ilUtil::sendInfo($this->lng->txt('crs_no_tests_inside_crs'));
                        $this->listObjectives();
                        return false;
                }
                
                $this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.crs_objective_list_questions.html','Modules/Course');
                $this->tpl->setVariable('TABLE_TITLE',$this->lng->txt('crs_objectives'));
                $this->tpl->setVariable('TBL_TITLE_IMG',ilUtil::getImagePath('icon_lobj.gif'));
                $this->ctrl->setParameter($this,'objective_id',(int) $_GET['objective_id']);
                $this->tpl->setVariable('FORMACTION',$this->ctrl->getFormAction($this));
                
                // Back button
                $this->__showButton('listObjectives',$this->lng->txt('back'));
                
                // Title
                $this->__initObjectivesObject((int) $_GET['objective_id']);
                $this->__initQuestionObject((int) $_GET['objective_id']);
                $this->tpl->setVariable('TABLE_TITLE',$this->lng->txt('crs_objectives_lm_assignment'));
                $this->tpl->setVariable('OBJECTIVE_TITLE',$this->objectives_obj->getTitle());
                
                // Footer
                $this->tpl->setVariable('DOWNRIGHT',ilUtil::getImagePath('arrow_downright.gif'));
                $this->tpl->setVariable('BTN_ASSIGN',$this->lng->txt('crs_objective_assign_lm'));
                $this->tpl->setVariable('BTN_CANCEL',$this->lng->txt('cancel'));
                
                $counter = 0;
                foreach($assignable as $node)
                {
                        if(!$tmp_tst =& ilObjectFactory::getInstanceByRefId((int) $node['ref_id'],false))
                        {
                                continue;
                        }               

                        $assignable = false;
                        foreach($qst = $this->__sortQuestions($tmp_tst->getAllQuestions()) as $question_data)
                        {
                                $tmp_question =& ilObjTest::_instanciateQuestion($question_data['question_id']);

                                $this->tpl->setCurrentBlock('chapter');
                                $this->tpl->setVariable('CHAPTER_TITLE',$tmp_question->getTitle());
                                $id = ilCourseObjectiveQuestion::_isAssigned((int) $_GET['objective_id'],
                                        $tmp_tst->getRefId(),
                                        $question_data['question_id']);
                                $this->tpl->setVariable('CHECK_CHAPTER',ilUtil::formCheckbox(
                                                $id ? 1 : 0,
                                                'questions[]',$node['ref_id'].'_'.$question_data['question_id']));
                                $this->tpl->parseCurrentBlock();
        
                        }
                        if(count($qst))
                        {
                                $this->tpl->setCurrentBlock('chapters');
                                $this->tpl->setVariable('TXT_CHAPTER',$this->lng->txt('objs_qst'));
                                $this->tpl->parseCurrentBlock();
                        }                       
                        
                        
                        if(strlen($node['description']))
                        {
                                $this->tpl->setCurrentBlock('row_desc');
                                $this->tpl->setVariable('DESCRIPTION',$node['description']);
                                $this->tpl->parseCurrentBlock();
                        }

                        $this->tpl->setCurrentBlock('table_content');
                        $this->tpl->setVariable('ROWCOL',ilUtil::switchColor($counter++,'tblrow1','tblrow2'));
                        $this->tpl->setVariable('TYPE_IMG',ilUtil::getImagePath('icon_'.$node['type'].'.gif'));
                        $this->tpl->setVariable('TYPE_ALT',$this->lng->txt('obj_'.$node['type']));
                        $this->tpl->setVariable('MAT_TITLE',$node['title']);
                        $this->tpl->parseCurrentBlock();
                }
        }

Here is the call graph for this function:

ilCourseObjectivesGUI::moveObjectiveDown (  ) 

Definition at line 561 of file class.ilCourseObjectivesGUI.php.

References $_GET, __initObjectivesObject(), listObjectives(), and ilUtil::sendInfo().

        {
                global $rbacsystem;

                // MINIMUM ACCESS LEVEL = 'write'
                if(!$rbacsystem->checkAccess("write", $this->course_obj->getRefId()))
                {
                        $this->ilias->raiseError($this->lng->txt("msg_no_perm_write"),$this->ilErr->MESSAGE);
                }
                if(!$_GET['objective_id'])
                {
                        ilUtil::sendInfo($this->lng->txt('crs_no_objective_selected'));
                        $this->listObjectives();
                        
                        return true;
                }
                $objective_obj =& $this->__initObjectivesObject((int) $_GET['objective_id']);

                $objective_obj->moveDown((int) $_GET['objective_id']);
                ilUtil::sendInfo($this->lng->txt('crs_moved_objective'));

                $this->listObjectives();

                return true;
        }

Here is the call graph for this function:

ilCourseObjectivesGUI::moveObjectiveUp (  ) 

Definition at line 536 of file class.ilCourseObjectivesGUI.php.

References $_GET, __initObjectivesObject(), listObjectives(), and ilUtil::sendInfo().

        {
                global $rbacsystem;

                // MINIMUM ACCESS LEVEL = 'write'
                if(!$rbacsystem->checkAccess("write", $this->course_obj->getRefId()))
                {
                        $this->ilias->raiseError($this->lng->txt("msg_no_perm_write"),$this->ilErr->MESSAGE);
                }
                if(!$_GET['objective_id'])
                {
                        ilUtil::sendInfo($this->lng->txt('crs_no_objective_selected'));
                        $this->listObjectives();
                        
                        return true;
                }
                $objective_obj =& $this->__initObjectivesObject((int) $_GET['objective_id']);

                $objective_obj->moveUp((int) $_GET['objective_id']);
                ilUtil::sendInfo($this->lng->txt('crs_moved_objective'));

                $this->listObjectives();

                return true;
        }

Here is the call graph for this function:

ilCourseObjectivesGUI::saveObjective (  ) 

Definition at line 813 of file class.ilCourseObjectivesGUI.php.

References __initObjectivesObject(), addObjective(), listObjectives(), ilUtil::sendInfo(), and ilUtil::stripSlashes().

        {
                global $rbacsystem;

                // MINIMUM ACCESS LEVEL = 'write'
                if(!$rbacsystem->checkAccess("write", $this->course_obj->getRefId()))
                {
                        $this->ilias->raiseError($this->lng->txt("msg_no_perm_write"),$this->ilErr->MESSAGE);
                }
                if(!$_POST['objective']['title'])
                {
                        ilUtil::sendInfo('crs_no_title_given',true);

                        $this->addObjective();
                        return false;
                }

                $objective_obj =& $this->__initObjectivesObject();

                $objective_obj->setTitle(ilUtil::stripSlashes($_POST['objective']['title']));
                $objective_obj->setDescription(ilUtil::stripSlashes($_POST['objective']['description']));
                $objective_obj->add();
                
                ilUtil::sendInfo($this->lng->txt('crs_added_objective'));
                $this->listObjectives();

                return true;
        }

Here is the call graph for this function:

ilCourseObjectivesGUI::setSubTabs (  ) 

set sub tabs

Definition at line 1197 of file class.ilCourseObjectivesGUI.php.

Referenced by executeCommand().

        {
                global $ilTabs;

                $ilTabs->addSubTabTarget("crs_objective_overview_objectives",
                                                                 $this->ctrl->getLinkTarget($this, "listObjectives"),
                                                                 array("listObjectives", "moveObjectiveUp", "moveObjectiveDown", "listAssignedLM"),
                                                                 array(),
                                                                 '',
                                                                 true);
                        
                $ilTabs->addSubTabTarget("crs_objective_overview_question_assignment",
                                                                 $this->ctrl->getLinkTarget($this, "editQuestionAssignment"),
                                                                 "editQuestionAssignment",
                                                                 array(),
                                                                 '',
                                                                 false);

        }

Here is the caller graph for this function:

ilCourseObjectivesGUI::updateObjective (  ) 

Definition at line 653 of file class.ilCourseObjectivesGUI.php.

References $_GET, __initObjectivesObject(), editObjective(), listObjectives(), ilUtil::sendInfo(), and ilUtil::stripSlashes().

        {
                global $rbacsystem;

                // MINIMUM ACCESS LEVEL = 'write'
                if(!$rbacsystem->checkAccess("write", $this->course_obj->getRefId()))
                {
                        $this->ilias->raiseError($this->lng->txt("msg_no_perm_write"),$this->ilErr->MESSAGE);
                }
                if(!isset($_GET['objective_id']))
                {               
                        ilUtil::sendInfo($this->lng->txt('crs_no_objective_selected'));
                        $this->listObjectives();

                        return false;
                }
                if(!$_POST['objective']['title'])
                {               
                        ilUtil::sendInfo($this->lng->txt('crs_objective_no_title_given'));
                        $this->editObjective();
                        
                        return false;
                }


                $objective_obj =& $this->__initObjectivesObject((int) $_GET['objective_id']);

                $objective_obj->setObjectiveId((int) $_GET['objective_id']);
                $objective_obj->setTitle(ilUtil::stripSlashes($_POST['objective']['title']));
                $objective_obj->setDescription(ilUtil::stripSlashes($_POST['objective']['description']));

                $objective_obj->update();
                
                ilUtil::sendInfo($this->lng->txt('crs_objective_modified'));
                $this->listObjectives();

                return true;
        }

Here is the call graph for this function:

ilCourseObjectivesGUI::updateQuestionAssignment (  ) 

Definition at line 1067 of file class.ilCourseObjectivesGUI.php.

References $data, __initQuestionObject(), ilCourseObjectiveQuestion::_getTest(), editQuestionAssignment(), and ilUtil::sendInfo().

        {
                global $rbacsystem;

                $this->tabs_gui->setSubTabActive('crs_objective_overview_question_assignment');


                // MINIMUM ACCESS LEVEL = 'write'
                if(!$rbacsystem->checkAccess("write", $this->course_obj->getRefId()))
                {
                        $this->ilias->raiseError($this->lng->txt("msg_no_perm_write"),$this->ilErr->MESSAGE);
                }
                if(!is_array($_POST['test']))
                {
                        ilUtil::sendInfo('Internal error: CRSM learning objectives');
                        $this->editQuestionAssignment();

                        return false;
                }
                // Validate
                foreach($_POST['test'] as $test_obj_id => $data)
                {
                        if(!preg_match('/1?[0-9][0-9]?/',$data['limit']) or 
                           $data['limit'] < 0 or 
                           $data['limit'] > 100)
                        {
                                ilUtil::sendInfo($this->lng->txt('crs_objective_insert_percent'));
                                $this->editQuestionAssignment();

                                return false;
                        }
                }
                
                foreach($_POST['test'] as $test_obj_id => $data)
                {
                        include_once './Modules/Course/classes/class.ilCourseObjectiveQuestion.php';

                        $test_data = ilCourseObjectiveQuestion::_getTest($test_obj_id);

                        $this->__initQuestionObject($test_data['objective_id']);
                        $this->objectives_qst_obj->setTestStatus($data['status'] ? 1 : 0);
                        $this->objectives_qst_obj->setTestSuggestedLimit($data['limit']);
                        $this->objectives_qst_obj->updateTest($test_obj_id);
                }
                ilUtil::sendInfo($this->lng->txt('crs_objective_updated_test'));
                $this->editQuestionAssignment();

                return true;
        }

Here is the call graph for this function:


Field Documentation

ilCourseObjectivesGUI::$course_id

Definition at line 43 of file class.ilCourseObjectivesGUI.php.

ilCourseObjectivesGUI::$course_obj

Definition at line 42 of file class.ilCourseObjectivesGUI.php.

ilCourseObjectivesGUI::$ctrl

Definition at line 36 of file class.ilCourseObjectivesGUI.php.

ilCourseObjectivesGUI::$ilErr

Definition at line 38 of file class.ilCourseObjectivesGUI.php.

Referenced by ilCourseObjectivesGUI(), and listObjectives().

ilCourseObjectivesGUI::$ilias

Definition at line 37 of file class.ilCourseObjectivesGUI.php.

Referenced by ilCourseObjectivesGUI().

ilCourseObjectivesGUI::$lng

Definition at line 39 of file class.ilCourseObjectivesGUI.php.

Referenced by ilCourseObjectivesGUI().

ilCourseObjectivesGUI::$tpl

The documentation for this class was generated from the following file: