Birmingham schools spokeswoman Michaelle Chapman said the students were to write about their favorite dish and how it was prepared. The teacher allowed them to make and bring the dish to class if they wished.
Of the 18 students, 16 of them brought in dishes and eight students got sick after tasting them.
Chapman said it's unknown which dishes caused the students to have gastrointestinal problems including vomiting.
The students' parents were called and they were taken to their personal doctors' offices.
Chapman said health officials came and collected samples of the food for testing.
Information from: The Birmingham News