apluslms / a-plus

A+ frontend portal - A+ LMS documentation:
https://apluslms.github.io/
Other
66 stars 73 forks source link

Inefficient way of checking whether the "Form a group" menu item should be shown or not. #1367

Open sayravai opened 4 months ago

sayravai commented 4 months ago

The current code goes through all the learning objects to look for the one with the largest allowed group size. This seems very inefficient as it creates a lot of extra queries for every page load. It would probably be a good idea to replace this by simply adding a "Students can form groups" boolean directly to the course instance model. This could be on by default, and if the teacher wants to hide the group forming functionality from students for the course instance, he/she could just uncheck a box in Edit course -> Course.