ILIAS  release_8 Revision v8.24
ilQuestionBrowserTableGUI 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 ilQuestionBrowserTableGUI:
+ Collaboration diagram for ilQuestionBrowserTableGUI:

Public Member Functions

 __construct ($a_parent_obj, $a_parent_cmd, $a_write_access=false, $confirmdelete=false, $taxIds=array(), $enableCommenting=false)
 
 isQuestionCommentingEnabled ()
 
 setQuestionCommentingEnabled (bool $questionCommentingEnabled)
 
 setQuestionData ($questionData)
 
 getSelectableColumns ()
 Get selectable columns. More...
 
 initFilter ()
 Init filter. More...
 
 fillHeader ()
 
 fillRow (array $a_set)
 fill row @access public More...
 
 setEditable ($value)
 
 getEditable ()
 
 setWriteAccess ($value)
 
 getWriteAccess ()
 
 numericOrdering (string $a_field)
 
- 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

 isCommentsColumnSelected ()
 
 getCommentsHtml ($qData)
 
 getCommentsAjaxLink ($questionId)
 
- 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

ILIAS Notes Service $notes
 
ILIAS UI Factory $ui_factory
 
ILIAS UI Renderer $renderer
 
 $editable = true
 
 $writeAccess = false
 
 $totalPoints = 0
 
 $confirmdelete
 
 $taxIds = array()
 
 $questionCommentingEnabled = false
 
- 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
 

Private Attributes

ILIAS TestQuestionPool InternalRequestService $request
 

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
Helmut Schottmüller ilias.nosp@m.@aur.nosp@m.ealis.nosp@m..de
Version
$Id$

@ilCtrl_Calls ilQuestionBrowserTableGUI: ilFormPropertyDispatchGUI

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

Constructor & Destructor Documentation

◆ __construct()

ilQuestionBrowserTableGUI::__construct (   $a_parent_obj,
  $a_parent_cmd,
  $a_write_access = false,
  $confirmdelete = false,
  $taxIds = array(),
  $enableCommenting = false 
)

Definition at line 46 of file class.ilQuestionBrowserTableGUI.php.

47 {
48 $this->setQuestionCommentingEnabled($enableCommenting);
49
50 // Bugfix: #0019539
51 if ($confirmdelete) {
52 $this->setId("qpl_confirm_del_" . $a_parent_obj->object->getRefId());
53 } else {
54 $this->setId("qpl_qst_brows_" . $a_parent_obj->object->getRefId());
55 }
56
57 parent::__construct($a_parent_obj, $a_parent_cmd);
58
59 global $DIC;
60 $lng = $DIC['lng'];
61 $ilCtrl = $DIC['ilCtrl'];
62 $this->request = $DIC->testQuestionPool()->internal()->request();
63 $this->lng = $lng;
64 $this->ctrl = $ilCtrl;
65
66 $this->renderer = $DIC->ui()->renderer();
67 $this->ui_factory = $DIC->ui()->factory();
68
69 $this->confirmdelete = $confirmdelete;
70 $this->setWriteAccess($a_write_access);
71 $this->taxIds = $taxIds;
72
73 $qplSetting = new ilSetting("qpl");
74
75 $this->setFormName('questionbrowser');
76 $this->setStyle('table', 'fullwidth');
77 if (!$confirmdelete) {
78 $this->addColumn('', '', '1%');
79 $this->addColumn($this->lng->txt("title"), 'title', '');
80 foreach ($this->getSelectedColumns() as $c) {
81 if (strcmp($c, 'description') == 0) {
82 $this->addColumn($this->lng->txt("description"), 'description', '');
83 }
84 if (strcmp($c, 'type') == 0) {
85 $this->addColumn($this->lng->txt("question_type"), 'ttype', '');
86 }
87 // According to mantis #12713
88 if (strcmp($c, 'points') == 0) {
89 $this->addColumn($this->lng->txt("points"), 'points', '', false, 'ilCenterForced');
90 }
91 if (strcmp($c, 'statistics') == 0) {
92 $this->addColumn($this->lng->txt('statistics'), '', '');
93 }
94 if (strcmp($c, 'author') == 0) {
95 $this->addColumn($this->lng->txt("author"), 'author', '');
96 }
97 if ($c == 'lifecycle') {
98 $this->addColumn($this->lng->txt('qst_lifecycle'), 'lifecycle', '');
99 }
100 if ($this->isQuestionCommentingEnabled() && $c == 'comments') {
101 $this->addColumn($this->lng->txt("ass_comments"), 'comments', '');
102 }
103 if (strcmp($c, 'created') == 0) {
104 $this->addColumn($this->lng->txt("create_date"), 'created', '');
105 }
106 if (strcmp($c, 'tstamp') == 0) {
107 $this->addColumn($this->lng->txt("last_update"), 'tstamp', '');
108 }
109 }
110 $this->addColumn($this->lng->txt('actions'), '');
111 $this->setSelectAllCheckbox('q_id');
112 } else {
113 $this->addColumn($this->lng->txt("title"), 'title', '');
114 foreach ($this->getSelectedColumns() as $c) {
115 if (strcmp($c, 'description') == 0) {
116 $this->addColumn($this->lng->txt("description"), 'description', '');
117 }
118 if (strcmp($c, 'type') == 0) {
119 $this->addColumn($this->lng->txt("question_type"), 'ttype', '');
120 }
121 }
122 }
123
124 if ($this->getWriteAccess()) {
125 if ($confirmdelete) {
126 $this->addCommandButton('confirmDeleteQuestions', $this->lng->txt('confirm'));
127 $this->addCommandButton('cancelDeleteQuestions', $this->lng->txt('cancel'));
128 } else {
129 $this->addMultiCommand('copy', $this->lng->txt('copy'));
130 $this->addMultiCommand('move', $this->lng->txt('move'));
131 $this->addMultiCommand('exportQuestion', $this->lng->txt('export'));
132 $this->addMultiCommand('deleteQuestions', $this->lng->txt('delete'));
133 }
134 }
135
136 $this->setRowTemplate("tpl.il_as_qpl_questionbrowser_row.html", "Modules/TestQuestionPool");
137
138 $this->setFormAction($this->ctrl->getFormAction($a_parent_obj, $a_parent_cmd));
139 $this->setDefaultOrderField("title");
140 $this->setDefaultOrderDirection("asc");
141
142 $this->setShowRowsSelector(true);
143
144 if ($confirmdelete) {
145 $this->disable('sort');
146 $this->disable('select_all');
147 } else {
148 $this->enable('sort');
149 $this->enable('header');
150 $this->enable('select_all');
151 $this->setFilterCommand('filterQuestionBrowser');
152 $this->setResetCommand('resetQuestionBrowser');
153 $this->initFilter();
154 }
155 $this->notes = $DIC->notes();
156 if ($this->isQuestionCommentingEnabled()) {
157 $this->notes->gui()->initJavascript();
158 }
159 }
setQuestionCommentingEnabled(bool $questionCommentingEnabled)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setShowRowsSelector(bool $a_value)
Toggle rows-per-page selector.
setFilterCommand(string $a_val, string $a_caption="")
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)
setDefaultOrderField(string $a_defaultorderfield)
setSelectAllCheckbox(string $a_select_all_checkbox, bool $a_select_all_on_top=false)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setId(string $a_val)
setDefaultOrderDirection(string $a_defaultorderdirection)
setResetCommand(string $a_val, string $a_caption="")
ilLanguage $lng
enable(string $a_module_name)
setStyle(string $a_element, string $a_style)
disable(string $a_module_name)
$c
Definition: cli.php:38
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References $c, $confirmdelete, $DIC, ilTableGUI\$lng, $taxIds, ILIAS\GlobalScreen\Provider\__construct(), ilTable2GUI\addColumn(), ilTable2GUI\addCommandButton(), ilTable2GUI\addMultiCommand(), ILIAS\Repository\ctrl(), ilTableGUI\disable(), ilTableGUI\enable(), ilTable2GUI\getSelectedColumns(), getWriteAccess(), initFilter(), isQuestionCommentingEnabled(), ILIAS\Repository\lng(), ilTable2GUI\setDefaultOrderDirection(), ilTable2GUI\setDefaultOrderField(), ilTable2GUI\setFilterCommand(), ilTable2GUI\setFormAction(), ilTable2GUI\setFormName(), ilTable2GUI\setId(), setQuestionCommentingEnabled(), ilTable2GUI\setResetCommand(), ilTable2GUI\setRowTemplate(), ilTable2GUI\setSelectAllCheckbox(), ilTable2GUI\setShowRowsSelector(), ilTableGUI\setStyle(), and setWriteAccess().

+ Here is the call graph for this function:

Member Function Documentation

◆ fillHeader()

ilQuestionBrowserTableGUI::fillHeader ( )

Reimplemented from ilTable2GUI.

Definition at line 340 of file class.ilQuestionBrowserTableGUI.php.

340 : void
341 {
342 foreach ($this->column as $key => $column) {
343 if (strcmp($column['text'], $this->lng->txt("points")) == 0) {
344 $this->column[$key]['text'] = $this->lng->txt("points") . " (" . $this->totalPoints . ")";
345 }
346 }
347 parent::fillHeader();
348 }
string $key
Consumer key/client ID value.
Definition: System.php:193

References ilTable2GUI\$column, ILIAS\LTI\ToolProvider\$key, and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ fillRow()

ilQuestionBrowserTableGUI::fillRow ( array  $a_set)

fill row @access public

Parameters

return void

Reimplemented from ilTable2GUI.

Definition at line 356 of file class.ilQuestionBrowserTableGUI.php.

356 : void
357 {
358 $class = strtolower(assQuestionGUI::_getGUIClassNameForId($a_set["question_id"]));
359 $this->ctrl->setParameterByClass("ilAssQuestionPageGUI", "q_id", $a_set["question_id"]);
360 $this->ctrl->setParameterByClass("ilAssQuestionPreviewGUI", "q_id", $a_set["question_id"]);
361 $this->ctrl->setParameterByClass($class, "q_id", $a_set["question_id"]);
362 $points = 0;
363
364 $actions = new ilAdvancedSelectionListGUI();
365 $actions->setId('qst' . $a_set["question_id"]);
366 $actions->setListTitle($this->lng->txt('actions'));
367
368 if (!$this->confirmdelete) {
369 $this->tpl->setCurrentBlock('checkbox');
370 $this->tpl->setVariable('CB_QUESTION_ID', $a_set["question_id"]);
371 $this->tpl->parseCurrentBlock();
372
373 if ($a_set["complete"] == 0) {
374 $icon = $this->ui_factory->symbol()->icon()->custom(ilUtil::getImagePath("icon_alert.svg"), $this->lng->txt("warning_question_not_complete"));
375 $this->tpl->setCurrentBlock("qpl_warning");
376 $this->tpl->setVariable("ICON_WARNING", $this->renderer->render($icon));
377 $this->tpl->parseCurrentBlock();
378 } else {
379 $points = $a_set["points"];
380 }
381 $this->totalPoints += $points;
382
383 foreach ($this->getSelectedColumns() as $c) {
384 if (strcmp($c, 'points') == 0) {
385 $this->tpl->setCurrentBlock('points');
386 $this->tpl->setVariable("QUESTION_POINTS", $points);
387 $this->tpl->parseCurrentBlock();
388 }
389 if (strcmp($c, 'statistics') == 0) {
390 $this->tpl->setCurrentBlock('statistics');
391 $this->tpl->setVariable("LINK_ASSESSMENT", $this->ctrl->getLinkTargetByClass('ilAssQuestionPreviewGUI', ilAssQuestionPreviewGUI::CMD_STATISTICS));
392 $this->tpl->setVariable("TXT_ASSESSMENT", $this->lng->txt("statistics"));
393 $this->tpl->setVariable("IMG_ASSESSMENT", ilUtil::getImagePath("assessment.gif", "Modules/TestQuestionPool"));
394 $this->tpl->parseCurrentBlock();
395 }
396 if (strcmp($c, 'author') == 0) {
397 $this->tpl->setCurrentBlock('author');
398 $this->tpl->setVariable("QUESTION_AUTHOR", $a_set["author"]);
399 $this->tpl->parseCurrentBlock();
400 }
401 if ($c == 'lifecycle') {
402 $lifecycle = ilAssQuestionLifecycle::getInstance($a_set['lifecycle']);
403
404 $this->tpl->setCurrentBlock('lifecycle');
405 $this->tpl->setVariable("QUESTION_LIFECYCLE", $lifecycle->getTranslation($this->lng));
406 $this->tpl->parseCurrentBlock();
407 }
408 if ($c == 'comments' && $this->isQuestionCommentingEnabled()) {
409 $this->tpl->setCurrentBlock('comments');
410 $this->tpl->setVariable("COMMENTS", $this->getCommentsHtml($a_set));
411 $this->tpl->parseCurrentBlock();
412 }
413 if (strcmp($c, 'created') == 0) {
414 $this->tpl->setCurrentBlock('created');
415 $this->tpl->setVariable('QUESTION_CREATED', ilDatePresentation::formatDate(new ilDateTime($a_set['created'], IL_CAL_UNIX)));
416 $this->tpl->parseCurrentBlock();
417 }
418 if (strcmp($c, 'tstamp') == 0) {
419 $this->tpl->setCurrentBlock('updated');
420 $this->tpl->setVariable('QUESTION_UPDATED', ilDatePresentation::formatDate(new ilDateTime($a_set['tstamp'], IL_CAL_UNIX)));
421 $this->tpl->parseCurrentBlock();
422 }
423 }
424
425 $actions->addItem(
426 $this->lng->txt('preview'),
427 '',
428 $this->ctrl->getLinkTargetByClass('ilAssQuestionPreviewGUI', ilAssQuestionPreviewGUI::CMD_SHOW)
429 );
430 $actions->addItem(
431 $this->lng->txt('statistics'),
432 '',
433 $this->ctrl->getLinkTargetByClass('ilAssQuestionPreviewGUI', ilAssQuestionPreviewGUI::CMD_STATISTICS)
434 );
435 if ($this->getEditable()) {
436 $editHref = $this->ctrl->getLinkTargetByClass($a_set['type_tag'] . 'GUI', 'editQuestion');
437 $actions->addItem($this->lng->txt('edit_question'), '', $editHref);
438
439 $editPageHref = $this->ctrl->getLinkTargetByClass('ilAssQuestionPageGUI', 'edit');
440 $actions->addItem($this->lng->txt('edit_page'), '', $editPageHref);
441 }
442
443 if ($this->getWriteAccess()) {
444 $this->ctrl->setParameter($this->parent_obj, 'q_id', $a_set['question_id']);
445 $moveHref = $this->ctrl->getLinkTarget($this->parent_obj, 'move');
446 $this->ctrl->setParameter($this->parent_obj, 'q_id', null);
447 $actions->addItem($this->lng->txt('move'), '', $moveHref);
448
449 $this->ctrl->setParameter($this->parent_obj, 'q_id', $a_set['question_id']);
450 $copyHref = $this->ctrl->getLinkTarget($this->parent_obj, 'copy');
451 $this->ctrl->setParameter($this->parent_obj, 'q_id', null);
452 $actions->addItem($this->lng->txt('copy'), '', $copyHref);
453
454 $this->ctrl->setParameter($this->parent_obj, 'q_id', $a_set['question_id']);
455 $deleteHref = $this->ctrl->getLinkTarget($this->parent_obj, 'deleteQuestions');
456 $this->ctrl->setParameter($this->parent_obj, 'q_id', null);
457 $actions->addItem($this->lng->txt('delete'), '', $deleteHref);
458 }
459
460 if ($this->getEditable()) {
461 $this->ctrl->setParameterByClass('ilAssQuestionFeedbackEditingGUI', 'q_id', $a_set['question_id']);
462 $feedbackHref = $this->ctrl->getLinkTargetByClass('ilAssQuestionFeedbackEditingGUI', ilAssQuestionFeedbackEditingGUI::CMD_SHOW);
463 $this->ctrl->setParameterByClass('ilAssQuestionFeedbackEditingGUI', 'q_id', null);
464 $actions->addItem($this->lng->txt('tst_feedback'), '', $feedbackHref);
465
466 $this->ctrl->setParameterByClass('ilAssQuestionHintsGUI', 'q_id', $a_set['question_id']);
467 $hintsHref = $this->ctrl->getLinkTargetByClass('ilAssQuestionHintsGUI', ilAssQuestionHintsGUI::CMD_SHOW_LIST);
468 $this->ctrl->setParameterByClass('ilAssQuestionHintsGUI', 'q_id', null);
469 $actions->addItem($this->lng->txt('tst_question_hints_tab'), '', $hintsHref);
470 }
471
472 if ($this->isQuestionCommentingEnabled()) {
473 $actions->addItem(
474 $this->lng->txt('ass_comments'),
475 'comments',
476 '',
477 '',
478 '',
479 '',
480 '',
481 '',
482 $this->getCommentsAjaxLink($a_set['question_id'])
483 );
484 }
485 } else {
486 $this->tpl->setCurrentBlock('hidden');
487 $this->tpl->setVariable('HIDDEN_QUESTION_ID', $a_set["question_id"]);
488 $this->tpl->parseCurrentBlock();
489 }
490
491 foreach ($this->getSelectedColumns() as $c) {
492 if (strcmp($c, 'description') == 0) {
493 $this->tpl->setCurrentBlock('description');
494 $this->tpl->setVariable("QUESTION_COMMENT", $a_set['description']);
495 $this->tpl->parseCurrentBlock();
496 }
497 if (strcmp($c, 'type') == 0) {
498 $this->tpl->setCurrentBlock('type');
499 $this->tpl->setVariable("QUESTION_TYPE", assQuestion::_getQuestionTypeName($a_set["type_tag"]));
500 $this->tpl->parseCurrentBlock();
501 }
502 }
503 $this->tpl->setVariable('QUESTION_ID', $a_set["question_id"]);
504 if (!$this->confirmdelete) {
505 $this->tpl->setVariable('QUESTION_HREF_LINKED', $this->ctrl->getLinkTargetByClass('ilAssQuestionPreviewGUI', ilAssQuestionPreviewGUI::CMD_SHOW));
506 $this->tpl->setVariable('QUESTION_TITLE_LINKED', $a_set['title']);
507 $this->tpl->setVariable('ACTIONS', $actions->getHTML());
508 } else {
509 $this->tpl->setVariable('QUESTION_ID_UNLINKED', $a_set['question_id']);
510 $this->tpl->setVariable('QUESTION_TITLE_UNLINKED', $a_set['title']);
511 }
512 }
const IL_CAL_UNIX
static _getGUIClassNameForId($a_q_id)
static _getQuestionTypeName($type_tag)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const CMD_SHOW_LIST
command constants
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false)
@classDescription Date and time handling
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)

References $c, ilTableGUI\$icon, assQuestionGUI\_getGUIClassNameForId(), assQuestion\_getQuestionTypeName(), ilAssQuestionFeedbackEditingGUI\CMD_SHOW, ilAssQuestionPreviewGUI\CMD_SHOW, ilAssQuestionHintsGUI\CMD_SHOW_LIST, ilAssQuestionPreviewGUI\CMD_STATISTICS, ILIAS\Repository\ctrl(), ilDatePresentation\formatDate(), getCommentsHtml(), getEditable(), ilUtil\getImagePath(), ilAssQuestionLifecycle\getInstance(), ilTable2GUI\getSelectedColumns(), getWriteAccess(), IL_CAL_UNIX, isQuestionCommentingEnabled(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getCommentsAjaxLink()

ilQuestionBrowserTableGUI::getCommentsAjaxLink (   $questionId)
protected

Definition at line 563 of file class.ilQuestionBrowserTableGUI.php.

563 : string
564 {
565 $ajax_hash = ilCommonActionDispatcherGUI::buildAjaxHash(1, $this->request->getRefId(), 'quest', $this->parent_obj->object->getId(), 'quest', $questionId);
566 $update_code = "il.UI.counter.getCounterObject($(\".ilTableOuter\")).incrementStatusCount(1);";
567 return ilNoteGUI::getListCommentsJSCall($ajax_hash, $update_code);
568 }
static buildAjaxHash(int $node_type, ?int $node_id, string $obj_type, int $obj_id, string $sub_type=null, int $sub_id=null, int $news_id=0)
Build ajax hash.
static getListCommentsJSCall(string $a_hash, string $a_update_code=null)
Get list comments js call.

References ilCommonActionDispatcherGUI\buildAjaxHash(), and ilNoteGUI\getListCommentsJSCall().

Referenced by getCommentsHtml().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getCommentsHtml()

ilQuestionBrowserTableGUI::getCommentsHtml (   $qData)
protected

Definition at line 547 of file class.ilQuestionBrowserTableGUI.php.

547 : string
548 {
549 if (!$qData['comments']) {
550 return '';
551 }
552
553 $ajax_link = $this->getCommentsAjaxLink($qData['question_id']);
554
555 $comment_glyph = $this->ui_factory->symbol()->glyph()->comment()->withCounter(
556 $this->ui_factory->counter()->status($qData['comments'])
557 )->withAdditionalOnLoadCode(function ($id) use ($ajax_link): string {
558 return "document.getElementById('$id').onclick = function (event) { $ajax_link; };";
559 });
560 return $this->renderer->render($comment_glyph);
561 }

References ilTable2GUI\$id, and getCommentsAjaxLink().

Referenced by fillRow().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getEditable()

ilQuestionBrowserTableGUI::getEditable ( )

Definition at line 519 of file class.ilQuestionBrowserTableGUI.php.

519 : bool
520 {
521 return $this->editable;
522 }

References $editable.

Referenced by fillRow().

+ Here is the caller graph for this function:

◆ getSelectableColumns()

ilQuestionBrowserTableGUI::getSelectableColumns ( )

Get selectable columns.

Returns
array key: column id, val: true/false -> default on/off

Reimplemented from ilTable2GUI.

Definition at line 209 of file class.ilQuestionBrowserTableGUI.php.

209 : array
210 {
211 global $DIC;
212 $lng = $DIC['lng'];
213 $cols["description"] = array(
214 "txt" => $lng->txt("description"),
215 "default" => true
216 );
217 $cols["type"] = array(
218 "txt" => $lng->txt("question_type"),
219 "default" => true
220 );
221 if (!$this->confirmdelete) {
222 $cols["points"] = array(
223 "txt" => $lng->txt("points"),
224 "default" => true
225 );
226 $cols["statistics"] = array(
227 "txt" => $lng->txt("statistics"),
228 "default" => true
229 );
230 $cols["author"] = array(
231 "txt" => $lng->txt("author"),
232 "default" => true
233 );
234 $cols['lifecycle'] = array(
235 'txt' => $lng->txt('qst_lifecycle'),
236 'default' => true
237 );
238 if ($this->isQuestionCommentingEnabled()) {
239 $cols["comments"] = array(
240 "txt" => $lng->txt("comments"),
241 "default" => true
242 );
243 }
244 $cols["created"] = array(
245 "txt" => $lng->txt("create_date"),
246 "default" => true
247 );
248 $cols["tstamp"] = array(
249 "txt" => $lng->txt("last_update"),
250 "default" => true
251 );
252 }
253 return $cols;
254 }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
$cols
Definition: xhr_table.php:11

References $cols, $DIC, ilTableGUI\$lng, isQuestionCommentingEnabled(), and ilLanguage\txt().

+ Here is the call graph for this function:

◆ getWriteAccess()

ilQuestionBrowserTableGUI::getWriteAccess ( )

Definition at line 529 of file class.ilQuestionBrowserTableGUI.php.

References $writeAccess.

Referenced by __construct(), and fillRow().

+ Here is the caller graph for this function:

◆ initFilter()

ilQuestionBrowserTableGUI::initFilter ( )

Init filter.

Reimplemented from ilTable2GUI.

Definition at line 259 of file class.ilQuestionBrowserTableGUI.php.

259 : void
260 {
261 global $DIC;
262 $lng = $DIC['lng'];
263
264 $ti = new ilTextInputGUI($lng->txt("title"), "title");
265 $ti->setMaxLength(64);
266 $ti->setValidationRegexp('/^[^%]+$/is');
267 $ti->setSize(20);
268 $this->addFilterItem($ti);
269 $ti->readFromSession();
270 $this->filter["title"] = $ti->getValue();
271
272 // description
273 $ti = new ilTextInputGUI($lng->txt("description"), "description");
274 $ti->setMaxLength(64);
275 $ti->setSize(20);
276 $ti->setValidationRegexp('/^[^%]+$/is');
277 $this->addFilterItem($ti);
278 $ti->readFromSession();
279 $this->filter["description"] = $ti->getValue();
280
281 if (!$this->confirmdelete) {
282 // author
283 $ti = new ilTextInputGUI($lng->txt("author"), "author");
284 $ti->setMaxLength(64);
285 $ti->setSize(20);
286 $ti->setValidationRegexp('/^[^%]+$/is');
287 $this->addFilterItem($ti);
288 $ti->readFromSession();
289 $this->filter["author"] = $ti->getValue();
290 }
291
292 // lifecycle
293 $lifecycleOptions = array_merge(
294 array('' => $this->lng->txt('qst_lifecycle_filter_all')),
295 ilAssQuestionLifecycle::getDraftInstance()->getSelectOptions($this->lng)
296 );
297 $lifecycleInp = new ilSelectInputGUI($this->lng->txt('qst_lifecycle'), 'lifecycle');
298 $lifecycleInp->setOptions($lifecycleOptions);
299 $this->addFilterItem($lifecycleInp);
300 $lifecycleInp->readFromSession();
301 $this->filter['lifecycle'] = $lifecycleInp->getValue();
302
304 $options = array();
305 $options[""] = $lng->txt('filter_all_question_types');
306 foreach ($types as $translation => $row) {
307 $options[$row['type_tag']] = $translation;
308 }
309
310 $si = new ilSelectInputGUI($this->lng->txt("question_type"), "type");
311 $si->setOptions($options);
312 $this->addFilterItem($si);
313 $si->readFromSession();
314 $this->filter["type"] = $si->getValue();
315
316 if ($this->parent_obj->object->getShowTaxonomies()) {
317 foreach ($this->taxIds as $taxId) {
318 if ($taxId == $this->parent_obj->object->getNavTaxonomyId()) {
319 continue;
320 }
321
322 $postvar = "tax_$taxId";
323
324 $inp = new ilTaxSelectInputGUI($taxId, $postvar, true);
325 $this->addFilterItem($inp);
326 $inp->readFromSession();
327 $this->filter[$postvar] = $inp->getValue();
328 }
329 }
330
331 // comments
332 if ($this->isQuestionCommentingEnabled()) {
333 $comments = new ilCheckboxInputGUI($lng->txt('ass_commented_questions_only'), 'commented');
334 $this->addFilterItem($comments);
335 $comments->readFromSession();
336 $this->filter['commented'] = $comments->getChecked();
337 }
338 }
This class represents a checkbox property in a property form.
static _getQuestionTypes($all_tags=false, $fixOrder=false, $withDeprecatedTypes=true)
This class represents a selection list property in a property form.
addFilterItem(ilTableFilterItem $a_input_item, bool $a_optional=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class represents a text property in a property form.
$comments

References $comments, $DIC, ilTableGUI\$lng, ilObjQuestionPool\_getQuestionTypes(), ilTable2GUI\addFilterItem(), ILIAS\UI\examples\Symbol\Glyph\Filter\filter(), ilAssQuestionLifecycle\getDraftInstance(), isQuestionCommentingEnabled(), ILIAS\Repository\lng(), and ilLanguage\txt().

Referenced by __construct().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isCommentsColumnSelected()

ilQuestionBrowserTableGUI::isCommentsColumnSelected ( )
protected

Definition at line 177 of file class.ilQuestionBrowserTableGUI.php.

177 : bool
178 {
179 return in_array('comments', $this->getSelectedColumns());
180 }

References ilTable2GUI\getSelectedColumns().

Referenced by setQuestionData().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isQuestionCommentingEnabled()

ilQuestionBrowserTableGUI::isQuestionCommentingEnabled ( )
Returns
bool

Definition at line 164 of file class.ilQuestionBrowserTableGUI.php.

References $questionCommentingEnabled.

Referenced by __construct(), fillRow(), getSelectableColumns(), initFilter(), and setQuestionData().

+ Here is the caller graph for this function:

◆ numericOrdering()

ilQuestionBrowserTableGUI::numericOrdering ( string  $a_field)
Parameters
string$a_field
Returns
bool

Reimplemented from ilTable2GUI.

Definition at line 538 of file class.ilQuestionBrowserTableGUI.php.

538 : bool
539 {
540 if (in_array($a_field, array('points', 'created', 'tstamp', 'comments'))) {
541 return true;
542 }
543
544 return false;
545 }

◆ setEditable()

ilQuestionBrowserTableGUI::setEditable (   $value)

Definition at line 514 of file class.ilQuestionBrowserTableGUI.php.

514 : void
515 {
516 $this->editable = $value;
517 }

◆ setQuestionCommentingEnabled()

ilQuestionBrowserTableGUI::setQuestionCommentingEnabled ( bool  $questionCommentingEnabled)
Parameters
bool$questionCommentingEnabled

Definition at line 172 of file class.ilQuestionBrowserTableGUI.php.

172 : void
173 {
174 $this->questionCommentingEnabled = $questionCommentingEnabled;
175 }

References $questionCommentingEnabled.

Referenced by __construct().

+ Here is the caller graph for this function:

◆ setQuestionData()

ilQuestionBrowserTableGUI::setQuestionData (   $questionData)

Definition at line 182 of file class.ilQuestionBrowserTableGUI.php.

182 : void
183 {
184 if ($this->isQuestionCommentingEnabled() && ($this->isCommentsColumnSelected() || $this->filter['commented'])) {
185 foreach ($questionData as $key => $data) {
186 $notes_context = $this->notes
187 ->data()
188 ->context(
189 $this->parent_obj->object->getId(),
190 $data['question_id'],
191 'quest'
192 );
193 $numComments = $this->notes
194 ->domain()
195 ->getNrOfCommentsForContext($notes_context);
196
197 if ($this->filter['commented'] && !$numComments) {
198 unset($questionData[$key]);
199 continue;
200 }
201
202 $questionData[$key]['comments'] = $numComments;
203 }
204 }
205
206 $this->setData($questionData);
207 }
setData(array $a_data)
Set table data.

References ilTableGUI\$data, ILIAS\LTI\ToolProvider\$key, ILIAS\UI\examples\Symbol\Glyph\Filter\filter(), isCommentsColumnSelected(), isQuestionCommentingEnabled(), and ilTable2GUI\setData().

+ Here is the call graph for this function:

◆ setWriteAccess()

ilQuestionBrowserTableGUI::setWriteAccess (   $value)

Definition at line 524 of file class.ilQuestionBrowserTableGUI.php.

524 : void
525 {
526 $this->writeAccess = $value;
527 }

Referenced by __construct().

+ Here is the caller graph for this function:

Field Documentation

◆ $confirmdelete

ilQuestionBrowserTableGUI::$confirmdelete
protected

Definition at line 37 of file class.ilQuestionBrowserTableGUI.php.

Referenced by __construct().

◆ $editable

ilQuestionBrowserTableGUI::$editable = true
protected

Definition at line 34 of file class.ilQuestionBrowserTableGUI.php.

Referenced by getEditable().

◆ $notes

ILIAS Notes Service ilQuestionBrowserTableGUI::$notes
protected

Definition at line 31 of file class.ilQuestionBrowserTableGUI.php.

◆ $questionCommentingEnabled

ilQuestionBrowserTableGUI::$questionCommentingEnabled = false
protected

◆ $renderer

ILIAS UI Renderer ilQuestionBrowserTableGUI::$renderer
protected

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

◆ $request

ILIAS TestQuestionPool InternalRequestService ilQuestionBrowserTableGUI::$request
private

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

◆ $taxIds

ilQuestionBrowserTableGUI::$taxIds = array()
protected

Definition at line 39 of file class.ilQuestionBrowserTableGUI.php.

Referenced by __construct().

◆ $totalPoints

ilQuestionBrowserTableGUI::$totalPoints = 0
protected

Definition at line 36 of file class.ilQuestionBrowserTableGUI.php.

◆ $ui_factory

ILIAS UI Factory ilQuestionBrowserTableGUI::$ui_factory
protected

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

◆ $writeAccess

ilQuestionBrowserTableGUI::$writeAccess = false
protected

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

Referenced by getWriteAccess().


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