anti-spam questions
Since I was a bit bored and thought it was something easy (except I wasted some time because of the upgrade issue lol) I moved the anti-spam questions from log_comments to their own table.
Doing this I also added a new field "language" to the table to start thinking about questions in multiple languages.
I remember once Arantor suggested also multiple answers for each question, that would probably be nice too. If I'm not wrong from the db-side the best way to handle that would be to split the table in two: questions and answers. Maybe we could use some other trick (like add another field referencing to the question.
Not sure what is more practical.
Re: anti-spam questions
Reply #1 –
Eh, I think you're overcomplicating it. I certainly didn't get as fancy as that, especially given all the scenarios where questions might be called for. I simply took the possibilities and stuffed them into arrays, and serialized it before storing in _settings, subdividing by language, then question then answer.
Re: anti-spam questions
Reply #2 –
mmm...lol
I'm known to make things complex! (especially at that time of the day)
Funny thing is that I "like" serialize and it's strange I didn't thought about it...
Re: anti-spam questions
Reply #3 –
What are all the scenarios where questions might be used?
I'd love to see all this cleaned-up, at the level of code design/implementation, I mean. As for db, it sounds better (if a little over-), considering that querying that table will not be very often anyway, will it? If it will - I don't see it atm - we might want to "cache" (as Ema put it on another issue) in settings.
Database design-wise, normalization vs serialization. Performance-wise, serialization vs normalization.
Re: anti-spam questions
Reply #4 –
Questions may be used anywhere that the CAPTCHA might be used: registration, posting, searching.
Typically, though, it will be the first registration and maybe the first few posts for users.
Re: anti-spam questions
Reply #5 –
Another FYI: while doing that I decided to destroy the entire anti-spam thing, so expect few changes to the area next time I push something...meaningful? Heck, did you ever see meaningful code coming from my fingers? O_o
Re: anti-spam questions
Reply #6 –
You wait until you play with the moderation/warnings code! That's lots of fun.