MDL-47618 quiz statistics: fatal error with groups.

The problem was that the names of query placeholders were changing. The
fix was to do things ourself, rather than using get_in_or_equal.