From ec802d8ef6211e230eecc76ded0f34b02df970d2 Mon Sep 17 00:00:00 2001 From: David Monllao Date: Wed, 19 Nov 2014 14:37:12 +0800 Subject: [PATCH] MDL-38128 mod_assign: Adding group selector to grading summary page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Thanks to Pau Ferrer OcaƱa and Avi Levy for their work on this issue. --- mod/assign/locallib.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/mod/assign/locallib.php b/mod/assign/locallib.php index 08d826b4f8e..4e216aefc10 100644 --- a/mod/assign/locallib.php +++ b/mod/assign/locallib.php @@ -4121,6 +4121,11 @@ class assign { if ($this->can_view_grades()) { $draft = ASSIGN_SUBMISSION_STATUS_DRAFT; $submitted = ASSIGN_SUBMISSION_STATUS_SUBMITTED; + + // Group selector will only be displayed if necessary. + $currenturl = new moodle_url('/mod/assign/view.php', array('id' => $this->get_course_module()->id)); + $o .= groups_print_activity_menu($this->get_course_module(), $currenturl->out(), true); + if ($instance->teamsubmission) { $summary = new assign_grading_summary($this->count_teams(), $instance->submissiondrafts, @@ -4134,7 +4139,9 @@ class assign { $instance->teamsubmission); $o .= $this->get_renderer()->render($summary); } else { - $summary = new assign_grading_summary($this->count_participants(0), + // The active group has already been updated in groups_print_activity_menu(). + $countparticipants = $this->count_participants(groups_get_activity_group($this->get_course_module())); + $summary = new assign_grading_summary($countparticipants, $instance->submissiondrafts, $this->count_submissions_with_status($draft), $this->is_any_submission_plugin_enabled(),