Moodle APIs 4.3
Moodle 4.3.6 (Build: 20240812)
core_grades

Topics

 external
 
 
 grade
 
 
 test
 
 

Directories

directory edit
  
 
directory grades
  
 
directory local
  
 

Namespaces

namespace  core_grades
  
 
namespace  core_grades\external
  
 
namespace  core_grades\form
  
 
namespace  core_grades\grades\grader\gradingpanel\point\external
  
 
namespace  core_grades\grades\grader\gradingpanel\scale\external
  
 
namespace  core_grades\local\gradeitem
  
 
namespace  core_grades\output
  
 
namespace  core_grades\privacy
  
 

Classes

class  behat_grades
 Behat grade related steps definitions. More...
 
class  core_grades\component_gradeitem
 Compontent definition of a gradeitem. More...
 
class  core_grades\component_gradeitems
 Helper class to fetch information about component grade items. More...
 
class  core_grades\external\create_gradecategories
 Create gradecategories webservice. More...
 
class  core_grades\external\get_enrolled_users_for_search_widget
 Get the enrolled users within and map some fields to the returned array of user objects. More...
 
class  core_grades\external\get_enrolled_users_for_selector
 Get the enrolled users within and map some fields to the returned array of user objects. More...
 
class  core_grades\external\get_gradable_users
 Get the gradable users in a course. More...
 
class  core_grades\form\add_category
 Prints the add category gradebook form. More...
 
class  core_grades\form\add_item
 Prints the add item gradebook form. More...
 
class  core_grades\form\add_outcome
 Prints the add outcome gradebook form. More...
 
class  core_grades\grades\grader\gradingpanel\point\external\fetch
 External grading panel point API. More...
 
class  core_grades\grades\grader\gradingpanel\point\external\store
 External grading panel point API. More...
 
class  core_grades\grades\grader\gradingpanel\scale\external\fetch
 External grading panel scale API. More...
 
class  core_grades\grades\grader\gradingpanel\scale\external\store
 External grading panel scale API. More...
 
interface  core_grades\local\gradeitem\advancedgrading_mapping
 Grade item, itemnumber mapping. More...
 
interface  core_grades\local\gradeitem\fieldname_mapping
 Grade item, fieldname mapping. More...
 
interface  core_grades\local\gradeitem\itemnumber_mapping
 Grade item, itemnumber mapping. More...
 
class  core_grades\output\action_bar
 The base class for the action bar in the gradebook pages. More...
 
class  core_grades\output\course_outcomes_action_bar
 Renderable class for the action bar elements in the gradebook course outcomes page. More...
 
class  core_grades\output\export_action_bar
 Renderable class for the action bar elements in the gradebook export pages. More...
 
class  core_grades\output\export_key_manager_action_bar
 Renderable class for the action bar elements in the gradebook exports key manager page. More...
 
class  core_grades\output\export_publish_action_bar
 Renderable class for the action bar elements in the gradebook publish export page. More...
 
class  core_grades\output\general_action_bar
 Renderable class for the general action bar in the gradebook pages. More...
 
class  core_grades\output\grade_letters_action_bar
 Renderable class for the action bar elements in the grade letters page. More...
 
class  core_grades\output\gradebook_setup_action_bar
 Renderable class for the action bar elements in the gradebook setup pages. More...
 
class  core_grades\output\import_action_bar
 Renderable class for the action bar elements in the gradebook import pages. More...
 
class  core_grades\output\import_key_manager_action_bar
 Renderable class for the action bar elements in the gradebook import key manager page. More...
 
class  core_grades\output\manage_outcomes_action_bar
 Renderable class for the action bar elements in the manage outcomes page. More...
 
class  core_grades\output\scales_action_bar
 Renderable class for the action bar elements in the gradebook scales page. More...
 
class  core_grades\privacy\provider
 Data provider class. More...
 
class  core_grades_external
 core grades functions More...
 
class  core_grades_renderer
 Renderer class for the grade pages. More...
 
class  course_settings_form
 First implementation of the preferences in the form of a moodleform. More...
 
class  edit_calculation_form
 
class  edit_category_form
 
class  edit_grade_form
 
class  edit_item_form
 
class  edit_letter_form
 
class  edit_outcome_form
 
class  edit_outcomeitem_form
 
class  edit_scale_form
 
class  grade_edit_tree
 A library of classes used by the grade edit pages. More...
 
class  grade_edit_tree_column
 Class grade_edit_tree_column. More...
 
class  grade_edit_tree_column_actions
 Class grade_edit_tree_column_actions. More...
 
class  grade_edit_tree_column_name
 Class grade_edit_tree_column_name. More...
 
class  grade_edit_tree_column_range
 Class grade_edit_tree_column_range. More...
 
class  grade_edit_tree_column_select
 Class grade_edit_tree_column_select. More...
 
class  grade_edit_tree_column_status
 Class grade_edit_tree_column_status. More...
 
class  grade_edit_tree_column_weight
 Class grade_edit_tree_column_weight. More...
 
class  grade_helper
 Grade helper class. More...
 
class  grade_plugin_info
 A simple class containing info about grade plugins. More...
 
class  grade_plugin_return
 Utility class used for return tracking when using edit and other forms in grade plugins. More...
 
class  grade_report
 An abstract class containing variables and methods used by all or most reports. More...
 
class  grade_seq
 Flat structure similar to grade tree. More...
 
class  grade_structure
 General structure representing grade items in course. More...
 
class  grade_tree
 This class represents a complete tree of categories, grade_items and final grades, organises as an array primarily, but which can also be converted to other formats. More...
 
class  graded_users_iterator
 This class iterates over all users that are graded in a course. More...
 
class  import_outcomes_form
 

Functions

 get_gradable_users (int $courseid, ?int $groupid=null, bool $onlyactiveenrol=false)
 Load a valid list of gradable users in a course.
 
 grade_build_nav ($path, $pagename=null, $id=null)
 Function central to gradebook for building and printing the navigation (breadcrumb trail).
 
 grade_button ($type, $courseid, $object)
 Local shortcut function for creating an edit/delete button for a grade_* object.
 
moodle_page grade_extend_settings ($plugininfo, $courseid)
 This method adds settings to the settings block for the grade system and its plugins.
 
 grade_get_graded_users_select ($report, $course, $userid, $groupid, $includeall)
 
 grade_get_plugin_info ($courseid, $active_type, $active_plugin)
 grade_get_plugin_info
 
 grade_hide_min_max_grade_upgrade_notice ($courseid)
 Hide warning about changed grades during upgrade from 2.8.0-2.8.6 and 2.9.0.
 
 grade_upgrade_use_min_max_from_grade_grade ($courseid)
 Use the grade min and max from the grade_grade.
 
 grade_upgrade_use_min_max_from_grade_item ($courseid)
 Use the grade min and max from the grade_item.
 
 hide_aggregatesubcats_upgrade_notice ($courseid)
 Hide warning about changed grades during upgrade to 2.8.
 
 hide_gradebook_calculations_freeze_notice ($courseid)
 Hide warning about changed grades due to bug fixes.
 
 hide_natural_aggregation_upgrade_notice ($courseid)
 Hide warning about changed grades during upgrade to 2.8.
 
 print_grade_page_head (int $courseid, string $active_type, ?string $active_plugin=null, string|bool $heading=false, bool $return=false, $buttons=false, bool $shownavigation=true, ?string $headerhelpidentifier=null, ?string $headerhelpcomponent=null, ?stdClass $user=null, ?action_bar $actionbar=null, $unused=null)
 Prints the page headers, breadcrumb trail, page heading, (optional) navigation and for any gradebook page.
 
 print_graded_users_selector ($course, $actionpage, $userid=0, $groupid=0, $includeall=true, $return=false)
 Print a selection popup form of the graded users in a course.
 
 print_natural_aggregation_upgrade_notice ($courseid, $context, $thispage, $return=false)
 Print warning about changed grades during upgrade to 2.8.
 

Variables

 $context = context_course::instance($courseid)
 
 $row = $tabs = array()
 Prints navigation tabs for viewing and editing grade letters.
 
 $row []
 
 $row = $tabs = array()
 Prints navigation tabs for viewing and editing grade outcomes.
 
 $row []
 
if(has_capability('moodle/grade:manageletters', $context)) $tabs [] = $row
 
if(has_capability('moodle/grade:manage', $context)) $tabs [] = $row
 
 if (!defined( 'MOODLE_INTERNAL'))
 A moodleform for editing grade letters.
 
 if (!defined( 'MOODLE_INTERNAL'))
 Edit form for grade outcomes.
 
 if (!defined( 'MOODLE_INTERNAL'))
 A form to allow importing outcomes from a file.
 
 if (!defined( 'MOODLE_INTERNAL'))
 Edit form for grade scales.
 
 if (!defined( 'MOODLE_INTERNAL'))
 A form for editing course grade settings.
 
 if (!defined( 'MOODLE_INTERNAL'))
 A moodleform to allow the editing of a calculated grade item.
 
 if (!defined( 'MOODLE_INTERNAL'))
 A moodleform to edit the grade options for an individual grade category.
 
 if (!defined( 'MOODLE_INTERNAL'))
 A moodleform to allow the editing of a user's grade for a particular activity.
 
 if (!defined( 'MOODLE_INTERNAL'))
 A moodleform allowing the editing of the grade options for an individual grade item.
 
 if (!defined( 'MOODLE_INTERNAL'))
 A moodleform to allow the creation and editing of outcome grade items.
 

Detailed Description

Function Documentation

◆ get_gradable_users()

get_gradable_users ( int $courseid,
?int $groupid = null,
bool $onlyactiveenrol = false )

Load a valid list of gradable users in a course.

Parameters
int$courseidThe course ID.
int | null$groupidThe group ID (optional).
bool$onlyactiveenrolInclude only active enrolments.
Return values
array\$usersA list of enrolled gradable users.

◆ grade_build_nav()

grade_build_nav ( $path,
$pagename = null,
$id = null )

Function central to gradebook for building and printing the navigation (breadcrumb trail).

Parameters
string$pathThe path of the calling script (using FILE?)
string$pagenameThe language string to use as the last part of the navigation (non-link)
mixed$idEither a plain integer (assuming the key is 'id') or an array of keys and values (e.g courseid => $courseid, itemid...)
Return values
string

◆ grade_button()

grade_button ( $type,
$courseid,
$object )

Local shortcut function for creating an edit/delete button for a grade_* object.

Parameters
string$type'edit' or 'delete'
int$courseidThe Course ID
grade_*$object The grade_* object
Return values
stringhtml

◆ grade_extend_settings()

moodle_page grade_extend_settings ( $plugininfo,
$courseid )

This method adds settings to the settings block for the grade system and its plugins.

$PAGE

◆ grade_get_plugin_info()

grade_get_plugin_info ( $courseid,
$active_type,
$active_plugin )

grade_get_plugin_info

Parameters
int$courseidThe course id
string$active_typetype of plugin on current page - import, export, report or edit
string$active_pluginactive plugin type - grader, user, cvs, ...
Return values
array

◆ grade_hide_min_max_grade_upgrade_notice()

grade_hide_min_max_grade_upgrade_notice ( $courseid)

Hide warning about changed grades during upgrade from 2.8.0-2.8.6 and 2.9.0.

Parameters
int$courseidThe current course id.

◆ grade_upgrade_use_min_max_from_grade_grade()

grade_upgrade_use_min_max_from_grade_grade ( $courseid)

Use the grade min and max from the grade_grade.

This is reserved for core use after an upgrade.

Parameters
int$courseidThe current course id.

◆ grade_upgrade_use_min_max_from_grade_item()

grade_upgrade_use_min_max_from_grade_item ( $courseid)

Use the grade min and max from the grade_item.

This is reserved for core use after an upgrade.

Parameters
int$courseidThe current course id.

◆ hide_aggregatesubcats_upgrade_notice()

hide_aggregatesubcats_upgrade_notice ( $courseid)

Hide warning about changed grades during upgrade to 2.8.

Parameters
int$courseidThe current course id.

◆ hide_gradebook_calculations_freeze_notice()

hide_gradebook_calculations_freeze_notice ( $courseid)

Hide warning about changed grades due to bug fixes.

Parameters
int$courseidThe current course id.

◆ hide_natural_aggregation_upgrade_notice()

hide_natural_aggregation_upgrade_notice ( $courseid)

Hide warning about changed grades during upgrade to 2.8.

Parameters
int$courseidThe current course id.

◆ print_grade_page_head()

print_grade_page_head ( int $courseid,
string $active_type,
?string $active_plugin = null,
string|bool $heading = false,
bool $return = false,
$buttons = false,
bool $shownavigation = true,
?string $headerhelpidentifier = null,
?string $headerhelpcomponent = null,
?stdClass $user = null,
?action_bar $actionbar = null,
$unused = null )

Prints the page headers, breadcrumb trail, page heading, (optional) navigation and for any gradebook page.

All gradebook pages MUST use these functions in favour of the usual print_header(), print_header_simple(), print_heading() etc.

Parameters
int$courseidCourse id
string$active_typeThe type of the current page (report, settings, import, export, scales, outcomes, letters)
string | null$active_pluginThe plugin of the current page (grader, fullview etc...)
string | bool$headingThe heading of the page.
boolean$returnWhether to return (true) or echo (false) the HTML generated by this function
string | bool$buttonsAdditional buttons to display on the page
boolean$shownavigationshould the gradebook navigation be shown?
string | null$headerhelpidentifierThe help string identifier if required.
string | null$headerhelpcomponentThe component for the help string.
stdClass | null$userThe user object for use with the user context header.
action_bar | null$actionbarThe actions bar which will be displayed on the page if $shownavigation is set to true. If $actionbar is not explicitly defined, the general action bar (core_grades\output\general_action_bar) will be used by default.
null$unusedThis parameter has been deprecated since 4.3 and should not be used anymore.
Return values
stringHTML code or nothing if $return == false

◆ print_graded_users_selector()

print_graded_users_selector ( $course,
$actionpage,
$userid = 0,
$groupid = 0,
$includeall = true,
$return = false )

Print a selection popup form of the graded users in a course.

Deprecated
since 2.0
Parameters
int$courseid of the course
string$actionpageThe page receiving the data from the popoup form
int$useridid of the currently selected user (or 'all' if they are all selected)
int$groupidid of requested group, 0 means all
int$includeallbool include all option
bool$returnIf true, will return the HTML, otherwise, will print directly
Return values
null

◆ print_natural_aggregation_upgrade_notice()

print_natural_aggregation_upgrade_notice ( $courseid,
$context,
$thispage,
$return = false )

Print warning about changed grades during upgrade to 2.8.

Parameters
int$courseidThe current course id.
context$contextThe course context.
string$thispageThe relative path for the current page. E.g. /grade/report/user/index.php
boolean$returnreturn as string
Return values
nothingor string if $return true

Variable Documentation

◆ $row [1/4]

$row = $tabs = array()

Prints navigation tabs for viewing and editing grade letters.

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

◆ $row [2/4]

$row[]
Initial value:
= new tabobject('lettersview',
$CFG->wwwroot.'/grade/edit/letter/index.php?id='.$COURSE->id,
get_string('letters', 'grades'))
Stores one tab.
Definition outputcomponents.php:3984

◆ $row [3/4]

$row = $tabs = array()

Prints navigation tabs for viewing and editing grade outcomes.

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

◆ $row [4/4]

$row[]
Initial value:
= new tabobject('courseoutcomes',
$CFG->wwwroot.'/grade/edit/outcome/course.php?id='.$courseid,
get_string('outcomescourse', 'grades'))
$courseid
The gradebook outcomes report.
Definition index.php:29

◆ if [1/10]

if(!defined('MOODLE_INTERNAL')) ( ! defined 'MOODLE_INTERNAL')

A moodleform for editing grade letters.

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

◆ if [2/10]

if(!defined('MOODLE_INTERNAL')) ( ! defined 'MOODLE_INTERNAL')

Edit form for grade outcomes.

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

◆ if [3/10]

if(!defined('MOODLE_INTERNAL')) ( ! defined 'MOODLE_INTERNAL')

A form to allow importing outcomes from a file.

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

◆ if [4/10]

if(!defined('MOODLE_INTERNAL')) ( ! defined 'MOODLE_INTERNAL')

Edit form for grade scales.

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

◆ if [5/10]

if(!defined('MOODLE_INTERNAL')) ( ! defined 'MOODLE_INTERNAL')

A form for editing course grade settings.

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

◆ if [6/10]

if(!defined('MOODLE_INTERNAL')) ( ! defined 'MOODLE_INTERNAL')

A moodleform to allow the editing of a calculated grade item.

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

◆ if [7/10]

if(!defined('MOODLE_INTERNAL')) ( ! defined 'MOODLE_INTERNAL')

A moodleform to edit the grade options for an individual grade category.

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

◆ if [8/10]

if(!defined('MOODLE_INTERNAL')) ( ! defined 'MOODLE_INTERNAL')

A moodleform to allow the editing of a user's grade for a particular activity.

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

◆ if [9/10]

if(!defined('MOODLE_INTERNAL')) ( ! defined 'MOODLE_INTERNAL')

A moodleform allowing the editing of the grade options for an individual grade item.

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

◆ if [10/10]

if(!defined('MOODLE_INTERNAL')) ( ! defined 'MOODLE_INTERNAL')

A moodleform to allow the creation and editing of outcome grade items.

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