This is by no means perfect and occasionally spits out some wacky numbers, but appears for the most part to work. Using evil_ds work as a base, and having a lazy sunday afternoon in which to tinker Ive made a simple calculator that attempts to backwards engineer possible voting combos based on a comics rating and votes.
How Many Votes Is That?
 body { line-height: 1.7em; }
function recalculate()Â {
 numgood = (parseInt(document.f.g.value) ? parseInt(document.f.g.value) : 0);
 numokay = (parseInt(document.f.o.value) ? parseInt(document.f.o.value) : 0);
 numbad = (parseInt(document.f.b.value) ? parseInt(document.f.b.value) : 0);
 numvotes = numgood + numokay + numbad;
 document.f.r.value = Math.round((((numgood * 10) + (numokay * 5)) / numvotes) * 100) / 100;
 document.f.v.value = numvotes;
}
function uncalculate() {
rating = document.shakedown.rat.value
votes = document.shakedown.votes.value
if (rating=="0" || votes=="0")
document.shakedown.combos.value = "Either they're all bad or you ain't grasped the concept of entering numbers in the boxes yet";
else
{
//origgoods = rating *votes /5-votes;
goods = Math.round((rating * votes)/5-votes);
//document.shakedown.combos.value = goods;
output = "Potential Voting combinations that could lead to these values \n\nGood Okay Bad\n"
oks = votes - goods;
bads= 0;
//output += Math.round((((goods * 10) + (oks * 5)) / votes) * 100) / 100 + "\n";Â //test line
if (Math.round((((goods * 10) + (oks * 5)) / votes) * 100) / 100 != rating)
output += "I don't think its possible but here are ratings that would be in the ballpark \n";
do {
newline = goods + "Â -Â " + oks + "Â -Â " + bads + "\n";
output += newline;
oks = oks -2
goods += 1
bads +=1
} while (oks > -1)
document.shakedown.combos.value = output;
}
}
Good:
onClick="document.f.g.value = (parseInt(document.f.g.value) ? parseInt(document.f.g.value) + 1 : 1); recalculate();">
onClick="document.f.g.value = (parseInt(document.f.g.value) ? parseInt(document.f.g.value) - 1 : 0); recalculate();">
Okay:
onClick="document.f.o.value = (parseInt(document.f.o.value) ? parseInt(document.f.o.value) + 1 : 1); recalculate();">
onClick="document.f.o.value = (parseInt(document.f.o.value) ? parseInt(document.f.o.value) - 1 : 0); recalculate();">
Bad:
onClick="document.f.b.value = (parseInt(document.f.b.value) ? parseInt(document.f.b.value) + 1 : 1); recalculate();">
onClick="document.f.b.value = (parseInt(document.f.b.value) ? parseInt(document.f.b.value) - 1 : 0); recalculate();">
Rating:
Votes:
---------------
Enter your rating and number of votes below
Rating:
Votes:
onClick="uncalculate();">
Possible combinations of voting that would lead to that rating
<br />Enter votes and rating above<br />