Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MDL-38412 fix quiz reports group mode weirdness.

Moodle currently selected group uses the session. This can cause weird
effects when you have two tabs open. This is particularly weird in the
quiz reports, where some actions like delete attempt are checked against
the currently selected group.

The solution is to put the currently selected group into the URL for all
actions like delete/regrade attempt, regrade all attempts, download and
sort table.
  • Loading branch information...
commit a4768fe2901580f30893ab7c749e45ece5672951 1 parent 2e4d9a0
@timhunt timhunt authored
View
6 mod/quiz/report/attemptsreport_options.php
@@ -113,12 +113,16 @@ public function __construct($mode, $quiz, $cm, $course) {
* @return array URL parameter name => value.
*/
protected function get_url_params() {
- return array(
+ $params = array(
'id' => $this->cm->id,
'mode' => $this->mode,
'attempts' => $this->attempts,
'onlygraded' => $this->onlygraded,
);
+ if (groups_get_activity_groupmode($this->cm, $this->course)) {
+ $params['group'] = $this->group;
+ }
+ return $params;
}
/**
View
2  mod/quiz/report/overview/report.php
@@ -69,7 +69,7 @@ public function display($quiz, $cm, $course) {
$courseshortname = format_string($course->shortname, true,
array('context' => context_course::instance($course->id)));
$table = new quiz_overview_table($quiz, $this->context, $this->qmsubselect,
- $options, $groupstudents, $students, $questions, $this->get_base_url());
+ $options, $groupstudents, $students, $questions, $options->get_url());
$filename = quiz_report_download_filename(get_string('overviewfilename', 'quiz_overview'),
$courseshortname, $quiz->name);
$table->is_downloading($options->download, $filename,
View
2  mod/quiz/report/responses/report.php
@@ -77,7 +77,7 @@ public function display($quiz, $cm, $course) {
$courseshortname = format_string($course->shortname, true,
array('context' => context_course::instance($course->id)));
$table = new quiz_responses_table($quiz, $this->context, $this->qmsubselect,
- $options, $groupstudents, $students, $questions, $this->get_base_url());
+ $options, $groupstudents, $students, $questions, $options->get_url());
$filename = quiz_report_download_filename(get_string('responsesfilename', 'quiz_responses'),
$courseshortname, $quiz->name);
$table->is_downloading($options->download, $filename,
Please sign in to comment.
Something went wrong with that request. Please try again.