We don't know how much extra credit they received, but hopefully it was worth it.

A class of Barberton High School students voluntarily signed up to be pepper sprayed for extra credit.

The result? A video of the experiment that's gone viral.

The students lined up outside and a teacher sprayed them in the face one-by-one as a Barberton police officer stood by and watched.

Many of the students began screaming as the pepper spray took effect. Some doubled over and at least one can be seen on the ground.

Parents signed a waiver sent by the Barberton police chief to allow their students to participate in the activity, which was for a criminal science technology class.

On Wednesday, the school issued a statement on the video:

"On Friday May 12, 2017 as part of the Criminal Science Technology Career Tech Education course at Barberton High School, students had an opportunity to voluntarily participate in an activity in which they would be subjected to a small amount of pepper spray for a brief period of time. The activity was conducted by the class instructor, who is a former police chief, and an experienced professional. Added supervision was provided by the school’s resource officer. Students were required to have parental permission and consent in order to participate in the voluntary exercise. The intent of the training is to help the students gain an industry recognized credential in the law and public safety course curriculum that is offered by the Ohio Department of Education."

Thousands have viewed the video, which has made its way onto several sites, including TODAY, Mashable and Daily Mail.

Watch the video below: