T201704030953
This commit is contained in:
@@ -11,4 +11,5 @@
|
|||||||
|
|
||||||
= start.php =
|
= start.php =
|
||||||
12101 - 0 questions wanted, no game without a question!
|
12101 - 0 questions wanted, no game without a question!
|
||||||
12102 - More questions wanted then existing
|
12102 - More questions wanted then existing
|
||||||
|
12103 - User ID not specified
|
||||||
@@ -61,6 +61,8 @@ class Database
|
|||||||
return 'A game without a question is not possible. Please select new game length.';
|
return 'A game without a question is not possible. Please select new game length.';
|
||||||
case 12102:
|
case 12102:
|
||||||
return 'We only have '.$values[0].' questions. Please select new game length.';
|
return 'We only have '.$values[0].' questions. Please select new game length.';
|
||||||
|
case 12103:
|
||||||
|
return 'No user ID specified. Sebastian, please fix the app.';
|
||||||
default:
|
default:
|
||||||
return 'An unknown error occurred.';
|
return 'An unknown error occurred.';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,8 +10,8 @@
|
|||||||
$data = '';
|
$data = '';
|
||||||
$error = 0;
|
$error = 0;
|
||||||
$values = null;
|
$values = null;
|
||||||
$uid = $_GET['uid'];
|
$uid = isset($_GET['uid']) ? $_GET['uid'] : '';
|
||||||
$length = $_GET['length'];
|
$length = isset($_GET['length']) ? $_GET['length'] : '';
|
||||||
$length = (($length === '0') || ($length && gettype(+$length) == 'integer')) ? +$_GET['length'] : 10;
|
$length = (($length === '0') || ($length && gettype(+$length) == 'integer')) ? +$_GET['length'] : 10;
|
||||||
$db = new Database();
|
$db = new Database();
|
||||||
$questions_count = $db->query('SELECT COUNT(*) FROM "Questions"')['data'][0]['count'];
|
$questions_count = $db->query('SELECT COUNT(*) FROM "Questions"')['data'][0]['count'];
|
||||||
@@ -23,7 +23,9 @@
|
|||||||
return array_slice($numbers, 0, $count-1);
|
return array_slice($numbers, 0, $count-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($length == 0) {
|
if($uid = '') {
|
||||||
|
$error = 12103;
|
||||||
|
} else if($length == 0) {
|
||||||
$error = 12101;
|
$error = 12101;
|
||||||
} else if($length > $questions_count) {
|
} else if($length > $questions_count) {
|
||||||
$error = 12102;
|
$error = 12102;
|
||||||
|
|||||||
Reference in New Issue
Block a user