MDL-35175 - Lesson shows no attempts if associated with a grouping

* Fixed query to properly match on groupingid