This would require a software solution, and is yet another feature of a shared API I'm in the process of designing.
Although it can be achieved with peer-to-peer (iPad-to-iPad), it is often easier and safer to have a (known) central server to connect to, this also allows accessing the same information from desktop computers (Mac and PC) as well as the ability for the system to send out regular summary emails showing scores and improvements to parents.
All Apple products support the Bonjour protocol to smartly detect and connect to a service, so if a "Education iPad Server" was deployed and available on the WiFi network it could be detected by all iPads and allow identification and transmission of information to/from student and teacher iPads. Bonjour could also be used on the teachers iPad to make it's "GetHomework" and "SubmitCompletedHomework" services available, although there would need to be a mechanism for the students to choose which teacher iPad to talk to, as every device running the service would show up (probably just show the teacher name/photo in a list).
Let me know if you're interested in more details, as this is something I'm doing in my spare time (for free), so it's progressing slowly.