ElkArte Community

Elk Development => Feature Discussion => Exterminated Features => Topic started by: emanuele on April 05, 2013, 06:36:45 pm

Title: anti-spam questions
Post by: emanuele on April 05, 2013, 06:36:45 pm
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.
Title: Re: anti-spam questions
Post by: Arantor on April 05, 2013, 06:42:47 pm
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.
Title: Re: anti-spam questions
Post by: emanuele on April 06, 2013, 03:57:53 am
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...
Title: Re: anti-spam questions
Post by: TestMonkey on April 06, 2013, 05:25:04 am
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.
Title: Re: anti-spam questions
Post by: Arantor on April 06, 2013, 09:53:40 am
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.
Title: Re: anti-spam questions
Post by: emanuele on April 08, 2013, 08:30:05 am
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
Title: Re: anti-spam questions
Post by: Arantor on April 08, 2013, 09:54:56 am
You wait until you play with the moderation/warnings code! That's lots of fun.
Title: Re: anti-spam questions
Post by: emanuele on April 08, 2013, 10:13:54 am
/me doesn't plan to live that long... :P
Title: Re: Quick question regarding Recount Posts in ManageMaintenance
Post by: emanuele on April 08, 2013, 11:05:09 am
Done (well, at least the idea):
https://github.com/emanuele45/Dialogo/commits/antispam_questions
does the commit before the last (https://github.com/emanuele45/Dialogo/commit/2d0eedc0d3f6ca421b736347a2536912ceffdfca) work for you? (I mean in general, I know it's probably broken :P)
Title: Re: anti-spam questions
Post by: emanuele on April 08, 2013, 11:13:59 am
/me posted in the wrong topic... lol
Title: Re: anti-spam questions
Post by: TestMonkey on April 09, 2013, 12:31:44 pm

Oh, thank you, this is cool! Much more readable and quite similar to other design (can't speak for the details on the run)

Names for the classes would be Control_Verification_Something, in tone with the pattern.

Quote(I mean in general, I know it's probably broken :P)
LOL! :D
Title: Re: anti-spam questions
Post by: emanuele on April 14, 2013, 04:54:06 pm
Well, sent: https://github.com/elkarte/Elkarte/pull/324