Just for the record, to make it so that it will give the big $$$ on 100% on any size quiz (not just those with 10 questions), modify the code slightly to look thusly:
Instead of this:
Code:
//Points = $$$
if ($totalcorrect=='10') {
$storeamount = 100 * $totalcorrect;
} else {
$storeamount = 10 * $totalcorrect;
}
$updatestore = $DB_site->query("UPDATE user SET storep=storep+'$storeamount' WHERE userid='$bbuserinfo[userid]'");
//END Points = $$$
Use this:
Code:
//Points = $$$
if ($totalcorrect==$question_count) {
$storeamount = 100 * $totalcorrect;
} else {
$storeamount = 10 * $totalcorrect;
}
$updatestore = $DB_site->query("UPDATE user SET storep=storep+'$storeamount' WHERE userid='$bbuserinfo[userid]'");
//END Points = $$$
This uses the already assigned variable: $question_count, which is the total numbers of questions assigned to the quiz. Thus if the two variables are equal, then the score is obviously 100%, and thus it will give the big $$$.
Enjoy!
)O( Cloudrunner )O(