Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.

Differences Between: [Versions 310 and 400] [Versions 311 and 400] [Versions 39 and 400] [Versions 400 and 401] [Versions 400 and 402] [Versions 400 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: 1688 lines (69 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.

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

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

return: string
param: stdClass $row

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

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

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

return: string
param: stdClass $row

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

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

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

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

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

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

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

return: string The formatted grade
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

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

return: string The team name
param: stdClass $row

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.

return: string
param: stdClass $row

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

return: string
param: stdClass $row

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

return: string
param: stdClass $row

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

return: string
param: stdClass $row

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

return: mixed stdClass or false
param: int $userid

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

return: string
param: stdClass $row

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

return: string
param: stdClass $row

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

return: string
param: stdClass $row

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

return: string
param: stdClass $row

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

return: string
param: stdClass $row

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

return: string
param: stdClass $row

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

return: string
param: stdClass $row

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

return: string
param: stdClass $row

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

return: string
param: stdClass $row

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

return: string
param: stdClass $row

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

return: string
param: stdClass $row

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.

return: string The summary with an optional link
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

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

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

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

return: array of data
param: string $columnname The name of the raw column 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.

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

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