Public Member Functions | |
ilCourseObjectivesGUI ($a_course_id) | |
& | executeCommand () |
execute command | |
listAssignedLM () | |
askDeleteLM () | |
deleteLM () | |
assignLMSelect () | |
assignChapterSelect () | |
assignLMChapter () | |
assignLM () | |
listObjectives () | |
moveObjectiveUp () | |
moveObjectiveDown () | |
addObjective () | |
editObjective () | |
updateObjective () | |
askDeleteObjective () | |
deleteObjectives () | |
saveObjective () | |
listAssignedQuestions () | |
askDeassignQuestion () | |
deassignQuestion () | |
assignTestSelect () | |
assignQuestionSelect () | |
__sortQuestions ($a_qst_ids) | |
assignQuestion () | |
editQuestionAssignment () | |
updateQuestionAssignment () | |
__initCourseObject () | |
& | __initObjectivesObject ($a_id=0) |
__initLMObject ($a_objective_id=0) | |
__initQuestionObject ($a_objective_id=0) | |
__showButton ($a_cmd, $a_text, $a_target= '') | |
__getAllLMs () | |
__getAllTests () | |
__getAllChapters ($a_ref_id) | |
setSubTabs () | |
set sub tabs | |
Data Fields | |
$ctrl | |
$ilias | |
$ilErr | |
$lng | |
$tpl | |
$course_obj | |
$course_id |
Definition at line 35 of file class.ilCourseObjectivesGUI.php.
ilCourseObjectivesGUI::__getAllChapters | ( | $ | a_ref_id | ) |
Definition at line 1994 of file class.ilCourseObjectivesGUI.php.
References $tree, and ilObjectFactory::getInstanceByRefId().
Referenced by assignChapterSelect().
{ $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') { $chapter[] = $node['child']; } } return $chapter ? $chapter : array(); }
ilCourseObjectivesGUI::__getAllLMs | ( | ) |
Definition at line 1958 of file class.ilCourseObjectivesGUI.php.
References $tree.
Referenced by assignLMSelect(), and listAssignedLM().
{ global $tree; #foreach($tree->getSubTree($tree->getNodeData($this->course_obj->getRefId())) as $node) foreach($tree->getChilds($this->course_obj->getRefId()) as $node) { switch($node['type']) { case 'lm': case 'htlm': case 'sahs': $all_lms[] = $node['ref_id']; break; } } return $all_lms ? $all_lms : array(); }
ilCourseObjectivesGUI::__getAllTests | ( | ) |
Definition at line 1977 of file class.ilCourseObjectivesGUI.php.
References $tree.
Referenced by assignTestSelect(), and listAssignedQuestions().
{ global $tree; #foreach($tree->getSubTree($tree->getNodeData($this->course_obj->getRefId())) as $node) foreach($tree->getChilds($this->course_obj->getRefId()) as $node) { switch($node['type']) { case 'tst': $all_tst[] = $node['ref_id']; break; } } return $all_tst ? $all_tst : array(); }
ilCourseObjectivesGUI::__initCourseObject | ( | ) |
Definition at line 1905 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; }
ilCourseObjectivesGUI::__initLMObject | ( | $ | a_objective_id = 0 |
) |
Definition at line 1923 of file class.ilCourseObjectivesGUI.php.
Referenced by askDeleteLM(), assignLM(), assignLMChapter(), deleteLM(), and listAssignedLM().
{ include_once './course/classes/class.ilCourseObjectiveLM.php'; $this->objectives_lm_obj =& new ilCourseObjectiveLM($a_objective_id); return true; }
& ilCourseObjectivesGUI::__initObjectivesObject | ( | $ | a_id = 0 |
) |
Definition at line 1918 of file class.ilCourseObjectivesGUI.php.
Referenced by askDeassignQuestion(), askDeleteLM(), askDeleteObjective(), assignChapterSelect(), assignLMSelect(), assignQuestionSelect(), assignTestSelect(), deleteObjectives(), editObjective(), editQuestionAssignment(), listAssignedLM(), listAssignedQuestions(), listObjectives(), moveObjectiveDown(), moveObjectiveUp(), saveObjective(), and updateObjective().
{ return new ilCourseObjective($this->course_obj,$a_id); }
ilCourseObjectivesGUI::__initQuestionObject | ( | $ | a_objective_id = 0 |
) |
Definition at line 1932 of file class.ilCourseObjectivesGUI.php.
Referenced by askDeassignQuestion(), assignQuestion(), assignQuestionSelect(), deassignQuestion(), editQuestionAssignment(), listAssignedQuestions(), and updateQuestionAssignment().
{ include_once './course/classes/class.ilCourseObjectiveQuestion.php'; $this->objectives_qst_obj =& new ilCourseObjectiveQuestion($a_objective_id); return true; }
ilCourseObjectivesGUI::__showButton | ( | $ | a_cmd, | |
$ | a_text, | |||
$ | a_target = '' | |||
) |
Definition at line 1941 of file class.ilCourseObjectivesGUI.php.
Referenced by assignChapterSelect(), assignLMSelect(), assignQuestionSelect(), assignTestSelect(), listAssignedLM(), listAssignedQuestions(), and listObjectives().
{ $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(); }
ilCourseObjectivesGUI::__sortQuestions | ( | $ | a_qst_ids | ) |
Definition at line 1678 of file class.ilCourseObjectivesGUI.php.
References ilUtil::sortArray().
Referenced by assignQuestionSelect(), and listAssignedQuestions().
{ return ilUtil::sortArray($a_qst_ids,'title','asc'); }
ilCourseObjectivesGUI::addObjective | ( | ) |
Definition at line 904 of file class.ilCourseObjectivesGUI.php.
References $rbacsystem.
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","course"); $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')); $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; }
ilCourseObjectivesGUI::askDeassignQuestion | ( | ) |
Definition at line 1272 of file class.ilCourseObjectivesGUI.php.
References $_GET, $_POST, $_SESSION, $counter, $rbacsystem, $tbl, $tpl, __initObjectivesObject(), __initQuestionObject(), ilObjTest::_instanciateQuestion(), listAssignedQuestions(), listObjectives(), 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'])) { sendInfo($this->lng->txt('crs_no_objective_selected')); $this->listObjectives(); return false; } if(!count($_POST['question'])) { sendInfo($this->lng->txt('crs_objectives_no_question_selected')); $this->listAssignedQuestions(); return false; } $this->ctrl->setParameter($this,'objective_id',(int) $_GET['objective_id']); $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.crs_objectives_deassign_qst.html","course"); $this->__initQuestionObject((int) $_GET['objective_id']); $tpl =& new ilTemplate("tpl.table.html", true, true); $tpl->addBlockfile("TBL_CONTENT", "tbl_content", "tpl.crs_objectives_deassign_qst_row.html","course"); // Send info sendInfo($this->lng->txt('crs_objectives_deassign_question_sure')); $counter = 0; foreach($_POST['question'] as $qid) { ++$counter; include_once './assessment/classes/class.ilObjTest.php'; $question = $this->objectives_qst_obj->getQuestion($qid); $tmp_question =& ilObjTest::_instanciateQuestion($question['question_id']); $tpl->setCurrentBlock("tbl_content"); $tpl->setVariable("ROWCOL",ilUtil::switchColor($counter,"tblrow2","tblrow1")); $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 add button $tpl->setCurrentBlock("plain_button"); $tpl->setVariable("PBTN_NAME",'listAssignedQuestions'); $tpl->setVariable("PBTN_VALUE",$this->lng->txt('cancel')); $tpl->parseCurrentBlock(); // Show add button $tpl->setCurrentBlock("plain_button"); $tpl->setVariable("PBTN_NAME",'deassignQuestion'); $tpl->setVariable("PBTN_VALUE",$this->lng->txt('crs_objective_deassign_question')); $tpl->parseCurrentBlock(); $tpl->setCurrentBlock("tbl_action_row"); $tpl->setVariable("COLUMN_COUNTS",1); $tpl->setVariable("WIDTH","width=\"50%\""); $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_crs.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("100%")); $tbl->setLimit($_GET["limit"]); $tbl->setOffset($_GET["offset"]); $tbl->setMaxCount(count($objectives)); // footer $tbl->disable("footer"); $tbl->disable('sort'); // render table $tbl->setTemplate($tpl); $tbl->render(); $this->tpl->setVariable("OBJECTIVES_TABLE", $tpl->get()); $_SESSION['crs_objectives_qst'] = $_POST['question']; return true; }
ilCourseObjectivesGUI::askDeleteLM | ( | ) |
Definition at line 218 of file class.ilCourseObjectivesGUI.php.
References $_GET, $_POST, $_SESSION, $counter, $rbacsystem, $tbl, $title, $tpl, __initLMObject(), __initObjectivesObject(), ilUtil::getImagePath(), ilLMObjectFactory::getInstance(), ilObjectFactory::getInstanceByRefId(), listAssignedLM(), listObjectives(), 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['lm'])) { sendInfo($this->lng->txt('crs_lm_no_assignments_selected')); $this->listAssignedLM(); return false; } if(!isset($_GET['objective_id'])) { sendInfo($this->lng->txt('crs_no_objective_selected')); $this->listObjectives(); return false; } $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.crs_objectives_delete_lm.html","course"); $this->ctrl->setParameter($this,'objective_id',(int) $_GET['objective_id']); sendInfo($this->lng->txt('crs_deassign_lm_sure')); $tpl =& new ilTemplate("tpl.table.html", true, true); $tpl->addBlockfile("TBL_CONTENT", "tbl_content", "tpl.crs_objectives_delete_lm_row.html","course"); $this->__initLMObject((int) $_GET['objective_id']); $counter = 0; foreach($_POST['lm'] as $lm_ass_id) { $lm_ass_data = $this->objectives_lm_obj->getLM($lm_ass_id); $tmp_lm =& ilObjectFactory::getInstanceByRefId($lm_ass_data['ref_id']); $title = $tmp_lm->getTitle(); if($lm_ass_data['type'] == 'st') { include_once './content/classes/class.ilLMObjectFactory.php'; $st_obj = ilLMObjectFactory::getInstance($tmp_lm,$lm_ass_data['obj_id']); $title .= (" -> ".$st_obj->getTitle()); } $tpl->setCurrentBlock("tbl_content"); $tpl->setVariable("ROWCOL",ilUtil::switchColor(++$counter,"tblrow2","tblrow1")); $tpl->setVariable("TITLE",$title); $tpl->setVariable("DESCRIPTION",$tmp_lm->getDescription()); $tpl->parseCurrentBlock(); } $tpl->setVariable("FORMACTION",$this->ctrl->getFormAction($this)); // Show action row $tpl->setCurrentBlock("tbl_action_btn"); $tpl->setVariable("BTN_NAME",'listAssignedLM'); $tpl->setVariable("BTN_VALUE",$this->lng->txt('cancel')); $tpl->parseCurrentBlock(); $tpl->setCurrentBlock("tbl_action_btn"); $tpl->setVariable("BTN_NAME",'deleteLM'); $tpl->setVariable("BTN_VALUE",$this->lng->txt('crs_lm_deassign')); $tpl->parseCurrentBlock(); $tpl->setCurrentBlock("tbl_action_row"); $tpl->setVariable("COLUMN_COUNTS",1); $tpl->setVariable("IMG_ARROW",ilUtil::getImagePath('arrow_downright.gif')); $tpl->parseCurrentBlock(); $tpl->setVariable("WIDTH","width=\"50%\""); // create table $tbl = new ilTableGUI(); $tbl->setStyle('table','std'); // title & header columns $objective_obj =& $this->__initObjectivesObject((int) $_GET['objective_id']); $header_title = $this->lng->txt("crs_objective")." (".$objective_obj->getTitle().')'; $tbl->setTitle($header_title,"icon_crs.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("100%")); $tbl->setLimit($_GET["limit"]); $tbl->setOffset($_GET["offset"]); $tbl->setMaxCount(count($objectives)); // 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_lm'] = $_POST['lm']; return true; }
ilCourseObjectivesGUI::askDeleteObjective | ( | ) |
Definition at line 1004 of file class.ilCourseObjectivesGUI.php.
References $_GET, $_POST, $_SESSION, $counter, $rbacsystem, $tbl, $tpl, __initObjectivesObject(), ilUtil::getImagePath(), listObjectives(), 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'])) { sendInfo($this->lng->txt('crs_no_objective_selected')); $this->listObjectives(); return true; } $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.crs_objectives.html","course"); 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","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",'listObjectives'); $tpl->setVariable("BTN_VALUE",$this->lng->txt('cancel')); $tpl->parseCurrentBlock(); $tpl->setCurrentBlock("tbl_action_btn"); $tpl->setVariable("BTN_NAME",'deleteObjectives'); $tpl->setVariable("BTN_VALUE",$this->lng->txt('delete')); $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_crs.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($objectives)); // 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; }
ilCourseObjectivesGUI::assignChapterSelect | ( | ) |
Definition at line 479 of file class.ilCourseObjectivesGUI.php.
References $_GET, $_POST, $counter, $lm_id, $rbacsystem, $tbl, $tpl, __getAllChapters(), __initObjectivesObject(), __showButton(), assignLMSelect(), ilUtil::formCheckbox(), ilUtil::getImagePath(), ilLMObjectFactory::getInstance(), ilObjectFactory::getInstanceByRefId(), sendInfo(), and ilUtil::switchColor().
Referenced by assignLMChapter().
{ 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['lm']) !== 1) { sendInfo($this->lng->txt('crs_select_exactly_one_lm')); $this->assignLMSelect(); return false; } foreach($_POST['lm'] as $lm_id) { $tmp_lm =& ilObjectFactory::getInstanceByRefId($lm_id); if($tmp_lm->getType() != 'lm') { sendInfo($this->lng->txt('crs_select_native_lm')); $this->assignLMSelect(); return false; } } $lm_id = (int) $_POST['lm'][0]; $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.crs_objectives_chapter_select.html","course"); $tpl =& new ilTemplate("tpl.table.html", true, true); $tpl->addBlockfile("TBL_CONTENT", "tbl_content", "tpl.crs_objectives_chapter_select_row.html","course"); $this->ctrl->setParameter($this,'objective_id',(int) $_GET['objective_id']); $this->ctrl->setParameter($this,'lm_id',(int) $lm_id); $this->__showButton('assignLMSelect',$this->lng->txt('back')); $lm_obj =& ilObjectFactory::getInstanceByRefId($lm_id); $counter = 0; foreach($this->__getAllChapters($lm_id) as $chapter) { ++$counter; include_once './content/classes/class.ilLMObjectFactory.php'; $st_obj = ilLMObjectFactory::getInstance($lm_obj,$chapter); $tpl->setCurrentBlock("tbl_content"); $tpl->setVariable("ROWCOL",ilUtil::switchColor($counter,"tblrow2","tblrow1")); $tpl->setVariable("TITLE",$st_obj->getTitle()); $tpl->setVariable("CHECK_OBJECTIVE",ilUtil::formCheckbox(0,'chapter[]',$st_obj->getId())); $tpl->parseCurrentBlock(); } $tpl->setVariable("FORMACTION",$this->ctrl->getFormAction($this)); // Show action row $tpl->setCurrentBlock("tbl_action_btn"); $tpl->setVariable("BTN_NAME",'assignLMChapter'); $tpl->setVariable("BTN_VALUE",$this->lng->txt('crs_objectives_assign_chapter')); $tpl->parseCurrentBlock(); $tpl->setCurrentBlock("tbl_action_row"); $tpl->setVariable("WIDTH","width=\"50%\""); $tpl->setVariable("COLUMN_COUNTS",2); $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_chapter_assignment").' ('.$objectives_obj->getTitle().')'; $tbl->setTitle($header_title,"icon_crs.gif",$this->lng->txt("crs_objectives")); $tbl->setHeaderNames(array('',$this->lng->txt("title"))); $tbl->setHeaderVars(array("type","title"), array("ref_id" => $this->course_obj->getRefId(), "cmdClass" => "ilcourseobjectivesgui", "cmdNode" => $_GET["cmdNode"])); $tbl->setColumnWidth(array("1%","99%")); $tbl->setLimit($_GET["limit"]); $tbl->setOffset($_GET["offset"]); $tbl->setMaxCount(count($objectives)); // footer $tbl->disable("footer"); $tbl->disable('sort'); // render table $tbl->setTemplate($tpl); $tbl->render(); $this->tpl->setVariable("OBJECTIVES_TABLE", $tpl->get()); return true; }
ilCourseObjectivesGUI::assignLM | ( | ) |
Definition at line 643 of file class.ilCourseObjectivesGUI.php.
References $_GET, $_POST, $counter, $lm_id, $rbacsystem, __initLMObject(), assignLMSelect(), ilObjectFactory::getInstanceByRefId(), listAssignedLM(), listObjectives(), and 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(!isset($_GET['objective_id'])) { sendInfo($this->lng->txt('crs_no_objective_selected')); $this->listObjectives(); return false; } if(!count($_POST['lm'])) { sendInfo($this->lng->txt('crs_no_lm_selected')); $this->assignLMSelect(); return false; } $this->__initLMObject((int) $_GET['objective_id']); $counter = 0; foreach($_POST['lm'] as $lm_id) { $tmp_lm =& ilObjectFactory::getInstanceByRefId($lm_id); $this->objectives_lm_obj->setType($tmp_lm->getType()); $this->objectives_lm_obj->setLMRefId($tmp_lm->getRefId()); $this->objectives_lm_obj->setLMObjId($tmp_lm->getId()); if($this->objectives_lm_obj->checkExists()) { continue; } $this->objectives_lm_obj->add(); ++$counter; } if($counter) { sendInfo($this->lng->txt('crs_objectives_assigned_lm')); $this->listAssignedLM(); } else { sendInfo($this->lng->txt('crs_lms_already_assigned')); $this->assignLMSelect(); } return true; }
ilCourseObjectivesGUI::assignLMChapter | ( | ) |
Definition at line 584 of file class.ilCourseObjectivesGUI.php.
References $_GET, $_POST, $counter, $rbacsystem, __initLMObject(), assignChapterSelect(), assignLMSelect(), ilObjectFactory::getInstanceByRefId(), listAssignedLM(), listObjectives(), and 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(!isset($_GET['objective_id'])) { sendInfo($this->lng->txt('crs_no_objective_selected')); $this->listObjectives(); return false; } if(!count($_POST['chapter'])) { $_POST['lm'] = array((int) $_GET['lm_id']); sendInfo($this->lng->txt('crs_no_chapter_selected')); $this->assignChapterSelect(); return false; } $this->__initLMObject((int) $_GET['objective_id']); $counter = 0; foreach($_POST['chapter'] as $chapter_id) { $tmp_lm =& ilObjectFactory::getInstanceByRefId((int) $_GET['lm_id']); $this->objectives_lm_obj->setType('st'); $this->objectives_lm_obj->setLMRefId($tmp_lm->getRefId()); $this->objectives_lm_obj->setLMObjId($chapter_id); if($this->objectives_lm_obj->checkExists()) { continue; } $this->objectives_lm_obj->add(); ++$counter; } if($counter) { sendInfo($this->lng->txt('crs_objectives_assigned_lm')); $this->listAssignedLM(); } else { sendInfo($this->lng->txt('crs_chapter_already_assigned')); $this->assignLMSelect(); } return true; }
ilCourseObjectivesGUI::assignLMSelect | ( | ) |
Definition at line 373 of file class.ilCourseObjectivesGUI.php.
References $_GET, $counter, $rbacsystem, $tbl, $tpl, __getAllLMs(), __initObjectivesObject(), __showButton(), ilUtil::formCheckbox(), ilUtil::getImagePath(), ilObjectFactory::getInstanceByRefId(), listAssignedLM(), listObjectives(), sendInfo(), and ilUtil::switchColor().
Referenced by assignChapterSelect(), assignLM(), and assignLMChapter().
{ 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'])) { sendInfo($this->lng->txt('crs_no_objective_selected')); $this->listObjectives(); return false; } if(!count($all_lms = $this->__getAllLMs())) { sendInfo($this->lng->txt('crs_no_objective_lms_found')); $this->listAssignedLM(); return false; } $this->ctrl->setParameter($this,'objective_id',(int) $_GET['objective_id']); $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.crs_objectives_lm_select.html","course"); $this->__showButton('listAssignedLM',$this->lng->txt('back')); $tpl =& new ilTemplate("tpl.table.html", true, true); $tpl->addBlockfile("TBL_CONTENT", "tbl_content", "tpl.crs_objectives_lm_select_row.html","course"); $counter = 0; foreach($all_lms as $item) { ++$counter; $tmp_lm =& ilObjectFactory::getInstanceByRefId($item); $tpl->setCurrentBlock("tbl_content"); $tpl->setVariable("ROWCOL",ilUtil::switchColor($counter,"tblrow2","tblrow1")); $tpl->setVariable("CHECK_OBJECTIVE",ilUtil::formCheckbox(0,'lm[]',$item)); $tpl->setVariable("IMG_TYPE",ilUtil::getImagePath('icon_'.$tmp_lm->getType().'.gif')); $tpl->setVariable("IMG_ALT",$this->lng->txt('obj_'.$tmp_lm->getType())); $tpl->setVariable("TITLE",$tmp_lm->getTitle()); $tpl->setVariable("DESCRIPTION",$tmp_lm->getDescription()); $tpl->parseCurrentBlock(); unset($tmp_lm); } $tpl->setVariable("FORMACTION",$this->ctrl->getFormAction($this)); // Show action row $tpl->setCurrentBlock("tbl_action_btn"); $tpl->setVariable("BTN_NAME",'assignLM'); $tpl->setVariable("BTN_VALUE",$this->lng->txt('crs_objective_assign_lm')); $tpl->parseCurrentBlock(); $tpl->setCurrentBlock("tbl_action_btn"); $tpl->setVariable("BTN_NAME",'assignChapterSelect'); $tpl->setVariable("BTN_VALUE",$this->lng->txt('crs_objective_assign_chapter')); $tpl->parseCurrentBlock(); $tpl->setCurrentBlock("tbl_action_row"); $tpl->setVariable("COLUMN_COUNTS",3); $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_lm_assignment").' ('.$objectives_obj->getTitle().')'; $tbl->setTitle($header_title,"icon_crs.gif",$this->lng->txt("crs_objectives")); $tbl->setHeaderNames(array('',$this->lng->txt('type'),$this->lng->txt("title"))); $tbl->setHeaderVars(array("","type","title"), array("ref_id" => $this->course_obj->getRefId(), "objective_id" => (int) $_GET['objective_id'], "cmdClass" => "ilcourseobjectivesgui", "cmdNode" => $_GET["cmdNode"])); $tbl->setColumnWidth(array("1%","1%",'98%')); $tbl->setLimit($_GET["limit"]); $tbl->setOffset($_GET["offset"]); $tbl->setMaxCount(count($objectives)); // footer $tbl->disable("footer"); $tbl->disable('sort'); // render table $tbl->setTemplate($tpl); $tbl->render(); $this->tpl->setVariable("OBJECTIVES_TABLE", $tpl->get()); return true; }
ilCourseObjectivesGUI::assignQuestion | ( | ) |
Definition at line 1683 of file class.ilCourseObjectivesGUI.php.
References $_GET, $_POST, $rbacsystem, __initQuestionObject(), ilCourseObjectiveQuestion::_isAssigned(), assignQuestionSelect(), assignTestSelect(), ilObjectFactory::getInstanceByRefId(), listAssignedQuestions(), listObjectives(), and 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(!isset($_GET['objective_id'])) { sendInfo($this->lng->txt('crs_no_objective_selected')); $this->listObjectives(); return false; } if(!$_GET['test_id']) { sendInfo($this->lng->txt('crs_no_test_selected')); $this->assignTestSelect(); return false; } if(!count($_POST['question'])) { $_POST['test_id'] = $_GET['test_id']; sendInfo($this->lng->txt('crs_no_question_selected')); $this->assignQuestionSelect(); return false; } $this->__initQuestionObject((int) $_GET['objective_id']); $tmp_test =& ilObjectFactory::getInstanceByRefId((int) $_GET['test_id'],false); $this->objectives_qst_obj->setTestRefId($tmp_test->getRefId()); $this->objectives_qst_obj->setTestObjId($tmp_test->getId()); $added = 0; foreach($_POST['question'] as $qid) { if((int) $_GET['objective_id'] == ilCourseObjectiveQuestion::_isAssigned((int) $_GET['objective_id'], $tmp_test->getRefId(), $qid)) { continue; } $this->objectives_qst_obj->setQuestionId($qid); $this->objectives_qst_obj->add(); ++$added; } if($added) { sendInfo($this->lng->txt('crs_objectives_assigned_new_questions')); $this->listAssignedQuestions(); return true; } else { sendInfo($this->lng->txt('crs_objectives_questions_already_assigned')); $this->assignQuestionSelect(); return false; } return false; }
ilCourseObjectivesGUI::assignQuestionSelect | ( | ) |
Definition at line 1542 of file class.ilCourseObjectivesGUI.php.
References $_GET, $_POST, $counter, $rbacsystem, $tbl, $tpl, __initObjectivesObject(), __initQuestionObject(), __showButton(), __sortQuestions(), ilObjTest::_instanciateQuestion(), ilCourseObjectiveQuestion::_isAssigned(), assignTestSelect(), ilUtil::formCheckbox(), ilUtil::getImagePath(), ilObjectFactory::getInstanceByRefId(), listObjectives(), sendInfo(), and ilUtil::switchColor().
Referenced by assignQuestion().
{ 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'])) { sendInfo($this->lng->txt('crs_no_objective_selected')); $this->listObjectives(); return false; } if(!$_POST['test_id']) { sendInfo($this->lng->txt('crs_select_exactly_one_tst')); $this->assignTestSelect(); return false; } $this->ctrl->setParameter($this,'objective_id',(int) $_GET['objective_id']); $this->ctrl->setParameter($this,'test_id',(int) $_POST['test_id']); $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.crs_objectives_question_select.html","course"); $this->__showButton('assignTestSelect',$this->lng->txt('back')); $tpl =& new ilTemplate("tpl.table.html", true, true); $tpl->addBlockfile("TBL_CONTENT", "tbl_content", "tpl.crs_objectives_question_select_row.html","course"); if(!$tmp_tst =& ilObjectFactory::getInstanceByRefId((int) $_POST['test_id'],false)) { sendInfo('Error: Test does not exist'); $this->assignTestSelect(); return false; } $this->__initQuestionObject((int) $_GET['objective_id']); $counter = 0; $assignable = false; foreach($this->__sortQuestions($tmp_tst->getAllQuestions()) as $question_data) { ++$counter; $tmp_question =& ilObjTest::_instanciateQuestion($question_data['question_id']); $tpl->setCurrentBlock("tbl_content"); $tpl->setVariable("ROWCOL",ilUtil::switchColor($counter,"tblrow2","tblrow1")); $tpl->setVariable("CHECK_OBJECTIVE",ilUtil::formCheckbox(0,'question[]',$question_data['question_id'])); $tpl->setVariable("TITLE",$tmp_question->getTitle()); $tpl->setVariable("DESCRIPTION",$tmp_question->getComment()); if(!$objective_id = ilCourseObjectiveQuestion::_isAssigned((int) $_GET['objective_id'], $tmp_tst->getRefId(),$question_data['question_id'])) { $tpl->setVariable("CHECK_OBJECTIVE",ilUtil::formCheckbox(0,'question[]',$question_data['question_id'])); $tpl->setVariable("ASSIGNED",$this->lng->txt('no')); $assignable = true; } else { $tmp_objective_obj =& $this->__initObjectivesObject($objective_id); #$assigned = $this->lng->txt('yes').' ('.$tmp_objective_obj->getTitle().')'; $assigned = $this->lng->txt('yes'); $tpl->setVariable("ASSIGNED",$assigned); $tpl->setVariable("CHECK_OBJECTIVE",' '); } $tpl->parseCurrentBlock(); unset($tmp_question); } $tpl->setVariable("FORMACTION",$this->ctrl->getFormAction($this)); $tpl->setVariable("WIDTH","width=\"50%\""); // Show action row if($assignable) { $tpl->setCurrentBlock("tbl_action_btn"); $tpl->setVariable("BTN_NAME",'assignQuestion'); $tpl->setVariable("BTN_VALUE",$this->lng->txt('crs_objective_assign_question')); $tpl->parseCurrentBlock(); $tpl->setCurrentBlock("tbl_action_row"); $tpl->setVariable("COLUMN_COUNTS",3); $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_objective_question_assignment").' ('.$objectives_obj->getTitle().')'; $tbl->setTitle($header_title,"icon_crs.gif",$this->lng->txt("crs_objectives")); $tbl->setHeaderNames(array('',$this->lng->txt("title"),$this->lng->txt('assigned'))); $tbl->setHeaderVars(array("","title",'assigned'), array("ref_id" => $this->course_obj->getRefId(), "objective_id" => (int) $_GET['objective_id'], "cmdClass" => "ilcourseobjectivesgui", "cmdNode" => $_GET["cmdNode"])); $tbl->setColumnWidth(array("1%","60%",'50%')); $tbl->setLimit($_GET["limit"]); $tbl->setOffset($_GET["offset"]); $tbl->setMaxCount(count($objectives)); // footer $tbl->disable("footer"); $tbl->disable('sort'); // render table $tbl->setTemplate($tpl); $tbl->render(); $this->tpl->setVariable("OBJECTIVES_TABLE", $tpl->get()); return true; }
ilCourseObjectivesGUI::assignTestSelect | ( | ) |
Definition at line 1423 of file class.ilCourseObjectivesGUI.php.
References $_GET, $counter, $rbacsystem, $tbl, $tpl, __getAllTests(), __initObjectivesObject(), __showButton(), ilUtil::formRadioButton(), ilUtil::getImagePath(), ilObjectFactory::getInstanceByRefId(), listAssignedQuestions(), listObjectives(), sendInfo(), and ilUtil::switchColor().
Referenced by assignQuestion(), and assignQuestionSelect().
{ 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'])) { sendInfo($this->lng->txt('crs_no_objective_selected')); $this->listObjectives(); return false; } if(!count($all_tests = $this->__getAllTests())) { sendInfo($this->lng->txt('crs_no_objective_tests_found')); $this->listAssignedQuestions(); return false; } $this->ctrl->setParameter($this,'objective_id',(int) $_GET['objective_id']); $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.crs_objectives_tst_select.html","course"); $this->__showButton('listAssignedQuestions',$this->lng->txt('back')); $tpl =& new ilTemplate("tpl.table.html", true, true); $tpl->addBlockfile("TBL_CONTENT", "tbl_content", "tpl.crs_objectives_tst_select_row.html","course"); $counter = 0; foreach($all_tests as $item) { ++$counter; $tmp_tst =& ilObjectFactory::getInstanceByRefId($item); $tpl->setCurrentBlock("tbl_content"); $tpl->setVariable("ROWCOL",ilUtil::switchColor($counter,"tblrow2","tblrow1")); $tpl->setVariable("IMG_TYPE",ilUtil::getImagePath('icon_'.$tmp_tst->getType().'.gif')); $tpl->setVariable("IMG_ALT",$this->lng->txt('obj_'.$tmp_tst->getType())); $tpl->setVariable("TITLE",$tmp_tst->getTitle()); $tpl->setVariable("DESCRIPTION",$tmp_tst->getDescription()); // Get status info if($tmp_tst->isRandomTest()) { $tpl->setVariable("STATUS",$this->lng->txt('crs_test_status_random')); $tpl->setVariable("CHECK_OBJECTIVE",' '); } elseif(!$tmp_tst->isComplete()) { $tpl->setVariable("STATUS",$this->lng->txt('crs_test_status_not_complete')); $tpl->setVariable("CHECK_OBJECTIVE",' '); } else { $tpl->setVariable("STATUS",$this->lng->txt('crs_test_status_complete')); $tpl->setVariable("CHECK_OBJECTIVE",ilUtil::formRadioButton(0,'test_id',$item)); } $tpl->setVariable("COUNT_QUESTIONS",count($tmp_tst->getExistingQuestions())); $tpl->parseCurrentBlock(); unset($tmp_tst); } $tpl->setVariable("FORMACTION",$this->ctrl->getFormAction($this)); // Show action row $tpl->setCurrentBlock("tbl_action_btn"); $tpl->setVariable("BTN_NAME",'assignQuestionSelect'); $tpl->setVariable("BTN_VALUE",$this->lng->txt('crs_objective_assign_question')); $tpl->parseCurrentBlock(); $tpl->setCurrentBlock("tbl_action_row"); $tpl->setVariable("COLUMN_COUNTS",4); $tpl->setVariable("WIDTH","width=\"75%\""); $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_objective_question_assignment").' ('.$objectives_obj->getTitle().')'; $tbl->setTitle($header_title,"icon_crs.gif",$this->lng->txt("crs_objectives")); $tbl->setHeaderNames(array('',$this->lng->txt("title"),$this->lng->txt('status'),$this->lng->txt('crs_count_questions'))); $tbl->setHeaderVars(array("","title",'status','nr_questions'), array("ref_id" => $this->course_obj->getRefId(), "objective_id" => (int) $_GET['objective_id'], "cmdClass" => "ilcourseobjectivesgui", "cmdNode" => $_GET["cmdNode"])); $tbl->setColumnWidth(array("1%","50%",'30%','20%')); $tbl->setLimit($_GET["limit"]); $tbl->setOffset($_GET["offset"]); $tbl->setMaxCount(count($objectives)); // footer $tbl->disable("footer"); $tbl->disable('sort'); // render table $tbl->setTemplate($tpl); $tbl->render(); $this->tpl->setVariable("OBJECTIVES_TABLE", $tpl->get()); return true; }
ilCourseObjectivesGUI::deassignQuestion | ( | ) |
Definition at line 1383 of file class.ilCourseObjectivesGUI.php.
References $_GET, $_SESSION, $rbacsystem, __initQuestionObject(), listAssignedQuestions(), listObjectives(), and 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(!isset($_GET['objective_id'])) { sendInfo($this->lng->txt('crs_no_objective_selected')); $this->listObjectives(); return false; } if(!count($_SESSION['crs_objectives_qst'])) { sendInfo($this->lng->txt('crs_objectives_no_question_selected')); $this->listAssignedQuestions(); return false; } $this->__initQuestionObject((int) $_GET['objective_id']); foreach($_SESSION['crs_objectives_qst'] as $qid) { $this->objectives_qst_obj->delete($qid); } unset($_SESSION['crs_objectives_qst']); sendInfo($this->lng->txt('crs_objectives_qst_deassigned')); $this->listAssignedQuestions(); return true; }
ilCourseObjectivesGUI::deleteLM | ( | ) |
Definition at line 335 of file class.ilCourseObjectivesGUI.php.
References $_GET, $_SESSION, $rbacsystem, __initLMObject(), listAssignedLM(), listObjectives(), and 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(!isset($_GET['objective_id'])) { sendInfo($this->lng->txt('crs_no_objective_selected')); $this->listObjectives(); return false; } if(!count($_SESSION['crs_delete_lm'])) { sendInfo('No lm selected'); $this->listAssignedLM(); return false; } $this->__initLMObject((int) $_GET['objective_id']); foreach($_SESSION['crs_delete_lm'] as $lm_ass_id) { $this->objectives_lm_obj->delete($lm_ass_id); } sendInfo($this->lng->txt('crs_lm_assignment_deleted')); $this->listAssignedLM(); return true; }
ilCourseObjectivesGUI::deleteObjectives | ( | ) |
Definition at line 1094 of file class.ilCourseObjectivesGUI.php.
References $_SESSION, $rbacsystem, __initObjectivesObject(), listObjectives(), and 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'])) { 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(); } sendInfo($this->lng->txt('crs_objectives_deleted')); $this->listObjectives(); return true; }
ilCourseObjectivesGUI::editObjective | ( | ) |
Definition at line 927 of file class.ilCourseObjectivesGUI.php.
References $_GET, $rbacsystem, __initObjectivesObject(), listObjectives(), and 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'])) { sendInfo($this->lng->txt('crs_no_objective_selected')); $this->listObjectives(); return false; } $this->tpl->addBlockFile("ADM_CONTENT","adm_content","tpl.crs_add_objective.html","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("TXT_DESC",$this->lng->txt('description')); $this->tpl->setVariable("TXT_REQUIRED_FLD",$this->lng->txt('required')); $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; }
ilCourseObjectivesGUI::editQuestionAssignment | ( | ) |
Definition at line 1754 of file class.ilCourseObjectivesGUI.php.
References $counter, $rbacsystem, $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','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_crs.gif')); $this->tpl->setVariable("TBL_TITLE_IMG_ALT",$this->lng->txt('obj_crs')); $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(); } }
& ilCourseObjectivesGUI::executeCommand | ( | ) |
execute command
Definition at line 68 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(); }
ilCourseObjectivesGUI::ilCourseObjectivesGUI | ( | $ | a_course_id | ) |
Definition at line 46 of file class.ilCourseObjectivesGUI.php.
References $ilCtrl, $ilErr, $ilias, $lng, $tpl, $tree, and __initCourseObject().
{ include_once './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(); }
ilCourseObjectivesGUI::listAssignedLM | ( | ) |
Definition at line 86 of file class.ilCourseObjectivesGUI.php.
References $_GET, $counter, $rbacsystem, $tbl, $title, $tpl, __getAllLMs(), __initLMObject(), __initObjectivesObject(), __showButton(), ilUtil::formCheckbox(), ilUtil::getImagePath(), ilLMObjectFactory::getInstance(), ilObjectFactory::getInstanceByRefId(), listObjectives(), sendInfo(), and ilUtil::switchColor().
Referenced by askDeleteLM(), assignLM(), assignLMChapter(), assignLMSelect(), and deleteLM().
{ 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'])) { 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_lm.html","course"); if(!count($this->__getAllLMs())) { $this->__showButton('listObjectives',$this->lng->txt('crs_objective_overview_objectives')); sendInfo($this->lng->txt('crs_no_lms_inside_course')); return true; } $this->__initLMObject((int) $_GET['objective_id']); if(!count($lms = $this->objectives_lm_obj->getLMs())) { sendInfo($this->lng->txt('crs_no_lms_assigned')); #$this->__showButton('listObjectives',$this->lng->txt('crs_objective_overview_objectives')); $this->__showButton('assignLMSelect',$this->lng->txt('crs_objective_assign_lm')); return true; } $tpl =& new ilTemplate("tpl.table.html", true, true); $tpl->addBlockfile("TBL_CONTENT", "tbl_content", "tpl.crs_objectives_lm_list_row.html","course"); #$this->__showButton('listObjectives',$this->lng->txt('crs_objective_overview_objectives')); $counter = 0; foreach($lms as $item) { ++$counter; $tmp_lm =& ilObjectFactory::getInstanceByRefId($item['ref_id']); $title = $tmp_lm->getTitle(); if($item['type'] == 'st') { include_once './content/classes/class.ilLMObjectFactory.php'; $st_obj = ilLMObjectFactory::getInstance($tmp_lm,$item['obj_id']); $title .= (" -> ".$st_obj->getTitle()); } $tpl->setCurrentBlock("tbl_content"); $tpl->setVariable("ROWCOL",ilUtil::switchColor($counter,"tblrow2","tblrow1")); $tpl->setVariable("CHECK_OBJECTIVE",ilUtil::formCheckbox(0,'lm[]',$item['lm_ass_id'])); $tpl->setVariable("IMG_TYPE",ilUtil::getImagePath('icon_'.$tmp_lm->getType().'.gif')); $tpl->setVariable("IMG_ALT",$this->lng->txt('obj_'.$tmp_lm->getType())); $tpl->setVariable("TITLE",$title); $tpl->setVariable("DESCRIPTION",$tmp_lm->getDescription()); $tpl->parseCurrentBlock(); unset($tmp_lm); } $tpl->setVariable("FORMACTION",$this->ctrl->getFormAction($this)); // Show action row $tpl->setCurrentBlock("tbl_action_btn"); $tpl->setVariable("BTN_NAME",'askDeleteLM'); $tpl->setVariable("BTN_VALUE",$this->lng->txt('crs_objective_delete_lm_assignment')); $tpl->parseCurrentBlock(); // Show add button $tpl->setCurrentBlock("plain_button"); $tpl->setVariable("PBTN_NAME",'assignLMSelect'); $tpl->setVariable("PBTN_VALUE",$this->lng->txt('crs_objective_assign_lm')); $tpl->parseCurrentBlock(); $tpl->setCurrentBlock("tbl_action_row"); $tpl->setVariable("COLUMN_COUNTS",3); $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 $objective_obj =& $this->__initObjectivesObject((int) $_GET['objective_id']); $header_title = $this->lng->txt("crs_objectives_assigned_lms")." (".$objective_obj->getTitle().")"; $tbl->setTitle($header_title,"icon_crs.gif",$this->lng->txt("crs_objectives")); $tbl->setHeaderNames(array('',$this->lng->txt('type'),$this->lng->txt("title"))); $tbl->setHeaderVars(array("","type","title"), array("ref_id" => $this->course_obj->getRefId(), "objective_id" => (int) $_GET['objective_id'], "cmdClass" => "ilcourseobjectivesgui", "cmdNode" => $_GET["cmdNode"])); $tbl->setColumnWidth(array("1%","1%",'98%')); $tbl->setLimit($_GET["limit"]); $tbl->setOffset($_GET["offset"]); $tbl->setMaxCount(count($objectives)); // footer $tbl->disable("footer"); $tbl->disable('sort'); // render table $tbl->setTemplate($tpl); $tbl->render(); $this->tpl->setVariable("OBJECTIVES_TABLE", $tpl->get()); return true; }
ilCourseObjectivesGUI::listAssignedQuestions | ( | ) |
Definition at line 1154 of file class.ilCourseObjectivesGUI.php.
References $_GET, $counter, $rbacsystem, $tbl, $tpl, __getAllTests(), __initObjectivesObject(), __initQuestionObject(), __showButton(), __sortQuestions(), ilObjTest::_instanciateQuestion(), ilUtil::formCheckbox(), ilUtil::getImagePath(), listObjectives(), sendInfo(), and ilUtil::switchColor().
Referenced by askDeassignQuestion(), assignQuestion(), assignTestSelect(), and deassignQuestion().
{ 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'])) { 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","course"); if(!count($this->__getAllTests())) { #$this->__showButton('listObjectives',$this->lng->txt('crs_objective_overview_objectives')); 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())) { 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","course"); #$this->__showButton('listObjectives',$this->lng->txt('crs_objective_overview_objectives')); $counter = 0; foreach($this->__sortQuestions($questions) as $question) { ++$counter; include_once './assessment/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_crs.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(count($objectives)); // footer $tbl->disable("footer"); $tbl->disable('sort'); // render table $tbl->setTemplate($tpl); $tbl->render(); $this->tpl->setVariable("OBJECTIVES_TABLE", $tpl->get()); return true; }
ilCourseObjectivesGUI::listObjectives | ( | ) |
Definition at line 701 of file class.ilCourseObjectivesGUI.php.
References $_GET, $counter, $rbacsystem, $tbl, $tpl, __initObjectivesObject(), __showButton(), ilCourseObjective::_getObjectiveIds(), ilUtil::formCheckbox(), ilUtil::getImagePath(), sendInfo(), and ilUtil::switchColor().
Referenced by askDeassignQuestion(), askDeleteLM(), askDeleteObjective(), assignLM(), assignLMChapter(), assignLMSelect(), assignQuestion(), assignQuestionSelect(), assignTestSelect(), deassignQuestion(), deleteLM(), deleteObjectives(), editObjective(), listAssignedLM(), listAssignedQuestions(), moveObjectiveDown(), moveObjectiveUp(), saveObjective(), and 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); } $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.crs_objectives.html","course"); if(!count($objectives = ilCourseObjective::_getObjectiveIds($this->course_obj->getId()))) { $this->__showButton('addObjective',$this->lng->txt('crs_add_objective')); sendInfo($this->lng->txt('crs_no_objectives_created')); return true; } #else #{ # $this->__showButton('editQuestionAssignment',$this->lng->txt('crs_objective_overview_question_assignment')); #} $tpl =& new ilTemplate("tpl.table.html", true, true); $tpl->addBlockfile("TBL_CONTENT", "tbl_content", "tpl.crs_objectives_row.html","course"); $counter = 0; foreach($objectives as $objective) { ++$counter; $objective_obj =& $this->__initObjectivesObject($objective); // Up down links if(count($objectives) > 1) { if($counter == 1) { $tpl->setVariable("NO_IMG_PRE_TYPE",ilUtil::getImagePath('empty.gif')); } if($counter > 1) { $tpl->setCurrentBlock("img"); $this->ctrl->setParameter($this,'objective_id',$objective_obj->getObjectiveId()); $tpl->setVariable("IMG_LINK",$this->ctrl->getLinkTarget($this,'moveObjectiveUp')); $tpl->setVariable("IMG_TYPE",ilUtil::getImagePath('a_up.gif')); $tpl->setVariable("IMG_ALT",$this->lng->txt('crs_move_up')); $tpl->parseCurrentBlock(); } if($counter < count($objectives)) { $tpl->setCurrentBlock("img"); $this->ctrl->setParameter($this,'objective_id',$objective_obj->getObjectiveId()); $tpl->setVariable("IMG_LINK",$this->ctrl->getLinkTarget($this,'moveObjectiveDown')); $tpl->setVariable("IMG_TYPE",ilUtil::getImagePath('a_down.gif')); $tpl->setVariable("IMG_ALT",$this->lng->txt('crs_move_down')); $tpl->parseCurrentBlock(); } if($counter == count($objectives)) { $tpl->setCurrentBlock("no_img_post"); $tpl->setVariable("NO_IMG_POST_TYPE",ilUtil::getImagePath('empty.gif')); $tpl->parseCurrentBlock(); } } // Edit link $tpl->setCurrentBlock("edit_img"); $this->ctrl->setParameter($this,'objective_id',$objective_obj->getObjectiveId()); $tpl->setVariable("EDIT_IMG_LINK",$this->ctrl->getLinkTarget($this,'editObjective')); $tpl->setVariable("EDIT_IMG_TYPE",ilUtil::getImagePath('edit.gif')); $tpl->setVariable("EDIT_IMG_ALT",$this->lng->txt('edit')); $tpl->parseCurrentBlock(); // Assign lm $tpl->setCurrentBlock("edit_img"); $this->ctrl->setParameter($this,'objective_id',$objective_obj->getObjectiveId()); $tpl->setVariable("EDIT_IMG_LINK",$this->ctrl->getLinkTarget($this,'listAssignedLM')); $tpl->setVariable("EDIT_IMG_TYPE",ilUtil::getImagePath('icon_lm.gif')); $tpl->setVariable("EDIT_IMG_ALT",$this->lng->txt('crs_lm_assignment')); $tpl->parseCurrentBlock(); // Assign questions $tpl->setCurrentBlock("edit_img"); $this->ctrl->setParameter($this,'objective_id',$objective_obj->getObjectiveId()); $tpl->setVariable("EDIT_IMG_LINK",$this->ctrl->getLinkTarget($this,'listAssignedQuestions')); $tpl->setVariable("EDIT_IMG_TYPE",ilUtil::getImagePath('icon_tst.gif')); $tpl->setVariable("EDIT_IMG_ALT",$this->lng->txt('crs_question_assignment')); $tpl->parseCurrentBlock(); $tpl->setCurrentBlock("options"); $tpl->setVariable("OPT_ROWCOL",ilUtil::switchColor($counter,"tblrow2","tblrow1")); $tpl->setCurrentBlock("tbl_content"); $tpl->setVariable("ROWCOL",ilUtil::switchColor($counter,"tblrow2","tblrow1")); $tpl->setVariable("CHECK_OBJECTIVE",ilUtil::formCheckbox(0,'objective[]',$objective_obj->getObjectiveId())); $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",'askDeleteObjective'); $tpl->setVariable("BTN_VALUE",$this->lng->txt('delete')); $tpl->parseCurrentBlock(); $tpl->setCurrentBlock("plain_button"); $tpl->setVariable("PBTN_NAME",'addObjective'); $tpl->setVariable("PBTN_VALUE",$this->lng->txt('crs_add_objective')); $tpl->parseCurrentBlock(); $tpl->setCurrentBlock("tbl_action_row"); $tpl->setVariable("COLUMN_COUNTS",3); $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_crs.gif",$this->lng->txt("crs_objectives")); $tbl->setHeaderNames(array('',$this->lng->txt("title"),$this->lng->txt('options'))); $tbl->setHeaderVars(array("type","title",'options'), array("ref_id" => $this->course_obj->getRefId(), "cmdClass" => "ilcourseobjectivesgui", "cmdNode" => $_GET["cmdNode"])); $tbl->setColumnWidth(array("1%","80%",'20%')); $tbl->setLimit($_GET["limit"]); $tbl->setOffset($_GET["offset"]); $tbl->setMaxCount(count($objectives)); // footer $tbl->disable("footer"); $tbl->disable('sort'); // render table $tbl->setTemplate($tpl); $tbl->render(); $this->tpl->setVariable("OBJECTIVES_TABLE", $tpl->get()); return true; }
ilCourseObjectivesGUI::moveObjectiveDown | ( | ) |
Definition at line 877 of file class.ilCourseObjectivesGUI.php.
References $_GET, $rbacsystem, __initObjectivesObject(), listObjectives(), and 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']) { 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']); sendInfo($this->lng->txt('crs_moved_objective')); $this->listObjectives(); return true; }
ilCourseObjectivesGUI::moveObjectiveUp | ( | ) |
Definition at line 852 of file class.ilCourseObjectivesGUI.php.
References $_GET, $rbacsystem, __initObjectivesObject(), listObjectives(), and 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']) { 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']); sendInfo($this->lng->txt('crs_moved_objective')); $this->listObjectives(); return true; }
ilCourseObjectivesGUI::saveObjective | ( | ) |
Definition at line 1124 of file class.ilCourseObjectivesGUI.php.
References $_POST, $rbacsystem, __initObjectivesObject(), addObjective(), listObjectives(), 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']) { 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(); sendInfo($this->lng->txt('crs_added_objective')); $this->listObjectives(); return true; }
ilCourseObjectivesGUI::setSubTabs | ( | ) |
set sub tabs
Definition at line 2016 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); }
ilCourseObjectivesGUI::updateObjective | ( | ) |
Definition at line 964 of file class.ilCourseObjectivesGUI.php.
References $_GET, $_POST, $rbacsystem, __initObjectivesObject(), editObjective(), listObjectives(), 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'])) { sendInfo($this->lng->txt('crs_no_objective_selected')); $this->listObjectives(); return false; } if(!$_POST['objective']['title']) { 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(); sendInfo($this->lng->txt('crs_objective_modified')); $this->listObjectives(); return true; }
ilCourseObjectivesGUI::updateQuestionAssignment | ( | ) |
Definition at line 1853 of file class.ilCourseObjectivesGUI.php.
References $_POST, $data, $rbacsystem, __initQuestionObject(), ilCourseObjectiveQuestion::_getTest(), editQuestionAssignment(), and 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'])) { 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) { sendInfo($this->lng->txt('crs_objective_insert_percent')); $this->editQuestionAssignment(); return false; } } foreach($_POST['test'] as $test_obj_id => $data) { include_once './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); } sendInfo($this->lng->txt('crs_objective_updated_test')); $this->editQuestionAssignment(); return true; }
ilCourseObjectivesGUI::$course_id |
Definition at line 44 of file class.ilCourseObjectivesGUI.php.
ilCourseObjectivesGUI::$course_obj |
Definition at line 43 of file class.ilCourseObjectivesGUI.php.
ilCourseObjectivesGUI::$ctrl |
Definition at line 37 of file class.ilCourseObjectivesGUI.php.
ilCourseObjectivesGUI::$ilErr |
Definition at line 39 of file class.ilCourseObjectivesGUI.php.
Referenced by ilCourseObjectivesGUI().
ilCourseObjectivesGUI::$ilias |
Definition at line 38 of file class.ilCourseObjectivesGUI.php.
Referenced by ilCourseObjectivesGUI().
ilCourseObjectivesGUI::$lng |
Definition at line 40 of file class.ilCourseObjectivesGUI.php.
Referenced by ilCourseObjectivesGUI().
ilCourseObjectivesGUI::$tpl |
Definition at line 41 of file class.ilCourseObjectivesGUI.php.
Referenced by askDeassignQuestion(), askDeleteLM(), askDeleteObjective(), assignChapterSelect(), assignLMSelect(), assignQuestionSelect(), assignTestSelect(), ilCourseObjectivesGUI(), listAssignedLM(), listAssignedQuestions(), and listObjectives().