Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 3.9.x will end* 10 May 2021 (12 months).
  • Bug fixes for security issues in 3.9.x will end* 8 May 2023 (36 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

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

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