24 include_once(
'./Services/Table/classes/class.ilTable2GUI.php');
 
   25 include_once 
'./Modules/Course/classes/class.ilCourseObjective.php';
 
   26 include_once(
'./Modules/Course/classes/class.ilCourseObjectiveMaterials.php');
 
   27 include_once(
'./Modules/Course/classes/class.ilCourseObjectiveQuestion.php');
 
   51                 $this->course_obj = $a_course_obj;
 
   54                 $this->lng->loadLanguageModule(
'crs');
 
   60                 $this->
addColumn($this->lng->txt(
'position'),
'1px');
 
   61                 $this->
addColumn($this->lng->txt(
'title'),
'title',
'25%');
 
   62                 $this->
addColumn($this->lng->txt(
'crs_objective_assigned_materials'),
'materials',
'25%');
 
   63                 $this->
addColumn($this->lng->txt(
'crs_objective_self_assessment'),
'self',
'25%');
 
   64                 $this->
addColumn($this->lng->txt(
'crs_objective_final_test'),
'final',
'25%');
 
   65                 $this->
addColumn($this->lng->txt(
''),
'5em');
 
   67                 $this->
setFormAction($this->ctrl->getFormAction($a_parent_obj));
 
   68                 $this->
setRowTemplate(
"tpl.crs_objectives_table_row.html",
"Modules/Course");
 
   72                 $this->
enable(
'select_all');
 
   89                 $this->tpl->setVariable(
'VAL_ID',$a_set[
'id']);
 
   90                 $this->tpl->setVariable(
'VAL_POSITION',$a_set[
'position']);
 
   91                 $this->tpl->setVariable(
'VAL_TITLE',$a_set[
'title']);
 
   92                 if(strlen($a_set[
'description']))
 
   94                         $this->tpl->setVariable(
'VAL_DESC',$a_set[
'description']);
 
  102                                 $this->tpl->touchBlock(
'ul_begin');
 
  103                                 foreach(
$data[
'items'] as $pg_st)
 
  105                                         $this->tpl->setCurrentBlock(
'st_pg');
 
  107                                         $this->tpl->setVariable(
'MAT_ALT',$this->lng->txt(
'obj_'.$pg_st[
'type']));
 
  108                                         include_once(
'Modules/LearningModule/classes/class.ilLMObject.php');
 
  110                                         $this->tpl->setVariable(
'MAT_TITLE',
$title);
 
  111                                         $this->tpl->parseCurrentBlock();
 
  113                                 $this->tpl->touchBlock(
'ul_end');
 
  117                                 $this->tpl->touchBlock(
'new_line');
 
  119                         $this->tpl->setCurrentBlock(
'mat_row');
 
  121                         $this->tpl->setVariable(
'LM_ALT',$this->lng->txt(
'obj_'.$data[
'type']));
 
  123                         $this->tpl->parseCurrentBlock();
 
  127                 foreach($a_set[
'self'] as 
$test)
 
  129                         foreach($test[
'questions'] as $question)
 
  131                                 $this->tpl->setCurrentBlock(
'self_qst_row');
 
  132                                 $this->tpl->setVariable(
'SELF_QST_TITLE',$question[
'title']);
 
  133                                 $this->tpl->parseCurrentBlock();
 
  135                         $this->tpl->setCurrentBlock(
'self_test_row');
 
  137                         $this->tpl->setVariable(
'SELF_TST_ALT',$this->lng->txt(
'obj_tst'));
 
  139                         $this->tpl->parseCurrentBlock();        
 
  143                 foreach($a_set[
'final'] as $test)
 
  145                         foreach($test[
'questions'] as $question)
 
  147                                 $this->tpl->setCurrentBlock(
'final_qst_row');
 
  148                                 $this->tpl->setVariable(
'FINAL_QST_TITLE',$question[
'title']);
 
  149                                 $this->tpl->parseCurrentBlock();
 
  151                         $this->tpl->setCurrentBlock(
'final_test_row');
 
  153                         $this->tpl->setVariable(
'FINAL_TST_ALT',$this->lng->txt(
'obj_tst'));
 
  155                         $this->tpl->parseCurrentBlock();        
 
  159                 $this->ctrl->setParameterByClass(get_class($this->
getParentObject()),
'objective_id',$a_set[
'id']);
 
  160                 $this->tpl->setVariable(
'EDIT_LINK',$this->ctrl->getLinkTargetByClass(get_class($this->
getParentObject()),
'edit'));
 
  161                 $this->tpl->setVariable(
'TXT_EDIT',$this->lng->txt(
'edit'));                    
 
  171         public function parse($a_objective_ids)
 
  174                 foreach($a_objective_ids as $objective_id)
 
  178                         $objective_data[
'id'] = $objective_id;
 
  179                         $objective_data[
'position'] = sprintf(
"%.1f",$position++);
 
  180                         $objective_data[
'title'] = $objective->getTitle();
 
  181                         $objective_data[
'description'] = $objective->getDescription();
 
  184                         $materials = array();
 
  186                         foreach($ass_materials->getMaterials() as $material)
 
  191                                 switch($material[
'type'])
 
  195                                                 $materials[$material[
'ref_id']][
'items'][] = $material;
 
  203                         $objective_data[
'materials'] = $materials;
 
  208                         foreach($question_obj->getSelfAssessmentTests() as 
$test)
 
  210                                 $questions = array();
 
  211                                 foreach($question_obj->getQuestionsOfTest(
$test[
'obj_id']) as $qst)
 
  216                                 $tmp_test[
'questions'] = $questions;
 
  220                         $objective_data[
'self'] = 
$tests;
 
  224                         foreach($question_obj->getFinalTests() as 
$test)
 
  226                                 $questions = array();
 
  227                                 foreach($question_obj->getQuestionsOfTest(
$test[
'obj_id']) as $qst)
 
  232                                 $tmp_test[
'questions'] = $questions;
 
  236                         $objective_data[
'final'] = 
$tests;
 
  238                         $objectives[] = $objective_data;
 
  241                 $this->
setData($objectives ? $objectives : array());