First, what the teacher is doing by posting a student's paper online without the student's permission is infringing on the student's copyright in the written work.
The student, absent any agreement to the contrary, holds the copyright in whatever work he/she creates and, therefore, it is the student who has the exclusive right to make copies, to authorize others to make copies, to make derivative works from the original, to sell or to display or perform the work created, and to sue anyone who infringes on these rights.
Then, depending on the assignment for which the writing was required of the student, it could also be a violation of the student's state privacy rights to publish the student's work online.
And, finally, yes, it could be a violation of FERPA (if the educational institution receives funding under an applicable program of the US Department of Education) to display a student's work without the student's consent.
Although, in Owosso ISD v Falvo, the court held that peer reviews and grading in a classroom does not violate FERPA, courts interpretations of FERPA have always favored confidentiality when it comes to any records that directly relate to a student that are held by the educational agency or a person (teacher) acting for the agency. These records can include photographs, student projects, graded papers, computer media, audio and videotapes, and written documents. . . . anything that contains personally identifiable information.