This commit is contained in:
2019-07-11 13:52:49 +02:00
parent bcaa397e7d
commit 12087cd8ab

View File

@@ -12,10 +12,14 @@ if (isset($_GET['n'])) {
} }
$questions = $db->getQuestions($n); $questions = $db->getQuestions($n);
$fullarray[] = [];
for ($i = 0; $i < len($questions); $i++) {
$answers[] = array($questions['answer0'], $questions['answer1'], $questions['answer2']); $answers[] = array($questions['answer0'], $questions['answer1'], $questions['answer2']);
$jsonarray[] = array("id" => $questions['id'], "answers" => $answers, "solution" => $questions['solution']); $jsonarray[] = array("id" => $questions['id'], "answers" => $answers, "solution" => $questions['solution']);
$fullarray[] = $jsonarray;
}
$questionsobj = json_encode($jsonarray);
$questionsobj = json_encode($fullarray);
echo($questionsobj); echo($questionsobj);
?> ?>