There are a few existing threads that discuss a way to do this, but it requires that the students do not have local admin rights or they can bypass the setting. Here are 2 threads that discuss how to use the airport binary to control those options
https://www.jamf.com/jamf-nation/discussions/23847/ability-to-disable-turn-wi-fi-off
https://www.jamf.com/jamf-nation/discussions/14603/delete-or-block-create-network-or-computer-to-computer
@mm2270 awesome thank you. Our student do not have admin right so that should make like easier.
You can create a policy with a script like this which requires admin authorization to change networks or turn off the wifi
#!/bin/bash
#Require Admin authentication to "create computer-to-computer networks", "Change Networks", "Turn Wi-Fi on or off"
/usr/libexec/airportd prefs RequireAdminIBSS=YES RequireAdminNetworkChange=YES RequireAdminPowerToggle=YES
exit 0
