It's a Wonderful Night - S1-E18
Other mistake: When Eric is ordered to go to his room he mentions that Feeny used to be his 6th grade teacher. However, later in the series it is emphasized several times that Mr. Feeny was Cory's teacher every grade he was ever in. With Cory only being 3 years younger than Eric, it would not be possible for Feeny to have been Eric's 6th grade teacher as Cory would have been in 3rd grade and had Feeny as a teacher per what is stressed on multiple occasions later in the series.
Chosen answer: In the present day, with the United States abiding by more stricter school health laws, for the most part this wouldn't be in school cafeterias as many cannot even have carbonated beverage machines now. However, in the 90s when the show takes place, it wasn't unheard of for there to be coffee machines in the cafeteria of small schools where the teachers eat with the students as we see them do often in the show. The idea being that the cafeteria was small enough so a teacher or hall monitor could catch a student before they could drink the coffee.