ILIAS  release_8 Revision v8.24
ilCourseObjectivesTableGUI Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilCourseObjectivesTableGUI:
+ Collaboration diagram for ilCourseObjectivesTableGUI:

Public Member Functions

 __construct (object $a_parent_obj, ilObject $a_course_obj)
 
 getSettings ()
 
 parse (array $a_objective_ids)
 
- Public Member Functions inherited from ilTable2GUI
 __construct (?object $a_parent_obj, string $a_parent_cmd="", string $a_template_context="")
 
 setOpenFormTag (bool $a_val)
 
 getOpenFormTag ()
 
 setCloseFormTag (bool $a_val)
 
 getCloseFormTag ()
 
 determineLimit ()
 
 getSelectableColumns ()
 Get selectable columns. More...
 
 determineSelectedColumns ()
 
 isColumnSelected (string $col)
 
 getSelectedColumns ()
 
 resetOffset (bool $a_in_determination=false)
 
 initFilter ()
 
 getParentObject ()
 
 getParentCmd ()
 
 setTopAnchor (string $a_val)
 
 getTopAnchor ()
 
 setNoEntriesText (string $a_text)
 
 getNoEntriesText ()
 
 setIsDataTable (bool $a_val)
 
 getIsDataTable ()
 
 setEnableTitle (bool $a_enabletitle)
 
 getEnableTitle ()
 
 setEnableHeader (bool $a_enableheader)
 
 getEnableHeader ()
 
 setEnableNumInfo (bool $a_val)
 
 getEnableNumInfo ()
 
 setTitle (string $a_title, string $a_icon="", string $a_icon_alt="")
 
 setDescription (string $a_val)
 
 getDescription ()
 
 setOrderField (string $a_order_field)
 
 getOrderField ()
 
 setData (array $a_data)
 Set table data. More...
 
 getData ()
 
 dataExists ()
 
 setPrefix (string $a_prefix)
 set prefix for sort and offset fields (if you have two or more tables on a page that you want to sort separately) More...
 
 getPrefix ()
 
 addFilterItem (ilTableFilterItem $a_input_item, bool $a_optional=false)
 
 addFilterItemByMetaType (string $id, int $type=self::FILTER_TEXT, bool $a_optional=false, string $caption="")
 Add filter by standard type. More...
 
 getFilterItems (bool $a_optionals=false)
 
 getFilterItemByPostVar (string $a_post_var)
 
 setFilterCols (int $a_val)
 
 getFilterCols ()
 
 setDisableFilterHiding (bool $a_val=true)
 
 getDisableFilterHiding ()
 
 isFilterSelected (string $a_col)
 Is given filter selected? More...
 
 getSelectedFilters ()
 
 determineSelectedFilters ()
 
 setCustomPreviousNext (string $a_prev_link, string $a_next_link)
 
 setFormAction (string $a_form_action, bool $a_multipart=false)
 
 getFormAction ()
 
 setFormName (string $a_name="")
 
 getFormName ()
 get the name of the parent form More...
 
 setId (string $a_val)
 
 getId ()
 
 setDisplayAsBlock (bool $a_val)
 
 getDisplayAsBlock ()
 
 setSelectAllCheckbox (string $a_select_all_checkbox, bool $a_select_all_on_top=false)
 
 setExternalSorting (bool $a_val)
 
 getExternalSorting ()
 
 setFilterCommand (string $a_val, string $a_caption="")
 
 getFilterCommand ()
 
 setResetCommand (string $a_val, string $a_caption="")
 
 getResetCommand ()
 
 setExternalSegmentation (bool $a_val)
 
 getExternalSegmentation ()
 
 setRowTemplate (string $a_template, string $a_template_dir="")
 Set row template. More...
 
 setDefaultOrderField (string $a_defaultorderfield)
 
 getDefaultOrderField ()
 
 setDefaultOrderDirection (string $a_defaultorderdirection)
 
 getDefaultOrderDirection ()
 
 setDefaultFilterVisiblity (bool $a_status)
 
 getDefaultFilterVisibility ()
 
 clearCommandButtons ()
 
 addCommandButton (string $a_cmd, string $a_text, string $a_onclick='', string $a_id="", string $a_class="")
 
 addCommandButtonInstance (ilButtonBase $a_button)
 
 addMultiItemSelectionButton (string $a_sel_var, array $a_options, string $a_cmd, string $a_text, string $a_default_selection='')
 
 setCloseCommand (string $a_link)
 
 addMultiCommand (string $a_cmd, string $a_text)
 
 addHiddenInput (string $a_name, string $a_value)
 
 addHeaderCommand (string $a_href, string $a_text, string $a_target="", string $a_img="")
 
 setTopCommands (bool $a_val)
 
 getTopCommands ()
 
 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)
 
 getNavParameter ()
 
 setOrderLink (string $key, string $order_dir)
 
 fillHeader ()
 
 determineOffsetAndOrder (bool $a_omit_offset=false)
 
 storeNavParameter ()
 
 getHTML ()
 Get HTML. More...
 
 numericOrdering (string $a_field)
 Should this field be sorted numeric? More...
 
 render ()
 
 writeFilterToSession ()
 
 resetFilter ()
 
 fillFooter ()
 
 getLinkbar (string $a_num)
 
 fillHiddenRow ()
 
 fillActionRow ()
 
 setHeaderHTML (string $html)
 
 storeProperty (string $type, string $value)
 
 loadProperty (string $type)
 
 getCurrentState ()
 get current settings for order, limit, columns and filter More...
 
 setContext (string $id)
 
 getContext ()
 
 setShowRowsSelector (bool $a_value)
 Toggle rows-per-page selector. More...
 
 getShowRowsSelector ()
 
 setShowTemplates (bool $a_value)
 
 getShowTemplates ()
 
 restoreTemplate (string $a_name)
 Restore state from template. More...
 
 saveTemplate (string $a_name)
 Save current state as template. More...
 
 deleteTemplate (string $a_name)
 
 getLimit ()
 
 getOffset ()
 
 setExportFormats (array $formats)
 Set available export formats. More...
 
 setPrintMode (bool $a_value=false)
 
 getPrintMode ()
 
 getExportMode ()
 
 exportData (int $format, bool $send=false)
 Export and optionally send current table data. More...
 
 setEnableAllCommand (bool $a_value)
 
 setRowSelectorLabel (string $row_selector_label)
 
 getRowSelectorLabel ()
 
 setPreventDoubleSubmission (bool $a_val)
 
 getPreventDoubleSubmission ()
 
 setLimit (int $a_limit=0, int $a_default_limit=0)
 set max. More...
 
- Public Member Functions inherited from ilTableGUI
 __construct (array $a_data=[], bool $a_global_tpl=true)
 
 setTemplate (ilTemplate $a_tpl)
 
 getTemplateObject ()
 
 setData (array $a_data)
 Set table data. More...
 
 getData ()
 
 setTitle (string $a_title, string $a_icon="", string $a_icon_alt="")
 
 setHelp (string $a_help_page, string $a_help_icon, string $a_help_icon_alt="")
 
 setHeaderNames (array $a_header_names)
 
 getColumnCount ()
 
 setHeaderVars (array $a_header_vars, array $a_header_params=[])
 
 setColumnWidth (array $a_column_width)
 set table column widths More...
 
 setOneColumnWidth (string $a_column_width, int $a_column_number)
 
 setMaxCount (int $a_max_count)
 set max. More...
 
 setLimit (int $a_limit=0, int $a_default_limit=0)
 set max. More...
 
 getLimit ()
 
 setPrefix (string $a_prefix)
 set prefix for sort and offset fields (if you have two or more tables on a page that you want to sort separately) More...
 
 setOffset (int $a_offset)
 set dataset offset More...
 
 getOffset ()
 
 setOrderColumn (string $a_order_column="", string $a_default_column="")
 
 getOrderColumn ()
 
 setOrderDirection (string $a_order_direction)
 
 getOrderDirection ()
 
 setFooter (string $a_style, string $a_previous="", string $a_next="")
 
 enable (string $a_module_name)
 
 disable (string $a_module_name)
 
 sortData ()
 
 render ()
 
 renderHeader ()
 
 setOrderLink (string $key, string $order_dir)
 
 setStyle (string $a_element, string $a_style)
 
 getStyle (string $a_element)
 
 setBase (string $a_base)
 
 getBase ()
 
 getFormName ()
 get the name of the parent form More...
 
 setFormName (string $a_name="cmd")
 
 getSelectAllCheckbox ()
 get the name of the checkbox that should be toggled with a select all button More...
 
 setSelectAllCheckbox (string $a_select_all_checkbox)
 
 clearActionButtons ()
 
 addActionButton (string $btn_name, string $btn_value)
 

Protected Member Functions

 fillRow (array $a_set)
 Standard Version of Fill Row. More...
 
- Protected Member Functions inherited from ilTable2GUI
 getRequestedValues ()
 
 prepareOutput ()
 Anything that must be done before HTML is generated. More...
 
 isFilterVisible ()
 Check if filter is visible: manually shown (session, db) or default value set. More...
 
 isAdvMDFilter (ilAdvancedMDRecordGUI $a_gui, ilTableFilterItem $a_element)
 Check if filter element is based on adv md. More...
 
 fillRow (array $a_set)
 Standard Version of Fill Row. More...
 
 getFilterValue (ilTableFilterItem $a_item)
 Get current filter value. More...
 
 setFilterValue (ilTableFilterItem $a_item, $a_value)
 
 fillMetaExcel (ilExcel $a_excel, int &$a_row)
 Add meta information to excel export. More...
 
 fillHeaderExcel (ilExcel $a_excel, int &$a_row)
 Excel Version of Fill Header. More...
 
 fillRowExcel (ilExcel $a_excel, int &$a_row, array $a_set)
 Excel Version of Fill Row. More...
 
 fillMetaCSV (ilCSVWriter $a_csv)
 Add meta information to csv export. More...
 
 fillHeaderCSV (ilCSVWriter $a_csv)
 CSV Version of Fill Header. More...
 
 fillRowCSV (ilCSVWriter $a_csv, array $a_set)
 CSV Version of Fill Row. More...
 

Protected Attributes

ilObject $course_obj
 
ilLOSettings $settings
 
- Protected Attributes inherited from ilTable2GUI
string $requested_tmpl_delete
 
string $requested_tmpl_create
 
string $requested_nav_par2 = ""
 
string $requested_nav_par = ""
 
string $requested_nav_par1 = ""
 
ILIAS Table TableGUIRequest $table_request = null
 
array $selected_columns = []
 
ilCtrl $ctrl
 
object $parent_obj = null
 
string $parent_cmd = ""
 
string $close_command = ""
 
string $top_anchor = "il_table_top"
 
array $filters = array()
 
array $optional_filters = array()
 
string $filter_cmd = 'applyFilter'
 
string $reset_cmd = 'resetFilter'
 
int $filter_cols = 5
 
bool $ext_sort = false
 
bool $ext_seg = false
 
string $context = ""
 
array $mi_sel_buttons = []
 
bool $disable_filter_hiding = false
 
bool $top_commands = true
 
array $selectable_columns = array()
 
array $selected_column = array()
 
bool $show_templates = false
 
bool $show_rows_selector = true
 
bool $rows_selector_off = false
 
bool $nav_determined = false
 
bool $limit_determined = false
 
bool $filters_determined = false
 
bool $columns_determined = false
 
bool $open_form_tag = true
 
bool $close_form_tag = true
 
array $export_formats = []
 
int $export_mode = 0
 
bool $print_mode = false
 
bool $enable_command_for_all = false
 
bool $restore_filter = false
 
array $restore_filter_values = []
 
bool $default_filter_visibility = false
 
array $sortable_fields = array()
 
bool $prevent_double_submission = true
 
string $row_selector_label = ""
 
bool $select_all_on_top = false
 
array $sel_buttons = []
 
string $nav_value = ''
 
string $noentriestext = ''
 
string $css_row = ''
 
bool $display_as_block = false
 
string $description = ''
 
string $id = ""
 
bool $custom_prev_next = false
 
string $reset_cmd_txt = ""
 
string $defaultorderfield = ""
 
string $defaultorderdirection = ""
 
array $column = []
 
bool $datatable = false
 
bool $num_info = false
 
bool $form_multipart = false
 
array $row_data = []
 
string $order_field = ""
 
array $selected_filter = []
 
string $form_action = ""
 
string $formname = ""
 
string $sort_order = ""
 
array $buttons = []
 
array $multi = []
 
array $hidden_inputs = []
 
array $header_commands = []
 
string $row_template = ""
 
string $row_template_dir = ""
 
string $filter_cmd_txt = ""
 
string $custom_prev = ""
 
string $custom_next = ""
 
array $raw_post_data = null
 
ilGlobalTemplateInterface $main_tpl
 
- Protected Attributes inherited from ilTableGUI
string $sort_order
 
string $link_params
 
array $header_params
 
 $tpl
 
ilLanguage $lng
 

Additional Inherited Members

- Static Public Member Functions inherited from ilTable2GUI
static getAllCommandLimit ()
 
- Static Public Member Functions inherited from ilTableGUI
static linkbar (string $AScript, int $AHits, int $ALimit, int $AOffset, array $AParams=array(), array $ALayout=array(), string $prefix='')
 
- Data Fields inherited from ilTable2GUI
const FILTER_TEXT = 1
 
const FILTER_SELECT = 2
 
const FILTER_DATE = 3
 
const FILTER_LANGUAGE = 4
 
const FILTER_NUMBER_RANGE = 5
 
const FILTER_DATE_RANGE = 6
 
const FILTER_DURATION_RANGE = 7
 
const FILTER_DATETIME_RANGE = 8
 
const FILTER_CHECKBOX = 9
 
const EXPORT_EXCEL = 1
 
const EXPORT_CSV = 2
 
const ACTION_ALL_LIMIT = 1000
 
- Data Fields inherited from ilTableGUI
string $title = ""
 
string $icon = ""
 
string $icon_alt = ""
 
string $help_page = ""
 
string $help_icon = ""
 
string $help_icon_alt = ""
 
array $header_names = []
 
array $header_vars = []
 
array $linkbar_vars = []
 
array $data = []
 
int $column_count = 0
 
array $column_width = []
 
int $max_count = 0
 
int $limit = 0
 
bool $max_limit = false
 
int $offset = 0
 
string $order_column = ""
 
string $order_direction = ""
 
string $footer_style = ""
 
string $footer_previous = ""
 
string $footer_next = ""
 
bool $lang_support = true
 
bool $global_tpl = false
 
string $form_name = ""
 
string $select_all_checkbox = ""
 
array $action_buttons = []
 
string $prefix = ""
 
string $base = ""
 
array $enabled
 
array $styles
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning

Author
Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 25 of file class.ilCourseObjectivesTableGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilCourseObjectivesTableGUI::__construct ( object  $a_parent_obj,
ilObject  $a_course_obj 
)

Definition at line 30 of file class.ilCourseObjectivesTableGUI.php.

31 {
32 global $DIC;
33
34 $this->course_obj = $a_course_obj;
35
36 $this->settings = ilLOSettings::getInstanceByObjId($this->course_obj->getId());
37
38 parent::__construct($a_parent_obj, 'listObjectives');
39 $this->lng->loadLanguageModule('crs');
40 $this->setFormName('objectives');
41 $this->addColumn('', 'f', "1px");
42 $this->addColumn($this->lng->txt('position'), 'position', '10em');
43 $this->addColumn($this->lng->txt('title'), 'title', '20%');
44 $this->addColumn($this->lng->txt('crs_objective_assigned_materials'), 'materials');
45 if ($this->getSettings()->worksWithInitialTest()) {
46 $this->addColumn($this->lng->txt('crs_objective_self_assessment'), 'self');
47 }
48 if ($this->getSettings()->getQualifyingTestType() == ilLOSettings::TYPE_QUALIFYING_SELECTED) {
49 $this->addColumn($this->lng->txt('crs_objective_tbl_col_final_tsts'), 'final');
50 } else {
51 $this->addColumn($this->lng->txt('crs_objective_final_test'), 'final');
52 }
53 $this->addColumn($this->lng->txt('actions'), '5em');
54
55 $this->setFormAction($this->ctrl->getFormAction($a_parent_obj));
56 $this->setRowTemplate("tpl.crs_objectives_table_row.html", "Modules/Course");
57 $this->disable('sort');
58 $this->enable('header');
59 $this->disable('numinfo');
60 $this->enable('select_all');
61 $this->setSelectAllCheckbox('objective');
62 $this->setLimit(200);
63 $this->addMultiCommand('activateObjectives', $this->lng->txt('set_online'));
64 $this->addMultiCommand('deactivateObjectives', $this->lng->txt('set_offline'));
65 $this->addMultiCommand('askDeleteObjectives', $this->lng->txt('delete'));
66 $this->addCommandButton('saveSorting', $this->lng->txt('sorting_save'));
67 }
static getInstanceByObjId(int $a_obj_id)
const TYPE_QUALIFYING_SELECTED
setLimit(int $a_limit=0, int $a_default_limit=0)
set max.
addCommandButton(string $a_cmd, string $a_text, string $a_onclick='', string $a_id="", string $a_class="")
setFormName(string $a_name="")
addMultiCommand(string $a_cmd, string $a_text)
setFormAction(string $a_form_action, bool $a_multipart=false)
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)
setSelectAllCheckbox(string $a_select_all_checkbox, bool $a_select_all_on_top=false)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
enable(string $a_module_name)
disable(string $a_module_name)
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), ilTable2GUI\addColumn(), ilTable2GUI\addCommandButton(), ilTable2GUI\addMultiCommand(), ILIAS\Repository\ctrl(), ilTableGUI\disable(), ilTableGUI\enable(), ilLOSettings\getInstanceByObjId(), getSettings(), ILIAS\Repository\lng(), ilTable2GUI\setFormAction(), ilTable2GUI\setFormName(), ilTable2GUI\setLimit(), ilTable2GUI\setRowTemplate(), ilTable2GUI\setSelectAllCheckbox(), ILIAS\Repository\settings(), and ilLOSettings\TYPE_QUALIFYING_SELECTED.

+ Here is the call graph for this function:

Member Function Documentation

◆ fillRow()

ilCourseObjectivesTableGUI::fillRow ( array  $a_set)
protected

Standard Version of Fill Row.

Most likely to be overwritten by derived class.

Parameters
array$a_setdata array

Reimplemented from ilTable2GUI.

Definition at line 74 of file class.ilCourseObjectivesTableGUI.php.

74 : void
75 {
76 $this->tpl->setVariable('VAL_ID', $a_set['id']);
77 $this->tpl->setVariable('VAL_POSITION', $a_set['position']);
78
79 // begin-patch lok
80 if ($a_set['online']) {
81 $this->tpl->setVariable('VAL_ONOFFLINE', $this->lng->txt('online'));
82 $this->tpl->setVariable('ONOFFLINE_CLASS', 'smallgreen');
83 } else {
84 $this->tpl->setVariable('VAL_ONOFFLINE', $this->lng->txt('offline'));
85 $this->tpl->setVariable('ONOFFLINE_CLASS', 'smallred');
86 }
87
88 if ($a_set['passes']) {
89 $this->tpl->setVariable('PASSES_TXT', $this->lng->txt('crs_loc_passes_info'));
90 $this->tpl->setVariable('PASSES_VAL', $a_set['passes']);
91 }
92
93 // begin-patch lok
94 $this->ctrl->setParameterByClass('ilcourseobjectivesgui', 'objective_id', $a_set['id']);
95 $this->tpl->setVariable('VAL_TITLE_LINKED', $this->ctrl->getLinkTargetByClass('ilcourseobjectivesgui', 'edit'));
96 // end-patch lok
97
98 $this->tpl->setVariable('VAL_TITLE', $a_set['title']);
99 if (strlen($a_set['description'])) {
100 $this->tpl->setVariable('VAL_DESC', $a_set['description']);
101 }
102
103 // materials
104 foreach ($a_set['materials'] as $data) {
105 if ($data['items'] ?? false) {
106 $this->tpl->touchBlock('ul_begin');
107 foreach ($data['items'] as $pg_st) {
108 $this->tpl->setCurrentBlock('st_pg');
109 $this->tpl->setVariable('MAT_IMG', ilObject::_getIcon($pg_st['obj_id'], "tiny", $pg_st['type']));
110 $this->tpl->setVariable('MAT_ALT', $this->lng->txt('obj_' . $pg_st['type']));
111 $title = ilLMObject::_lookupTitle($pg_st['obj_id']);
112 $this->tpl->setVariable('MAT_TITLE', $title);
113 $this->tpl->parseCurrentBlock();
114 }
115 $this->tpl->touchBlock('ul_end');
116 } else {
117 $this->tpl->touchBlock('new_line');
118 }
119 $this->tpl->setCurrentBlock('mat_row');
120 $this->tpl->setVariable('LM_IMG', ilObject::_getIcon($data['obj_id'], "tiny", $data['type']));
121 $this->tpl->setVariable('LM_ALT', $this->lng->txt('obj_' . $data['type']));
122
123 if ($data['online']) {
124 $this->tpl->setCurrentBlock('mat_online');
125 $this->tpl->setVariable('MAT_VAL_ONOFFLINE', $this->lng->txt('online'));
126 } else {
127 $this->tpl->setCurrentBlock('mat_offline');
128 $this->tpl->setVariable('MAT_VAL_ONOFFLINE', $this->lng->txt('offline'));
129 }
130 $this->tpl->parseCurrentBlock();
131 $this->tpl->setCurrentBlock('mat_row');
132
133 if ($data['type'] == 'catr' || $data['type'] == 'crsr' || $data['type'] == 'grpr') {
134 $this->tpl->setVariable(
135 'LM_TITLE',
137 );
138 } else {
139 $this->tpl->setVariable('LM_TITLE', ilObject::_lookupTitle($data['obj_id']));
140 }
141
142 $this->tpl->parseCurrentBlock();
143 }
144
145 // self assessment
146 // begin-patch lok
147 if ($this->getSettings()->worksWithInitialTest()) {
148 if ($this->getSettings()->hasSeparateInitialTests()) {
149 if ($a_set['initial'] ?? false) {
150 $obj_id = ilObject::_lookupObjId($a_set['initial']);
151 $this->tpl->setCurrentBlock('initial_test_per_objective');
152 $this->tpl->setVariable('IT_IMG', ilObject::_getIcon($obj_id, 'tiny'));
153 $this->tpl->setVariable('IT_ALT', $this->lng->txt('obj_tst'));
154 $this->tpl->setVariable('IT_TITLE', ilObject::_lookupTitle($obj_id));
155 $this->tpl->setVariable('IT_TITLE_LINK', ilLink::_getLink($a_set['initial']));
156
157 $this->ctrl->setParameterByClass('ilobjtestgui', 'ref_id', $a_set['initial']);
158 $this->ctrl->setParameterByClass('ilobjtestgui', 'cmd', 'questionsTabGateway');
159 $this->tpl->setVariable(
160 'IT_TITLE_LINK',
161 $this->ctrl->getLinkTargetByClass('ilobjtestgui')
162 );
163
164 $this->tpl->parseCurrentBlock();
165 } else {
166 $this->tpl->touchBlock('with_self_test');
167 }
168 } else {
169 foreach (($a_set['self'] ?? []) as $test) {
170 // begin-patch lok
171 foreach ((array) ($test['questions'] ?? []) as $question) {
172 $this->tpl->setCurrentBlock('self_qst_row');
173 $this->tpl->setVariable('SELF_QST_TITLE', $question['title']);
174 $this->tpl->parseCurrentBlock();
175 }
176 if (count($test['questions'] ?? []) === 0) {
177 $this->tpl->touchBlock('self_qst_row');
178 }
179 // end-patch lok
180 }
181 // begin-patch lok
182 if (count($a_set['self'] ?? []) === 0) {
183 $this->tpl->touchBlock('self_qst_row');
184 }
185 }
186
187 // end-patch lok
188 }
189 // end-patch lok
190
191 // final test questions
192 if ($this->getSettings()->getQualifyingTestType() == ilLOSettings::TYPE_QUALIFYING_SELECTED) {
193 if ($a_set['final'] ?? false) {
194 $obj_id = ilObject::_lookupObjId($a_set['final']);
195 $this->tpl->setCurrentBlock('final_test_per_objective');
196 $this->tpl->setVariable('FT_IMG', ilObject::_getIcon($obj_id, 'tiny'));
197 $this->tpl->setVariable('FT_ALT', $this->lng->txt('obj_tst'));
198 $this->tpl->setVariable('FT_TITLE', ilObject::_lookupTitle($obj_id));
199
200 $this->ctrl->setParameterByClass('ilobjtestgui', 'ref_id', $a_set['final']);
201 $this->ctrl->setParameterByClass('ilobjtestgui', 'cmd', 'questionsTabGateway');
202 $this->tpl->setVariable(
203 'FT_TITLE_LINK',
204 $this->ctrl->getLinkTargetByClass('ilobjtestgui')
205 );
206
207 $this->tpl->parseCurrentBlock();
208 } else {
209 $this->tpl->touchBlock('with_final_test');
210 }
211 } else {
212 foreach ((array) ($a_set['final'] ?? []) as $test) {
213 foreach ((array) ($test['questions'] ?? []) as $question) {
214 $this->tpl->setCurrentBlock('final_qst_row');
215 $this->tpl->setVariable('FINAL_QST_TITLE', $question['title'] ?? '');
216 $this->tpl->parseCurrentBlock();
217 }
218 if (count($test['questions'] ?? []) === 0) {
219 $this->tpl->touchBlock('final_qst_row');
220 }
221 }
222 if (count($a_set['final'] ?? []) === 0) {
223 $this->tpl->touchBlock('final_qst_row');
224 }
225 }
226 $this->ctrl->setParameterByClass('ilcourseobjectivesgui', 'objective_id', $a_set['id']);
227 $this->tpl->setVariable('EDIT_LINK', $this->ctrl->getLinkTargetByClass('ilcourseobjectivesgui', 'edit'));
228 $this->tpl->setVariable('TXT_EDIT', $this->lng->txt('edit'));
229
230 $alist = new ilAdvancedSelectionListGUI();
231 $alist->setId($a_set['id']);
232
233 $alist->addItem(
234 $this->lng->txt('edit'),
235 '',
236 $this->ctrl->getLinkTargetByClass('ilcourseobjectivesgui', 'edit')
237 );
238 // materials
239 $alist->addItem(
240 $this->lng->txt('crs_objective_action_materials'),
241 '',
242 $this->ctrl->getLinkTargetByClass('ilcourseobjectivesgui', 'materialAssignment')
243 );
244 // itest
245 if ($this->getSettings()->worksWithInitialTest() && !$this->getSettings()->hasSeparateInitialTests()) {
246 $alist->addItem(
247 $this->lng->txt('crs_objective_action_itest'),
248 '',
249 $this->ctrl->getLinkTargetByClass('ilcourseobjectivesgui', 'selfAssessmentAssignment')
250 );
251 }
252 // qtest
253 if ($this->getSettings()->hasSeparateQualifiedTests()) {
254 // @todo
255 } else {
256 $alist->addItem(
257 $this->lng->txt('crs_objective_action_qtest'),
258 '',
259 $this->ctrl->getLinkTargetByClass('ilcourseobjectivesgui', 'finalTestAssignment')
260 );
261 }
262
263 $this->ctrl->setParameterByClass('illopagegui', 'objective_id', $a_set['id']);
264 $alist->addItem(
265 $this->lng->txt('crs_edit_lo_introduction'),
266 '',
267 $this->ctrl->getLinkTargetByClass('illopagegui', 'edit')
268 );
269
270 $this->tpl->setVariable('VAL_ACTIONS', $alist->getHTML());
271
272 // end-patch lok
273 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupTargetTitle(int $a_obj_id)
static _lookupTitle(int $a_obj_id)
static _getIcon(int $obj_id=0, string $size="big", string $type="", bool $offline=false)
Get icon for repository item.
static _lookupObjId(int $ref_id)
static _lookupTitle(int $obj_id)

References ilTableGUI\$data, ilTableGUI\$title, ilObject\_getIcon(), ilLink\_getLink(), ilObject\_lookupObjId(), ilContainerReference\_lookupTargetTitle(), ilLMObject\_lookupTitle(), ilObject\_lookupTitle(), ILIAS\Repository\ctrl(), getSettings(), ILIAS\Repository\lng(), and ilLOSettings\TYPE_QUALIFYING_SELECTED.

+ Here is the call graph for this function:

◆ getSettings()

ilCourseObjectivesTableGUI::getSettings ( )

Definition at line 69 of file class.ilCourseObjectivesTableGUI.php.

70 {
71 return $this->settings;
72 }
Settings for LO courses.

References $settings.

Referenced by __construct(), fillRow(), and parse().

+ Here is the caller graph for this function:

◆ parse()

ilCourseObjectivesTableGUI::parse ( array  $a_objective_ids)

Definition at line 275 of file class.ilCourseObjectivesTableGUI.php.

275 : void
276 {
277 $position = 1;
278 $objectives = [];
279 foreach ($a_objective_ids as $objective_id) {
280 $objective = new ilCourseObjective($this->course_obj, $objective_id);
281
282 $objective_data = [];
283 $objective_data['id'] = $objective_id;
284 $objective_data['position'] = sprintf("%.1f", $position++) * 10;
285 $objective_data['title'] = $objective->getTitle();
286 $objective_data['description'] = $objective->getDescription();
287
288 $objective_data['online'] = $objective->isActive();
289 $objective_data['passes'] = $objective->getPasses();
290
291 // assigned materials
292 $materials = array();
293 $ass_materials = new ilCourseObjectiveMaterials($objective_id);
294 foreach ($ass_materials->getMaterials() as $material) {
295 $materials[$material['ref_id']]['obj_id'] = $obj_id = ilObject::_lookupObjId($material['ref_id']);
296 $materials[$material['ref_id']]['type'] = ilObject::_lookupType($obj_id);
297
298 switch ($material['type']) {
299 case 'pg':
300 case 'st':
301 $materials[$material['ref_id']]['items'][] = $material;
302 break;
303 default:
304
305 }
306 $materials[$material['ref_id']]['online'] = !ilObject::lookupOfflineStatus($obj_id);
307 }
308 $objective_data['materials'] = $materials;
309 $question_obj = new ilCourseObjectiveQuestion($objective_id);
310
311 // self assessment questions
312 // begin-patch lok
313 if ($this->getSettings()->worksWithInitialTest()) {
314 if ($this->getSettings()->hasSeparateInitialTests()) {
315 $assignments = ilLOTestAssignments::getInstance($this->course_obj->getId());
316 $assignment = $assignments->getAssignmentByObjective(
317 $objective_id,
319 );
320
321 $objective_data['initial'] = 0;
322 if ($assignment instanceof ilLOTestAssignment) {
323 $test_id = $assignment->getTestRefId();
324
326 $test_candidate = $factory->getInstanceByRefId($test_id, false);
327 if ($test_candidate instanceof ilObjTest) {
328 $objective_data['initial'] = $test_id;
329 }
330 }
331 } elseif (ilLOUtils::lookupRandomTest(ilObject::_lookupObjId($this->getSettings()->getInitialTest()))) {
332 $test = array();
333 $objective_data['self'] = [];
335 $this->course_obj->getId(),
336 $objective_id,
337 ilObject::_lookupObjId($this->getSettings()->getInitialTest()),
339 ) as $sequence_id
340 ) {
341 $test['obj_id'] = ilObject::_lookupObjId($this->getSettings()->getInitialTest());
342 $qst = ilLOUtils::lookupQplBySequence($this->getSettings()->getInitialTest(), $sequence_id);
343 if ($qst) {
344 $test['questions'][] = array('title' => $qst);
345 }
346 $objective_data['self'] = array($test);
347 }
348 } else {
349 $tests = array();
350 foreach ($question_obj->getSelfAssessmentTests() as $test) {
351 $questions = array();
352 foreach ($question_obj->getQuestionsOfTest($test['obj_id']) as $qst) {
353 $questions[] = $qst;
354 }
355 $tmp_test = $test;
356 $tmp_test['questions'] = $questions;
357
358 $tests[] = $tmp_test;
359 }
360 $objective_data['self'] = $tests;
361 }
362 }
363
364 if ($this->getSettings()->getQualifyingTestType() == ilLOSettings::TYPE_QUALIFYING_SELECTED) {
365 $assignments = ilLOTestAssignments::getInstance($this->course_obj->getId());
366 $assignment = $assignments->getAssignmentByObjective($objective_id, ilLOSettings::TYPE_TEST_QUALIFIED);
367
368 $objective_data['final'] = 0;
369 if ($assignment instanceof ilLOTestAssignment) {
370 $test_id = $assignment->getTestRefId();
371
373 $test_candidate = $factory->getInstanceByRefId($test_id, false);
374 if ($test_candidate instanceof ilObjTest) {
375 $objective_data['final'] = $test_id;
376 }
377 }
378 } elseif ($this->getSettings()->getQualifiedTest()) {
379 if (ilLOUtils::lookupRandomTest(ilObject::_lookupObjId($this->getSettings()->getQualifiedTest()))) {
380 $test = array();
382 $this->course_obj->getId(),
383 $objective_id,
384 ilObject::_lookupObjId($this->getSettings()->getQualifiedTest()),
386 ) as $sequence_id
387 ) {
388 $test['obj_id'] = ilObject::_lookupObjId($this->getSettings()->getQualifiedTest());
389 $qst = ilLOUtils::lookupQplBySequence($this->getSettings()->getQualifiedTest(), $sequence_id);
390 if ($qst) {
391 $test['questions'][] = array('title' => $qst);
392 }
393 $objective_data['final'] = array($test);
394 }
395 } else {
396 $tests = array();
397 foreach ($question_obj->getFinalTests() as $test) {
398 $questions = array();
399 foreach ($question_obj->getQuestionsOfTest($test['obj_id']) as $qst) {
400 $questions[] = $qst;
401 }
402 $tmp_test = $test;
403 $tmp_test['questions'] = $questions;
404
405 $tests[] = $tmp_test;
406 }
407 $objective_data['final'] = $tests;
408 }
409 }
410 // end-patch lok
411 $objectives[] = $objective_data;
412 }
413 $this->setData($objectives);
414 }
class ilCourseObjectiveMaterials
class ilcourseobjectiveQuestion
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static lookupSequencesByType(int $a_container_id, int $a_objective_id, int $a_test_id, int $a_test_type)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getInstance(int $a_container_id)
static lookupRandomTest(int $a_test_obj_id)
static lookupQplBySequence(int $a_test_ref_id, int $a_sequence_id)
Lookup assigned qpl name (including taxonomy) by sequence.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupType(int $id, bool $reference=false)
static lookupOfflineStatus(int $obj_id)
Lookup offline status using objectDataCache.
setData(array $a_data)
Set table data.
$factory
Definition: metadata.php:75
$objectives

References $factory, $objectives, ilObject\_lookupObjId(), ilObject\_lookupType(), ilLOTestAssignments\getInstance(), getSettings(), ilObject\lookupOfflineStatus(), ilLOUtils\lookupQplBySequence(), ilLOUtils\lookupRandomTest(), ilLORandomTestQuestionPools\lookupSequencesByType(), ilTable2GUI\setData(), ilLOSettings\TYPE_QUALIFYING_SELECTED, ilLOSettings\TYPE_TEST_INITIAL, and ilLOSettings\TYPE_TEST_QUALIFIED.

+ Here is the call graph for this function:

Field Documentation

◆ $course_obj

ilObject ilCourseObjectivesTableGUI::$course_obj
protected

Definition at line 27 of file class.ilCourseObjectivesTableGUI.php.

◆ $settings

ilLOSettings ilCourseObjectivesTableGUI::$settings
protected

Definition at line 28 of file class.ilCourseObjectivesTableGUI.php.

Referenced by getSettings().


The documentation for this class was generated from the following file: