A student has opted out of directory information and wants to be anonymous in an online course. Are we required to allow the student to take the course anonymously?

No.  Under FERPA, a student may not use his or her right to opt out of directory information disclosures to prevent school officials from identifying the student by name or disclosing the student’s electronic identifier or institutional e-mail address in class.

K-12 School Officials
Postsecondary School Officials
Exceptions - Directory Information