You can use any of the Scorm/AICC variables, the name should be the easiest. The solution only checks if there is a name, it is not really using it, is it?
You can also try with AICC_Lesson_Status. AICC_Lesson_Status can either be “incomplete”, “completed”, “passed” or “failed”. So you can use 4 conditions to check for these values and it should do the same as AICC_Lesson_Status does not exist in the HTML output.