Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.3.x will end 7 October 2024 (12 months).
  • Bug fixes for security issues in 4.3.x will end 21 April 2025 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.2.x is supported too.

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

External grading API

Copyright: 2013 Paul Charsley
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 590 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

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

format_text($items, $contextid, $componentname, $itemid)   X-Ref
Recursively processes all elements in an array and runs \core_external\util::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.

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

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

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

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

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

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

param: array $definition
return: stdClass definition object

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.

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