Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+4 votes
in Q2A Core by

Use case:

Rate limit for asking questions = 1

1. User asks 1st question, everything is fine.

2. User clicks on "Ask a Question" to ask a 2nd question, types in all text, then clicks on Ask.

3. Message appears: ~ too many questions

Why can we not warn the user already before he inputs all the text and wastes his time?

Q2A version: 1.5.3
Interesting idea. Might be something for version 1.6
yep, it's on the list: http://www.question2answer.org/qa/19042/ and gets hopefully sorted out in one of the future versions!
got the exact same request of one of my users today :)

2 Answers

0 votes

to solve this, in qa-page-question-view.php you add:

        if(!qa_limits_remaining($userid, QA_LIMIT_ANSWERS)) {


after:         $rules['answerbutton']=($post['type']=='Q') && ($permiterror_post_a!='level') && (!$rules['closed']) &&
            (qa_opt('allow_self_answer') || !$rules['isbyuser']);

+1 vote
I did it this way originally to save an extra database query when opening the page, but I've somewhat relaxed that constraint now anyway. So users will be pre-warned on the 'Ask' page. But I thought this was mainly an anti-spam issue, and no one is bothered about inconveniencing spammers. Are you using it as a way to regulate the activity volumes of normative users as well?
"regulate the activity volumes of normative users as well" → exactly.

As the users get points on answering questions, I prevent spam users to get a lot of points / to answer more than 5 questions per hour.
OK, Q2A 1.6 will show the error ahead of time (will be in dev later today)