MDL-40843 Correctly access course_modinfo->get_groups()