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');
28 include_once
'./Modules/Course/classes/Objectives/class.ilLOUtils.php';
31 include_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');
82 $this->
addColumn($this->lng->txt(
'crs_objective_final_test'),
'final');
83 $this->
addColumn($this->lng->txt(
''),
'5em');
85 $this->
setFormAction($this->ctrl->getFormAction($a_parent_obj));
86 $this->
setRowTemplate(
"tpl.crs_objectives_table_row.html",
"Modules/Course");
90 $this->
enable(
'select_all');
97 $this->
addMultiCommand(
'activateObjectives', $this->lng->txt(
'set_online'));
98 $this->
addMultiCommand(
'deactivateObjectives', $this->lng->txt(
'set_offline'));
99 $this->
addMultiCommand(
'askDeleteObjectives',$this->lng->txt(
'delete'));
126 $this->tpl->setVariable(
'VAL_ID',$a_set[
'id']);
127 $this->tpl->setVariable(
'VAL_POSITION',$a_set[
'position']);
132 $this->tpl->setVariable(
'VAL_ONOFFLINE',$this->lng->txt(
'online'));
133 $this->tpl->setVariable(
'ONOFFLINE_CLASS',
'smallgreen');
137 $this->tpl->setVariable(
'VAL_ONOFFLINE',$this->lng->txt(
'offline'));
138 $this->tpl->setVariable(
'ONOFFLINE_CLASS',
'smallred');
143 $this->tpl->setVariable(
'PASSES_TXT',$this->lng->txt(
'crs_loc_passes_info'));
144 $this->tpl->setVariable(
'PASSES_VAL',$a_set[
'passes']);
149 $this->ctrl->setParameterByClass(
'ilcourseobjectivesgui',
'objective_id',$a_set[
'id']);
150 $this->tpl->setVariable(
'VAL_TITLE_LINKED',$this->ctrl->getLinkTargetByClass(
'ilcourseobjectivesgui',
'edit'));
153 $this->tpl->setVariable(
'VAL_TITLE',$a_set[
'title']);
154 if(strlen($a_set[
'description']))
156 $this->tpl->setVariable(
'VAL_DESC',$a_set[
'description']);
164 $this->tpl->touchBlock(
'ul_begin');
165 foreach(
$data[
'items'] as $pg_st)
167 $this->tpl->setCurrentBlock(
'st_pg');
168 $this->tpl->setVariable(
'MAT_IMG',
ilObject::_getIcon($pg_st[
'obj_id'],
"tiny", $pg_st[
'type']));
169 $this->tpl->setVariable(
'MAT_ALT',$this->lng->txt(
'obj_'.$pg_st[
'type']));
170 include_once(
'Modules/LearningModule/classes/class.ilLMObject.php');
172 $this->tpl->setVariable(
'MAT_TITLE',
$title);
173 $this->tpl->parseCurrentBlock();
175 $this->tpl->touchBlock(
'ul_end');
179 $this->tpl->touchBlock(
'new_line');
181 $this->tpl->setCurrentBlock(
'mat_row');
183 $this->tpl->setVariable(
'LM_ALT',$this->lng->txt(
'obj_'.$data[
'type']));
185 if(
$data[
'type'] ==
'catr' or
$data[
'type'] ==
'crsr')
187 include_once
'./Services/ContainerReference/classes/class.ilContainerReference.php';
188 $this->tpl->setVariable(
197 $this->tpl->parseCurrentBlock();
204 foreach($a_set[
'self'] as
$test)
207 foreach((array) $test[
'questions'] as $question)
209 $this->tpl->setCurrentBlock(
'self_qst_row');
210 $this->tpl->setVariable(
'SELF_QST_TITLE',$question[
'title']);
211 $this->tpl->parseCurrentBlock();
213 #$this->tpl->setCurrentBlock('self_test_row'); 214 #$this->tpl->setVariable('SELF_TST_ALT',$this->lng->txt('obj_tst')); 215 #$this->tpl->setVariable('SELF_TST_TITLE',ilObject::_lookupTitle($test['obj_id'])); 216 #$this->tpl->parseCurrentBlock(); 220 if(!count($a_set[
'self']))
222 $this->tpl->touchBlock(
'self_qst_row');
229 foreach((array) $a_set[
'final'] as
$test)
231 foreach((array) $test[
'questions'] as $question)
233 $this->tpl->setCurrentBlock(
'final_qst_row');
234 $this->tpl->setVariable(
'FINAL_QST_TITLE',$question[
'title']);
235 $this->tpl->parseCurrentBlock();
238 #$this->tpl->setCurrentBlock('final_test_row'); 239 #$this->tpl->setVariable('FINAL_TST_ALT',$this->lng->txt('obj_tst')); 240 #$this->tpl->setVariable('FINAL_TST_TITLE',ilObject::_lookupTitle($test['obj_id'])); 241 #$this->tpl->parseCurrentBlock(); 247 #$this->ctrl->setParameterByClass(get_class($this->getParentObject()),'objective_id',$a_set['id']); 248 $this->ctrl->setParameterByClass(
'ilcourseobjectivesgui',
'objective_id',$a_set[
'id']);
249 #$this->tpl->setVariable('EDIT_LINK',$this->ctrl->getLinkTargetByClass(get_class($this->getParentObject()),'edit')); 250 $this->tpl->setVariable(
'EDIT_LINK',$this->ctrl->getLinkTargetByClass(
'ilcourseobjectivesgui',
'edit'));
252 $this->tpl->setVariable(
'TXT_EDIT',$this->lng->txt(
'edit'));
254 include_once(
"./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
256 $alist->setId($a_set[
'id']);
257 $alist->setListTitle($this->lng->txt(
"actions"));
260 $this->lng->txt(
'edit'),
262 $this->ctrl->getLinkTargetByClass(
'ilcourseobjectivesgui',
'edit')
266 $this->lng->txt(
'crs_objective_action_materials'),
268 $this->ctrl->getLinkTargetByClass(
'ilcourseobjectivesgui',
'materialAssignment')
274 $this->lng->txt(
'crs_objective_action_itest'),
276 $this->ctrl->getLinkTargetByClass(
'ilcourseobjectivesgui',
'selfAssessmentAssignment')
281 $this->lng->txt(
'crs_objective_action_qtest'),
283 $this->ctrl->getLinkTargetByClass(
'ilcourseobjectivesgui',
'finalTestAssignment')
286 if($this->
getSettings()->isQualifiedTestPerObjectiveVisible())
288 $this->ctrl->setParameterByClass(
'ilconditionhandlerinterface',
'objective_id',$a_set[
'id']);
290 $this->lng->txt(
'preconditions'),
292 $this->ctrl->getLinkTargetByClass(
'ilconditionhandlerinterface',
'listConditions')
296 $this->ctrl->setParameterByClass(
'illopagegui',
'objective_id',$a_set[
'id']);
298 $this->lng->txt(
'edit_page'),
300 $this->ctrl->getLinkTargetByClass(
'illopagegui',
'edit')
304 $this->tpl->setVariable(
'VAL_ACTIONS',$alist->getHTML());
316 public function parse($a_objective_ids)
319 foreach($a_objective_ids as $objective_id)
323 $objective_data[
'id'] = $objective_id;
324 $objective_data[
'position'] = sprintf(
"%.1f",$position++) * 10;
325 $objective_data[
'title'] = $objective->getTitle();
326 $objective_data[
'description'] = $objective->getDescription();
329 $objective_data[
'online'] = $objective->isActive();
330 $objective_data[
'passes'] = $objective->getPasses();
334 $materials = array();
336 foreach($ass_materials->getMaterials() as $material)
341 switch($material[
'type'])
345 $materials[$material[
'ref_id']][
'items'][] = $material;
353 $objective_data[
'materials'] = $materials;
363 include_once
'./Modules/Course/classes/Objectives/class.ilLORandomTestQuestionPools.php';
365 $this->course_obj->getId(),
373 $test[
'questions'][] = array(
'title' => $qst);
375 $objective_data[
'self'] = array($test);
380 foreach($question_obj->getSelfAssessmentTests() as
$test)
382 $questions = array();
383 foreach($question_obj->getQuestionsOfTest(
$test[
'obj_id']) as $qst)
388 $tmp_test[
'questions'] = $questions;
392 $objective_data[
'self'] =
$tests;
404 include_once
'./Modules/Course/classes/Objectives/class.ilLORandomTestQuestionPools.php';
406 $this->course_obj->getId(),
414 $test[
'questions'][] = array(
'title' => $qst);
416 $objective_data[
'final'] = array($test);
421 foreach($question_obj->getFinalTests() as
$test)
423 $questions = array();
424 foreach($question_obj->getQuestionsOfTest(
$test[
'obj_id']) as $qst)
429 $tmp_test[
'questions'] = $questions;
433 $objective_data[
'final'] =
$tests;
438 $objectives[] = (array) $objective_data;
440 $this->
setData($objectives ? $objectives : array());
addCommandButton($a_cmd, $a_text, $a_onclick='', $a_id="", $a_class=null)
Add Command button.
static getInstanceByObjId($a_obj_id)
get singleton instance
static _getIcon($a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
Get icon for repository item.
setFormName($a_formname)
Set Form name.
static _lookupTitle($a_id)
lookup object title
static _lookupTitle($a_obj_id)
Lookup title.
class ilCourseObjectiveMaterials
setLimit($a_limit=0, $a_default_limit=0)
set max.
__construct($a_parent_obj, $a_course_obj)
Constructor.
static lookupRandomTest($a_test_obj_id)
Check if test is a random test.
parse($a_objective_ids)
parse
addColumn($a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="")
Add a column to the header.
static _lookupObjId($a_id)
addMultiCommand($a_cmd, $a_text)
Add Command button.
enable($a_module_name)
enables particular modules of table
static _lookupTargetTitle($a_obj_id)
Lookup target title.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
static _lookupType($a_id, $a_reference=false)
lookup object type
User interface class for advanced drop-down selection lists.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
getSettings()
Get settings.
disable($a_module_name)
diesables particular modules of table
const TYPE_TEST_QUALIFIED
setSelectAllCheckbox($a_select_all_checkbox)
Set the name of the checkbox that should be toggled with a select all button.
class ilcourseobjectiveQuestion
static lookupQplBySequence($a_test_ref_id, $a_sequence_id)
Lookup assigned qpl name (including taxonomy) by sequence.