T201704040058

This commit is contained in:
Leander
2017-04-04 00:58:10 +02:00
parent 878be6c465
commit c62149521b

View File

@@ -23,6 +23,10 @@
return $points;
}
$correct_answer = $db->query('SELECT "current_right_answer" FROM "Games" WHERE "ID" = $1', array($uid))
['data'][0]['current_right_answer'];
$correct = $correct_answer == $chosen_answer ? true : false;
$score = $correct_answer == $chosen_answer ? calculate_points($time) : 0;
if($uid == '') {
$error = 13101;
} else if($time == 0) {
@@ -30,10 +34,7 @@
} else if($chosen_answer == -1) {
$error = 13103;
} else {
$correct_answer = $db->query('SELECT "current_right_answer" FROM "Games" WHERE "ID" = $1', array($uid))
['data'][0]['current_right_answer'];
$correct = $correct_answer == $chosen_answer ? true : false;
$score = $correct_answer == $chosen_answer ? calculate_points($time) : 0;
// points in table
}
$results = array('correct' => $correct, 'score', $score);