Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

Differences Between: [Versions 310 and 311] [Versions 311 and 400] [Versions 311 and 401] [Versions 311 and 402] [Versions 39 and 311]

Contains class mod_feedback_responses_table

Copyright: 2016 Marina Glancy
License: GNU GPL v3 or later
File Size: 670 lines (25 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

Class: mod_feedback_responses_table  - X-Ref

Class mod_feedback_responses_table

__construct(mod_feedback_structure $feedbackstructure, $group = 0)   X-Ref

param: mod_feedback_structure $feedbackstructure
param: int $group retrieve only users from this group (optional)

init($group = 0)   X-Ref
Initialises table

param: int $group retrieve only users from this group (optional)

get_context()   X-Ref
Current context

return: context_module

other_cols($column, $row)   X-Ref
Allows to set the display column value for all columns without "col_xxxxx" method.

param: string $column column name
param: stdClass $row current record result of SQL query

col_userpic($row)   X-Ref
Prepares column userpic for display

param: stdClass $row
return: string

col_deleteentry($row)   X-Ref
Prepares column deleteentry for display

param: stdClass $row
return: string

get_link_single_entry($row)   X-Ref
Returns a link for viewing a single response

param: stdClass $row
return: \moodle_url

col_completed_timemodified($student)   X-Ref
Prepares column completed_timemodified for display

param: stdClass $student
return: string

col_courseid($row)   X-Ref
Prepares column courseid for display

param: array $row
return: string

col_groups($row)   X-Ref
Prepares column groups for display

param: array $row
return: string

add_all_values_to_output()   X-Ref
Adds common values to the table that do not change the number or order of entries and
are only needed when outputting or downloading data.

query_db($pagesize, $useinitialsbar=true)   X-Ref
Query the db. Store results in the table object for use by build_table.

param: int $pagesize size of page for paginated displayed table.
param: bool $useinitialsbar do you want to use the initials bar. Bar

get_total_responses_count()   X-Ref
Returns total number of reponses (without any filters applied)

return: int

define_columns($columns)   X-Ref
Defines columns

param: array $columns an array of identifying names for columns. If

out($pagesize, $useinitialsbar, $downloadhelpbutton='')   X-Ref
Convenience method to call a number of methods for you to display the

param: int $pagesize
param: bool $useinitialsbar
param: string $downloadhelpbutton

display()   X-Ref
Displays the table

get_reponse_navigation_links($record)   X-Ref
Returns links to previous/next responses in the list

param: stdClass $record
return: array array of three elements [$prevresponseurl, $returnurl, $nextresponseurl]

download()   X-Ref
Download the data.

build_table()   X-Ref
Take the data returned from the db_query and go through all the rows
processing each col using either col_{columnname} method or other_cols
method or if other_cols returns NULL then put the data straight into the

This overwrites the parent method because full SQL query may fail on Mysql
because of the limit in the number of tables in the join. Therefore we only
join 59 tables in the main query and add the rest here.

return: void

build_table_chunk(&$rows, &$columnsgroups)   X-Ref
Retrieve additional columns. Database engine may have a limit on number of joins.

param: array $rows Array of rows with already retrieved data, new values will be added to this array
param: array $columnsgroups array of arrays of columns. Each element has up to self::TABLEJOINLIMIT items. This

download_buttons()   X-Ref
Returns html code for displaying "Download" button if applicable.

get_responses_for_external($row)   X-Ref
Return user responses data ready for the external function.

param: stdClass $row the table row containing the responses
return: array returns the responses ready to be used by an external function

add_data_for_external($row)   X-Ref
Add data for the external structure that will be returned.

param: stdClass $row a database query record row

export_external_structure($page = 0, $perpage = 0)   X-Ref
Exports the table as an external structure handling pagination.

param: int $page page number (for pagination)
param: int $perpage elements per page
return: array returns the table ready to be used by an external function