The idea is that when you click on Volgende, to $getal1, $getal1, $soort, and $antwoord are put in an array. If this is the 2nd time, it 1st and 2nd time there come to be.
THIS IS MY PHP CODE IN ENGLISH
<?php
$kind = $_SESSION['kind'];//get the kind of task choose from +-/*
$class = $_SESSION['class'];//get the number of class
$answers = $_SESSION['answers'];//get the previous answers
if($class == "klas4"){
$max = 10;
}
if($class == "klas5"){
$max = 20;
}
if($class == "klas6"){
$max = 100;
}
$number1 = mt_rand(0, $max);
$number2 = mt_rand(0, $max);
?>
<div class="som">
<form action="" method="post">
<?php echo $number1 . $kind . $number2 ?>
<input name="answer" type="number">
<input type="submit" name="next" value="next">
</form>
</div>
<?php
if(isset($_POST['next']))
{
$answer = $_POST['next'];
$answers=array($answers);
array_push($answers,$number1,$kind, $number2,$answer);
var_dump($answers);
$_SESSION['answers']=$answers;
}
?>
If this code is executed, everything comes together.
I hope someone can help