Selectively disable team mode if there are no groups

This update disables the Team mode checkbox in mod_form.php if there
are no groups in the course, and throws up an error (that also disables
team mode) if the workshop suddenly finds itself with no teams (if
groups have been deleted or if a grouping was selected that contains no
teams).