This commit is contained in:
2019-07-11 13:54:37 +02:00
parent 5eec6fc65d
commit 1d7767dc67

View File

@@ -13,9 +13,9 @@ if (isset($_GET['n'])) {
$questions = $db->getQuestions($n); $questions = $db->getQuestions($n);
$fullarray[] = []; $fullarray[] = [];
for ($i = 0; $i < count($questions); $i++) { foreach($questions as $q)
$answers[] = array($questions['answer0'], $questions['answer1'], $questions['answer2']); $answers[] = array($q['answer0'], $q['answer1'], $q['answer2']);
$jsonarray[] = array("id" => $questions['id'], "answers" => $answers, "solution" => $questions['solution']); $jsonarray[] = array("id" => $q['id'], "answers" => $answers, "solution" => $q['solution']);
$fullarray[] = $jsonarray; $fullarray[] = $jsonarray;
} }