“Math is, unfortunately, the course that so many students get into high school and try to avoid,” said Sen. Jill Schupp, a Creve Coeur Democrat who was the lone “no” vote in the Senate.

Proponents countered that students interested in computer science also tend to be interested in math and science. They say encouraging classes such as coding is an economic development tool.

Parents and guardians will be required to sign a form acknowledging that substituting a math or science class for a computer science class could adversely affect college admission decisions.

The legislation also allows the Department of Elementary and Secondary Education to select a nonprofit that could solicit proposals from companies — the objective being for the company to help launch a science, technology, engineering and mathematics — or STEM — career awareness program in the state.

Schupp said that giving a nonprofit the ability to choose a company opens the potential for corruption.

If “a nonprofit was chosen by DESE with all good intentions, and the nonprofit receives a donation from a vendor that then wins the contract to provide the — to become the provider — I don’t know how we know about that,” Schupp said during floor debate on Friday.