Applescript for deleting desktop files upon logout
Is there any specific reason why you wouldn't want to have your students use a Guest Account on the system instead? That would allow you to provide them restricted access to the system while deleting all their files on logout automatically.

To enable a guest user:


Go to System Preferences > Users &amp; Groups
Click the lock icon to unlock it if necessary and type an administrator name and password
Select the Guest User in the list of accounts from the left sidebar
Check the option Allow guests to log in to this computer
You can also setup restrictions through Parental Controls by checking the option Enable parental controls and then clicking on Open Parental Controls...


See:
Using the Guest Account in OS X
OS X Mountain Lion: Set up guest users
OS X Lion: Set up a guest account