MDL-38128 mod_assign: count_submissions_with_status

Improving performance caching get_submission_group()
results.