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.

Class represents the result of an availability check for the user.

Copyright: 2014 The Open University
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 95 lines (3 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

result:: (3 methods):
  __construct()
  is_available()
  filter_nodes()


Class: result  - X-Ref

Class represents the result of an availability check for the user.

You can pass an object of this class to tree::get_result_information to
display suitable student information about the result.

__construct($available, tree_node $node = null,array $failedchildren = array()   X-Ref
Constructs result.

param: bool $available True if available
param: tree_node $node Node if failed & should be displayed
param: result[] $failedchildren Array of children who failed too

is_available()   X-Ref
Checks if the result was a yes.

return: bool True if the activity is available

filter_nodes(array $array)   X-Ref
Filters the provided array so that it only includes nodes which are
supposed to be displayed in the result output. (I.e. those for which
the user failed the test, and which are not set to totally hide
output.)

param: tree_node[] $array Input array of nodes
return: array Output array containing only those nodes set for display