Be aware that your robot detection will not work as it is:
* The question (and answer) is always the same * The answer is in the source code for the site * The answer is only checked in the frontend (so robots will never see it at all)
Effective anti spam should be done in the backend, as a spambot would just send HTTP requests directly to your backend.