dynamic questions

This commit is contained in:
CHIEFSOFT\ameye
2024-08-19 11:45:10 -04:00
parent 90ff12c547
commit 5b13c120b3
+7 -3
View File
@@ -14,10 +14,14 @@ class WrenchResources extends BaseController
$raw_json = file_get_contents('php://input');
$in = json_decode($raw_json, true);
$a = rand(1,20);
$b = rand(1,30);
$c= $a+$b;
$next_question = [
"question" => 'This is the question - '. rand(1000,9999),
"option" => ['aaaaaaa '. rand(1000,9999), 'bbbbbbbbb '. rand(1000,9999), 'cccccccc '. rand(1000,9999)],
"answer" => 'bbbbbb',
"question" => "What is C ? <br> C= $a + $b .",
"option" => [ rand(1000,9999), $c , rand(1000,9999)],
"answer" => $c,
"last" => false,
"points" => 10
];