MDL-38429: lesson report - Improve lesson statistics code.