Search moodle.org's
Developer Documentation

See Release Notes

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

Differences Between: [Versions 310 and 402] [Versions 39 and 402]

Classes to enforce the various access rules that can apply to a activity.

Copyright: 2009 Tim Hunt
Copyright: 2015 Stephen Bourget
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 735 lines (34 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

block_activity_results:: (11 methods):
  init()
  has_config()
  applicable_formats()
  get_owning_activity()
  instance_config_save()
  get_content()
  instance_allow_multiple()
  activity_format_grade()
  activity_link()
  get_scale()
  get_config_for_external()


Class: block_activity_results  - X-Ref

Block activity_results class definition.

This block can be added to a course page or a activity page to display of list of
the best/worst students/groups in a particular activity.

init()   X-Ref
Core function used to initialize the block.


has_config()   X-Ref
Allow the block to have a configuration page

return: boolean

applicable_formats()   X-Ref
Core function, specifies where the block can be used.

return: array

get_owning_activity()   X-Ref
If this block belongs to a activity context, then return that activity's id.
Otherwise, return 0.

return: stdclass the activity record.

instance_config_save($data, $nolongerused = false)   X-Ref
Used to save the form config data

param: stdclass $data
param: bool $nolongerused

get_content()   X-Ref
Used to generate the content for the block.

return: string

instance_allow_multiple()   X-Ref
Allows the block to be added multiple times to a single page

return: boolean

activity_format_grade($grade)   X-Ref
Formats the grade to the specified decimal points

param: float $grade
return: string

activity_link($activity, $cm)   X-Ref
Generates the Link to the activity module when displayed outside of the module.

param: stdclass $activity
param: stdclass $cm
return: string

get_scale($scaleid)   X-Ref
Generates a numeric array of scale entries

param: int $scaleid
return: array

get_config_for_external()   X-Ref
Return the plugin config settings for external functions.

return: stdClass the configs for both the block instance and plugin