MDL-45991 groups: Auto-create groups with ungrouped users only
When using auto-create groups, sometimes it is needed to only create
groups with users that are not already inside a course group. This
patch creates a checkbox that will ignore users that are in already
existing groups. It alters the groups_get_potential_members function so
that the eligible users are retrieved entirely though sql.
In order to post to all groups in a forum, you must have the
moodle/site:accessallgroups capability.
Thanks to Jakob Ackermann <jackermann@onlineschool.ca> for part of the fix
on this one.
There are two phpunit.xml build locations, one for overall
and another for individual components. To reduce id changes
when running different components, we use the same initial ID
in all component files when building.
In order to do this in a sane way, I cleaned up a lot of old mess,
inclduing:
1. Previously, qtype_calcuated used ->answeres when importing, and
->answer when saving the form. This was crazy, so I fixed it, and
stripped out the code that made the alternative variable name work.
2. Similarly, it could handle ->answer being either an array, such as
you would get form the HTML editor, or a simple string, which is what
you get form the form. I simplified that too.
3. Finally, I made import use a transaction around saving each
question, so we don't get half questions in the database when an error
occurs.
With the previous commit in this issue, now the course management
UI defaults to show the "default category" courses.
But some bits were missing in order to make that default behavior
fully equivalent with the manual navigation to that category.
This patch:
- Adds the missing categoryid url param, used by some of the options
in the UI, like sorting, that was completely broken.
- Sets the context to the default category, previously was being set to
system context, incorrectly if now we are defaulting to a category.
That way everything is 100% the same than when we land to the category manually.
In various places, when showing several attempts, we try to hilight the
most significant one (the one that gave the final grade if the quiz is
set to first/last/best attempt). That was not working because the table
zebra stripes were a more specific rule.
Also, the colour was inconsistent, not nice, and not very bootstrapy, so
I changed it.