39         $this->course_obj = $a_course_obj;
    45         $this->renderer = $DIC->ui()->renderer();
    46         $this->uiFactory = $DIC->ui()->factory();
    48         $this->
lng->loadLanguageModule(
'crs');
    51         $this->
addColumn($this->
lng->txt(
'position'), 
'position', 
'10em');
    52         $this->
addColumn($this->
lng->txt(
'title'), 
'title', 
'20%');
    53         $this->
addColumn($this->
lng->txt(
'crs_objective_assigned_materials'), 
'materials');
    55             $this->
addColumn($this->
lng->txt(
'crs_objective_self_assessment'), 
'self');
    58             $this->
addColumn($this->
lng->txt(
'crs_objective_tbl_col_final_tsts'), 
'final');
    60             $this->
addColumn($this->
lng->txt(
'crs_objective_final_test'), 
'final');
    65         $this->
setRowTemplate(
"tpl.crs_objectives_table_row.html", 
"Modules/Course");
    69         $this->
enable(
'select_all');
    83     protected function fillRow(array $a_set): void
    85         $this->tpl->setVariable(
'VAL_ID', $a_set[
'id']);
    86         $this->tpl->setVariable(
'VAL_POSITION', $a_set[
'position']);
    89         if ($a_set[
'online']) {
    90             $this->tpl->setVariable(
'VAL_ONOFFLINE', $this->
lng->txt(
'online'));
    91             $this->tpl->setVariable(
'ONOFFLINE_CLASS', 
'smallgreen');
    93             $this->tpl->setVariable(
'VAL_ONOFFLINE', $this->
lng->txt(
'offline'));
    94             $this->tpl->setVariable(
'ONOFFLINE_CLASS', 
'smallred');
    97         if ($a_set[
'passes']) {
    98             $this->tpl->setVariable(
'PASSES_TXT', $this->
lng->txt(
'crs_loc_passes_info'));
    99             $this->tpl->setVariable(
'PASSES_VAL', $a_set[
'passes']);
   103         $this->
ctrl->setParameterByClass(
'ilcourseobjectivesgui', 
'objective_id', $a_set[
'id']);
   104         $this->tpl->setVariable(
'VAL_TITLE_LINKED', $this->
ctrl->getLinkTargetByClass(
'ilcourseobjectivesgui', 
'edit'));
   107         $this->tpl->setVariable(
'VAL_TITLE', $a_set[
'title']);
   108         if (strlen($a_set[
'description'])) {
   109             $this->tpl->setVariable(
'VAL_DESC', $a_set[
'description']);
   113         foreach ($a_set[
'materials'] as 
$data) {
   114             if ($data[
'items'] ?? 
false) {
   115                 $this->tpl->touchBlock(
'ul_begin');
   116                 foreach ($data[
'items'] as $pg_st) {
   117                     $this->tpl->setCurrentBlock(
'st_pg');
   118                     $this->tpl->setVariable(
'MAT_IMG', 
ilObject::_getIcon($pg_st[
'obj_id'], 
"tiny", $pg_st[
'type']));
   119                     $this->tpl->setVariable(
'MAT_ALT', $this->
lng->txt(
'obj_' . $pg_st[
'type']));
   121                     $this->tpl->setVariable(
'MAT_TITLE', 
$title);
   122                     $this->tpl->parseCurrentBlock();
   124                 $this->tpl->touchBlock(
'ul_end');
   126                 $this->tpl->touchBlock(
'new_line');
   128             $this->tpl->setCurrentBlock(
'mat_row');
   129             $this->tpl->setVariable(
'LM_IMG', 
ilObject::_getIcon($data[
'obj_id'], 
"tiny", $data[
'type']));
   130             $this->tpl->setVariable(
'LM_ALT', $this->
lng->txt(
'obj_' . $data[
'type']));
   132             if ($data[
'online']) {
   133                 $this->tpl->setCurrentBlock(
'mat_online');
   134                 $this->tpl->setVariable(
'MAT_VAL_ONOFFLINE', $this->
lng->txt(
'online'));
   136                 $this->tpl->setCurrentBlock(
'mat_offline');
   137                 $this->tpl->setVariable(
'MAT_VAL_ONOFFLINE', $this->
lng->txt(
'offline'));
   139             $this->tpl->parseCurrentBlock();
   140             $this->tpl->setCurrentBlock(
'mat_row');
   142             if ($data[
'type'] == 
'catr' || $data[
'type'] == 
'crsr' || $data[
'type'] == 
'grpr') {
   143                 $this->tpl->setVariable(
   151             $this->tpl->parseCurrentBlock();
   156         if ($this->
getSettings()->worksWithInitialTest()) {
   157             if ($this->
getSettings()->hasSeparateInitialTests()) {
   158                 if ($a_set[
'initial'] ?? 
false) {
   160                     $this->tpl->setCurrentBlock(
'initial_test_per_objective');
   162                     $this->tpl->setVariable(
'IT_ALT', $this->
lng->txt(
'obj_tst'));
   164                     $this->tpl->setVariable(
'IT_TITLE_LINK', ilLink::_getLink($a_set[
'initial']));
   166                     $this->
ctrl->setParameterByClass(
'ilobjtestgui', 
'ref_id', $a_set[
'initial']);
   167                     $this->
ctrl->setParameterByClass(
'ilobjtestgui', 
'cmd', 
'questionsTabGateway');
   168                     $this->tpl->setVariable(
   170                         $this->
ctrl->getLinkTargetByClass(
'ilobjtestgui')
   173                     $this->tpl->parseCurrentBlock();
   175                     $this->tpl->touchBlock(
'with_self_test');
   178                 foreach (($a_set[
'self'] ?? []) as $test) {
   180                     foreach ((array) ($test[
'questions'] ?? []) as $question) {
   181                         $this->tpl->setCurrentBlock(
'self_qst_row');
   182                         $this->tpl->setVariable(
'SELF_QST_TITLE', $question[
'title']);
   183                         $this->tpl->parseCurrentBlock();
   185                     if (count($test[
'questions'] ?? []) === 0) {
   186                         $this->tpl->touchBlock(
'self_qst_row');
   191                 if (count($a_set[
'self'] ?? []) === 0) {
   192                     $this->tpl->touchBlock(
'self_qst_row');
   202             if ($a_set[
'final'] ?? 
false) {
   204                 $this->tpl->setCurrentBlock(
'final_test_per_objective');
   206                 $this->tpl->setVariable(
'FT_ALT', $this->
lng->txt(
'obj_tst'));
   209                 $this->
ctrl->setParameterByClass(
'ilobjtestgui', 
'ref_id', $a_set[
'final']);
   210                 $this->
ctrl->setParameterByClass(
'ilobjtestgui', 
'cmd', 
'questionsTabGateway');
   211                 $this->tpl->setVariable(
   213                     $this->
ctrl->getLinkTargetByClass(
'ilobjtestgui')
   216                 $this->tpl->parseCurrentBlock();
   218                 $this->tpl->touchBlock(
'with_final_test');
   221             foreach ((array) ($a_set[
'final'] ?? []) as $test) {
   222                 foreach ((array) ($test[
'questions'] ?? []) as $question) {
   223                     $this->tpl->setCurrentBlock(
'final_qst_row');
   224                     $this->tpl->setVariable(
'FINAL_QST_TITLE', $question[
'title'] ?? 
'');
   225                     $this->tpl->parseCurrentBlock();
   227                 if (count($test[
'questions'] ?? []) === 0) {
   228                     $this->tpl->touchBlock(
'final_qst_row');
   231             if (count($a_set[
'final'] ?? []) === 0) {
   232                 $this->tpl->touchBlock(
'final_qst_row');
   235         $this->
ctrl->setParameterByClass(
'ilcourseobjectivesgui', 
'objective_id', $a_set[
'id']);
   236         $this->tpl->setVariable(
'EDIT_LINK', $this->
ctrl->getLinkTargetByClass(
'ilcourseobjectivesgui', 
'edit'));
   237         $this->tpl->setVariable(
'TXT_EDIT', $this->
lng->txt(
'edit'));
   239         $dropDownItems = array();
   241         $dropDownItems[] = $this->uiFactory->button()->shy(
   242             $this->
lng->txt(
'edit'),
   243             $this->
ctrl->getLinkTargetByClass(
'ilcourseobjectivesgui', 
'edit')
   247         $dropDownItems[] = $this->uiFactory->button()->shy(
   248             $this->
lng->txt(
'crs_objective_action_materials'),
   249             $this->
ctrl->getLinkTargetByClass(
'ilcourseobjectivesgui', 
'materialAssignment')
   254             $dropDownItems[] = $this->uiFactory->button()->shy(
   255                 $this->
lng->txt(
'crs_objective_action_itest'),
   256                 $this->
ctrl->getLinkTargetByClass(
'ilcourseobjectivesgui', 
'selfAssessmentAssignment')
   260         if ($this->
getSettings()->hasSeparateQualifiedTests()) {
   263             $dropDownItems[] = $this->uiFactory->button()->shy(
   264                 $this->
lng->txt(
'crs_objective_action_qtest'),
   265                 $this->
ctrl->getLinkTargetByClass(
'ilcourseobjectivesgui', 
'finalTestAssignment')
   269         $this->
ctrl->setParameterByClass(
'illopagegui', 
'objective_id', $a_set[
'id']);
   271         $dropDownItems[] = $this->uiFactory->button()->shy(
   272             $this->
lng->txt(
'crs_edit_lo_introduction'),
   273             $this->
ctrl->getLinkTargetByClass(
'illopagegui', 
'edit')
   275         $dropDown = $this->uiFactory->dropdown()->standard($dropDownItems)
   276                 ->withAriaLabel(
'Actions');
   277         $this->tpl->setVariable(
'VAL_ACTIONS', $this->renderer->render($dropDown));
   282     public function parse(array $a_objective_ids): void
   286         foreach ($a_objective_ids as $objective_id) {
   289             $objective_data = [];
   290             $objective_data[
'id'] = $objective_id;
   291             $objective_data[
'position'] = sprintf(
"%.1f", $position++) * 10;
   292             $objective_data[
'title'] = $objective->getTitle();
   293             $objective_data[
'description'] = $objective->getDescription();
   295             $objective_data[
'online'] = $objective->isActive();
   296             $objective_data[
'passes'] = $objective->getPasses();
   299             $materials = array();
   301             foreach ($ass_materials->getMaterials() as $material) {
   305                 switch ($material[
'type']) {
   308                         $materials[$material[
'ref_id']][
'items'][] = $material;
   314             $objective_data[
'materials'] = $materials;
   319             if ($this->
getSettings()->worksWithInitialTest()) {
   320                 if ($this->
getSettings()->hasSeparateInitialTests()) {
   322                     $assignment = $assignments->getAssignmentByObjective(
   327                     $objective_data[
'initial'] = 0;
   329                         $test_id = $assignment->getTestRefId();
   332                         $test_candidate = $factory->getInstanceByRefId($test_id, 
false);
   333                         if ($test_candidate instanceof 
ilObjTest) {
   334                             $objective_data[
'initial'] = $test_id;
   339                     $objective_data[
'self'] = [];
   341                         $this->course_obj->getId(),
   348                         $qst = ilLOUtils::lookupQplBySequence($this->
getSettings()->getInitialTest(), $sequence_id);
   350                             $test[
'questions'][] = array(
'title' => $qst);
   352                         $objective_data[
'self'] = array($test);
   356                     foreach ($question_obj->getSelfAssessmentTests() as $test) {
   357                         $questions = array();
   358                         foreach ($question_obj->getQuestionsOfTest($test[
'obj_id']) as $qst) {
   362                         $tmp_test[
'questions'] = $questions;
   364                         $tests[] = $tmp_test;
   366                     $objective_data[
'self'] = $tests;
   374                 $objective_data[
'final'] = 0;
   376                     $test_id = $assignment->getTestRefId();
   379                     $test_candidate = $factory->getInstanceByRefId($test_id, 
false);
   380                     if ($test_candidate instanceof 
ilObjTest) {
   381                         $objective_data[
'final'] = $test_id;
   384             } elseif ($this->
getSettings()->getQualifiedTest()) {
   388                         $this->course_obj->getId(),
   395                         $qst = ilLOUtils::lookupQplBySequence($this->
getSettings()->getQualifiedTest(), $sequence_id);
   397                             $test[
'questions'][] = array(
'title' => $qst);
   399                         $objective_data[
'final'] = array($test);
   403                     foreach ($question_obj->getFinalTests() as $test) {
   404                         $questions = array();
   405                         foreach ($question_obj->getQuestionsOfTest($test[
'obj_id']) as $qst) {
   409                         $tmp_test[
'questions'] = $questions;
   411                         $tests[] = $tmp_test;
   413                     $objective_data[
'final'] = $tests;
 static _lookupTargetTitle(int $a_obj_id)
 
enable(string $a_module_name)
 
static _getIcon(int $obj_id=0, string $size="big", string $type="", bool $offline=false)
Get icon for repository item. 
 
setFormAction(string $a_form_action, bool $a_multipart=false)
 
addCommandButton(string $a_cmd, string $a_text, string $a_onclick='', string $a_id="", string $a_class="")
 
setSelectAllCheckbox(string $a_select_all_checkbox, bool $a_select_all_on_top=false)
 
setFormName(string $a_name="")
 
static _lookupObjId(int $ref_id)
 
static lookupOfflineStatus(int $obj_id)
Lookup offline status using objectDataCache. 
 
static _lookupTitle(int $a_obj_id)
 
class ilCourseObjectiveMaterials 
 
static _lookupTitle(int $obj_id)
 
parse(array $a_objective_ids)
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
__construct(object $a_parent_obj, ilObject $a_course_obj)
 
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template. 
 
UIImplementationFactory $uiFactory
 
static getInstanceByObjId(int $a_obj_id)
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
static lookupRandomTest(int $a_test_obj_id)
 
static lookupSequencesByType(int $a_container_id, int $a_objective_id, int $a_test_id, int $a_test_type)
 
setLimit(int $a_limit=0, int $a_default_limit=0)
 
static getInstance(int $a_container_id)
 
addColumn(string $a_text, string $a_sort_field="", string $a_width="", bool $a_is_checkbox_action_column=false, string $a_class="", string $a_tooltip="", bool $a_tooltip_with_html=false)
 
disable(string $a_module_name)
 
const TYPE_TEST_QUALIFIED
 
const TYPE_QUALIFYING_SELECTED
 
static _lookupType(int $id, bool $reference=false)
 
addMultiCommand(string $a_cmd, string $a_text)
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...