T201704031338
This commit is contained in:
@@ -29,7 +29,9 @@ class Question
|
|||||||
$c = $db->query('SELECT "name" FROM "Categories" WHERE "ID" = $1', array($cid))['data'][0]['name'];
|
$c = $db->query('SELECT "name" FROM "Categories" WHERE "ID" = $1', array($cid))['data'][0]['name'];
|
||||||
$this->question = $q;
|
$this->question = $q;
|
||||||
$this->answers = array('a0' => $a0, 'a1' => $a1, 'a2' => $a2, 'a3' => $a3);
|
$this->answers = array('a0' => $a0, 'a1' => $a1, 'a2' => $a2, 'a3' => $a3);
|
||||||
|
print_r($this->answers);
|
||||||
shuffle($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);
|
||||||
$this->category_id = $cid;
|
$this->category_id = $cid;
|
||||||
$this->category = $c;
|
$this->category = $c;
|
||||||
@@ -52,7 +54,6 @@ class Question
|
|||||||
'question' => $this->question,
|
'question' => $this->question,
|
||||||
'answers' => [$this->answers['a0'], $this->answers['a1'], $this->answers['a2'], $this->answers['a3']]
|
'answers' => [$this->answers['a0'], $this->answers['a1'], $this->answers['a2'], $this->answers['a3']]
|
||||||
);
|
);
|
||||||
print_r($this->answers);
|
|
||||||
return $question_object;
|
return $question_object;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user