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.

Differences Between: [Versions 401 and 402] [Versions 401 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: 2 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