Hey J2008,
This is fairly easy to create. If you are a beginner, I would suggest to start of with 3 basic pages. When you a comfortable with what they do, you put them together in one page, and use a hidden formfield to decide which section of the process you occupy.
The pages below are an example of how something like this might be done, and should get you started. If you need a processing page for your final form, have a look at page 3, and follow that logic. Of course these are barebone examples, which you might want to expand a bit to do more thorough data verification.
page 1: The first question:
<html>
<body>
<h1>How many options?</h1>
<form action="page2.php" method="post">
<select name="ocount">
<option>Select number of options per questions</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
<select name="qcount">
<option>Select number of questions</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
<input type="submit">
</form>
page2: generating the input form:
if(is_numeric($_POST['ocount']) && is_numeric($_POST['qcount']))
{
echo "<form action=\"page3.php\" method=\"post\">";
for($i=0; $i< $_POST['qcount'])
{
echo "Question ".$i;
for($j=0; $j< $_POST['ocount'])
{
echo "<input type=\"text\" name=\"question[".$i."][]\"><br />";
}
}
echo "
<input type=\"submit\">
</form>";
}
page 3; the generation of the form to be saved:
if(isset($_POST['question']) && is_array($_POST['question']))
{
echo "<form action=\"page3.php\" method=\"post\">";
foreach($_POST['question'] as $i=> $qs)
{
foreach($qs as $thisanswer)
{
echo "<input type=\"radio\" name=\"answer[".$i."][]\">".$thisanswer;
}
}
echo "
<input type=\"submit\">
</form>";
}