random answers

This commit is contained in:
CHIEFSOFT\ameye
2024-08-19 13:49:57 -04:00
parent 2cf8995e40
commit a67ae45d3c
@@ -18,6 +18,19 @@ class WrenchResources extends BaseController
$b = rand(1,30);
$c= $a+$b;
$ansPos = rand(1,4);
for ($ii=1; $ii<=4; $ii++){
if ($ii== $ansPos){
$next_question["option_mix"][]= $c;
}else
{
$ansRand = rand(1000,9999);
$next_question["option_mix"][]= ($ansRand == $c)? $ansRand+rand(1,5) : $ansRand;
}
}
$next_question = [
"question" => "What is C ? <br> C = $a + $b .",
"option" => [ rand(1000,9999), $c , rand(1000,9999)],