dynamic questions
This commit is contained in:
@@ -14,10 +14,14 @@ class WrenchResources extends BaseController
|
|||||||
$raw_json = file_get_contents('php://input');
|
$raw_json = file_get_contents('php://input');
|
||||||
$in = json_decode($raw_json, true);
|
$in = json_decode($raw_json, true);
|
||||||
|
|
||||||
|
$a = rand(1,20);
|
||||||
|
$b = rand(1,30);
|
||||||
|
$c= $a+$b;
|
||||||
|
|
||||||
$next_question = [
|
$next_question = [
|
||||||
"question" => 'This is the question - '. rand(1000,9999),
|
"question" => "What is C ? <br> C= $a + $b .",
|
||||||
"option" => ['aaaaaaa '. rand(1000,9999), 'bbbbbbbbb '. rand(1000,9999), 'cccccccc '. rand(1000,9999)],
|
"option" => [ rand(1000,9999), $c , rand(1000,9999)],
|
||||||
"answer" => 'bbbbbb',
|
"answer" => $c,
|
||||||
"last" => false,
|
"last" => false,
|
||||||
"points" => 10
|
"points" => 10
|
||||||
];
|
];
|
||||||
|
|||||||
Reference in New Issue
Block a user