If she was a human being, like...how would she DO that?
She's either a magical being from another world, that was hanging out in their classroom for some reason, and she magically transported them into the world she made when they died...or she's some kinda of alien with future tech, that was hanging out in their classroom for some reason, and she digitized their consciousnesses and copied them into a virtual world she made.