I've been grinding away at this for many days now, and I feel like I'm never going to get past this brick wall. It's also becoming a pressing matter for my client. So I'm considering hiring this out, but first I'd like to take one last swing at getting this challenge solved.
Here's what we've got:
* There are CCK nodes called "quests". These quests have a hidden textfield on them containing a 10-character code.
* Users complete these quests in the real world, and upon doing so are given a little slip of paper with the quest's secret code.
* The user logs in, browses to the quest, and fills in the code (still working this one out -- probably a Panel)
* If the code is correct, they get a confirmation message. If it's incorrect, they're bounced back to the input form (no idea how to achieve this -- Forms functionality in Rules is totally opaque to me)
* When the user correctly submits five different codes, the user is sent an email with instructions on how to receive a prize.
I've got the validation portion partially figured out, although right now all the system does is flash a red error message upon submission of an incorrect code and a green system message upon submission of a correct code. No idea how to keep the user from successfully submitting the form at all, or to bounce them back to the edit form like we see when other standard Drupal validations fail (missing title or whatever).
The scheduling, rules and (probably) views required to perform the accounting is just beyond me, I'm afraid. I've been considering a couple approaches:
-
Using Content Profile, add an integer field to each user's profile and increment that integer upward each time a successful, unique code is submitted. Fire the email off when the field first exactly hits 5. I ran into a dead end here because I lack the PHP know-how to do the integer-increment thing.
-
Using Flags, flag the node as "completed" upon submitting a correct code. Run a View each time a correct code is submitted, and once there are precisely 5 "completed" flags associated with the user, fire off an email. I got a lot further with this approach, but I'm not sure how to fire off an event based on a specific Views result. Or how to run a view for the submitting user, for that matter.
-
Use Scheduler to run this whole thing as a cron event, but I think the previous bullet (fire the View upon correct code submission) does the trick.
Any help anyone can share would be much appreciated. Or if you're interested in doing this yourself, email me at paul@z-com.com and we can talk rates and time required. Thanks!