Add debug tracing to grade_mixin