Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.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