How to select a default viewing group?

How to select a default viewing group?

by Wanlun Xue -
Number of replies: 0

When enable grouping and view a list of sessions, it is defaulted to see all sessions, how can I set one group of session to be default display? Same when taking attendance, can visible group default to be blahblahblah instead of "all participants" ?


I have been changing the sequence of the grouping dropdownlist, but the default will still be "all" and then

I found the groups_get_activity_group function in group lib.php, and add the following code.

``
if ($update and $changegroup != -1) {

    if ($changegroup == 0) {
       ////keep the same
}else{
   ///////I add these code
        $SESSION->activegroup[$cm->course][$groupmode][$cm->groupingid] = 1;

}

``

because the desired group id in that course is 1, however it will not work for other class because the group id is dynamic. 


How can I set my desired group default? Please advise.

Thanks


Attachment Screen Shot 2021-06-11 at 2.51.39 PM.png
Attachment Screen Shot 2021-06-14 at 8.30.00 AM.png
Average of ratings: -