24include_once(
'./Services/Table/classes/class.ilTable2GUI.php');
 
   25include_once 
'./Modules/Course/classes/class.ilCourseObjective.php';
 
   26include_once(
'./Modules/Course/classes/class.ilCourseObjectiveMaterials.php');
 
   27include_once(
'./Modules/Course/classes/class.ilCourseObjectiveQuestion.php');
 
   28include_once 
'./Modules/Course/classes/Objectives/class.ilLOUtils.php';
 
   31include_once 
'./Modules/Course/classes/Objectives/class.ilLOSettings.php';
 
   60                $this->course_obj = $a_course_obj;
 
   67                $this->lng->loadLanguageModule(
'crs');
 
   70                parent::__construct($a_parent_obj,
'listObjectives');
 
   73                $this->
addColumn($this->lng->txt(
'position'),
'position',
'10em');
 
   74                $this->
addColumn($this->lng->txt(
'title'),
'title',
'20%');
 
   75                $this->
addColumn($this->lng->txt(
'crs_objective_assigned_materials'),
'materials');
 
   79                        $this->
addColumn($this->lng->txt(
'crs_objective_self_assessment'),
'self');
 
   84                        $this->
addColumn($this->lng->txt(
'crs_objective_tbl_col_final_tsts'),
'final');
 
   88                        $this->
addColumn($this->lng->txt(
'crs_objective_final_test'),
'final');
 
   90                $this->
addColumn($this->lng->txt(
'actions'),
'5em');
 
   92                $this->
setFormAction($this->ctrl->getFormAction($a_parent_obj));
 
   93                $this->
setRowTemplate(
"tpl.crs_objectives_table_row.html",
"Modules/Course");
 
   97                $this->
enable(
'select_all');
 
  104                $this->
addMultiCommand(
'activateObjectives', $this->lng->txt(
'set_online'));
 
  105                $this->
addMultiCommand(
'deactivateObjectives', $this->lng->txt(
'set_offline'));
 
  106                $this->
addMultiCommand(
'askDeleteObjectives',$this->lng->txt(
'delete'));
 
  133                $GLOBALS[
'ilLog']->write(__METHOD__.
': '.print_r($a_set,TRUE));
 
  135                $this->tpl->setVariable(
'VAL_ID',$a_set[
'id']);
 
  136                $this->tpl->setVariable(
'VAL_POSITION',$a_set[
'position']);
 
  141                        $this->tpl->setVariable(
'VAL_ONOFFLINE',$this->lng->txt(
'online'));
 
  142                        $this->tpl->setVariable(
'ONOFFLINE_CLASS',
'smallgreen');
 
  146                        $this->tpl->setVariable(
'VAL_ONOFFLINE',$this->lng->txt(
'offline'));
 
  147                        $this->tpl->setVariable(
'ONOFFLINE_CLASS',
'smallred');
 
  152                        $this->tpl->setVariable(
'PASSES_TXT',$this->lng->txt(
'crs_loc_passes_info'));
 
  153                        $this->tpl->setVariable(
'PASSES_VAL',$a_set[
'passes']);
 
  158                $this->ctrl->setParameterByClass(
'ilcourseobjectivesgui',
'objective_id',$a_set[
'id']);
 
  159                $this->tpl->setVariable(
'VAL_TITLE_LINKED',$this->ctrl->getLinkTargetByClass(
'ilcourseobjectivesgui',
'edit'));
 
  162                $this->tpl->setVariable(
'VAL_TITLE',$a_set[
'title']);
 
  163                if(strlen($a_set[
'description']))
 
  165                        $this->tpl->setVariable(
'VAL_DESC',$a_set[
'description']);
 
  173                                $this->tpl->touchBlock(
'ul_begin');
 
  174                                foreach(
$data[
'items'] as $pg_st)
 
  176                                        $this->tpl->setCurrentBlock(
'st_pg');
 
  177                                        $this->tpl->setVariable(
'MAT_IMG',
ilObject::_getIcon($pg_st[
'obj_id'],
"tiny", $pg_st[
'type']));
 
  178                                        $this->tpl->setVariable(
'MAT_ALT',$this->lng->txt(
'obj_'.$pg_st[
'type']));
 
  179                                        include_once(
'Modules/LearningModule/classes/class.ilLMObject.php');
 
  181                                        $this->tpl->setVariable(
'MAT_TITLE',
$title);
 
  182                                        $this->tpl->parseCurrentBlock();
 
  184                                $this->tpl->touchBlock(
'ul_end');
 
  188                                $this->tpl->touchBlock(
'new_line');
 
  190                        $this->tpl->setCurrentBlock(
'mat_row');
 
  192                        $this->tpl->setVariable(
'LM_ALT',$this->lng->txt(
'obj_'.$data[
'type']));
 
  194                        if(
$data[
'type'] == 
'catr' or 
$data[
'type'] == 
'crsr' or 
$data[
'type'] == 
'grpr')
 
  196                                include_once 
'./Services/ContainerReference/classes/class.ilContainerReference.php';
 
  197                                $this->tpl->setVariable(
 
  206                        $this->tpl->parseCurrentBlock();
 
  213                        if($this->
getSettings()->hasSeparateInitialTests())
 
  215                                if($a_set[
'initial'])
 
  217                                        include_once 
'./Services/Link/classes/class.ilLink.php';
 
  219                                        $this->tpl->setCurrentBlock(
'initial_test_per_objective');
 
  221                                        $this->tpl->setVariable(
'IT_ALT', $this->lng->txt(
'obj_tst'));
 
  223                                        $this->tpl->setVariable(
'IT_TITLE_LINK',  
ilLink::_getLink($a_set[
'initial']));
 
  225                                        include_once 
'./Services/Link/classes/class.ilLink.php';
 
  226                                        $this->ctrl->setParameterByClass(
'ilobjtestgui',
'ref_id',$a_set[
'initial']);
 
  227                                        $this->ctrl->setParameterByClass(
'ilobjtestgui',
'cmd',
'questionsTabGateway');
 
  228                                        $this->tpl->setVariable(
 
  230                                                        $this->ctrl->getLinkTargetByClass(
'ilobjtestgui')
 
  233                                        $this->tpl->parseCurrentBlock();
 
  237                                        $this->tpl->touchBlock(
'initial_test_per_objective');
 
  242                                foreach($a_set[
'self'] as 
$test)
 
  245                                        foreach((array) 
$test[
'questions'] as $question)
 
  247                                                $this->tpl->setCurrentBlock(
'self_qst_row');
 
  248                                                $this->tpl->setVariable(
'SELF_QST_TITLE',$question[
'title']);
 
  249                                                $this->tpl->parseCurrentBlock();
 
  254                                if(!count($a_set[
'self']))
 
  256                                        $this->tpl->touchBlock(
'self_qst_row');
 
  270                                $this->tpl->setCurrentBlock(
'final_test_per_objective');
 
  272                                $this->tpl->setVariable(
'FT_ALT', $this->lng->txt(
'obj_tst'));
 
  275                                include_once 
'./Services/Link/classes/class.ilLink.php';
 
  276                                $this->ctrl->setParameterByClass(
'ilobjtestgui',
'ref_id',$a_set[
'final']);
 
  277                                $this->ctrl->setParameterByClass(
'ilobjtestgui',
'cmd',
'questionsTabGateway');
 
  278                                $this->tpl->setVariable(
 
  280                                                $this->ctrl->getLinkTargetByClass(
'ilobjtestgui')
 
  284                                $this->tpl->parseCurrentBlock();
 
  288                                $this->tpl->touchBlock(
'final_test_per_objective');
 
  293                        foreach((array) $a_set[
'final'] as 
$test)
 
  295                                foreach((array) 
$test[
'questions'] as $question)
 
  297                                        $this->tpl->setCurrentBlock(
'final_qst_row');
 
  298                                        $this->tpl->setVariable(
'FINAL_QST_TITLE',$question[
'title']);
 
  299                                        $this->tpl->parseCurrentBlock();
 
  302                                #$this->tpl->setCurrentBlock('final_test_row'); 
  303                                #$this->tpl->setVariable('FINAL_TST_IMG',ilUtil::getImagePath('icon_tst_s.png')); 
  304                                #$this->tpl->setVariable('FINAL_TST_ALT',$this->lng->txt('obj_tst')); 
  305                                #$this->tpl->setVariable('FINAL_TST_TITLE',ilObject::_lookupTitle($test['obj_id'])); 
  306                                #$this->tpl->parseCurrentBlock();        
  313                #$this->ctrl->setParameterByClass(get_class($this->getParentObject()),'objective_id',$a_set['id']); 
  314                $this->ctrl->setParameterByClass(
'ilcourseobjectivesgui',
'objective_id',$a_set[
'id']);
 
  315                #$this->tpl->setVariable('EDIT_LINK',$this->ctrl->getLinkTargetByClass(get_class($this->getParentObject()),'edit')); 
  316                $this->tpl->setVariable(
'EDIT_LINK',$this->ctrl->getLinkTargetByClass(
'ilcourseobjectivesgui',
'edit'));
 
  318                $this->tpl->setVariable(
'TXT_EDIT',$this->lng->txt(
'edit'));
 
  320                include_once(
"./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
 
  322                $alist->setId($a_set[
'id']);
 
  326                                $this->lng->txt(
'edit'), 
 
  328                                $this->ctrl->getLinkTargetByClass(
'ilcourseobjectivesgui', 
'edit')
 
  332                                $this->lng->txt(
'crs_objective_action_materials'),
 
  334                                $this->ctrl->getLinkTargetByClass(
'ilcourseobjectivesgui', 
'materialAssignment')
 
  340                                        $this->lng->txt(
'crs_objective_action_itest'),
 
  342                                        $this->ctrl->getLinkTargetByClass(
'ilcourseobjectivesgui', 
'selfAssessmentAssignment')
 
  346                if($this->
getSettings()->hasSeparateQualifiedTests())
 
  349                        #               $this->lng->txt('crs_objective_action_qtest_sep'), 
  351                        #               $this->ctrl->getLinkTargetByClass('ilcourseobjectivesgui', 'finalSeparatedTestAssignment') 
  357                                        $this->lng->txt(
'crs_objective_action_qtest'),
 
  359                                        $this->ctrl->getLinkTargetByClass(
'ilcourseobjectivesgui', 
'finalTestAssignment')
 
  364                $this->ctrl->setParameterByClass(
'illopagegui',
'objective_id',$a_set[
'id']);
 
  366                                $this->lng->txt(
'crs_edit_lo_introduction'),
 
  368                                $this->ctrl->getLinkTargetByClass(
'illopagegui', 
'edit')
 
  372                $this->tpl->setVariable(
'VAL_ACTIONS',$alist->getHTML());
 
  384        public function parse($a_objective_ids)
 
  387                foreach($a_objective_ids as $objective_id)
 
  391                        $objective_data[
'id'] = $objective_id;
 
  392                        $objective_data[
'position'] = 
sprintf(
"%.1f",$position++) * 10;
 
  393                        $objective_data[
'title'] = $objective->getTitle();
 
  394                        $objective_data[
'description'] = $objective->getDescription();
 
  397                        $objective_data[
'online'] = $objective->isActive();
 
  398                        $objective_data[
'passes'] = $objective->getPasses();
 
  402                        $materials = array();
 
  404                        foreach($ass_materials->getMaterials() as $material)
 
  409                                switch($material[
'type'])
 
  413                                                $materials[$material[
'ref_id']][
'items'][] = $material;
 
  421                        $objective_data[
'materials'] = $materials;
 
  428                                if($this->
getSettings()->hasSeparateInitialTests())
 
  430                                        include_once 
'./Modules/Course/classes/Objectives/class.ilLOTestAssignments.php';
 
  434                                        $objective_data[
'initial'] = 0;
 
  437                                                $test_id = $assignment->getTestRefId();
 
  439                                                include_once 
'./Services/Object/classes/class.ilObjectFactory.php';
 
  441                                                $test_candidate = $factory->getInstanceByRefId($test_id,FALSE);
 
  444                                                        $objective_data[
'initial'] = $test_id;
 
  451                                        include_once 
'./Modules/Course/classes/Objectives/class.ilLORandomTestQuestionPools.php';
 
  453                                                        $this->course_obj->getId(),
 
  461                                                $test[
'questions'][] = array(
'title' => $qst);
 
  463                                        $objective_data[
'self'] = array(
$test);
 
  468                                        foreach($question_obj->getSelfAssessmentTests() as 
$test)
 
  470                                                $questions = array();
 
  471                                                foreach($question_obj->getQuestionsOfTest(
$test[
'obj_id']) as $qst)
 
  476                                                $tmp_test[
'questions'] = $questions;
 
  478                                                $tests[] = $tmp_test;
 
  480                                        $objective_data[
'self'] = $tests;
 
  490                                include_once 
'./Modules/Course/classes/Objectives/class.ilLOTestAssignments.php';
 
  494                                $objective_data[
'final'] = 0;
 
  497                                        $test_id = $assignment->getTestRefId();
 
  499                                        include_once 
'./Services/Object/classes/class.ilObjectFactory.php';
 
  501                                        $test_candidate = $factory->getInstanceByRefId($test_id,FALSE);
 
  504                                                $objective_data[
'final'] = $test_id;
 
  513                                        include_once 
'./Modules/Course/classes/Objectives/class.ilLORandomTestQuestionPools.php';
 
  515                                                        $this->course_obj->getId(),
 
  523                                                $test[
'questions'][] = array(
'title' => $qst);
 
  525                                        $objective_data[
'final'] = array(
$test);
 
  530                                        foreach($question_obj->getFinalTests() as 
$test)
 
  532                                                $questions = array();
 
  533                                                foreach($question_obj->getQuestionsOfTest(
$test[
'obj_id']) as $qst)
 
  538                                                $tmp_test[
'questions'] = $questions;
 
  540                                                $tests[] = $tmp_test;
 
  542                                        $objective_data[
'final'] = $tests;
 
  547                        $objectives[] = (array) $objective_data;
 
  549                $this->
setData($objectives ? $objectives : array());
 
sprintf('%.4f', $callTime)
An exception for terminatinating execution or to throw for unit testing.
User interface class for advanced drop-down selection lists.
static _lookupTargetTitle($a_obj_id)
Lookup target title.
class ilCourseObjectiveMaterials
class ilcourseobjectiveQuestion
getSettings()
Get settings.
parse($a_objective_ids)
parse
__construct($a_parent_obj, $a_course_obj)
Constructor.
static _lookupTitle($a_obj_id)
Lookup title.
const TYPE_TEST_QUALIFIED
const TYPE_QUALIFYING_SELECTED
static getInstanceByObjId($a_obj_id)
get singleton instance
static getInstance($a_container_id)
Get instance by container id.
static lookupRandomTest($a_test_obj_id)
Check if test is a random test.
static lookupQplBySequence($a_test_ref_id, $a_sequence_id)
Lookup assigned qpl name (including taxonomy) by sequence.
static _getLink($a_ref_id, $a_type='', $a_params=array(), $append="")
static _lookupObjId($a_id)
static _lookupTitle($a_id)
lookup object title
static _getIcon($a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
Get icon for repository item.
static _lookupType($a_id, $a_reference=false)
lookup object type
addColumn($a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="", $a_tooltip_with_html=false)
Add a column to the header.
setData($a_data)
set table data @access public
setRowTemplate($a_template, $a_template_dir="")
Set row template.
setLimit($a_limit=0, $a_default_limit=0)
set max.
addMultiCommand($a_cmd, $a_text)
Add Command button.
setSelectAllCheckbox($a_select_all_checkbox)
Set the name of the checkbox that should be toggled with a select all button.
setFormName($a_formname="")
Set Form name.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
addCommandButton($a_cmd, $a_text, $a_onclick='', $a_id="", $a_class=null)
Add Command button.
disable($a_module_name)
diesables particular modules of table
enable($a_module_name)
enables particular modules of table
$GLOBALS['loaded']
Global hash that tracks already loaded includes.