ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilExerciseSubmissionTableGUI Class Reference

Exercise submission table. More...

+ Inheritance diagram for ilExerciseSubmissionTableGUI:
+ Collaboration diagram for ilExerciseSubmissionTableGUI:

Public Member Functions

 __construct ($a_parent_obj, $a_parent_cmd, ilObjExercise $a_exc, $a_item_id)
 Constructor. More...
 
 initFilter ()
 
 getSelectableColumns ()
 
 render ()
 
- Public Member Functions inherited from ilTable2GUI
 __construct ($a_parent_obj, $a_parent_cmd="", $a_template_context="")
 ilTable2GUI constructor. More...
 
 setOpenFormTag ($a_val)
 Set open form tag. More...
 
 getOpenFormTag ()
 Get open form tag. More...
 
 setCloseFormTag ($a_val)
 Set close form tag. More...
 
 getCloseFormTag ()
 Get close form tag. More...
 
 determineLimit ()
 Determine the limit. More...
 
 getSelectableColumns ()
 Get selectable columns. More...
 
 determineSelectedColumns ()
 Determine selected columns. More...
 
 isColumnSelected ($a_col)
 Is given column selected? More...
 
 getSelectedColumns ()
 Get selected columns. More...
 
 executeCommand ()
 Execute command. More...
 
 resetOffset ($a_in_determination=false)
 Reset offset. More...
 
 initFilter ()
 Init filter. More...
 
 getParentObject ()
 Get parent object. More...
 
 getParentCmd ()
 Get parent command. More...
 
 setTopAnchor ($a_val)
 Set top anchor. More...
 
 getTopAnchor ()
 Get top anchor. More...
 
 setNoEntriesText ($a_text)
 Set text for an empty table. More...
 
 getNoEntriesText ()
 Get text for an empty table. More...
 
 setIsDataTable ($a_val)
 Set is data table. More...
 
 getIsDataTable ()
 Get is data table. More...
 
 setEnableTitle ($a_enabletitle)
 Set Enable Title. More...
 
 getEnableTitle ()
 Get Enable Title. More...
 
 setEnableHeader ($a_enableheader)
 Set Enable Header. More...
 
 getEnableHeader ()
 Get Enable Header. More...
 
 setEnableNumInfo ($a_val)
 Set enable num info. More...
 
 getEnableNumInfo ()
 Get enable num info. More...
 
 setTitle ($a_title, $a_icon=0, $a_icon_alt=0)
 Set title and title icon. More...
 
 setDescription ($a_val)
 Set description. More...
 
 getDescription ()
 Get description. More...
 
 setOrderField ($a_order_field)
 set order column More...
 
 getOrderField ()
 
 setData ($a_data)
 
 getData ()
 
 dataExists ()
 
 setPrefix ($a_prefix)
 
 getPrefix ()
 
 addFilterItem ($a_input_item, $a_optional=false)
 Add filter item. More...
 
 addFilterItemByMetaType ($id, $type=self::FILTER_TEXT, $a_optional=false, $caption=null)
 Add filter by standard type. More...
 
 getFilterItems ($a_optionals=false)
 Get filter items. More...
 
 getFilterItemByPostVar ($a_post_var)
 
 setFilterCols ($a_val)
 Set filter columns. More...
 
 getFilterCols ()
 Get filter columns. More...
 
 setDisableFilterHiding ($a_val=true)
 Set disable filter hiding. More...
 
 getDisableFilterHiding ()
 Get disable filter hiding. More...
 
 isFilterSelected ($a_col)
 Is given filter selected? More...
 
 getSelectedFilters ()
 Get selected filters. More...
 
 determineSelectedFilters ()
 Determine selected filters. More...
 
 setCustomPreviousNext ($a_prev_link, $a_next_link)
 Set custom previous/next links. More...
 
 setFormAction ($a_form_action, $a_multipart=false)
 Set Form action parameter. More...
 
 getFormAction ()
 Get Form action parameter. More...
 
 setFormName ($a_formname="")
 Set Form name. More...
 
 getFormName ()
 Get Form name. More...
 
 setId ($a_val)
 Set id. More...
 
 getId ()
 Get element id. More...
 
 setDisplayAsBlock ($a_val)
 Set display as block. More...
 
 getDisplayAsBlock ()
 Get display as block. More...
 
 getSelectAllCheckbox ()
 Get the name of the checkbox that should be toggled with a select all button. More...
 
 setSelectAllCheckbox ($a_select_all_checkbox, $a_select_all_on_top=false)
 Set the name of the checkbox that should be toggled with a select all button. More...
 
 setExternalSorting ($a_val)
 Set external sorting. More...
 
 getExternalSorting ()
 Get external sorting. More...
 
 setFilterCommand ($a_val, $a_caption=null)
 Set filter command. More...
 
 getFilterCommand ()
 Get filter command. More...
 
 setResetCommand ($a_val, $a_caption=null)
 Set reset filter command. More...
 
 getResetCommand ()
 Get reset filter command. More...
 
 setExternalSegmentation ($a_val)
 Set external segmentation. More...
 
 getExternalSegmentation ()
 Get external segmentation. More...
 
 setRowTemplate ($a_template, $a_template_dir="")
 Set row template. More...
 
 setDefaultOrderField ($a_defaultorderfield)
 Set Default order field. More...
 
 getDefaultOrderField ()
 Get Default order field. More...
 
 setDefaultOrderDirection ($a_defaultorderdirection)
 Set Default order direction. More...
 
 getDefaultOrderDirection ()
 Get Default order direction. More...
 
 setDefaultFilterVisiblity ($a_status)
 Set default filter visiblity. More...
 
 getDefaultFilterVisibility ()
 Get default filter visibility. More...
 
 clearCommandButtons ()
 
 addCommandButton ($a_cmd, $a_text, $a_onclick='', $a_id="", $a_class=null)
 Add Command button. More...
 
 addCommandButtonInstance (ilButtonBase $a_button)
 Add Command button instance. More...
 
 addSelectionButton ($a_sel_var, $a_options, $a_cmd, $a_text, $a_default_selection='')
 Add Selection List + Command button. More...
 
 addMultiItemSelectionButton ($a_sel_var, $a_options, $a_cmd, $a_text, $a_default_selection='')
 Add Selection List + Command button for selected items. More...
 
 setCloseCommand ($a_link)
 Add command for closing table. More...
 
 addMultiCommand ($a_cmd, $a_text)
 Add Command button. More...
 
 addHiddenInput ($a_name, $a_value)
 Add Hidden Input field. More...
 
 addHeaderCommand ($a_href, $a_text, $a_target="", $a_img="")
 Add Header Command (Link) (Image needed for now) More...
 
 setTopCommands ($a_val)
 Set top commands (display command buttons on top of table, too) More...
 
 getTopCommands ()
 Get top commands (display command buttons on top of table, too) More...
 
 addColumn ( $a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="", $a_tooltip_with_html=false)
 Add a column to the header. More...
 
 getNavParameter ()
 
 setOrderLink ($sort_field, $order_dir)
 
 fillHeader ()
 
 determineOffsetAndOrder ($a_omit_offset=false)
 Determine offset and order. More...
 
 storeNavParameter ()
 
 getHTML ()
 Get HTML. More...
 
 numericOrdering ($a_field)
 Should this field be sorted numeric? More...
 
 render ()
 render table public More...
 
 writeFilterToSession ()
 Write filter values to session. More...
 
 resetFilter ()
 Reset filter. More...
 
 fillFooter ()
 Fill footer row. More...
 
 getLinkbar ($a_num)
 Get previous/next linkbar. More...
 
 fillHiddenRow ()
 
 fillActionRow ()
 Fill Action Row. More...
 
 setHeaderHTML ($html)
 set header html More...
 
 storeProperty ($type, $value)
 Store table property. More...
 
 loadProperty ($type)
 Load table property. More...
 
 getCurrentState ()
 get current settings for order, limit, columns and filter More...
 
 setContext ($id)
 Set context. More...
 
 getContext ()
 Get context. More...
 
 setShowRowsSelector ($a_value)
 Toggle rows-per-page selector. More...
 
 getShowRowsSelector ()
 Get rows-per-page selector state. More...
 
 setShowTemplates ($a_value)
 Toggle templates. More...
 
 getShowTemplates ()
 Get template state. More...
 
 restoreTemplate ($a_name)
 Restore state from template. More...
 
 saveTemplate ($a_name)
 Save current state as template. More...
 
 deleteTemplate ($a_name)
 Delete template. More...
 
 getLimit ()
 Get limit. More...
 
 getOffset ()
 Get offset. More...
 
 setExportFormats (array $formats)
 Set available export formats. More...
 
 setPrintMode ($a_value=false)
 Toogle print mode. More...
 
 getPrintMode ()
 Get print mode. More...
 
 getExportMode ()
 Was export activated? More...
 
 exportData ($format, $send=false)
 Export and optionally send current table data. More...
 
 setEnableAllCommand ($a_value)
 Enable actions for all entries in current result. More...
 
 setRowSelectorLabel ($row_selector_label)
 
 getRowSelectorLabel ()
 
 setPreventDoubleSubmission ($a_val)
 Set prevent double submission. More...
 
 getPreventDoubleSubmission ()
 Get prevent double submission. More...
 
 setLimit ($a_limit=0, $a_default_limit=0)
 
- Public Member Functions inherited from ilTableGUI
 __construct ($a_data=0, $a_global_tpl=true)
 Constructor. More...
 
 setTemplate ($a_tpl)
 set template public More...
 
getTemplateObject ()
 
 setData ($a_data)
 set table data public More...
 
 getData ()
 
 setTitle ($a_title, $a_icon=0, $a_icon_alt=0)
 set table title public More...
 
 setHelp ($a_help_page, $a_help_icon, $a_help_icon_alt=0)
 set table help page public More...
 
 setHeaderNames ($a_header_names)
 set table header names public More...
 
 getColumnCount ()
 Returns the column count based on the number of the header row columns public. More...
 
 setHeaderVars ($a_header_vars, $a_header_params=0)
 set table header vars public More...
 
 setColumnWidth ($a_column_width)
 set table column widths public More...
 
 setOneColumnWidth ($a_column_width, $a_column_number)
 set one table column width public More...
 
 setMaxCount ($a_max_count)
 set max. More...
 
 setLimit ($a_limit=0, $a_default_limit=0)
 set max. More...
 
 getLimit ()
 Get limit. More...
 
 setPrefix ($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) public More...
 
 setOffset ($a_offset)
 set dataset offset public More...
 
 getOffset ()
 Get offset. More...
 
 setOrderColumn ($a_order_column=0, $a_default_column=0)
 set order column public More...
 
 getOrderColumn ()
 Get order column. More...
 
 setOrderDirection ($a_order_direction)
 set order direction public More...
 
 getOrderDirection ()
 Get order direction. More...
 
 setFooter ($a_style, $a_previous=0, $a_next=0)
 set order direction public More...
 
 enable ($a_module_name)
 enables particular modules of table More...
 
 disable ($a_module_name)
 diesables particular modules of table More...
 
 sortData ()
 
 render ()
 render table public More...
 
 renderHeader ()
 
 setOrderLink ($key, $order_dir)
 
 setStyle ($a_element, $a_style)
 
 getStyle ($a_element)
 
 setBase ($a_base)
 Set Base script name (deprecated, only use this for workarounds). More...
 
 getBase ()
 Get Base script name (deprecated, only use this for workarounds). More...
 
 getFormName ()
 
 setFormName ($a_name="cmd")
 
 getSelectAllCheckbox ()
 
 setSelectAllCheckbox ($a_select_all_checkbox)
 
 clearActionButtons ()
 
 addActionButton ($btn_name, $btn_value)
 

Data Fields

const MODE_BY_ASSIGNMENT = 1
 
const MODE_BY_USER = 2
 
- 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
 $title
 
 $icon
 
 $icon_alt
 
 $help_page
 
 $help_icon
 
 $help_icon_alt
 
 $header_names
 
 $header_vars
 
 $linkbar_vars
 
 $data
 
 $column_count
 
 $column_width
 
 $max_count
 
 $limit
 
 $max_limit = false
 
 $offset
 
 $order_column
 
 $order_direction
 
 $footer_style
 
 $footer_previous
 
 $footer_next
 
 $lang_support = true
 
 $global_tpl
 
 $form_name
 
 $select_all_checkbox
 
 $action_buttons
 
 $prefix
 
 $base = ""
 
 $enabled
 
 $styles
 

Protected Member Functions

 initMode ($a_item_id)
 
 parseData ()
 
 parseModeColumns ()
 
 parseColumns ()
 
 parseRow ($a_user_id, ilExAssignment $a_ass, array $a_row)
 
- Protected Member Functions inherited from ilTable2GUI
 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, $a_element)
 Check if filter element is based on adv md. More...
 
 fillRow ($a_set)
 Standard Version of Fill Row. More...
 
 getFilterValue (ilFormPropertyGUI $a_item)
 Get current filter value. More...
 
 SetFilterValue (ilFormPropertyGUI $a_item, $a_value)
 Set current filter value. More...
 
 fillMetaExcel (ilExcel $a_excel, &$a_row)
 Add meta information to excel export. More...
 
 fillHeaderExcel (ilExcel $a_excel, &$a_row)
 Excel Version of Fill Header. More...
 
 fillRowExcel (ilExcel $a_excel, &$a_row, $a_set)
 Excel Version of Fill Row. More...
 
 fillMetaCSV ($a_csv)
 Add meta information to csv export. More...
 
 fillHeaderCSV ($a_csv)
 CSV Version of Fill Header. More...
 
 fillRowCSV ($a_csv, $a_set)
 CSV Version of Fill Row. More...
 

Protected Attributes

 $access
 
 $exc
 
 $mode
 
 $filter
 
 $comment_modals = array()
 
 $cols_mandatory = array("name", "status")
 
 $cols_default = array("login", "submission", "idl", "calc_deadline")
 
 $cols_order
 
- Protected Attributes inherited from ilTable2GUI
 $ctrl
 
 $tpl
 
 $parent_obj
 
 $parent_cmd
 
 $close_command = ""
 
 $top_anchor = "il_table_top"
 
 $filters = array()
 
 $optional_filters = array()
 
 $filter_cmd = 'applyFilter'
 
 $reset_cmd = 'resetFilter'
 
 $filter_cols = 5
 
 $ext_sort = false
 
 $ext_seg = false
 
 $context = ""
 
 $mi_sel_buttons = []
 
 $disable_filter_hiding = false
 
 $selected_filter = false
 
 $top_commands = true
 
 $selectable_columns = array()
 
 $selected_column = array()
 
 $show_templates = false
 
 $show_rows_selector = true
 
 $rows_selector_off = false
 
 $nav_determined = false
 
 $limit_determined = false
 
 $filters_determined = false
 
 $columns_determined = false
 
 $open_form_tag = true
 
 $close_form_tag = true
 
 $export_formats = []
 
 $export_mode
 
 $print_mode
 
 $enable_command_for_all
 
 $restore_filter
 
 $restore_filter_values
 
 $default_filter_visibility = false
 
 $sortable_fields = array()
 
 $prevent_double_submission = true
 
 $row_selector_label
 
 $select_all_on_top = false
 
 $sel_buttons = []
 
- Protected Attributes inherited from ilTableGUI
 $tpl
 
 $lng
 

Additional Inherited Members

- Static Public Member Functions inherited from ilTable2GUI
static getAllCommandLimit ()
 Get maximum number of entries to enable actions for all. More...
 

Detailed Description

Exercise submission table.

Author
Jörg Lützenkirchen luetz.nosp@m.enki.nosp@m.rchen.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$

Definition at line 17 of file class.ilExerciseSubmissionTableGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilExerciseSubmissionTableGUI::__construct (   $a_parent_obj,
  $a_parent_cmd,
ilObjExercise  $a_exc,
  $a_item_id 
)

Constructor.

Parameters
string$a_parent_obj
string$a_parent_cmd
ilObjExercise$a_exc
int$a_item_id
Returns
self

Definition at line 48 of file class.ilExerciseSubmissionTableGUI.php.

References $columns, $DIC, $id, $ilCtrl, ilTable2GUI\addColumn(), ilTable2GUI\addMultiCommand(), ilTable2GUI\getParentCmd(), ilTable2GUI\getSelectedColumns(), initFilter(), initMode(), parseColumns(), parseData(), ilTable2GUI\setData(), ilTable2GUI\setDefaultOrderDirection(), ilTable2GUI\setDefaultOrderField(), ilTable2GUI\setFilterCommand(), ilTable2GUI\setFormAction(), ilTable2GUI\setFormName(), ilTable2GUI\setResetCommand(), ilTable2GUI\setRowTemplate(), and ilTable2GUI\setShowTemplates().

49  {
50  global $DIC;
51 
52  $this->ctrl = $DIC->ctrl();
53  $this->access = $DIC->access();
54  $this->tpl = $DIC["tpl"];
55  $this->lng = $DIC->language();
56 
57 
58  $ilCtrl = $DIC->ctrl();
59 
60  $this->exc = $a_exc;
61 
62  $this->initMode($a_item_id);
63 
64  parent::__construct($a_parent_obj, $a_parent_cmd);
65 
66  $this->setShowTemplates(true);
67 
68  $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
69  $this->setRowTemplate("tpl.exc_members_row.html", "Modules/Exercise");
70 
71  #25100
72  if ($this->mode == self::MODE_BY_ASSIGNMENT) {
73  $this->setDefaultOrderField("name");
74  $this->setDefaultOrderDirection("asc");
75  }
76 
77 
78  // columns
79 
80  $this->addColumn("", "", "1", true);
81 
82  $selected = $this->getSelectedColumns();
83  $columns = $this->parseColumns();
84  foreach ($this->cols_order as $id) {
85  if (in_array($id, $this->cols_mandatory) ||
86  in_array($id, $selected)) {
87  if (array_key_exists($id, $columns)) {
88  $col = $columns[$id];
89  $this->addColumn($col[0], $col[1]);
90  }
91  }
92  }
93 
94  $this->addColumn($this->lng->txt("actions"));
95 
96 
97  // multi actions
98 
99  $this->addMultiCommand("saveStatusSelected", $this->lng->txt("exc_save_selected"));
100 
101  $this->setFormName("ilExcIDlForm");
102 
103  // see 0021530 and parseRow here with similar action per user
104  if ($this->mode == self::MODE_BY_ASSIGNMENT &&
105  $this->ass->hasActiveIDl() &&
106  !$this->ass->hasReadOnlyIDl()) {
107  $this->addMultiCommand("setIndividualDeadline", $this->lng->txt("exc_individual_deadline_action"));
108  }
109 
110  if ($this->exc->hasTutorFeedbackMail() &&
111  $this->mode == self::MODE_BY_ASSIGNMENT) {
112  $this->addMultiCommand("redirectFeedbackMail", $this->lng->txt("exc_tbl_action_feedback_mail"));
113  }
114 
115  $this->addMultiCommand("sendMembers", $this->lng->txt("exc_send_assignment"));
116 
117  if ($this->mode == self::MODE_BY_ASSIGNMENT &&
118  $this->ass &&
119  $this->ass->hasTeam()) {
120  $this->addMultiCommand("createTeams", $this->lng->txt("exc_team_multi_create"));
121  $this->addMultiCommand("dissolveTeams", $this->lng->txt("exc_team_multi_dissolve"));
122  }
123 
124  if ($this->mode == self::MODE_BY_ASSIGNMENT) {
125  $this->addMultiCommand("confirmDeassignMembers", $this->lng->txt("exc_deassign_members"));
126  }
127 
128  $this->setFilterCommand($this->getParentCmd() . "Apply");
129  $this->setResetCommand($this->getParentCmd() . "Reset");
130 
131  $this->initFilter();
132  $this->setData($this->parseData());
133 
134  include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
135  }
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
global $DIC
Definition: saml.php:7
setShowTemplates($a_value)
Toggle templates.
if(!array_key_exists('StateId', $_REQUEST)) $id
getParentCmd()
Get parent command.
global $ilCtrl
Definition: ilias.php:18
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
setResetCommand($a_val, $a_caption=null)
Set reset filter command.
addMultiCommand($a_cmd, $a_text)
Add Command button.
getSelectedColumns()
Get selected columns.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
setFormName($a_formname="")
Set Form name.
addColumn( $a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="", $a_tooltip_with_html=false)
Add a column to the header.
if(! $in) $columns
Definition: Utf8Test.php:45
setFilterCommand($a_val, $a_caption=null)
Set filter command.
+ Here is the call graph for this function:

Member Function Documentation

◆ getSelectableColumns()

ilExerciseSubmissionTableGUI::getSelectableColumns ( )

Definition at line 171 of file class.ilExerciseSubmissionTableGUI.php.

References $cols, $columns, $id, and parseColumns().

172  {
173  $cols = array();
174 
175  $columns = $this->parseColumns();
176  foreach ($this->cols_order as $id) {
177  if (in_array($id, $this->cols_mandatory)) {
178  continue;
179  }
180 
181  if (array_key_exists($id, $columns)) {
182  $col = $columns[$id];
183 
184  $cols[$id] = array(
185  "txt" => $col[0],
186  "default" => in_array($id, $this->cols_default)
187  );
188  }
189  }
190  return $cols;
191  }
if(!array_key_exists('StateId', $_REQUEST)) $id
if(! $in) $columns
Definition: Utf8Test.php:45
$cols
Definition: xhr_table.php:11
+ Here is the call graph for this function:

◆ initFilter()

ilExerciseSubmissionTableGUI::initFilter ( )

Definition at line 137 of file class.ilExerciseSubmissionTableGUI.php.

References PHPMailer\PHPMailer\$options, ilTable2GUI\addFilterItemByMetaType(), initMode(), parseData(), and parseModeColumns().

Referenced by __construct().

138  {
139  if ($this->mode == self::MODE_BY_ASSIGNMENT) {
140  $item = $this->addFilterItemByMetaType("flt_name", self::FILTER_TEXT, false, $this->lng->txt("name") . " / " . $this->lng->txt("login"));
141  $this->filter["name"] = $item->getValue();
142  }
143 
144  $this->lng->loadLanguageModule("search");
145  $options = array(
146  "" => $this->lng->txt("search_any"),
147  "notgraded" => $this->lng->txt("exc_notgraded"),
148  "passed" => $this->lng->txt("exc_passed"),
149  "failed" => $this->lng->txt("exc_failed")
150  );
151  $item = $this->addFilterItemByMetaType("flt_status", self::FILTER_SELECT, false, $this->lng->txt("exc_tbl_status"));
152  $item->setOptions($options);
153  $this->filter["status"] = $item->getValue();
154 
155  $options = array(
156  "" => $this->lng->txt("search_any"),
157  "y" => $this->lng->txt("exc_tbl_filter_has_submission"),
158  "n" => $this->lng->txt("exc_tbl_filter_has_no_submission")
159  );
160  $item = $this->addFilterItemByMetaType("flt_subm", self::FILTER_SELECT, false, $this->lng->txt("exc_tbl_filter_submission"));
161  $item->setOptions($options);
162  $this->filter["subm"] = $item->getValue();
163  }
addFilterItemByMetaType($id, $type=self::FILTER_TEXT, $a_optional=false, $caption=null)
Add filter by standard type.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initMode()

ilExerciseSubmissionTableGUI::initMode (   $a_item_id)
abstractprotected

Referenced by __construct(), and initFilter().

+ Here is the caller graph for this function:

◆ parseColumns()

ilExerciseSubmissionTableGUI::parseColumns ( )
protected

Definition at line 193 of file class.ilExerciseSubmissionTableGUI.php.

References $cols, and parseModeColumns().

Referenced by __construct(), and getSelectableColumns().

194  {
195  $cols = $this->parseModeColumns();
196 
197  $cols["submission"] = array($this->lng->txt("exc_tbl_submission_date"), "submission");
198 
199  $cols["status"] = array($this->lng->txt("exc_tbl_status"), "status");
200  $cols["mark"] = array($this->lng->txt("exc_tbl_mark"), "mark");
201  $cols["status_time"] = array($this->lng->txt("exc_tbl_status_time"), "status_time");
202 
203  $cols["sent_time"] = array($this->lng->txt("exc_tbl_sent_time"), "sent_time");
204 
205  if ($this->exc->hasTutorFeedbackText() ||
206  $this->exc->hasTutorFeedbackMail() ||
207  $this->exc->hasTutorFeedbackFile()) {
208  $cols["feedback_time"] = array($this->lng->txt("exc_tbl_feedback_time"), "feedback_time");
209  }
210 
211  if ($this->exc->hasTutorFeedbackText()) {
212  $cols["comment"] = array($this->lng->txt("exc_tbl_comment"), "comment");
213  }
214 
215  $cols["notice"] = array($this->lng->txt("exc_tbl_notice"), "notice");
216 
217  return $cols;
218  }
$cols
Definition: xhr_table.php:11
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parseData()

ilExerciseSubmissionTableGUI::parseData ( )
abstractprotected

Referenced by __construct(), initFilter(), and ilExParticipantTableGUI\initMode().

+ Here is the caller graph for this function:

◆ parseModeColumns()

ilExerciseSubmissionTableGUI::parseModeColumns ( )
abstractprotected

Referenced by initFilter(), and parseColumns().

+ Here is the caller graph for this function:

◆ parseRow()

ilExerciseSubmissionTableGUI::parseRow (   $a_user_id,
ilExAssignment  $a_ass,
array  $a_row 
)
protected

Definition at line 220 of file class.ilExerciseSubmissionTableGUI.php.

References $access, ilTable2GUI\$ctrl, $ilCtrl, $info, $name, $url, ilExAssignment\afterDeadlineStrict(), ilGlyphGUI\CLOSE, ilFSStorageExercise\countFeedbackFiles(), ilDatePresentation\formatDate(), ilGlyphGUI\get(), ilExAssignment\getId(), ilTable2GUI\getId(), ilModalGUI\getInstance(), ilObjectFactory\getInstanceByObjId(), ilTable2GUI\getParentCmd(), ilTable2GUI\getParentObject(), ilTable2GUI\getSelectedColumns(), ilExAssignmentTeam\getTeamId(), ilExAssignment\hasActiveIDl(), ilExAssignment\hasReadOnlyIDl(), ilExAssignment\hasTeam(), IL_CAL_DATETIME, IL_CAL_UNIX, ilUtil\prepareFormOutput(), and ilFormPropertyGUI\setInfo().

Referenced by ilExParticipantTableGUI\fillRow(), and ilExerciseMemberTableGUI\fillRow().

221  {
223  $ilAccess = $this->access;
224 
225  $has_no_team_yet = ($a_ass->hasTeam() &&
226  !ilExAssignmentTeam::getTeamId($a_ass->getId(), $a_user_id));
227 
228 
229  // static columns
230 
231  if ($this->mode == self::MODE_BY_ASSIGNMENT) {
232  if (!$a_ass->hasTeam()) {
233  $this->tpl->setVariable("VAL_NAME", $a_row["name"]);
234 
235  // #18327
236  if (!$ilAccess->checkAccessOfUser($a_user_id, "read", "", $this->exc->getRefId()) &&
237  is_array($info = $ilAccess->getInfo())) {
238  $this->tpl->setCurrentBlock('access_warning');
239  $this->tpl->setVariable('PARENT_ACCESS', $info[0]["text"]);
240  $this->tpl->parseCurrentBlock();
241  }
242  } else {
243  asort($a_row["team"]);
244  foreach ($a_row["team"] as $team_member_id => $team_member_name) { // #10749
245  if (sizeof($a_row["team"]) > 1) {
246  $ilCtrl->setParameterByClass("ilExSubmissionTeamGUI", "id", $team_member_id);
247  $url = $ilCtrl->getLinkTargetByClass("ilExSubmissionTeamGUI", "confirmRemoveTeamMember");
248  $ilCtrl->setParameterByClass("ilExSubmissionTeamGUI", "id", "");
249 
250  include_once "Services/UIComponent/Glyph/classes/class.ilGlyphGUI.php";
251 
252  $this->tpl->setCurrentBlock("team_member_removal_bl");
253  $this->tpl->setVariable("URL_TEAM_MEMBER_REMOVAL", $url);
254  $this->tpl->setVariable(
255  "TXT_TEAM_MEMBER_REMOVAL",
256  ilGlyphGUI::get(ilGlyphGUI::CLOSE, $this->lng->txt("remove"))
257  );
258  $this->tpl->parseCurrentBlock();
259  }
260 
261  // #18327
262  if (!$ilAccess->checkAccessOfUser($team_member_id, "read", "", $this->exc->getRefId()) &&
263  is_array($info = $ilAccess->getInfo())) {
264  $this->tpl->setCurrentBlock('team_access_warning');
265  $this->tpl->setVariable('TEAM_PARENT_ACCESS', $info[0]["text"]);
266  $this->tpl->parseCurrentBlock();
267  }
268 
269  $this->tpl->setCurrentBlock("team_member");
270  $this->tpl->setVariable("TXT_MEMBER_NAME", $team_member_name);
271  $this->tpl->parseCurrentBlock();
272  }
273 
274  if ($has_no_team_yet) {
275  // #11957
276  $this->tpl->setCurrentBlock("team_info");
277  $this->tpl->setVariable("TXT_TEAM_INFO", $this->lng->txt("exc_no_team_yet"));
278  } else {
279  $this->tpl->setCurrentBlock("team_info");
280  $this->tpl->setVariable("TXT_TEAM_INFO", "(" . $a_row["submission_obj"]->getTeam()->getId() . ")");
281  }
282  }
283  } else {
284  $this->tpl->setVariable("VAL_NAME", $a_row["name"]);
285  }
286 
287  // do not grade or mark if no team yet
288  if (!$has_no_team_yet) {
289  // status
290  $this->tpl->setVariable("SEL_" . strtoupper($a_row["status"]), ' selected="selected" ');
291  $this->tpl->setVariable("TXT_NOTGRADED", $this->lng->txt("exc_notgraded"));
292  $this->tpl->setVariable("TXT_PASSED", $this->lng->txt("exc_passed"));
293  $this->tpl->setVariable("TXT_FAILED", $this->lng->txt("exc_failed"));
294  } else {
295  $nt_colspan = in_array("mark", $this->getSelectedColumns())
296  ? 2
297  : 1;
298 
299  $this->tpl->setVariable("NO_TEAM_COLSPAN", $nt_colspan);
300  }
301 
302 
303  // comment modal
304 
305  if ($this->exc->hasTutorFeedbackText()) {
306  $comment_id = "excasscomm_" . $a_ass->getId() . "_" . $a_user_id;
307 
308  $modal = ilModalGUI::getInstance();
309  $modal->setId($comment_id);
310  $modal->setHeading($this->lng->txt("exc_tbl_action_feedback_text"));
311 
312  $lcomment_form = new ilPropertyFormGUI();
313  $lcomment_form->setId($comment_id);
314  $lcomment_form->setPreventDoubleSubmission(false);
315 
316  $lcomment = new ilTextAreaInputGUI($this->lng->txt("exc_comment_for_learner"), "lcomment_" . $a_ass->getId() . "_" . $a_user_id);
317  $lcomment->setInfo($this->lng->txt("exc_comment_for_learner_info"));
318  $lcomment->setValue($a_row["comment"]);
319  $lcomment->setCols(45);
320  $lcomment->setRows(10);
321  $lcomment_form->addItem($lcomment);
322 
323  $lcomment_form->addCommandButton("save", $this->lng->txt("save"));
324  // $lcomment_form->addCommandButton("cancel", $lng->txt("cancel"));
325 
326  $modal->setBody($lcomment_form->getHTML());
327 
328  $this->comment_modals[] = $modal->getHTML();
329  unset($modal);
330  }
331 
332 
333  // selectable columns
334 
335  foreach ($this->getSelectedColumns() as $col) {
336  $include_seconds = false;
337  switch ($col) {
338  case "image":
339  if (!$a_ass->hasTeam()) {
340  include_once "./Services/Object/classes/class.ilObjectFactory.php";
341  if ($usr_obj = ilObjectFactory::getInstanceByObjId($a_user_id, false)) {
342  $this->tpl->setVariable("VAL_IMAGE", $usr_obj->getPersonalPicturePath("xxsmall"));
343  $this->tpl->setVariable("TXT_IMAGE", $this->lng->txt("personal_picture"));
344  }
345  }
346  break;
347 
348  case "team_members":
349  if ($a_ass->hasTeam()) {
350  if (!sizeof($a_row["team"])) {
351  $this->tpl->setVariable("VAL_TEAM_MEMBER", $this->lng->txt("exc_no_team_yet"));
352  } else {
353  foreach ($a_row["team"] as $name) {
354  $this->tpl->setCurrentBlock("team_member_bl");
355  $this->tpl->setVariable("VAL_TEAM_MEMBER", $name);
356  $this->tpl->parseCurrentBlock();
357  }
358  }
359  } else {
360  $this->tpl->setVariable("VAL_TEAM_MEMBER", " ");
361  }
362  break;
363 
364  case "idl":
365  $this->tpl->setVariable(
366  "VAL_" . strtoupper($col),
367  $a_row[$col]
369  : " "
370  );
371  break;
372 
373  case "calc_deadline":
374  $this->tpl->setVariable(
375  "VAL_" . strtoupper($col),
376  $a_row[$col]
378  : " "
379  );
380  break;
381 
382  case "mark":
383  if ($has_no_team_yet) {
384  break;
385  }
386  // fallthrough
387 
388  // no break
389  case "notice":
390  // see #22076
391  $this->tpl->setVariable("VAL_" . strtoupper($col), ilUtil::prepareFormOutput(trim($a_row[$col])));
392  break;
393 
394  case "comment":
395  // for js-updating
396  $this->tpl->setVariable("LCOMMENT_ID", $comment_id . "_snip");
397 
398  // see #22076
399  $this->tpl->setVariable("VAL_" . strtoupper($col), (trim($a_row[$col]) !== "")
400  ? nl2br(trim($a_row[$col]))
401  : " ");
402  break;
403 
404  case "submission":
405  $include_seconds = true;
406  if ($a_row["submission_obj"]) {
407  foreach ($a_row["submission_obj"]->getFiles() as $file) {
408  if ($file["late"]) {
409  $this->tpl->setVariable("TXT_LATE", $this->lng->txt("exc_late_submission"));
410  break;
411  }
412  }
413  }
414  // fallthrough
415 
416  // no break
417  case "feedback_time":
418  case "status_time":
419  case "sent_time":
420  $this->tpl->setVariable(
421  "VAL_" . strtoupper($col),
422  $a_row[$col]
424  new ilDateTime($a_row[$col], IL_CAL_DATETIME),
425  false,
426  false,
427  $include_seconds
428  )
429  : " "
430  );
431  break;
432 
433  case "login":
434  if ($a_ass->hasTeam()) {
435  break;
436  }
437  // fallthrough
438 
439  // no break
440  default:
441  $this->tpl->setVariable("VAL_" . strtoupper($col), $a_row[$col]
442  ? trim($a_row[$col])
443  : " ");
444  break;
445  }
446  }
447 
448 
449  // actions
450 
451  include_once "Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php";
452  $actions = new ilAdvancedSelectionListGUI();
453  $actions->setId($a_ass->getId() . "_" . $a_user_id);
454  $actions->setListTitle($this->lng->txt("actions"));
455 
456  $file_info = $a_row["submission_obj"]->getDownloadedFilesInfoForTableGUIS($this->getParentObject(), $this->getParentCmd());
457 
458  $counter = $file_info["files"]["count"];
459  if ($counter) {
460  if ($file_info["files"]["download_url"]) {
461  $actions->addItem(
462  $file_info["files"]["download_txt"] . " (" . $counter . ")",
463  "",
464  $file_info["files"]["download_url"]
465  );
466  }
467 
468  if ($file_info["files"]["download_new_url"]) {
469  $actions->addItem(
470  $file_info["files"]["download_new_txt"],
471  "",
472  $file_info["files"]["download_new_url"]
473  );
474  }
475  }
476 
477  if (!$has_no_team_yet &&
478  $a_ass->hasActiveIDl() &&
479  !$a_ass->hasReadOnlyIDl()) {
480  $idl_id = $a_ass->hasTeam()
481  ? "t" . ilExAssignmentTeam::getTeamId($a_ass->getId(), $a_user_id)
482  : $a_user_id;
483 
484  $this->tpl->setVariable("VAL_IDL_ID", $a_ass->getId() . "_" . $idl_id);
485 
486  $actions->addItem(
487  $this->lng->txt("exc_individual_deadline_action"),
488  "",
489  "#",
490  "",
491  "",
492  "",
493  "",
494  false,
495  "il.ExcIDl.trigger('" . $idl_id . "'," . $a_ass->getId() . ")"
496  );
497  }
498 
499  // feedback mail
500  if ($this->exc->hasTutorFeedbackMail()) {
501  $actions->addItem(
502  $this->lng->txt("exc_tbl_action_feedback_mail"),
503  "",
504  $ilCtrl->getLinkTarget($this->parent_obj, "redirectFeedbackMail")
505  );
506  }
507 
508  // feedback files
509  if ($this->exc->hasTutorFeedbackFile()) {
510  include_once("./Modules/Exercise/classes/class.ilFSStorageExercise.php");
511  $storage = new ilFSStorageExercise($this->exc->getId(), $a_ass->getId());
512  $counter = $storage->countFeedbackFiles($a_row["submission_obj"]->getFeedbackId());
513  $counter = $counter
514  ? " (" . $counter . ")"
515  : "";
516  $actions->addItem(
517  $this->lng->txt("exc_tbl_action_feedback_file") . $counter,
518  "",
519  $ilCtrl->getLinkTargetByClass("ilfilesystemgui", "listFiles")
520  );
521  }
522 
523  // comment (modal - see above)
524  if ($this->exc->hasTutorFeedbackText()) {
525  $actions->addItem(
526  $this->lng->txt("exc_tbl_action_feedback_text"),
527  "",
528  "#",
529  "",
530  "",
531  "",
532  "",
533  false,
534  "il.ExcManagement.showComment('" . $comment_id . "')"
535  );
536  }
537 
538  // peer review
539  if (($peer_review = $a_row["submission_obj"]->getPeerReview()) && $a_ass->afterDeadlineStrict()) { // see #22246
540  $counter = $peer_review->countGivenFeedback(true, $a_user_id);
541  $counter = $counter
542  ? " (" . $counter . ")"
543  : "";
544  $actions->addItem(
545  $this->lng->txt("exc_tbl_action_peer_review_given") . $counter,
546  "",
547  $ilCtrl->getLinkTargetByClass("ilexpeerreviewgui", "showGivenPeerReview")
548  );
549 
550  $counter = sizeof($peer_review->getPeerReviewsByPeerId($a_user_id, true));
551  $counter = $counter
552  ? " (" . $counter . ")"
553  : "";
554  $actions->addItem(
555  $this->lng->txt("exc_tbl_action_peer_review_received") . $counter,
556  "",
557  $ilCtrl->getLinkTargetByClass("ilexpeerreviewgui", "showReceivedPeerReview")
558  );
559  }
560 
561  // team
562  if ($has_no_team_yet) {
563  $actions->addItem(
564  $this->lng->txt("exc_create_team"),
565  "",
566  $ilCtrl->getLinkTargetByClass("ilExSubmissionTeamGUI", "createSingleMemberTeam")
567  );
568  } elseif ($a_ass->hasTeam()) {
569  $actions->addItem(
570  $this->lng->txt("exc_tbl_action_team_log"),
571  "",
572  $ilCtrl->getLinkTargetByClass("ilExSubmissionTeamGUI", "showTeamLog")
573  );
574  }
575 
576  $this->tpl->setVariable("ACTIONS", $actions->getHTML());
577  }
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
const IL_CAL_DATETIME
This class represents a property form user interface.
static getTeamId($a_assignment_id, $a_user_id, $a_create_on_demand=false)
Get team id for member id.
getId()
Get assignment id.
static get($a_glyph, $a_text="")
Get glyph html.
const IL_CAL_UNIX
getParentCmd()
Get parent command.
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date public.
getParentObject()
Get parent object.
global $ilCtrl
Definition: ilias.php:18
setInfo($a_info)
Set Information Text.
Date and time handling
getSelectedColumns()
Get selected columns.
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
User interface class for advanced drop-down selection lists.
afterDeadlineStrict($a_include_personal=true)
static getInstance()
Get instance.
This class represents a text area property in a property form.
$url
countFeedbackFiles($a_user_id)
Count number of feedback files for a user.
getId()
Get element id.
$info
Definition: index.php:5
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ render()

ilExerciseSubmissionTableGUI::render ( )

Definition at line 579 of file class.ilExerciseSubmissionTableGUI.php.

References ilTable2GUI\$ctrl, $DIC, $ilCtrl, ilTable2GUI\$tpl, $url, and ilTable2GUI\getParentObject().

580  {
581  global $DIC;
583  $tpl = $DIC->ui()->mainTemplate();
584 
585  $url = $ilCtrl->getLinkTarget($this->getParentObject(), "saveCommentForLearners", "", true, false);
586 
587  $tpl->addJavaScript("Modules/Exercise/js/ilExcManagement.js");
588  $tpl->addOnLoadCode('il.ExcManagement.init("' . $url . '");');
589 
590  return parent::render() .
591  implode("\n", $this->comment_modals);
592  }
global $DIC
Definition: saml.php:7
getParentObject()
Get parent object.
global $ilCtrl
Definition: ilias.php:18
$url
+ Here is the call graph for this function:

Field Documentation

◆ $access

ilExerciseSubmissionTableGUI::$access
protected

◆ $cols_default

ilExerciseSubmissionTableGUI::$cols_default = array("login", "submission", "idl", "calc_deadline")
protected

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

◆ $cols_mandatory

ilExerciseSubmissionTableGUI::$cols_mandatory = array("name", "status")
protected

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

◆ $cols_order

ilExerciseSubmissionTableGUI::$cols_order
protected
Initial value:
= array("image", "name", "login", "team_members",
"sent_time", "submission", "calc_deadline", "idl", "status", "mark", "status_time",
"feedback_time", "comment", "notice")

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

◆ $comment_modals

ilExerciseSubmissionTableGUI::$comment_modals = array()
protected

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

◆ $exc

ilExerciseSubmissionTableGUI::$exc
protected

Definition at line 24 of file class.ilExerciseSubmissionTableGUI.php.

◆ $filter

ilExerciseSubmissionTableGUI::$filter
protected

Definition at line 26 of file class.ilExerciseSubmissionTableGUI.php.

◆ $mode

ilExerciseSubmissionTableGUI::$mode
protected

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

◆ MODE_BY_ASSIGNMENT

const ilExerciseSubmissionTableGUI::MODE_BY_ASSIGNMENT = 1

Definition at line 29 of file class.ilExerciseSubmissionTableGUI.php.

◆ MODE_BY_USER

const ilExerciseSubmissionTableGUI::MODE_BY_USER = 2

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


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