what i'm trying to do is the following:

certain node types generate codes
those codes are given out to people via email or in person
if the code is entered on our site, a flag is set in the users account on that node so that we know they were given that code.
the codes are one-time use only.

this is to track attendance at events.

Is there a module that does this, or can it be done without modules, or do i need to write a module?