In order to cast to a Chromecast from any device, both devices must be on the same network.
In most classrooms, the Chromecast is defaulted to a hidden network configured for each room. See the following link for a guide on accessing your hidden network from wireless devices:
...
Our desktops are connected to our the scsprivate network which means that we will need to change the Chromecast’s connection to scsprivate as well. Using the method of casting from the desktop as opposed to your chromebook or another wireless device will allow the possibility of interrupted casting sessions. If you have a USB wireless adapter for your desktop, then you may use that to connect to the hidden casting network.
Follow the steps below to change the Chromecast’s network connection to scsprivate:
...
STEP 4: Select scsprivate. It should be a saved network so no password will be required.
...
STEP 5: Select Connect.
...
STEP 6: Your Chromecast is now on the same network as your desktop! Using the following guide, cast from your desktop to the Chromecast.
...