T201704032316
This commit is contained in:
26
answer.php
Normal file
26
answer.php
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Created by PhpStorm.
|
||||||
|
* User: leanderschmedemann
|
||||||
|
* Date: 03/04/2017
|
||||||
|
* Time: 14:00
|
||||||
|
*/
|
||||||
|
|
||||||
|
require_once('includes.inc.php');
|
||||||
|
$data = '';
|
||||||
|
$error = 0;
|
||||||
|
$user = isset($_GET['uid']) ? $_GET['uid'] : '';
|
||||||
|
$time = isset($_GET['time']) ? $_GET['time'] : '';
|
||||||
|
$time = (($time === '0') || ($time && gettype(+$time) == 'integer')) ? +$_GET['time'] : 0;
|
||||||
|
$answer = isset($_GET['answer']) ? $_GET['answer'] : '';
|
||||||
|
$answer = (($answer === '0') || ($answer && gettype(+$answer) == 'integer')) ? +$_GET['answer'] : -1;
|
||||||
|
|
||||||
|
function calculate_points($time) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//if user is ''...
|
||||||
|
//if time is 0...
|
||||||
|
//if answer is -1...
|
||||||
|
|
||||||
|
?>
|
||||||
@@ -37,6 +37,7 @@
|
|||||||
}
|
}
|
||||||
// Create new game for user.
|
// Create new game for user.
|
||||||
$db->query('INSERT INTO "Games" ("ID") VALUES ($1)', array($uid));
|
$db->query('INSERT INTO "Games" ("ID") VALUES ($1)', array($uid));
|
||||||
|
print_v(pg_last_error());
|
||||||
// Find questions for new game and insert into table.
|
// Find questions for new game and insert into table.
|
||||||
$questions = random_numbers(0, $questions_count-1, $length);
|
$questions = random_numbers(0, $questions_count-1, $length);
|
||||||
foreach($questions as $question) {
|
foreach($questions as $question) {
|
||||||
|
|||||||
Reference in New Issue
Block a user