See https://github.com/scholarpress/buddypress-courseware/blob/master/gradebook/gradebook.class.php#L394