Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 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 310 and 402] [Versions 310 and 403]

Base class for the options that control what is visible in an {@link quiz_attempts_report}.

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

Defines 1 class


Class: mod_quiz_attempts_report_options  - X-Ref

Base class for the options that control what is visible in an {@link quiz_attempts_report}.

__construct($mode, $quiz, $cm, $course)   X-Ref
Constructor.

param: string $mode which report these options are for.
param: object $quiz the settings for the quiz being reported on.
param: object $cm the course module objects for the quiz being reported on.
param: object $coures the course settings for the coures this quiz is in.

get_url_params()   X-Ref
Get the URL parameters required to show the report with these options.

return: array URL parameter name => value.

get_url()   X-Ref
Get the URL to show the report with these options.

return: moodle_url the URL.

process_settings_from_form($fromform)   X-Ref
Process the data we get when the settings form is submitted. This includes
updating the fields of this class, and updating the user preferences
where appropriate.

param: object $fromform The data from $mform->get_data() from the settings form.

process_settings_from_params()   X-Ref
Set up this preferences object using optional_param (using user_preferences
to set anything not specified by the params.


get_initial_form_data()   X-Ref
Get the current value of the settings to pass to the settings form.


setup_from_form_data($fromform)   X-Ref
Set the fields of this object from the form data.

param: object $fromform The data from $mform->get_data() from the settings form.

setup_from_params()   X-Ref
Set the fields of this object from the URL parameters.


setup_from_user_preferences()   X-Ref
Set the fields of this object from the user's preferences.
(For those settings that are backed by user-preferences).


update_user_preferences()   X-Ref
Update the user preferences so they match the settings in this object.
(For those settings that are backed by user-preferences).


resolve_dependencies()   X-Ref
Check the settings, and remove any 'impossible' combinations.


is_showing_finished_attempts()   X-Ref
Whether the options are such that finished attempts are being shown.

return: boolean