MDL-38664 Lesson mod: code improvement for lesson attemps