Reference CoursewareTab.type() to avoid hard-coding types everywhere.

Same for the other types checked below.