コード例 #1
0
 /**
  * clone objective materials
  *
  * @access public
  *
  * @param int source objective
  * @param int target objective
  * @param int copy id
  */
 public function cloneDependencies($a_new_objective, $a_copy_id)
 {
     global $ilObjDataCache, $ilLog;
     include_once 'Services/CopyWizard/classes/class.ilCopyWizardOptions.php';
     $cwo = ilCopyWizardOptions::_getInstance($a_copy_id);
     $mappings = $cwo->getMappings();
     #$ilLog->write(__METHOD__.': 1');
     foreach ($this->getMaterials() as $material) {
         #$ilLog->write(__METHOD__.': 2');
         // Copy action omit ?
         if (!isset($mappings[$material['ref_id']]) or !$mappings[$material['ref_id']]) {
             continue;
         }
         #$ilLog->write(__METHOD__.': 3');
         $material_ref_id = $material['ref_id'];
         $material_rbac_obj_id = $ilObjDataCache->lookupObjId($material_ref_id);
         $material_obj_id = $material['obj_id'];
         $new_ref_id = $mappings[$material_ref_id];
         $new_rbac_obj_id = $ilObjDataCache->lookupObjId($new_ref_id);
         #$ilLog->write(__METHOD__.': 4');
         // Link
         if ($new_rbac_obj_id == $material_rbac_obj_id) {
             #$ilLog->write(__METHOD__.': 5');
             $ilLog->write(__METHOD__ . ': Material has been linked. Keeping object id.');
             $new_obj_id = $material_obj_id;
         } elseif ($material['type'] == 'st' or $material['type'] == 'pg') {
             #$GLOBALS['ilLog']->write(__METHOD__.': '.print_r($material,TRUE));
             #$GLOBALS['ilLog']->write(__METHOD__.': '.print_r($mappings,TRUE));
             #$ilLog->write(__METHOD__.': 6');
             // Chapter assignment
             $new_material_info = isset($mappings[$material_ref_id . '_' . $material_obj_id]) ? $mappings[$material_ref_id . '_' . $material_obj_id] : '';
             $new_material_arr = explode('_', $new_material_info);
             if (!isset($new_material_arr[1]) or !$new_material_arr[1]) {
                 $ilLog->write(__METHOD__ . ': No mapping found for chapter: ' . $material_obj_id);
                 continue;
             }
             $new_obj_id = $new_material_arr[1];
             $ilLog->write(__METHOD__ . ': New material id is: ' . $new_obj_id);
         } else {
             #$ilLog->write(__METHOD__.': 7');
             // Any type
             $new_obj_id = $ilObjDataCache->lookupObjId($mappings[$material_ref_id]);
         }
         #$ilLog->write(__METHOD__.': 8');
         $new_material = new ilCourseObjectiveMaterials($a_new_objective);
         #$ilLog->write(__METHOD__.': 8.1');
         $new_material->setLMRefId($new_ref_id);
         #$ilLog->write(__METHOD__.': 8.2');
         $new_material->setLMObjId($new_obj_id);
         #$ilLog->write(__METHOD__.': 8.3');
         $new_material->setType($material['type']);
         #$ilLog->write(__METHOD__.': 8.4');
         $new_material->add();
         #$ilLog->write(__METHOD__.': 9');
     }
 }
コード例 #2
0
 /**
  * parse
  *
  * @access public
  * @param array array of objective id's
  */
 public function parse($a_objective_ids)
 {
     $position = 1;
     foreach ($a_objective_ids as $objective_id) {
         $objective = new ilCourseObjective($this->course_obj, $objective_id);
         $objective_data['id'] = $objective_id;
         $objective_data['position'] = sprintf("%.1f", $position++);
         $objective_data['title'] = $objective->getTitle();
         $objective_data['description'] = $objective->getDescription();
         // assigned materials
         $materials = array();
         $ass_materials = new ilCourseObjectiveMaterials($objective_id);
         foreach ($ass_materials->getMaterials() as $material) {
             $materials[$material['ref_id']]['obj_id'] = $obj_id = ilObject::_lookupObjId($material['ref_id']);
             $materials[$material['ref_id']]['type'] = ilObject::_lookupType($obj_id);
             switch ($material['type']) {
                 case 'pg':
                 case 'st':
                     $materials[$material['ref_id']]['items'][] = $material;
                     break;
                 default:
             }
         }
         $objective_data['materials'] = $materials;
         $question_obj = new ilCourseObjectiveQuestion($objective_id);
         // self assessment questions
         $tests = array();
         foreach ($question_obj->getSelfAssessmentTests() as $test) {
             $questions = array();
             foreach ($question_obj->getQuestionsOfTest($test['obj_id']) as $qst) {
                 $questions[] = $qst;
             }
             $tmp_test = $test;
             $tmp_test['questions'] = $questions;
             $tests[] = $tmp_test;
         }
         $objective_data['self'] = $tests;
         // final test questions
         $tests = array();
         foreach ($question_obj->getFinalTests() as $test) {
             $questions = array();
             foreach ($question_obj->getQuestionsOfTest($test['obj_id']) as $qst) {
                 $questions[] = $qst;
             }
             $tmp_test = $test;
             $tmp_test['questions'] = $questions;
             $tests[] = $tmp_test;
         }
         $objective_data['final'] = $tests;
         $objectives[] = $objective_data;
     }
     $this->setData($objectives ? $objectives : array());
 }
コード例 #3
0
 protected function getObjectivesStatus($a_set_errors = true)
 {
     if (!$this->getObjectivesAvailableStatus($a_set_errors)) {
         return false;
     }
     include_once './Modules/Course/classes/class.ilCourseObjective.php';
     $num_active = ilCourseObjective::_getCountObjectives($this->getParentObject()->getId(), true);
     if (!$num_active) {
         if ($a_set_errors) {
             $this->appendFailure(self::SECTION_OBJECTIVES, 'crs_loc_err_no_active_lo');
         }
         return false;
     }
     foreach (ilCourseObjective::_getObjectiveIds($this->getParentObject()->getId(), true) as $objective_id) {
         include_once './Modules/Course/classes/class.ilCourseObjectiveMaterials.php';
         $obj = new ilCourseObjectiveMaterials($objective_id);
         if (!count($obj->getMaterials())) {
             if ($a_set_errors) {
                 $this->appendFailure(self::SECTION_OBJECTIVES, 'crs_loc_err_no_active_mat');
             }
             return false;
         }
     }
     // check for assigned initial test questions
     if ($this->getSettings()->worksWithInitialTest() && !$this->getSettings()->hasSeparateInitialTests()) {
         // check for assigned questions
         if (!$this->lookupQuestionsAssigned($this->getSettings()->getInitialTest())) {
             if ($a_set_errors) {
                 $this->appendFailure(self::SECTION_OBJECTIVES, 'crs_loc_err_no_active_qst');
             }
             return false;
         }
     }
     // check for assigned questions
     if (!$this->getSettings()->hasSeparateQualifiedTests() and !$this->lookupQuestionsAssigned($this->getSettings()->getQualifiedTest())) {
         if ($a_set_errors) {
             $this->appendFailure(self::SECTION_OBJECTIVES, 'crs_loc_err_no_active_qst');
         }
         return false;
     }
     // @deprecated
     /*
     if(!$this->checkNumberOfTries())
     {
     	if($a_set_errors)
     	{
     		$this->appendFailure(self::SECTION_OBJECTIVES, 'crs_loc_err_nr_tries_exceeded');
     	}
     	return false;
     }
     */
     return true;
 }
コード例 #4
0
 /**
  * render objective
  *
  * @access protected
  * @param int objective id
  * @param bool co page status
  * @param ilAccordionGUI $a_accordion 
  * @param array $a_lo_result 
  * @return string html
  */
 protected function renderObjective($a_objective_id, &$a_has_lo_page, ilAccordionGUI $a_accordion = null, array $a_lo_result = null)
 {
     global $ilUser, $lng;
     include_once './Modules/Course/classes/class.ilCourseObjective.php';
     $objective = new ilCourseObjective($this->getContainerObject(), $a_objective_id);
     include_once './Services/Container/classes/class.ilContainerSorting.php';
     include_once './Services/Object/classes/class.ilObjectActivation.php';
     $items = ilObjectActivation::getItemsByObjective($a_objective_id);
     // sorting is handled by ilCourseObjectiveMaterials
     // $items = ilContainerSorting::_getInstance($this->getContainerObject()->getId())->sortSubItems('lobj',$a_objective_id,$items);
     include_once './Modules/Course/classes/class.ilCourseObjectiveMaterials.php';
     $objectives_lm_obj = new ilCourseObjectiveMaterials($a_objective_id);
     // #13381 - map material assignment to position
     $sort_map = array();
     foreach ($objectives_lm_obj->getMaterials() as $item) {
         $sort_map[$item["lm_ass_id"]] = $item["position"];
     }
     $is_manage = $this->getContainerGUI()->isActiveAdministrationPanel();
     $is_order = $this->getContainerGUI()->isActiveOrdering();
     $sort_content = array();
     foreach ($items as $item) {
         if ($this->getDetailsLevel($a_objective_id) < self::DETAILS_ALL) {
             continue;
         }
         $item_list_gui2 = $this->getItemGUI($item);
         $item_list_gui2->enableIcon(true);
         if ($is_order || $a_accordion) {
             $item_list_gui2->enableCommands(true, true);
             $item_list_gui2->enableProperties(false);
         }
         $chapters = $objectives_lm_obj->getChapters();
         if (count($chapters)) {
             $has_sections = false;
             foreach ($chapters as $chapter) {
                 if ($chapter['ref_id'] != $item['child']) {
                     continue;
                 }
                 $has_sections = true;
                 include_once './Modules/LearningModule/classes/class.ilLMObject.php';
                 $title = $item['title'] . " &rsaquo; " . ilLMObject::_lookupTitle($chapter['obj_id']) . " (" . $lng->txt('obj_' . $chapter['type']) . ")";
                 $item_list_gui2->setDefaultCommandParameters(array("obj_id" => $chapter['obj_id'], "focus_id" => $chapter['obj_id'], "focus_return" => $this->container_obj->getRefId()));
                 if ($is_order) {
                     $item_list_gui2->setPositionInputField("[lobj][" . $a_objective_id . "][" . $chapter['lm_ass_id'] . "]", sprintf('%d', $chapter['position'] * 10));
                 }
                 $sub_item_html = $item_list_gui2->getListItemHTML($item['ref_id'], $item['obj_id'], $title, $item['description']);
                 // #13381 - use materials order
                 $sort_key = str_pad($chapter['position'], 5, 0, STR_PAD_LEFT) . "_" . strtolower($title) . "_" . $chapter['lm_ass_id'];
                 $sort_content[$sort_key] = $sub_item_html;
             }
         }
         $this->rendered_items[$item['child']] = true;
         if ($lm_ass_id = $objectives_lm_obj->isAssigned($item['ref_id'], true)) {
             if ($is_order) {
                 $item_list_gui2->setPositionInputField("[lobj][" . $a_objective_id . "][" . $lm_ass_id . "]", sprintf('%d', $sort_map[$lm_ass_id] * 10));
             }
             $sub_item_html = $item_list_gui2->getListItemHTML($item['ref_id'], $item['obj_id'], $item['title'], $item['description']);
             // #13381 - use materials order
             $sort_key = str_pad($sort_map[$lm_ass_id], 5, 0, STR_PAD_LEFT) . "_" . strtolower($item['title']) . "_" . $lm_ass_id;
             $sort_content[$sort_key] = $sub_item_html;
         }
     }
     if ($this->getDetailsLevel($a_objective_id) == self::DETAILS_ALL) {
         $this->objective_list_gui->enableCommands(false);
     } else {
         $this->objective_list_gui->enableCommands(true);
     }
     if ($is_order) {
         $this->objective_list_gui->setPositionInputField("[lobj][" . $a_objective_id . "][0]", $objective->__getPosition() * 10);
     }
     ksort($sort_content);
     if (!$a_accordion) {
         foreach ($sort_content as $sub_item_html) {
             $this->objective_list_gui->addSubItemHTML($sub_item_html);
         }
         return $this->objective_list_gui->getListItemHTML(0, $a_objective_id, $objective->getTitle(), $objective->getDescription(), $is_manage || $is_order);
     } else {
         $acc_content = $sort_content;
         $initial_shown = false;
         if ($this->getSettings()->hasSeparateInitialTests() and !$a_lo_result['initial_status']) {
             $acc_content[] = $this->renderTest($this->getTestAssignments()->getTestByObjective($a_objective_id, ilLOSettings::TYPE_TEST_INITIAL), $a_objective_id, true, false, $a_lo_result);
             $initial_shown = TRUE;
         } elseif ($this->getSettings()->hasSeparateQualifiedTests()) {
             $acc_content[] = $this->renderTest($this->getTestAssignments()->getTestByObjective($a_objective_id, ilLOSettings::TYPE_TEST_QUALIFIED), $a_objective_id, false, false, $a_lo_result);
         }
         /*
         if($this->loc_settings->getInitialTest() &&
         	$this->loc_settings->getType() == ilLOSettings::LOC_INITIAL_SEL &&
         	!$a_lo_result["initial_status"])
         {
         	$acc_content[] = $this->renderTest($this->loc_settings->getInitialTest(), $a_objective_id, true, false, $a_lo_result);
         	$initial_shown = true;
         }	
         if(!$initial_shown &&
         	$this->loc_settings->getQualifiedTest() && 
         	$this->loc_settings->isQualifiedTestPerObjectiveVisible())
         {
         	$acc_content[] = $this->renderTest($this->loc_settings->getQualifiedTest(), $a_objective_id, false, false, $a_lo_result);
         }
         */
         $co_page = null;
         include_once "./Services/COPage/classes/class.ilPageUtil.php";
         if (ilPageUtil::_existsAndNotEmpty("lobj", $objective->getObjectiveId())) {
             $a_has_lo_page = true;
             include_once 'Modules/Course/classes/Objectives/class.ilLOPageGUI.php';
             $page_gui = new ilLOPageGUI($objective->getObjectiveId());
             include_once "./Services/Style/classes/class.ilObjStyleSheet.php";
             $page_gui->setStyleId(ilObjStyleSheet::getEffectiveContentStyleId(0));
             $page_gui->setPresentationTitle("");
             $page_gui->setTemplateOutput(false);
             $page_gui->setHeader("");
             $co_page = "<div class='ilContObjectiveIntro'>" . $page_gui->showPage() . "</div>";
         }
         // patch optes start
         $a_accordion->addItem($this->buildAccordionTitle($objective, $a_lo_result), $co_page . $this->buildAccordionContent($acc_content), isset($_GET["oobj"]) && (int) $_GET["oobj"] == $objective->getObjectiveId());
         // patch optes end
     }
 }
コード例 #5
0
 /**
  * clone objectives
  *
  * @access public
  * @param int target id
  * @param int copy id
  * 
  */
 public function ilClone($a_target_id, $a_copy_id)
 {
     global $ilLog;
     $ilLog->write(__METHOD__ . ': Start cloning learning objectives...');
     $query = "SELECT * FROM crs_objectives " . "WHERE crs_id  = " . $this->db->quote($this->course_obj->getId(), 'integer') . ' ' . "ORDER BY position ";
     $res = $this->db->query($query);
     if (!$res->numRows()) {
         $ilLog->write(__METHOD__ . ': ... no objectives found.');
         return true;
     }
     if (!is_object($new_course = ilObjectFactory::getInstanceByRefId($a_target_id, false))) {
         $ilLog->write(__METHOD__ . ': Cannot init new course object.');
         return true;
     }
     while ($row = $res->fetchRow(DB_FETCHMODE_OBJECT)) {
         $new_objective = new ilCourseObjective($new_course);
         $new_objective->setTitle($row->title);
         $new_objective->setDescription($row->description);
         $new_objective->setActive($row->active);
         $objective_id = $new_objective->add();
         $ilLog->write(__METHOD__ . ': Added new objective nr: ' . $objective_id);
         // Clone crs_objective_tst entries
         include_once 'Modules/Course/classes/class.ilCourseObjectiveQuestion.php';
         $objective_qst = new ilCourseObjectiveQuestion($row->objective_id);
         $objective_qst->cloneDependencies($objective_id, $a_copy_id);
         // Clone test assignments
         include_once './Modules/Course/classes/Objectives/class.ilLOTestAssignments.php';
         include_once './Modules/Course/classes/Objectives/class.ilLOSettings.php';
         $assignments = ilLOTestAssignments::getInstance($this->course_obj->getId());
         $assignment_it = $assignments->getAssignmentByObjective($row->objective_id, ilLOSettings::TYPE_TEST_INITIAL);
         if ($assignment_it) {
             $assignment_it->cloneSettings($a_copy_id, $new_course->getId(), $objective_id);
         }
         $assignment_qt = $assignments->getAssignmentByObjective($row->objective_id, ilLOSettings::TYPE_TEST_QUALIFIED);
         if ($assignment_qt) {
             $assignment_qt->cloneSettings($a_copy_id, $new_course->getId(), $objective_id);
         }
         $ilLog->write(__METHOD__ . ': Finished objective question dependencies: ' . $objective_id);
         // Clone crs_objective_lm entries (assigned course materials)
         include_once 'Modules/Course/classes/class.ilCourseObjectiveMaterials.php';
         $objective_material = new ilCourseObjectiveMaterials($row->objective_id);
         $objective_material->cloneDependencies($objective_id, $a_copy_id);
     }
     $ilLog->write(__METHOD__ . ': Finished cloning objectives.');
 }
コード例 #6
0
 function __getOtherResources()
 {
     include_once 'Modules/Course/classes/class.ilCourseObjectiveMaterials.php';
     $assigned = ilCourseObjectiveMaterials::_getAllAssignedMaterials($this->course_obj->getId());
     foreach (ilObjectActivation::getItems($this->course_obj->getRefId(), false) as $node) {
         if (in_array($node['ref_id'], $assigned)) {
             continue;
         }
         if ($node['type'] == 'tst') {
             continue;
         }
         $all_lms[] = $node['ref_id'];
     }
     return $all_lms ? $all_lms : array();
 }
コード例 #7
0
 /**
  * Get objective items
  * 
  * @param int $a_objective_id
  * @return array
  */
 public static function getItemsByObjective($a_objective_id)
 {
     include_once './Modules/Course/classes/class.ilCourseObjectiveMaterials.php';
     $item_ids = ilCourseObjectiveMaterials::_getAssignedMaterials($a_objective_id);
     return self::processListItems($item_ids);
 }
コード例 #8
0
 /**
  * parse
  *
  * @access public
  * @param array array of objective id's
  */
 public function parse($a_objective_ids)
 {
     $position = 1;
     foreach ($a_objective_ids as $objective_id) {
         $objective = new ilCourseObjective($this->course_obj, $objective_id);
         $objective_data['id'] = $objective_id;
         $objective_data['position'] = sprintf("%.1f", $position++) * 10;
         $objective_data['title'] = $objective->getTitle();
         $objective_data['description'] = $objective->getDescription();
         // begin-patch lok
         $objective_data['online'] = $objective->isActive();
         $objective_data['passes'] = $objective->getPasses();
         // end-patch lok
         // assigned materials
         $materials = array();
         $ass_materials = new ilCourseObjectiveMaterials($objective_id);
         foreach ($ass_materials->getMaterials() as $material) {
             $materials[$material['ref_id']]['obj_id'] = $obj_id = ilObject::_lookupObjId($material['ref_id']);
             $materials[$material['ref_id']]['type'] = ilObject::_lookupType($obj_id);
             switch ($material['type']) {
                 case 'pg':
                 case 'st':
                     $materials[$material['ref_id']]['items'][] = $material;
                     break;
                 default:
             }
         }
         $objective_data['materials'] = $materials;
         $question_obj = new ilCourseObjectiveQuestion($objective_id);
         // self assessment questions
         // begin-patch lok
         if ($this->getSettings()->worksWithInitialTest()) {
             if (ilLOUtils::lookupRandomTest(ilObject::_lookupObjId($this->getSettings()->getInitialTest()))) {
                 $test = array();
                 include_once './Modules/Course/classes/Objectives/class.ilLORandomTestQuestionPools.php';
                 $rnd = new ilLORandomTestQuestionPools($this->course_obj->getId(), $objective_id, ilLOSettings::TYPE_TEST_INITIAL);
                 $test['obj_id'] = ilObject::_lookupObjId($this->getSettings()->getInitialTest());
                 $qst = ilLOUtils::lookupQplBySequence($this->getSettings()->getInitialTest(), $rnd->getQplSequence());
                 if ($qst) {
                     $test['questions'][] = array('title' => $qst);
                 }
                 $objective_data['self'] = array($test);
             } else {
                 $tests = array();
                 foreach ($question_obj->getSelfAssessmentTests() as $test) {
                     $questions = array();
                     foreach ($question_obj->getQuestionsOfTest($test['obj_id']) as $qst) {
                         $questions[] = $qst;
                     }
                     $tmp_test = $test;
                     $tmp_test['questions'] = $questions;
                     $tests[] = $tmp_test;
                 }
                 $objective_data['self'] = $tests;
             }
         }
         // end-patch lok
         // final test questions
         // begin-patch lok
         if ($this->getSettings()->getQualifiedTest()) {
             if (ilLOUtils::lookupRandomTest(ilObject::_lookupObjId($this->getSettings()->getQualifiedTest()))) {
                 $test = array();
                 include_once './Modules/Course/classes/Objectives/class.ilLORandomTestQuestionPools.php';
                 $rnd = new ilLORandomTestQuestionPools($this->course_obj->getId(), $objective_id, ilLOSettings::TYPE_TEST_QUALIFIED);
                 $test['obj_id'] = ilObject::_lookupObjId($this->getSettings()->getQualifiedTest());
                 $qst = ilLOUtils::lookupQplBySequence($this->getSettings()->getQualifiedTest(), $rnd->getQplSequence());
                 if ($qst) {
                     $test['questions'][] = array('title' => $qst);
                 }
                 $objective_data['final'] = array($test);
             } else {
                 $tests = array();
                 foreach ($question_obj->getFinalTests() as $test) {
                     $questions = array();
                     foreach ($question_obj->getQuestionsOfTest($test['obj_id']) as $qst) {
                         $questions[] = $qst;
                     }
                     $tmp_test = $test;
                     $tmp_test['questions'] = $questions;
                     $tests[] = $tmp_test;
                 }
                 $objective_data['final'] = $tests;
             }
         }
         // end-patch lok
         $objectives[] = (array) $objective_data;
     }
     $this->setData($objectives ? $objectives : array());
 }
コード例 #9
0
 public function saveSortingObject()
 {
     if (isset($_POST['position']["lobj"])) {
         $lobj = $_POST['position']["lobj"];
         unset($_POST['position']["lobj"]);
         $objective_order = array();
         foreach ($lobj as $objective_id => $materials) {
             $objective_order[$objective_id] = $materials[0];
             unset($lobj[$objective_id][0]);
         }
         // objective order
         include_once "Modules/Course/classes/class.ilCourseObjective.php";
         asort($objective_order);
         $pos = 0;
         foreach (array_keys($objective_order) as $objective_id) {
             $obj = new ilCourseObjective($this->object, $objective_id);
             $obj->writePosition(++$pos);
         }
         // material order
         include_once "Modules/Course/classes/class.ilCourseObjectiveMaterials.php";
         foreach ($lobj as $objective_id => $materials) {
             $objmat = new ilCourseObjectiveMaterials($objective_id);
             asort($materials);
             $pos = 0;
             foreach (array_keys($materials) as $ass_id) {
                 $objmat->writePosition($ass_id, ++$pos);
             }
         }
     }
     return parent::saveSortingObject();
 }
コード例 #10
0
 /**
  * render objective
  *
  * @access protected
  * @param int objective id
  * @return string html
  */
 protected function renderObjective($a_objective_id)
 {
     global $ilUser, $lng;
     include_once './Modules/Course/classes/class.ilCourseObjective.php';
     $objective = new ilCourseObjective($this->getContainerObject(), $a_objective_id);
     include_once './Services/Container/classes/class.ilContainerSorting.php';
     include_once './Services/Object/classes/class.ilObjectActivation.php';
     $items = ilObjectActivation::getItemsByObjective($a_objective_id);
     $items = ilContainerSorting::_getInstance($this->getContainerObject()->getId())->sortSubItems('lobj', $a_objective_id, $items);
     include_once './Modules/Course/classes/class.ilCourseObjectiveMaterials.php';
     $objectives_lm_obj = new ilCourseObjectiveMaterials($a_objective_id);
     $pos = 1;
     foreach ($items as $item) {
         if ($this->getDetailsLevel($a_objective_id) < self::DETAILS_ALL) {
             continue;
         }
         $chapters = $objectives_lm_obj->getChapters();
         $item_list_gui2 = $this->getItemGUI($item);
         $item_list_gui2->enableIcon(true);
         if (count($chapters)) {
             $num = 0;
             $has_sections = false;
             foreach ($chapters as $chapter) {
                 if ($chapter['ref_id'] != $item['child']) {
                     continue;
                 }
                 $has_sections = true;
                 include_once './Modules/LearningModule/classes/class.ilLMObject.php';
                 $details[$num]['desc'] = $lng->txt('obj_' . $chapter['type']) . ' -> ';
                 $details[$num]['target'] = '_top';
                 $details[$num]['link'] = "ilias.php?baseClass=ilLMPresentationGUI&ref_id=" . $chapter['ref_id'] . '&obj_id=' . $chapter['obj_id'];
                 $details[$num]['name'] = ilLMObject::_lookupTitle($chapter['obj_id']);
                 $num++;
             }
             if ($has_sections) {
                 $item_list_gui2->enableItemDetailLinks(true);
                 $item_list_gui2->setItemDetailLinks($details, $lng->txt('crs_suggested_sections') . ': ');
             }
         }
         if ($this->getContainerGUI()->isActiveAdministrationPanel()) {
             $item_list_gui2->enableCheckbox(true);
             if ($this->getContainerObject()->getOrderType() == ilContainer::SORT_MANUAL) {
                 $item_list_gui2->setPositionInputField("[lobj][" . $a_objective_id . "][" . $item["ref_id"] . "]", sprintf('%.1f', $pos));
                 $pos++;
             }
         }
         $this->rendered_items[$item['child']] = true;
         $sub_item_html = $item_list_gui2->getListItemHTML($item['ref_id'], $item['obj_id'], $item['title'], $item['description']);
         $this->determineAdminCommands($item["ref_id"], $item_list_gui2->adminCommandsIncluded());
         $this->objective_list_gui->addSubItemHTML($sub_item_html);
     }
     if ($this->getDetailsLevel($a_objective_id) == self::DETAILS_ALL) {
         $this->objective_list_gui->enableCommands(false);
     } else {
         $this->objective_list_gui->enableCommands(true);
     }
     $html = $this->objective_list_gui->getListItemHTML(0, $a_objective_id, $objective->getTitle(), $objective->getDescription());
     return $html;
 }
コード例 #11
0
 /**
  * material assignment
  *
  * @access protected
  * @return
  */
 protected function materialAssignment()
 {
     global $ilAccess, $ilErr, $tpl;
     if (!$ilAccess->checkAccess('write', '', $this->course_obj->getRefId())) {
         $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->WARNING);
     }
     if (!$_GET['objective_id']) {
         ilUtil::sendFailure($this->lng->txt('crs_no_objective_selected'), true);
         $this->ctrl->redirect($this, 'listObjectives');
     }
     $this->ctrl->saveParameter($this, 'objective_id');
     $this->objective = new ilCourseObjective($this->course_obj, (int) $_GET['objective_id']);
     include_once './Modules/Course/classes/class.ilCourseObjectiveMaterialAssignmentTableGUI.php';
     $table = new ilCourseObjectiveMaterialAssignmentTableGUI($this, $this->course_obj, (int) $_GET['objective_id']);
     $table->setTitle($this->lng->txt('crs_objective_wiz_materials'), 'icon_lobj.png', $this->lng->txt('crs_objectives'));
     include_once 'Modules/Course/classes/class.ilCourseObjectiveMaterials.php';
     $table->parse(ilCourseObjectiveMaterials::_getAssignableMaterials($this->course_obj->getRefId()));
     $this->__initQuestionObject((int) $_GET['objective_id']);
     $w_tpl = $this->initWizard(2);
     $w_tpl->setVariable('WIZ_CONTENT', $table->getHTML());
     $tpl->setContent($w_tpl->get());
 }