As an experiment, we've enabled voting on WP Questions, so prize money is now assigned by a vote.
The askers and the top experts can both vote, though an expert who offered an answer on a particular question will not be allowed to vote on that question.
Voting starts either when the asker starts it, or 2 days after the question has expired.
To start the voting, the asker would click on the Assign Prize Money link:
Please note that after the voting is done, all votes will be public:
There is a drop-down select box under each answer. You can vote all the money to one answer, or you can vote to divide the prize:
If the prize is 15, then what you assign must equal 15. If you try to vote 10, and the prize is 15, you will not be allowed to finalize your vote.
Click the send button when you are ready.
What follows is a very technical description of the software, meant for computer programmers.
To end the voting and actually distributed the money, we have a cron script that runs each night. It uses this function to fetch the relevant questions and votes:
function getVotes() {
$arrayOfVotes = array();
$query = "
SELECT vote.*, question.prize_amount, question.subject
FROM vote, question
WHERE question.id=vote.question_id
AND question.status='voting_in_progress'
AND to_days(question.end_at) < to_days(now() - 4)
";
$result = mysql_query($query);
while ($row = mysql_fetch_assoc($result)) {
$arrayOfVotes[$row['question_id']][] = $row;
}
$query2 = "
SELECT vote.*, question.prize_amount, question.subject
FROM vote, question
WHERE question.id=vote.question_id
AND question.status='voting_in_progress'
AND to_days(question.voting_starts) < to_days(now() - 2)
";
$result2 = mysql_query($query2);
while ($row = mysql_fetch_assoc($result2)) {
$arrayOfVotes[$row['question_id']][] = $row;
}
return $arrayOfVotes;
}
If the asker votes on the question, then the question immediately gains the status of "voting_in_progress". If, instead, the asker abandons the question, and never votes, then the question remains open till 4 or 2 days after its end_at date (when the question is first created, the end_at date is set 72 hours in the future).
question.voting_starts is a date set whenever the asker votes.
If the asker never votes, voting is open to the rest of the community 2 days after the date stored in question.end_at.
If no one ever votes on a question, then it is never found by the above the SQL. We have another cron script that runs every night and which will take any question that is still unresolved after 2 weeks and sweep its prize money into the Community Pot.






