Moodle APIs 3.9
Moodle 3.9.13+ (Build: 20220325)
Public Member Functions | Public Attributes | Protected Member Functions | Static Protected Attributes | List of all members
mod_quiz_attempts_report_options Class Reference

Base class for the options that control what is visible in an quiz_attempts_report. More...

Inheritance diagram for mod_quiz_attempts_report_options:
quiz_overview_options quiz_responses_options

Public Member Functions

 __construct ($mode, $quiz, $cm, $course)
 Constructor. More...
 
 get_initial_form_data ()
 Get the current value of the settings to pass to the settings form. More...
 
 get_url ()
 Get the URL to show the report with these options. More...
 
 process_settings_from_form ($fromform)
 Process the data we get when the settings form is submitted. More...
 
 process_settings_from_params ()
 Set up this preferences object using optional_param (using user_preferences to set anything not specified by the params.
 
 resolve_dependencies ()
 Check the settings, and remove any 'impossible' combinations. More...
 
 setup_from_form_data ($fromform)
 Set the fields of this object from the form data. More...
 
 setup_from_params ()
 Set the fields of this object from the URL parameters. More...
 
 setup_from_user_preferences ()
 Set the fields of this object from the user's preferences. More...
 
 update_user_preferences ()
 Update the user preferences so they match the settings in this object. More...
 

Public Attributes

string $attempts = quiz_attempts_report::ENROLLED_WITH
 quiz_attempts_report::ALL_WITH or quiz_attempts_report::ENROLLED_WITH quiz_attempts_report::ENROLLED_WITHOUT or quiz_attempts_report::ENROLLED_ALL
 
bool $checkboxcolumn = false
 whether the report table should have a column of checkboxes.
 
object $cm
 the course module objects for the quiz being reported on.
 
object $course
 the course settings for the course the quiz is in.
 
string $download = ''
 whether the data should be downloaded in some format, or '' to display it.
 
int $group = 0
 the currently selected group. More...
 
string $mode
 the report mode.
 
bool $onlygraded = false
 whether to show all finished attmepts, or just the one that gave the final grade for the user.
 
int $pagesize = quiz_attempts_report::DEFAULT_PAGE_SIZE
 Number of attempts to show per page.
 
object $quiz
 the settings for the quiz being reported on.
 
array null $states
 of quiz_attempt::IN_PROGRESS, etc. More...
 
bool $usercanseegrades
 whether the current user has permission to see grades.
 

Protected Member Functions

 get_url_params ()
 Get the URL parameters required to show the report with these options. More...
 
 is_showing_finished_attempts ()
 Whether the options are such that finished attempts are being shown. More...
 

Static Protected Attributes

static array $statefields
 form field name => corresponding quiz_attempt:: state constant. More...
 

Detailed Description

Base class for the options that control what is visible in an quiz_attempts_report.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Constructor & Destructor Documentation

◆ __construct()

mod_quiz_attempts_report_options::__construct (   $mode,
  $quiz,
  $cm,
  $course 
)

Constructor.

Parameters
string$modewhich report these options are for.
object$quizthe settings for the quiz being reported on.
object$cmthe course module objects for the quiz being reported on.
object$couresthe course settings for the coures this quiz is in.

Member Function Documentation

◆ get_initial_form_data()

mod_quiz_attempts_report_options::get_initial_form_data ( )

Get the current value of the settings to pass to the settings form.

Reimplemented in quiz_overview_options, and quiz_responses_options.

◆ get_url()

mod_quiz_attempts_report_options::get_url ( )

Get the URL to show the report with these options.

Return values
moodle_urlthe URL.

◆ get_url_params()

mod_quiz_attempts_report_options::get_url_params ( )
protected

Get the URL parameters required to show the report with these options.

Return values
arrayURL parameter name => value.

Reimplemented in quiz_overview_options, and quiz_responses_options.

◆ is_showing_finished_attempts()

mod_quiz_attempts_report_options::is_showing_finished_attempts ( )
protected

Whether the options are such that finished attempts are being shown.

Return values
boolean

◆ process_settings_from_form()

mod_quiz_attempts_report_options::process_settings_from_form (   $fromform)

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.

Parameters
object$fromformThe data from $mform->get_data() from the settings form.

◆ resolve_dependencies()

mod_quiz_attempts_report_options::resolve_dependencies ( )

Check the settings, and remove any 'impossible' combinations.

Reimplemented in quiz_overview_options, and quiz_responses_options.

◆ setup_from_form_data()

mod_quiz_attempts_report_options::setup_from_form_data (   $fromform)

Set the fields of this object from the form data.

Parameters
object$fromformThe data from $mform->get_data() from the settings form.

Reimplemented in quiz_overview_options, and quiz_responses_options.

◆ setup_from_params()

mod_quiz_attempts_report_options::setup_from_params ( )

Set the fields of this object from the URL parameters.

Reimplemented in quiz_overview_options, and quiz_responses_options.

◆ setup_from_user_preferences()

mod_quiz_attempts_report_options::setup_from_user_preferences ( )

Set the fields of this object from the user's preferences.

(For those settings that are backed by user-preferences).

Reimplemented in quiz_overview_options, and quiz_responses_options.

◆ update_user_preferences()

mod_quiz_attempts_report_options::update_user_preferences ( )

Update the user preferences so they match the settings in this object.

(For those settings that are backed by user-preferences).

Reimplemented in quiz_overview_options, and quiz_responses_options.

Member Data Documentation

◆ $group

int mod_quiz_attempts_report_options::$group = 0

the currently selected group.

0 if no group is selected.

◆ $statefields

array mod_quiz_attempts_report_options::$statefields
staticprotected
Initial value:
= array(
'stateinprogress' => quiz_attempt::IN_PROGRESS,
'stateoverdue' => quiz_attempt::OVERDUE,
'statefinished' => quiz_attempt::FINISHED,
'stateabandoned' => quiz_attempt::ABANDONED,
)
string const FINISHED
to identify the finished state.
Definition: attemptlib.php:592
string const ABANDONED
to identify the abandoned state.
Definition: attemptlib.php:594
string const OVERDUE
to identify the overdue state.
Definition: attemptlib.php:590
string const IN_PROGRESS
to identify the in progress state.
Definition: attemptlib.php:588

form field name => corresponding quiz_attempt:: state constant.

◆ $states

array null mod_quiz_attempts_report_options::$states
Initial value:

of quiz_attempt::IN_PROGRESS, etc.

constants. null means no restriction.


The documentation for this class was generated from the following file: