Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+3 votes
546 views
in Q2A Core by
I think it would be useful to prevent negative user points. I changed my points so users start at 20 instead of 100, but this means two downvotes and they're in negative points.

If a user gets a new downvotes early on, they may get discouraged by a negative score. It would be better IMO if all users started at 0 but didn't go below that.

The only problem I see is that if they get two downvotes, then one upvote, a recalculation would send them back to 0.
by
edited by
Also as a side note, what does "Multiply all points" apply to? It definitely doesn't apply to ALL point categories, since with it set to x10 one user has -50 points, but with x1 they have 13.
by
The multiple applies to all points and all users, but there's another fixed total at the bottom of the points admin page which is added on at the end. Based on the numbers you mention, it sounds like this user has -7 points (before applying the multiple or addition), and you've got all users starting on 20.

1 Answer

+1 vote
by
selected by
 
Best answer
It would be possible, but pretty hard, to do this by modifying a few pieces of Q2A's code. But there's actually a simple hack that should work - change the MySQL column type of qa_userpoints.points to UNSIGNED INT NOT NULL instead of INT NOT NULL. I'm guessing MySQL will set the column to zero whenever the Q2A code tried to make it negative.

As an aside, in practice I think people don't down vote stuff very often, or at least that's my experience with this Q&A site about Q2A.
by
Hmm, I tried that on a test table in phpMyAdmin and I got "Out of range" warning. Anyway, it's not too much of an issue now - I removed the x10 multiplier and all points are over 0 now. So they'll only go negative if they get a lot of downvotes.
by
OK. Just FYI, the warning should not be a problem in practice, since it won't affect Q2A's operation.
...