Is it possible? Sure. Is it enforceable? It depends upon whether it conflicts with state law as well as, as applicable, the constitutional rights of students to opt out of participation.