Moodle APIs  3.8
Moodle 3.8.6 (Build: 20201109)
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
quiz_statistics_table Class Reference

This table has one row for each question in the quiz, with sub-rows when random questions and variants appear. More...

Inheritance diagram for quiz_statistics_table:
flexible_table

Public Member Functions

 __construct ()
 Constructor.
 
 add_data ($row, $classname='')
 This method actually directly echoes the row passed to it now or adds it to the download. More...
 
 add_data_keyed ($rowwithkeys, $classname='')
 Add a row of data to the table. More...
 
 add_separator ()
 Add a seperator line to table.
 
 col_fullname ($row)
 Fullname is treated as a special columname in tablelib and should always be treated the same as the fullname of a user. More...
 
 collapsible ($bool)
 Sets the is_collapsible variable to the given boolean. More...
 
 column_class ($column, $classname)
 Sets the given $column index to the given $classname in $this->column_class. More...
 
 column_style ($column, $property, $value)
 Sets the given $column index and $property index to the given $value in $this->column_style. More...
 
 column_style_all ($property, $value)
 Sets all columns' $propertys to the given $value in $this->column_style. More...
 
 column_suppress ($column)
 What this method does is set the column so that if the same data appears in consecutive rows, then it is not repeated. More...
 
 define_baseurl ($url)
 Sets $this->baseurl. More...
 
 define_columns ($columns)
 
 define_header_column (string $column)
 Mark a specific column as being a table header using the column name defined in define_columns. More...
 
 define_headers ($headers)
 
 define_help_for_headers ($helpicons)
 Defines a help icon for the header. More...
 
 download_buttons ()
 Get the html for the download buttons. More...
 
 export_class_instance ($exportclass=null)
 Get, and optionally set, the export class. More...
 
 finish_html ()
 This function is not part of the public api.
 
 finish_output ($closeexportclassdoc=true)
 You should call this to finish outputting the table data after adding data to the table with add_data or add_data_keyed.
 
 format_and_add_array_of_rows ($rowstoadd, $finish=true)
 Add a number of rows to the table at once. More...
 
 format_row ($row)
 Call appropriate methods on this table class to perform any processing on values before displaying in table. More...
 
 format_text ($text, $format=FORMAT_MOODLE, $options=NULL, $courseid=NULL)
 Used from col_* functions when text is to be displayed. More...
 
 get_initial_first ()
 This function is not part of the public api. More...
 
 get_initial_last ()
 This function is not part of the public api. More...
 
 get_page_size ()
 
 get_page_start ()
 
 get_row_from_keyed ($rowwithkeys)
 This function is not part of the public api.
 
 get_row_html ($row, $classname='')
 Generate html code for the passed row. More...
 
 get_sort_columns ()
 Get the columns to sort by, in the form required by construct_order_by(). More...
 
 get_sql_sort ()
 
 get_sql_where ()
 
 initialbars ($bool)
 Sets the use_initials variable to the given boolean. More...
 
 is_downloadable ($downloadable=null)
 Probably don't need to call this directly. More...
 
 is_downloading ($download=null, $filename='', $sheettitle='')
 Call this to pass the download type. More...
 
 is_persistent ($persistent=null)
 Call with boolean true to store table layout changes in the user_preferences table. More...
 
 is_sortable ($column=null)
 Is the column sortable? More...
 
 make_styles_string ($styles)
 This function is not part of the public api. More...
 
 no_sorting ($column)
 Do not sort using this column. More...
 
 other_cols ($column, $row)
 You can override this method in a child class. More...
 
 pageable ($bool)
 Sets the use_pages variable to the given boolean. More...
 
 pagesize ($perpage, $total)
 Sets the pagesize variable to the given integer, the totalrows variable to the given integer, and the use_pages variable to true. More...
 
 print_headers ()
 This function is not part of the public api.
 
 print_html ()
 This method is deprecated although the old api is still supported. More...
 
 print_initials_bar ()
 This function is not part of the public api.
 
 print_nothing_to_display ()
 This function is not part of the public api.
 
 print_row ($row, $classname='')
 This function is not part of the public api.
 
 set_attribute ($attribute, $value)
 Gives the given $value to the $attribute index of $this->attributes. More...
 
 set_control_variables ($variables)
 Assigns each given variable in the array to the corresponding index in the request class variable. More...
 
 setup ()
 Must be called after table is defined. More...
 
 show_download_buttons_at ($showat)
 Where to show download buttons. More...
 
 sortable ($bool, $defaultcolumn=NULL, $defaultorder=SORT_ASC)
 Sets the is_sortable variable to the given boolean, sort_default_column to the given string, and the sort_default_order to the given integer. More...
 
 start_html ()
 This function is not part of the public api.
 
 start_output ()
 This function is not part of the public api. More...
 
 statistics_setup ($quiz, $cmid, $reporturl, $s)
 Set up the columns and headers and other properties of the table and then call flexible_table::setup() method. More...
 
 text_sorting ($column)
 Use text sorting functions for this column (required for text columns with Oracle). More...
 
 wrap_html_finish ()
 Close a statistics table div.
 
 wrap_html_start ()
 Open a div tag to wrap statistics table.
 

Static Public Member Functions

static construct_order_by ($cols, $textsortcols=array())
 Prepare an an order by clause from the list of columns to be sorted. More...
 
static get_sort_for_table ($uniqueid)
 Get the order by clause from the session or user preferences, for the table with id $uniqueid. More...
 

Public Attributes

 $attributes = array()
 
 $baseurl = NULL
 
 $column_class = array()
 
 $column_nosort = array('userpic')
 
 $column_style = array()
 
 $column_suppress = array()
 
 $columns = array()
 
 $currentrow = 0
 
 $currpage = 0
 
string $download = ''
 which download plugin to use. More...
 
bool $downloadable = false
 whether data is downloadable from table. More...
 
 $exportclass = null
 
 $headers = array()
 
 $is_collapsible = false
 
 $is_sortable = false
 
 $maxsortkeys = 2
 
 $pagesize = 30
 
 $request = array()
 
boolean $setup = false
 Stores if setup has already been called on this flixible table.
 
 $showdownloadbuttonsat = array(TABLE_P_TOP)
 Array of positions in which to display download controls.
 
 $sort_default_column = NULL
 
 $sort_default_order = SORT_ASC
 
bool $started_output = false
 Has start output been called yet?
 
 $totalrows = 0
 
 $uniqueid = NULL
 
 $use_initials = false
 
 $use_pages = false
 
string $useridfield = 'id'
 Key of field returned by db query that is the id field of the user table or equivalent.
 

Protected Member Functions

 can_be_reset ()
 Are there some table preferences that can be reset? More...
 
 col_actions ($questionstat)
 Actions that can be performed on the question by this user (e.g. More...
 
 col_discrimination_index ($questionstat)
 Discrimination index. More...
 
 col_discriminative_efficiency ($questionstat)
 Discrimination efficiency, similar to, but different from, the Discrimination index. More...
 
 col_effective_weight ($questionstat)
 The effective question weight. More...
 
 col_facility ($questionstat)
 The facility index (average fraction). More...
 
 col_icon ($questionstat)
 The question type icon. More...
 
 col_intended_weight ($questionstat)
 The intended question weight. More...
 
 col_name ($questionstat)
 The question name. More...
 
 col_number ($questionstat)
 The question number. More...
 
 col_qtype ($questionstat)
 The question type name. More...
 
 col_random_guess_score ($questionstat)
 An estimate of the fraction a student would get by guessing randomly. More...
 
 col_s ($questionstat)
 The number of attempts at this question. More...
 
 col_sd ($questionstat)
 The standard deviation of the fractions. More...
 
 format_percentage (float $number, bool $fraction=true, int $decimals=2)
 Format a number to a localised percentage with specified decimal points. More...
 
 format_percentage_range (float $min=null, float $max=null, bool $fraction=true, int $decimals=2)
 Format $min and $max to localised percentages and form a string that represents a range between them. More...
 
 format_range (string $min=null, string $max=null)
 Format inputs to represent a range between $min and $max. More...
 
 is_calculated_question_summary ($questionstat)
 Check if the given stats object is an instance of calculated_question_summary. More...
 
 is_dubious_question ($questionstat)
 This method encapsulates the test for wheter a question should be considered dubious. More...
 
 print_one_initials_bar ($alpha, $current, $class, $title, $urlvar)
 Helper function, used by print_initials_bar() to output one initial bar. More...
 
 render_reset_button ()
 Generate the HTML for the table preferences reset button. More...
 
 show_hide_link ($column, $index)
 Generate the HTML for the collapse/uncollapse icon. More...
 
 sort_icon ($isprimary, $order)
 Generate the HTML for the sort icon. More...
 
 sort_link ($text, $column, $isprimary, $order)
 Generate the HTML for the sort link. More...
 
 sort_order_name ($isprimary, $order)
 Generate the correct tool tip for changing the sort order. More...
 

Protected Attributes

integer $cmid
 the quiz course_module id.
 
$filename $filename
 
string $headercolumn = null
 A column which should be considered as a header column.
 
object $quiz
 the quiz settings.
 
$sheettitle $sheettitle
 

Detailed Description

This table has one row for each question in the quiz, with sub-rows when random questions and variants appear.

There are columns for the various item and position statistics.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Member Function Documentation

◆ add_data()

flexible_table::add_data (   $row,
  $classname = '' 
)
inherited

This method actually directly echoes the row passed to it now or adds it to the download.

If this is the first row and start_output has not already been called this method also calls start_output to open the table or send headers for the downloaded. Can be used as before. print_html now calls finish_html to close table.

Parameters
array$rowa numerically keyed row of data to add to the table.
string$classnameCSS class name to add to this row's tr tag.
Return values
boolsuccess.

◆ add_data_keyed()

flexible_table::add_data_keyed (   $rowwithkeys,
  $classname = '' 
)
inherited

Add a row of data to the table.

This function takes an array or object with column names as keys or property names.

It ignores any elements with keys that are not defined as columns. It puts in empty strings into the row when there is no element in the passed array corresponding to a column in the table. It puts the row elements in the proper order (internally row table data is stored by in arrays with a numerical index corresponding to the column number).

Parameters
object | array$rowwithkeysarray keys or object property names are column names, as defined in call to define_columns.
string$classnameCSS class name to add to this row's tr tag.

◆ can_be_reset()

flexible_table::can_be_reset ( )
protectedinherited

Are there some table preferences that can be reset?

If true, then the "reset table preferences" widget should be displayed.

Return values
bool

◆ col_actions()

quiz_statistics_table::col_actions (   $questionstat)
protected

Actions that can be performed on the question by this user (e.g.

edit or preview).

Parameters
core_question\statistics\questions\calculated$questionstatstats for the question.
Return values
stringcontents of this table cell.

◆ col_discrimination_index()

quiz_statistics_table::col_discrimination_index (   $questionstat)
protected

Discrimination index.

This is the product moment correlation coefficient between the fraction for this question, and the average fraction for the other questions in this quiz.

Parameters
core_question\statistics\questions\calculated$questionstatstats for the question.
Return values
stringcontents of this table cell.

◆ col_discriminative_efficiency()

quiz_statistics_table::col_discriminative_efficiency (   $questionstat)
protected

Discrimination efficiency, similar to, but different from, the Discrimination index.

Parameters
core_question\statistics\questions\calculated$questionstatstats for the question.
Return values
stringcontents of this table cell.

◆ col_effective_weight()

quiz_statistics_table::col_effective_weight (   $questionstat)
protected

The effective question weight.

That is, an estimate of the actual influence this question has on the student's overall mark.

Parameters
core_question\statistics\questions\calculated$questionstatstats for the question.
Return values
stringcontents of this table cell.

◆ col_facility()

quiz_statistics_table::col_facility (   $questionstat)
protected

The facility index (average fraction).

Parameters
core_question\statistics\questions\calculated$questionstatstats for the question.
Return values
stringcontents of this table cell.

◆ col_fullname()

flexible_table::col_fullname (   $row)
inherited

Fullname is treated as a special columname in tablelib and should always be treated the same as the fullname of a user.

@uses $this->useridfield if the userid field is not expected to be id then you need to override $this->useridfield to point at the correct field for the user id.

Parameters
object$rowthe data from the db containing all fields from the users table necessary to construct the full name of the user in current language.
Return values
stringcontents of cell in column 'fullname', for this row.

Reimplemented in core_tag_manage_table, assign_grading_table, tool_policy\acceptances_table, webservice\token_table, core_user\participants_table, forumreport_summary\summary_table, and quiz_attempts_report_table.

◆ col_icon()

quiz_statistics_table::col_icon (   $questionstat)
protected

The question type icon.

Parameters
core_question\statistics\questions\calculated$questionstatstats for the question.
Return values
stringcontents of this table cell.

◆ col_intended_weight()

quiz_statistics_table::col_intended_weight (   $questionstat)
protected

The intended question weight.

Maximum mark for the question as a percentage of maximum mark for the quiz. That is, the indended influence this question on the student's overall mark.

Parameters
core_question\statistics\questions\calculated$questionstatstats for the question.
Return values
stringcontents of this table cell.

◆ col_name()

quiz_statistics_table::col_name (   $questionstat)
protected

The question name.

Parameters
core_question\statistics\questions\calculated$questionstatstats for the question.
Return values
stringcontents of this table cell.

◆ col_number()

quiz_statistics_table::col_number (   $questionstat)
protected

The question number.

Parameters
core_question\statistics\questions\calculated$questionstatstats for the question.
Return values
stringcontents of this table cell.

◆ col_qtype()

quiz_statistics_table::col_qtype (   $questionstat)
protected

The question type name.

Parameters
core_question\statistics\questions\calculated$questionstatstats for the question.
Return values
stringcontents of this table cell.

◆ col_random_guess_score()

quiz_statistics_table::col_random_guess_score (   $questionstat)
protected

An estimate of the fraction a student would get by guessing randomly.

Parameters
core_question\statistics\questions\calculated$questionstatstats for the question.
Return values
stringcontents of this table cell.

◆ col_s()

quiz_statistics_table::col_s (   $questionstat)
protected

The number of attempts at this question.

Parameters
core_question\statistics\questions\calculated$questionstatstats for the question.
Return values
stringcontents of this table cell.

◆ col_sd()

quiz_statistics_table::col_sd (   $questionstat)
protected

The standard deviation of the fractions.

Parameters
core_question\statistics\questions\calculated$questionstatstats for the question.
Return values
stringcontents of this table cell.

◆ collapsible()

flexible_table::collapsible (   $bool)
inherited

Sets the is_collapsible variable to the given boolean.

Parameters
bool$bool
Return values
void

◆ column_class()

flexible_table::column_class (   $column,
  $classname 
)
inherited

Sets the given $column index to the given $classname in $this->column_class.

Parameters
int$column
string$classname
Return values
void

◆ column_style()

flexible_table::column_style (   $column,
  $property,
  $value 
)
inherited

Sets the given $column index and $property index to the given $value in $this->column_style.

Parameters
int$column
string$property
mixed$value
Return values
void

◆ column_style_all()

flexible_table::column_style_all (   $property,
  $value 
)
inherited

Sets all columns' $propertys to the given $value in $this->column_style.

Parameters
int$property
string$value
Return values
void

◆ column_suppress()

flexible_table::column_suppress (   $column)
inherited

What this method does is set the column so that if the same data appears in consecutive rows, then it is not repeated.

For example, in the quiz overview report, the fullname column is set to be suppressed, so that when one student has made multiple attempts, their name is only printed in the row for their first attempt.

Parameters
int$columnthe index of a column.

◆ construct_order_by()

static flexible_table::construct_order_by (   $cols,
  $textsortcols = array() 
)
staticinherited

Prepare an an order by clause from the list of columns to be sorted.

Parameters
array$colscolumn name => SORT_ASC or SORT_DESC
Return values
SQLfragment that can be used in an ORDER BY clause.

◆ define_baseurl()

flexible_table::define_baseurl (   $url)
inherited

Sets $this->baseurl.

Parameters
moodle_url | string$urlthe url with params needed to call up this page

◆ define_columns()

flexible_table::define_columns (   $columns)
inherited
Parameters
array$columnsan array of identifying names for columns. If columns are sorted then column names must correspond to a field in sql.

Reimplemented in mod_feedback_responses_table.

◆ define_header_column()

flexible_table::define_header_column ( string  $column)
inherited

Mark a specific column as being a table header using the column name defined in define_columns.

Note: Only one column can be a header, and it will be rendered using a th tag.

Parameters
string$column

◆ define_headers()

flexible_table::define_headers (   $headers)
inherited
Parameters
array$headersnumerical keyed array of displayed string titles for each column.

◆ define_help_for_headers()

flexible_table::define_help_for_headers (   $helpicons)
inherited

Defines a help icon for the header.

Always use this function if you need to create header with sorting and help icon.

Parameters
renderable[]$helpiconsAn array of renderable objects to be used as help icons

◆ download_buttons()

flexible_table::download_buttons ( )
inherited

Get the html for the download buttons.

Usually only use internally

Reimplemented in mod_feedback_responses_table.

◆ export_class_instance()

flexible_table::export_class_instance (   $exportclass = null)
inherited

Get, and optionally set, the export class.

Parameters
$exportclass(optional) if passed, set the table to use this export class.
Return values
table_default_export_format_parentthe export class in use (after any set).

◆ format_and_add_array_of_rows()

flexible_table::format_and_add_array_of_rows (   $rowstoadd,
  $finish = true 
)
inherited

Add a number of rows to the table at once.

And optionally finish output after they have been added.

Parameters
(object|array|null)[]$rowstoadd Array of rows to add to table, a null value in array adds a separator row. Or a object or array is added to table. We expect properties for the row array as would be passed to add_data_keyed.
bool$finish

◆ format_percentage()

quiz_statistics_table::format_percentage ( float  $number,
bool  $fraction = true,
int  $decimals = 2 
)
protected

Format a number to a localised percentage with specified decimal points.

Parameters
float$numberThe number being formatted
bool$fractionAn indicator for whether the number is a fraction or is already multiplied by 100
int$decimalsSets the number of decimal points
Return values
string

◆ format_percentage_range()

quiz_statistics_table::format_percentage_range ( float  $min = null,
float  $max = null,
bool  $fraction = true,
int  $decimals = 2 
)
protected

Format $min and $max to localised percentages and form a string that represents a range between them.

This function does not check if $min is less than $max or not. If both $min and $max are equal to null, this function returns an empty string.

Parameters
float | null$minThe minimum value of the range
float | null$maxThe maximum value of the range
bool$fractionAn indicator for whether min and max are a fractions or are already multiplied by 100
int$decimalsSets the number of decimal points
Return values
stringA formatted string that represents a range between $min to $max.

◆ format_range()

quiz_statistics_table::format_range ( string  $min = null,
string  $max = null 
)
protected

Format inputs to represent a range between $min and $max.

This function does not check if $min is less than $max or not. If both $min and $max are equal to null, this function returns an empty string.

Parameters
string | null$minThe minimum value in the range
string | null$maxThe maximum value in the range
Return values
string

◆ format_row()

flexible_table::format_row (   $row)
inherited

Call appropriate methods on this table class to perform any processing on values before displaying in table.

Takes raw data from the database and process it into human readable format, perhaps also adding html linking when displaying table as html, adding a div wrap, etc.

See for example col_fullname below which will be called for a column whose name is 'fullname'.

Parameters
array | object$rowrow of data from db used to make one row of the table.
Return values
arrayone row for the table, added using add_data_keyed method.

Reimplemented in assign_grading_table, and tool_policy\acceptances_table.

◆ format_text()

flexible_table::format_text (   $text,
  $format = FORMAT_MOODLE,
  $options = NULL,
  $courseid = NULL 
)
inherited

Used from col_* functions when text is to be displayed.

Does the right thing - either converts text to html or strips any html tags depending on if we are downloading and what is the download type. Params are the same as format_text function in weblib.php but some default options are changed.

◆ get_initial_first()

flexible_table::get_initial_first ( )
inherited

This function is not part of the public api.

Return values
stringinitial of first name we are currently filtering by

◆ get_initial_last()

flexible_table::get_initial_last ( )
inherited

This function is not part of the public api.

Return values
stringinitial of last name we are currently filtering by

◆ get_page_size()

flexible_table::get_page_size ( )
inherited
Return values
intthe pagesize for LIMIT clause of SQL

◆ get_page_start()

flexible_table::get_page_start ( )
inherited
Return values
intthe offset for LIMIT clause of SQL

◆ get_row_html()

flexible_table::get_row_html (   $row,
  $classname = '' 
)
inherited

Generate html code for the passed row.

Parameters
array$rowRow data.
string$classnameclasses to add.
Return values
string::$htmlhtml code for the row passed.

◆ get_sort_columns()

flexible_table::get_sort_columns ( )
inherited

Get the columns to sort by, in the form required by construct_order_by().

Return values
arraycolumn name => SORT_... constant.

Reimplemented in quiz_attempts_report_table, assign_grading_table, and tool_policy\acceptances_table.

◆ get_sort_for_table()

static flexible_table::get_sort_for_table (   $uniqueid)
staticinherited

Get the order by clause from the session or user preferences, for the table with id $uniqueid.

Parameters
string$uniqueidthe identifier for a table.
Return values
SQLfragment that can be used in an ORDER BY clause.

◆ get_sql_sort()

flexible_table::get_sql_sort ( )
inherited
Return values
SQLfragment that can be used in an ORDER BY clause.

Reimplemented in gradereport_history\output\tablelog.

◆ get_sql_where()

flexible_table::get_sql_where ( )
inherited
Return values
stringsql to add to where statement.

Reimplemented in core_tag_manage_table, and tool_policy\acceptances_table.

◆ initialbars()

flexible_table::initialbars (   $bool)
inherited

Sets the use_initials variable to the given boolean.

Parameters
bool$bool
Return values
void

◆ is_calculated_question_summary()

quiz_statistics_table::is_calculated_question_summary (   $questionstat)
protected

Check if the given stats object is an instance of calculated_question_summary.

Parameters
core_question\statistics\questions\calculated$questionstatStats object
Return values
bool

◆ is_downloadable()

flexible_table::is_downloadable (   $downloadable = null)
inherited

Probably don't need to call this directly.

Calling is_downloading with a param automatically sets table as downloadable.

Parameters
bool$downloadableoptional param to set whether data from table is downloadable. If ommitted this function can be used to get current state of table.
Return values
boolwhether table data is set to be downloadable.

◆ is_downloading()

flexible_table::is_downloading (   $download = null,
  $filename = '',
  $sheettitle = '' 
)
inherited

Call this to pass the download type.

Use : $download = optional_param('download', '', PARAM_ALPHA); To get the download type. We assume that if you call this function with params that this table's data is downloadable, so we call is_downloadable for you (even if the param is '', which means no download this time. Also you can call this method with no params to get the current set download type.

Parameters
string$downloaddataformat type. One of csv, xhtml, ods, etc
string$filenamefilename for downloads without file extension.
string$sheettitletitle for downloaded data.
Return values
stringdownload dataformat type. One of csv, xhtml, ods, etc

◆ is_dubious_question()

quiz_statistics_table::is_dubious_question (   $questionstat)
protected

This method encapsulates the test for wheter a question should be considered dubious.

Parameters
core_question\statistics\questions\calculated$questionstatstats for the question.
Return values
boolis this question possibly not pulling it's weight?

◆ is_persistent()

flexible_table::is_persistent (   $persistent = null)
inherited

Call with boolean true to store table layout changes in the user_preferences table.

Note: user_preferences.value has a maximum length of 1333 characters. Call with no parameter to get current state of table persistence.

Parameters
bool$persistentOptional parameter to set table layout persistence.
Return values
boolWhether or not the table layout preferences will persist.

◆ is_sortable()

flexible_table::is_sortable (   $column = null)
inherited

Is the column sortable?

Parameters
stringcolumn name, null means table
Return values
bool

◆ make_styles_string()

flexible_table::make_styles_string (   $styles)
inherited

This function is not part of the public api.

Parameters
array$stylesCSS-property => value
Return values
stringvalues suitably to go in a style="" attribute in HTML.

◆ no_sorting()

flexible_table::no_sorting (   $column)
inherited

Do not sort using this column.

Parameters
stringcolumn name

◆ other_cols()

flexible_table::other_cols (   $column,
  $row 
)
inherited

You can override this method in a child class.

See the description of build_table which calls this method.

Reimplemented in mod_feedback_responses_table, tool_policy\acceptances_table, assign_grading_table, quiz_statistics_question_table, webservice\token_table, core_user\participants_table, quiz_last_responses_table, and quiz_overview_table.

◆ pageable()

flexible_table::pageable (   $bool)
inherited

Sets the use_pages variable to the given boolean.

Parameters
bool$bool
Return values
void

◆ pagesize()

flexible_table::pagesize (   $perpage,
  $total 
)
inherited

Sets the pagesize variable to the given integer, the totalrows variable to the given integer, and the use_pages variable to true.

Parameters
int$perpage
int$total
Return values
void

◆ print_html()

flexible_table::print_html ( )
inherited

This method is deprecated although the old api is still supported.

Deprecated:
1.9.2 - Jun 2, 2008

◆ print_one_initials_bar()

flexible_table::print_one_initials_bar (   $alpha,
  $current,
  $class,
  $title,
  $urlvar 
)
protectedinherited

Helper function, used by print_initials_bar() to output one initial bar.

Parameters
array$alphaof letters in the alphabet.
string$currentthe currently selected letter.
string$classclass name to add to this initial bar.
string$titlethe name to put in front of this initial bar.
string$urlvarURL parameter name for this initial.
Deprecated:
since Moodle 3.3

◆ render_reset_button()

flexible_table::render_reset_button ( )
protectedinherited

Generate the HTML for the table preferences reset button.

Return values
stringHTML fragment, empty string if no need to reset

◆ set_attribute()

flexible_table::set_attribute (   $attribute,
  $value 
)
inherited

Gives the given $value to the $attribute index of $this->attributes.

Parameters
string$attribute
mixed$value
Return values
void

◆ set_control_variables()

flexible_table::set_control_variables (   $variables)
inherited

Assigns each given variable in the array to the corresponding index in the request class variable.

Parameters
array$variables
Return values
void

◆ setup()

flexible_table::setup ( )
inherited

Must be called after table is defined.

Use methods above first. Cannot use functions below till after calling this method.

Return values
type?

Reimplemented in assign_grading_table.

◆ show_download_buttons_at()

flexible_table::show_download_buttons_at (   $showat)
inherited

Where to show download buttons.

Parameters
array$showatarray of postions in which to show download buttons. Containing TABLE_P_TOP and/or TABLE_P_BOTTOM

◆ show_hide_link()

flexible_table::show_hide_link (   $column,
  $index 
)
protectedinherited

Generate the HTML for the collapse/uncollapse icon.

This is a helper method used by print_headers().

Parameters
string$columnthe column name, index into various names.
int$indexnumerical index of the column.
Return values
stringHTML fragment.

Reimplemented in core_user\participants_table, assign_grading_table, tool_dataprivacy\output\expired_contexts_table, and tool_dataprivacy\output\data_requests_table.

◆ sort_icon()

flexible_table::sort_icon (   $isprimary,
  $order 
)
protectedinherited

Generate the HTML for the sort icon.

This is a helper method used by sort_link().

Parameters
bool$isprimarywhether an icon is needed (it is only needed for the primary sort column.)
int$orderSORT_ASC or SORT_DESC
Return values
stringHTML fragment.

◆ sort_link()

flexible_table::sort_link (   $text,
  $column,
  $isprimary,
  $order 
)
protectedinherited

Generate the HTML for the sort link.

This is a helper method used by print_headers().

Parameters
string$textthe text for the link.
string$columnthe column name, may be a fake column like 'firstname' or a real one.
bool$isprimarywhether the is column is the current primary sort column.
int$orderSORT_ASC or SORT_DESC
Return values
stringHTML fragment.

◆ sort_order_name()

flexible_table::sort_order_name (   $isprimary,
  $order 
)
protectedinherited

Generate the correct tool tip for changing the sort order.

This is a helper method used by sort_link().

Parameters
bool$isprimarywhether the is column is the current primary sort column.
int$orderSORT_ASC or SORT_DESC
Return values
stringthe correct title.

◆ sortable()

flexible_table::sortable (   $bool,
  $defaultcolumn = NULL,
  $defaultorder = SORT_ASC 
)
inherited

Sets the is_sortable variable to the given boolean, sort_default_column to the given string, and the sort_default_order to the given integer.

Parameters
bool$bool
string$defaultcolumn
int$defaultorder
Return values
void

◆ start_output()

flexible_table::start_output ( )
inherited

This function is not part of the public api.

You don't normally need to call this. It is called automatically when needed when you start adding data to the table.

◆ statistics_setup()

quiz_statistics_table::statistics_setup (   $quiz,
  $cmid,
  $reporturl,
  $s 
)

Set up the columns and headers and other properties of the table and then call flexible_table::setup() method.

Parameters
object$quizthe quiz settings
int$cmidthe quiz course_module id
moodle_url$reporturlthe URL to redisplay this report.
int$snumber of attempts included in the statistics.

◆ text_sorting()

flexible_table::text_sorting (   $column)
inherited

Use text sorting functions for this column (required for text columns with Oracle).

Be warned that you cannot use this with column aliases. You can only do this with real columns. See MDL-40481 for an example.

Parameters
stringcolumn name

Member Data Documentation

◆ $download

string flexible_table::$download = ''
inherited

which download plugin to use.

Default '' means none - print html table with paging. Property set by is_downloading which typically passes in cleaned data from $

◆ $downloadable

bool flexible_table::$downloadable = false
inherited

whether data is downloadable from table.

Determines whether to display download buttons. Set by method downloadable().


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