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 400 and 402] [Versions 400 and 403]

External grading API

Copyright: 2013 Paul Charsley
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 583 lines (25 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: core_grading_external  - X-Ref

core grading functions

get_definitions_parameters()   X-Ref
Describes the parameters for get_definitions

return: external_function_parameters

get_definitions($cmids, $areaname, $activeonly = false)   X-Ref
Returns the definitions for the requested course module ids

return: array of areas with definitions for each requested course module id
param: array of ints $cmids
param: string $areaname
param: boolean $activeonly default is false, if true, only the active method is returned

format_text($items, $contextid, $componentname, $itemid)   X-Ref
Recursively processes all elements in an array and runs external_format_text()on
all elements which have a text field and associated format field with a key name
that ends with the text 'format'. The modified array is returned.

return: array the input array with all fields formatted
param: array $items the array to be processed
param: int $contextid
param: string $componentname
param: int $itemid

grading_area()   X-Ref
Creates a grading area

return: external_single_structure

definition()   X-Ref
creates a grading form definition

return: external_single_structure

get_definitions_returns()   X-Ref
Describes the get_definitions return value

return: external_single_structure

get_grading_methods()   X-Ref

return: array of available grading methods

get_gradingform_instances_parameters()   X-Ref
Describes the parameters for get_gradingform_instances

return: external_function_parameters

get_gradingform_instances($definitionid, $since = 0)   X-Ref
Returns the instances and fillings for the requested definition id

return: array of grading instances with fillings for the definition id
param: int $definitionid
param: int $since only return instances with timemodified >= since

grading_instance()   X-Ref
Creates a grading instance

return: external_single_structure

get_gradingform_instances_returns()   X-Ref
Describes the get_gradingform_instances return value

return: external_single_structure

save_definitions_parameters()   X-Ref
Describes the parameters for save_definitions

return: external_function_parameters

save_definitions($areas)   X-Ref
Saves the areas and definitions

return: null
param: array $areas array of areas containing definitions to be saved

save_definitions_returns()   X-Ref
Describes the return value for save_definitions

return: external_single_structure

create_definition_object($definition)   X-Ref
Creates a definition stdClass object using the values from the definition
array that is passed in as a parameter

return: stdClass definition object
param: array $definition

set_new_ids($arraytoset, $startnumber)   X-Ref
Recursively iterates through arrays. Any array without an id key-value combination
is assumed to be an array of values to be inserted and an id key-value is added with
the value matching the regex '/^NEWID\d+$/' that is expected by each grading form implementation.

return: array with missing id keys added for all arrays
param: array $arraytoset the array to be processed
param: int $startnumber the starting number for the new id numbers