ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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 ()
 
 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_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_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
 

Private Attributes

UIRenderer $renderer
 
UIFactory $uiFactory
 

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 27 of file class.ilCourseObjectivesTableGUI.php.

Constructor & Destructor Documentation

◆ __construct()

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

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

36 {
37 global $DIC;
38
39 $this->course_obj = $a_course_obj;
40
41 $this->settings = ilLOSettings::getInstanceByObjId($this->course_obj->getId());
42
43 parent::__construct($a_parent_obj, 'listObjectives');
44
45 $this->renderer = $DIC->ui()->renderer();
46 $this->uiFactory = $DIC->ui()->factory();
47
48 $this->lng->loadLanguageModule('crs');
49 $this->setFormName('objectives');
50 $this->addColumn('', 'f', "1px");
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');
54 if ($this->getSettings()->worksWithInitialTest()) {
55 $this->addColumn($this->lng->txt('crs_objective_self_assessment'), 'self');
56 }
57 if ($this->getSettings()->getQualifyingTestType() == ilLOSettings::TYPE_QUALIFYING_SELECTED) {
58 $this->addColumn($this->lng->txt('crs_objective_tbl_col_final_tsts'), 'final');
59 } else {
60 $this->addColumn($this->lng->txt('crs_objective_final_test'), 'final');
61 }
62 $this->addColumn($this->lng->txt('actions'), '5em');
63
64 $this->setFormAction($this->ctrl->getFormAction($a_parent_obj));
65 $this->setRowTemplate("tpl.crs_objectives_table_row.html", "components/ILIAS/Course");
66 $this->disable('sort');
67 $this->enable('header');
68 $this->disable('numinfo');
69 $this->enable('select_all');
70 $this->setSelectAllCheckbox('objective');
71 $this->setLimit(200);
72 $this->addMultiCommand('activateObjectives', $this->lng->txt('set_online'));
73 $this->addMultiCommand('deactivateObjectives', $this->lng->txt('set_offline'));
74 $this->addMultiCommand('askDeleteObjectives', $this->lng->txt('delete'));
75 $this->addCommandButton('saveSorting', $this->lng->txt('sorting_save'));
76 }
renderer()
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)
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26

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(), renderer(), 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<string,mixed>$a_set data array

Reimplemented from ilTable2GUI.

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

83 : void
84 {
85 $this->tpl->setVariable('VAL_ID', $a_set['id']);
86 $this->tpl->setVariable('VAL_POSITION', $a_set['position']);
87
88 // begin-patch lok
89 if ($a_set['online']) {
90 $this->tpl->setVariable('VAL_ONOFFLINE', $this->lng->txt('online'));
91 $this->tpl->setVariable('ONOFFLINE_CLASS', 'smallgreen');
92 } else {
93 $this->tpl->setVariable('VAL_ONOFFLINE', $this->lng->txt('offline'));
94 $this->tpl->setVariable('ONOFFLINE_CLASS', 'smallred');
95 }
96
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']);
100 }
101
102 // begin-patch lok
103 $this->ctrl->setParameterByClass('ilcourseobjectivesgui', 'objective_id', $a_set['id']);
104 $this->tpl->setVariable('VAL_TITLE_LINKED', $this->ctrl->getLinkTargetByClass('ilcourseobjectivesgui', 'edit'));
105 // end-patch lok
106
107 $this->tpl->setVariable('VAL_TITLE', $a_set['title']);
108 if (strlen($a_set['description'])) {
109 $this->tpl->setVariable('VAL_DESC', $a_set['description']);
110 }
111
112 // materials
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']));
120 $title = ilLMObject::_lookupTitle($pg_st['obj_id']);
121 $this->tpl->setVariable('MAT_TITLE', $title);
122 $this->tpl->parseCurrentBlock();
123 }
124 $this->tpl->touchBlock('ul_end');
125 } else {
126 $this->tpl->touchBlock('new_line');
127 }
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']));
131
132 if ($data['online']) {
133 $this->tpl->setCurrentBlock('mat_online');
134 $this->tpl->setVariable('MAT_VAL_ONOFFLINE', $this->lng->txt('online'));
135 } else {
136 $this->tpl->setCurrentBlock('mat_offline');
137 $this->tpl->setVariable('MAT_VAL_ONOFFLINE', $this->lng->txt('offline'));
138 }
139 $this->tpl->parseCurrentBlock();
140 $this->tpl->setCurrentBlock('mat_row');
141
142 if ($data['type'] == 'catr' || $data['type'] == 'crsr' || $data['type'] == 'grpr') {
143 $this->tpl->setVariable(
144 'LM_TITLE',
146 );
147 } else {
148 $this->tpl->setVariable('LM_TITLE', ilObject::_lookupTitle($data['obj_id']));
149 }
150
151 $this->tpl->parseCurrentBlock();
152 }
153
154 // self assessment
155 // begin-patch lok
156 if ($this->getSettings()->worksWithInitialTest()) {
157 if ($this->getSettings()->hasSeparateInitialTests()) {
158 if ($a_set['initial'] ?? false) {
159 $obj_id = ilObject::_lookupObjId($a_set['initial']);
160 $this->tpl->setCurrentBlock('initial_test_per_objective');
161 $this->tpl->setVariable('IT_IMG', ilObject::_getIcon($obj_id, 'tiny'));
162 $this->tpl->setVariable('IT_ALT', $this->lng->txt('obj_tst'));
163 $this->tpl->setVariable('IT_TITLE', ilObject::_lookupTitle($obj_id));
164 $this->tpl->setVariable('IT_TITLE_LINK', ilLink::_getLink($a_set['initial']));
165
166 $this->ctrl->setParameterByClass('ilobjtestgui', 'ref_id', $a_set['initial']);
167 $this->ctrl->setParameterByClass('ilobjtestgui', 'cmd', 'questionsTabGateway');
168 $this->tpl->setVariable(
169 'IT_TITLE_LINK',
170 $this->ctrl->getLinkTargetByClass('ilobjtestgui')
171 );
172
173 $this->tpl->parseCurrentBlock();
174 } else {
175 $this->tpl->touchBlock('with_self_test');
176 }
177 } else {
178 foreach (($a_set['self'] ?? []) as $test) {
179 // begin-patch lok
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();
184 }
185 if (count($test['questions'] ?? []) === 0) {
186 $this->tpl->touchBlock('self_qst_row');
187 }
188 // end-patch lok
189 }
190 // begin-patch lok
191 if (count($a_set['self'] ?? []) === 0) {
192 $this->tpl->touchBlock('self_qst_row');
193 }
194 }
195
196 // end-patch lok
197 }
198 // end-patch lok
199
200 // final test questions
201 if ($this->getSettings()->getQualifyingTestType() == ilLOSettings::TYPE_QUALIFYING_SELECTED) {
202 if ($a_set['final'] ?? false) {
203 $obj_id = ilObject::_lookupObjId($a_set['final']);
204 $this->tpl->setCurrentBlock('final_test_per_objective');
205 $this->tpl->setVariable('FT_IMG', ilObject::_getIcon($obj_id, 'tiny'));
206 $this->tpl->setVariable('FT_ALT', $this->lng->txt('obj_tst'));
207 $this->tpl->setVariable('FT_TITLE', ilObject::_lookupTitle($obj_id));
208
209 $this->ctrl->setParameterByClass('ilobjtestgui', 'ref_id', $a_set['final']);
210 $this->ctrl->setParameterByClass('ilobjtestgui', 'cmd', 'questionsTabGateway');
211 $this->tpl->setVariable(
212 'FT_TITLE_LINK',
213 $this->ctrl->getLinkTargetByClass('ilobjtestgui')
214 );
215
216 $this->tpl->parseCurrentBlock();
217 } else {
218 $this->tpl->touchBlock('with_final_test');
219 }
220 } else {
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();
226 }
227 if (count($test['questions'] ?? []) === 0) {
228 $this->tpl->touchBlock('final_qst_row');
229 }
230 }
231 if (count($a_set['final'] ?? []) === 0) {
232 $this->tpl->touchBlock('final_qst_row');
233 }
234 }
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'));
238
239 $dropDownItems = array();
240
241 $dropDownItems[] = $this->uiFactory->button()->shy(
242 $this->lng->txt('edit'),
243 $this->ctrl->getLinkTargetByClass('ilcourseobjectivesgui', 'edit')
244 );
245
246 // materials
247 $dropDownItems[] = $this->uiFactory->button()->shy(
248 $this->lng->txt('crs_objective_action_materials'),
249 $this->ctrl->getLinkTargetByClass('ilcourseobjectivesgui', 'materialAssignment')
250 );
251
252 // itest
253 if ($this->getSettings()->worksWithInitialTest() && !$this->getSettings()->hasSeparateInitialTests()) {
254 $dropDownItems[] = $this->uiFactory->button()->shy(
255 $this->lng->txt('crs_objective_action_itest'),
256 $this->ctrl->getLinkTargetByClass('ilcourseobjectivesgui', 'selfAssessmentAssignment')
257 );
258 }
259 // qtest
260 if ($this->getSettings()->hasSeparateQualifiedTests()) {
261 // @todo
262 } else {
263 $dropDownItems[] = $this->uiFactory->button()->shy(
264 $this->lng->txt('crs_objective_action_qtest'),
265 $this->ctrl->getLinkTargetByClass('ilcourseobjectivesgui', 'finalTestAssignment')
266 );
267 }
268
269 $this->ctrl->setParameterByClass('illopagegui', 'objective_id', $a_set['id']);
270
271 $dropDownItems[] = $this->uiFactory->button()->shy(
272 $this->lng->txt('crs_edit_lo_introduction'),
273 $this->ctrl->getLinkTargetByClass('illopagegui', 'edit')
274 );
275 $dropDown = $this->uiFactory->dropdown()->standard($dropDownItems)
276 ->withAriaLabel('Actions');
277 $this->tpl->setVariable('VAL_ACTIONS', $this->renderer->render($dropDown));
278
279 // end-patch lok
280 }
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(), ilObject\_lookupObjId(), ilContainerReference\_lookupTargetTitle(), ilLMObject\_lookupTitle(), ilObject\_lookupTitle(), ILIAS\Repository\ctrl(), getSettings(), ILIAS\Repository\lng(), renderer(), and ilLOSettings\TYPE_QUALIFYING_SELECTED.

+ Here is the call graph for this function:

◆ getSettings()

ilCourseObjectivesTableGUI::getSettings ( )

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

79 {
80 return $this->settings;
81 }
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 282 of file class.ilCourseObjectivesTableGUI.php.

282 : void
283 {
284 $position = 1;
285 $objectives = [];
286 foreach ($a_objective_ids as $objective_id) {
287 $objective = new ilCourseObjective($this->course_obj, $objective_id);
288
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();
294
295 $objective_data['online'] = $objective->isActive();
296 $objective_data['passes'] = $objective->getPasses();
297
298 // assigned materials
299 $materials = array();
300 $ass_materials = new ilCourseObjectiveMaterials($objective_id);
301 foreach ($ass_materials->getMaterials() as $material) {
302 $materials[$material['ref_id']]['obj_id'] = $obj_id = ilObject::_lookupObjId($material['ref_id']);
303 $materials[$material['ref_id']]['type'] = ilObject::_lookupType($obj_id);
304
305 switch ($material['type']) {
306 case 'pg':
307 case 'st':
308 $materials[$material['ref_id']]['items'][] = $material;
309 break;
310 default:
311 }
312 $materials[$material['ref_id']]['online'] = !ilObject::lookupOfflineStatus($obj_id);
313 }
314 $objective_data['materials'] = $materials;
315 $question_obj = new ilCourseObjectiveQuestion($objective_id);
316
317 // self assessment questions
318 // begin-patch lok
319 if ($this->getSettings()->worksWithInitialTest()) {
320 if ($this->getSettings()->hasSeparateInitialTests()) {
321 $assignments = ilLOTestAssignments::getInstance($this->course_obj->getId());
322 $assignment = $assignments->getAssignmentByObjective(
323 $objective_id,
325 );
326
327 $objective_data['initial'] = 0;
328 if ($assignment instanceof ilLOTestAssignment) {
329 $test_id = $assignment->getTestRefId();
330
331 $factory = new ilObjectFactory();
332 $test_candidate = $factory->getInstanceByRefId($test_id, false);
333 if ($test_candidate instanceof ilObjTest) {
334 $objective_data['initial'] = $test_id;
335 }
336 }
337 } elseif (ilLOUtils::lookupRandomTest(ilObject::_lookupObjId($this->getSettings()->getInitialTest()))) {
338 $test = array();
339 $objective_data['self'] = [];
341 $this->course_obj->getId(),
342 $objective_id,
343 ilObject::_lookupObjId($this->getSettings()->getInitialTest()),
345 ) as $sequence_id
346 ) {
347 $test['obj_id'] = ilObject::_lookupObjId($this->getSettings()->getInitialTest());
348 $qst = ilLOUtils::lookupQplBySequence($this->getSettings()->getInitialTest(), $sequence_id);
349 if ($qst) {
350 $test['questions'][] = array('title' => $qst);
351 }
352 $objective_data['self'] = array($test);
353 }
354 } else {
355 $tests = array();
356 foreach ($question_obj->getSelfAssessmentTests() as $test) {
357 $questions = array();
358 foreach ($question_obj->getQuestionsOfTest($test['obj_id']) as $qst) {
359 $questions[] = $qst;
360 }
361 $tmp_test = $test;
362 $tmp_test['questions'] = $questions;
363
364 $tests[] = $tmp_test;
365 }
366 $objective_data['self'] = $tests;
367 }
368 }
369
370 if ($this->getSettings()->getQualifyingTestType() == ilLOSettings::TYPE_QUALIFYING_SELECTED) {
371 $assignments = ilLOTestAssignments::getInstance($this->course_obj->getId());
372 $assignment = $assignments->getAssignmentByObjective($objective_id, ilLOSettings::TYPE_TEST_QUALIFIED);
373
374 $objective_data['final'] = 0;
375 if ($assignment instanceof ilLOTestAssignment) {
376 $test_id = $assignment->getTestRefId();
377
378 $factory = new ilObjectFactory();
379 $test_candidate = $factory->getInstanceByRefId($test_id, false);
380 if ($test_candidate instanceof ilObjTest) {
381 $objective_data['final'] = $test_id;
382 }
383 }
384 } elseif ($this->getSettings()->getQualifiedTest()) {
385 if (ilLOUtils::lookupRandomTest(ilObject::_lookupObjId($this->getSettings()->getQualifiedTest()))) {
386 $test = array();
388 $this->course_obj->getId(),
389 $objective_id,
390 ilObject::_lookupObjId($this->getSettings()->getQualifiedTest()),
392 ) as $sequence_id
393 ) {
394 $test['obj_id'] = ilObject::_lookupObjId($this->getSettings()->getQualifiedTest());
395 $qst = ilLOUtils::lookupQplBySequence($this->getSettings()->getQualifiedTest(), $sequence_id);
396 if ($qst) {
397 $test['questions'][] = array('title' => $qst);
398 }
399 $objective_data['final'] = array($test);
400 }
401 } else {
402 $tests = array();
403 foreach ($question_obj->getFinalTests() as $test) {
404 $questions = array();
405 foreach ($question_obj->getQuestionsOfTest($test['obj_id']) as $qst) {
406 $questions[] = $qst;
407 }
408 $tmp_test = $test;
409 $tmp_test['questions'] = $questions;
410
411 $tests[] = $tmp_test;
412 }
413 $objective_data['final'] = $tests;
414 }
415 }
416 // end-patch lok
417 $objectives[] = $objective_data;
418 }
419 $this->setData($objectives);
420 }
class ilCourseObjectiveMaterials
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
class ilcourseobjective
static lookupSequencesByType(int $a_container_id, int $a_objective_id, int $a_test_id, int $a_test_type)
Settings for LO courses.
static getInstance(int $a_container_id)
static lookupRandomTest(int $a_test_obj_id)
Class ilObjectFactory This class offers methods to get instances of the type-specific object classes ...
static _lookupType(int $id, bool $reference=false)
static lookupOfflineStatus(int $obj_id)
Lookup offline status using objectDataCache.
setData(array $a_data)
Set table data.
$objectives

References $objectives, ilObject\_lookupObjId(), ilObject\_lookupType(), ilLOTestAssignments\getInstance(), getSettings(), ilObject\lookupOfflineStatus(), 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 29 of file class.ilCourseObjectivesTableGUI.php.

◆ $renderer

UIRenderer ilCourseObjectivesTableGUI::$renderer
private

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

◆ $settings

ilLOSettings ilCourseObjectivesTableGUI::$settings
protected

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

Referenced by getSettings().

◆ $uiFactory

UIFactory ilCourseObjectivesTableGUI::$uiFactory
private

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


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