Differences Between: [Versions 310 and 402] [Versions 311 and 402] [Versions 39 and 402] [Versions 400 and 402] [Versions 401 and 402]
Contains class mod_feedback_responses_table
Copyright: | 2016 Marina Glancy |
License: | http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later |
File Size: | 675 lines (25 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
mod_feedback_responses_table:: (24 methods):
__construct()
init()
get_context()
other_cols()
col_userpic()
col_deleteentry()
get_link_single_entry()
col_completed_timemodified()
col_courseid()
col_groups()
add_all_values_to_output()
query_db()
get_total_responses_count()
define_columns()
out()
display()
get_reponse_navigation_links()
download()
build_table()
build_table_chunk()
download_buttons()
get_responses_for_external()
add_data_for_external()
export_external_structure()
Class: mod_feedback_responses_table - X-Ref
Class mod_feedback_responses_table__construct(mod_feedback_structure $feedbackstructure, $group = 0) X-Ref |
Constructor 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 table. 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 table. 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 |