Reseting SparkCore or Photon

The Spark/Particle Core has an easy to use factory reset via the MODE button that reflashes the whole system and user firmware (but not the bootloader) with a firmware image that is stored on the device itself.
The Particle Photon has no such image on board, so there is no one-button factory reset, but the so called Safe Mode, which prevents the application (user) firmware from running and hence provides a predefined safe state of the device.
In this mode it’s very simple to “factory reset” the device via particle flash --usb tinker (or any other predefined firmware of your liking).

And for re-claiming a device that got claimed to a students account, as long you have phyiscal access to the device you can always claim it without the need to know the previous “owner” - unless it has been completely locked against reprogramming (see this discussion Digital Signatures for Security)

If you happen to have a JTAG/SWD programmer, flashing a complete firmware image, including bootloader might be even easier.