It appears that the issue is with adding the record to mdl_grade_items, there is no check to see if 'grade' column from attforblock = zero, change mdl_grade_items.gradetype to 3?
Attendance (plugin)
Glitch in module
Eztabaida hau blokeatu da eta beraz aurrerantzean ezingo duzu bertan erantzun.