Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

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

This file contains the definition for the grading table which subclassses easy_table

Copyright: 2012 NetSpot {@link http://www.netspot.com.au}
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 1672 lines (68 kb)
Included or required:0 times
Referenced: 1 time
Includes or requires: 0 files

Defines 1 class


Class: assign_grading_table  - X-Ref

Extends table_sql to provide a table of assignment submissions

__construct(assign $assignment,$perpage,$filter,$rowoffset,$quickgrading,$downloadfilename = null)   X-Ref
overridden constructor keeps a reference to the assignment class that is displaying this table

param: assign $assignment The assignment class
param: int $perpage how many per page
param: string $filter The current filter
param: int $rowoffset For showing a subsequent page of results
param: bool $quickgrading Is this table wrapped in a quickgrading form?
param: string $downloadfilename

format_row($row)   X-Ref
Before adding each row to the table make sure rownum is incremented.

param: array $row row of data from db used to make one row of the table.
return: array one row for the table

col_recordid(stdClass $row)   X-Ref
Add a column with an ID that uniquely identifies this user in this assignment.

param: stdClass $row
return: string

get_row_class($row)   X-Ref
Add the userid to the row class so it can be updated via ajax.

param: stdClass $row The row of data
return: string The row class

get_rows_per_page()   X-Ref
Return the number of rows to display on a single page.

return: int The number of rows per page

col_workflowstatus(stdClass $row)   X-Ref
list current marking workflow state

param: stdClass $row
return: string

col_workflowstate($row)   X-Ref
For download only - list current marking workflow state

param: stdClass $row - The row of data
return: string The current marking workflow state

col_allocatedmarker(stdClass $row)   X-Ref
list current marker

param: stdClass $row - The row of data
return: id the user->id of the marker.

col_scale($row)   X-Ref
For download only - list all the valid options for this custom scale.

param: stdClass $row - The row of data
return: string A list of valid options for the current scale

display_grade($grade, $editable, $userid, $modified)   X-Ref
Display a grade with scales etc.

param: string $grade
param: boolean $editable
param: int $userid The user id of the user this grade belongs to
param: int $modified Timestamp showing when the grade was last modified
return: string The formatted grade

col_team(stdClass $row)   X-Ref
Get the team info for this user.

param: stdClass $row
return: string The team name

get_group_and_submission($userid, &$group, &$submission, $attemptnumber)   X-Ref
Use a static cache to try and reduce DB calls.

param: int $userid The user id for this submission
param: int $group The groupid (returned)
param: stdClass|false $submission The stdClass submission or false (returned)
param: int $attemptnumber Return a specific attempt number (-1 for latest)

col_outcomes(stdClass $row)   X-Ref
Format a list of outcomes.

param: stdClass $row
return: string

col_picture(stdClass $row)   X-Ref
Format a user picture for display.

param: stdClass $row
return: string

col_fullname($row)   X-Ref
Format a user record for display (link to profile).

param: stdClass $row
return: string

col_select(stdClass $row)   X-Ref
Insert a checkbox for selecting the current row for batch operations.

param: stdClass $row
return: string

get_gradebook_data_for_user($userid)   X-Ref
Return a users grades from the listing of all grade data for this assignment.

param: int $userid
return: mixed stdClass or false

col_gradecanbechanged(stdClass $row)   X-Ref
Format a column of data for display.

param: stdClass $row
return: string

col_grademax(stdClass $row)   X-Ref
Format a column of data for display

param: stdClass $row
return: string

col_grade(stdClass $row)   X-Ref
Format a column of data for display.

param: stdClass $row
return: string

col_finalgrade(stdClass $row)   X-Ref
Format a column of data for display.

param: stdClass $row
return: string

col_timemarked(stdClass $row)   X-Ref
Format a column of data for display.

param: stdClass $row
return: string

col_timesubmitted(stdClass $row)   X-Ref
Format a column of data for display.

param: stdClass $row
return: string

col_status(stdClass $row)   X-Ref
Format a column of data for display

param: stdClass $row
return: string

col_allowsubmissionsfromdate(stdClass $row)   X-Ref
Format a column of data for display.

param: stdClass $row
return: string

col_duedate(stdClass $row)   X-Ref
Format a column of data for display.

param: stdClass $row
return: string

col_cutoffdate(stdClass $row)   X-Ref
Format a column of data for display.

param: stdClass $row
return: string

col_userid(stdClass $row)   X-Ref
Format a column of data for display.

param: stdClass $row
return: string

format_plugin_summary_with_link(assign_plugin $plugin,stdClass $item,$returnaction,$returnparams)   X-Ref
Write the plugin summary with an optional link to view the full feedback/submission.

param: assign_plugin $plugin Submission plugin or feedback plugin
param: stdClass $item Submission or grade
param: string $returnaction The return action to pass to the
param: string $returnparams The return params to pass to the view_submission
return: string The summary with an optional link

other_cols($colname, $row)   X-Ref
Format the submission and feedback columns.

param: string $colname The column name
param: stdClass $row The submission row
return: mixed string or NULL

get_column_data($columnname)   X-Ref
Using the current filtering and sorting - load all rows and return a single column from them.

param: string $columnname The name of the raw column data
return: array of data

get_assignment_name()   X-Ref
Return things to the renderer.

return: string the assignment name

get_course_module_id()   X-Ref
Return things to the renderer.

return: int the course module id

get_course_id()   X-Ref
Return things to the renderer.

return: int the course id

get_course_context()   X-Ref
Return things to the renderer.

return: stdClass The course context

submissions_enabled()   X-Ref
Return things to the renderer.

return: bool Does this assignment accept submissions

can_view_all_grades()   X-Ref
Return things to the renderer.

return: bool Can this user view all grades (the gradebook)

get_sort_columns()   X-Ref
Always return a valid sort - even if the userid column is missing.

return: array column name => SORT_... constant.

show_hide_link($column, $index)   X-Ref
Override the table show_hide_link to not show for select column.

param: string $column the column name, index into various names.
param: int $index numerical index of the column.
return: string HTML fragment.

setup()   X-Ref
Overides setup to ensure it will only run a single time.