Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

Generator for the gradingforum_guide plugin.

Copyright: 2019 Andrew Nicols <andrew@nicols.co.uk>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 239 lines (8 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 2 files
 grade/grading/form/guide/tests/generator/guide.php
 grade/grading/form/guide/tests/generator/criterion.php

Defines 1 class

gradingform_guide_generator:: (7 methods):
  create_instance()
  get_guide()
  get_criterion()
  get_criterion_for_values()
  get_submitted_form_data()
  get_test_guide()
  get_test_form_data()


Class: gradingform_guide_generator  - X-Ref

Generator for the gradingforum_guide plugintype.

create_instance(context $context,string $component,string $area,string $name,string $description,array $criteria)   X-Ref
Create an instance of a marking guide.

param: context $context
param: string $component
param: string $area
param: string $name
param: string $description
param: array $criteria The list of criteria to add to the generated guide
return: gradingform_guide_controller

get_guide(string $name, string $description)   X-Ref
Get a new guide for use with the guide controller.

Note: This is just a helper class used to build a new definition. It does not persist the data.

param: string $name
param: string $description
return: generator_guide

get_criterion(string $shortname,string $description,string $descriptionmarkers,float $maxscore)   X-Ref
Get a new criterion for use with a guide.

Note: This is just a helper class used to build a new definition. It does not persist the data.

param: string $shortname The shortname for the criterion
param: string $description The description for the criterion
param: string $descriptionmarkers The description for the marker for this criterion
param: float $maxscore The maximum score possible for this criterion
return: criterion

get_criterion_for_values(gradingform_controller $controller, string $shortname)   X-Ref
Given a controller instance, fetch the level and criterion information for the specified values.

param: gradingform_controller $controller
param: string $shortname The shortname to match the criterion on
return: stdClass

get_submitted_form_data(gradingform_guide_controller $controller, int $itemid, array $values)   X-Ref
Get submitted form data

param: gradingform_guide_controller $controller
param: int $itemid
param: array $values A set of array values where the array key is the name of the criterion, and the value is an

get_test_guide(context_module $context,string $component = 'mod_assign',string $areaname = 'submission')   X-Ref
Generate a guide controller with sample data required for testing of this class.

param: context_module $context
return: gradingform_guide_controller

get_test_form_data(gradingform_guide_controller $controller,int $itemid,float $spellingscore,string $spellingremark,float $picturescore,string $pictureremark)   X-Ref
Fetch a set of sample data.

param: gradingform_guide_controller $controller
param: int $itemid
param: float $spellingscore
param: string $spellingremark
param: float $picturescore
param: string $pictureremark
return: array