T201704040058
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user