mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
MDL-43833 quiz reports: persist states settings between pages.
This commit is contained in:
parent
a929fd50f9
commit
69d8094f83
1 changed files with 16 additions and 3 deletions
|
@ -119,6 +119,11 @@ class mod_quiz_attempts_report_options {
|
|||
'attempts' => $this->attempts,
|
||||
'onlygraded' => $this->onlygraded,
|
||||
);
|
||||
|
||||
if ($this->states) {
|
||||
$params['states'] = implode('-', $this->states);
|
||||
}
|
||||
|
||||
if (groups_get_activity_groupmode($this->cm, $this->course)) {
|
||||
$params['group'] = $this->group;
|
||||
}
|
||||
|
@ -164,6 +169,12 @@ class mod_quiz_attempts_report_options {
|
|||
$toform->onlygraded = $this->onlygraded;
|
||||
$toform->pagesize = $this->pagesize;
|
||||
|
||||
if ($this->states) {
|
||||
foreach (self::$statefields as $field => $state) {
|
||||
$toform->$field = in_array($state, $this->states);
|
||||
}
|
||||
}
|
||||
|
||||
return $toform;
|
||||
}
|
||||
|
||||
|
@ -186,7 +197,7 @@ class mod_quiz_attempts_report_options {
|
|||
}
|
||||
|
||||
/**
|
||||
* Set the fields of this object from the user's preferences.
|
||||
* Set the fields of this object from the URL parameters.
|
||||
*/
|
||||
public function setup_from_params() {
|
||||
$this->attempts = optional_param('attempts', $this->attempts, PARAM_ALPHAEXT);
|
||||
|
@ -194,8 +205,10 @@ class mod_quiz_attempts_report_options {
|
|||
$this->onlygraded = optional_param('onlygraded', $this->onlygraded, PARAM_BOOL);
|
||||
$this->pagesize = optional_param('pagesize', $this->pagesize, PARAM_INT);
|
||||
|
||||
$this->states = explode('-', optional_param('states',
|
||||
implode('-', $this->states), PARAM_ALPHAEXT));
|
||||
$states = optional_param('states', '', PARAM_ALPHAEXT);
|
||||
if (!empty($states)) {
|
||||
$this->states = explode('-', $states);
|
||||
}
|
||||
|
||||
$this->download = optional_param('download', $this->download, PARAM_ALPHA);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue