diff --git a/Question.php b/Question.php index ab2d47e..495adaa 100644 --- a/Question.php +++ b/Question.php @@ -28,11 +28,12 @@ class Question $cid = $question_details['Categories_ID']; $c = $db->query('SELECT "name" FROM "Categories" WHERE "ID" = $1', array($cid))['data'][0]['name']; $this->question = $q; - $this->answers = array('a0' => $a0, 'a1' => $a1, 'a2' => $a2, 'a3' => $a3); + $this->answers = array($a0, $a1, $a2, $a3); print_r($this->answers); shuffle($this->answers); print_r($this->answers); - $this->correct_answer_position = array_search('a0', $this->answers); + $this->correct_answer_position = array_search($a0, $this->answers); + print_r($this->correct_answer_position); $this->category_id = $cid; $this->category = $c; }