Non-core contributed modules

Gradebook will not show all participants when groups are defined, and course group mode is set to no

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.8.2
  • Fix Version/s: None
  • Component/s: Patch: Gradebook Plus
  • Labels:
    None
  • Environment:
    any
  • Database:
    Any
  • Affected Branches:
    MOODLE_18_STABLE

Description

Using MOODLE_18_STABLE, from 9/14/07.

If there are groups defined in a course, and the course-level groups mode is set to 'no', the gradebook will only display users that are in the first group (groupid 1). The course group mode must be set to 'separate' or 'visible' in order to see all participants in the gradebook.

It looks like in get_formatted_grades(), it ignores the course groupmode setting and calls get_current_group(), which gets the current group from $SESSION->currentgroup[$courseid] . This seems to be getting set to 1 somewhere along the way. If the course group mode is 'no', it should just default to showing all participants.

Here's a fix -

diff -r1.3.2.8 lib.php
396,399c396,400
< // if the user has selected a group to view by get the group members
< if ($currentgroup = get_current_group($course->id)) { < $groupmembers = get_group_users($currentgroup); < }

>
> // if the user has selected a group to view by, and the course group mode is not 0, get the group members
> if ($currentgroup = get_current_group($course->id) && groupmode($course) != 0) { > $groupmembers = get_group_users($currentgroup); > }

  1. gbpv2_lib.php.diff
    15/Nov/07 6:48 AM
    1 kB
    Anthony Borrow
  2. gradebookgroupspatch.txt
    18/Oct/07 1:54 AM
    2 kB
    Ann Adamcik
  3. grouppatch.diff
    18/Oct/07 4:16 AM
    1 kB
    Anthony Borrow

Issue Links

Activity

Hide
Ann Adamcik added a comment -

This is affecting downloading also. Attached is a more complete patch. This displays and downloads grades for all participants if the course groupmode is not set.

Show
Ann Adamcik added a comment - This is affecting downloading also. Attached is a more complete patch. This displays and downloads grades for all participants if the course groupmode is not set.
Hide
Anthony Borrow added a comment -

Ann - Thanks for the patch. I am including another diff file since it is in a more readable format (just a matter of personal preference) and what Eclipse generates when I committed the patch. Would you mind checking to see if the same issue exists in Moodle core (18STABLE) and if so creating a tracker issue for that if it does not already exist. As much as possible I would like to keep GBPv2 and Moodle core as closely aligned and patched as possible. Thanks - Anthony

Show
Anthony Borrow added a comment - Ann - Thanks for the patch. I am including another diff file since it is in a more readable format (just a matter of personal preference) and what Eclipse generates when I committed the patch. Would you mind checking to see if the same issue exists in Moodle core (18STABLE) and if so creating a tracker issue for that if it does not already exist. As much as possible I would like to keep GBPv2 and Moodle core as closely aligned and patched as possible. Thanks - Anthony
Hide
Anthony Borrow added a comment - - edited

Ann - It would also help if you (and others) could test the latest commit and verify that it is working properly. Peace - Anthony

Show
Anthony Borrow added a comment - - edited Ann - It would also help if you (and others) could test the latest commit and verify that it is working properly. Peace - Anthony
Hide
Ann Adamcik added a comment -

Anthony - I've tested on demo.moodle.org, and the same issue exists in the core gradebook. I've filed MDL-11831. I'll test the latest commit - thanks for getting to this so quickly!

Show
Ann Adamcik added a comment - Anthony - I've tested on demo.moodle.org, and the same issue exists in the core gradebook. I've filed MDL-11831. I'll test the latest commit - thanks for getting to this so quickly!
Hide
Anthony Borrow added a comment -

Ann and Wen - Some minor changes to how groups are determined. I wanted to be explicit about what is happening logically. I felt that Ann's patch was a little harder to read and I was running into issues in a metacourse where groups were separate groups were assigned; however, the student could not view his/her own record. So if there is no groupmode then the list is the entire class otherwise it gets the group number and a group number of 0 should show all participants. I think this will handle all scenarios but let's test it and make sure. Similarly, I made some changes to how groups were handled in exception.php (CONTRIB-109) so that it handles groups according to a similar/consistent logic. Let me know what you think. Thanks - Anthony

Show
Anthony Borrow added a comment - Ann and Wen - Some minor changes to how groups are determined. I wanted to be explicit about what is happening logically. I felt that Ann's patch was a little harder to read and I was running into issues in a metacourse where groups were separate groups were assigned; however, the student could not view his/her own record. So if there is no groupmode then the list is the entire class otherwise it gets the group number and a group number of 0 should show all participants. I think this will handle all scenarios but let's test it and make sure. Similarly, I made some changes to how groups were handled in exception.php (CONTRIB-109) so that it handles groups according to a similar/consistent logic. Let me know what you think. Thanks - Anthony
Hide
Anthony Borrow added a comment -

Once I get some feedback that this is working and does not break something else, I will go ahead and commit the patches (gbpv2_lib.php.diff in CONTRIB-105 and gbpv2_exception.php.diff in CONTRIB-109). Initial testing seems to make this behave much more consistently. Thanks for your help in testing. Peace - Anthony

Show
Anthony Borrow added a comment - Once I get some feedback that this is working and does not break something else, I will go ahead and commit the patches (gbpv2_lib.php.diff in CONTRIB-105 and gbpv2_exception.php.diff in CONTRIB-109). Initial testing seems to make this behave much more consistently. Thanks for your help in testing. Peace - Anthony
Hide
Anthony Borrow added a comment -

OK - I think we have this working now so that the groups will display as expected and students can view their grades for courses utilizing groups. Peace - Anthony

Show
Anthony Borrow added a comment - OK - I think we have this working now so that the groups will display as expected and students can view their grades for courses utilizing groups. Peace - Anthony
Hide
Anthony Borrow added a comment -

Closing all of my resolved issues. Peace - Anthony

Show
Anthony Borrow added a comment - Closing all of my resolved issues. Peace - Anthony

People

Vote (1)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: