May-22-2022, 11:23 PM
(This post was last modified: May-22-2022, 11:23 PM by Pedroski55.)
Well, maybe dynamically generated variables is something for a future version of Python, because, in PHP, that is a) possible and b) very handy!
This dynamically generates data arrays for output in html tables.
The number of questions varies from time to time. Like the OP said, I don't know or care how many questions there are each time.
But, of course, the whole output.html.php file is generated using Python and couple of text files!
This dynamically generates data arrays for output in html tables.
The number of questions varies from time to time. Like the OP said, I don't know or care how many questions there are each time.
But, of course, the whole output.html.php file is generated using Python and couple of text files!
Quote:if(isset($_POST['studentnum'])) {
$count = count($questions);
for($i=1; $i<=$count; $i++) {
//echo '$i is ' . $i . '<br>';
$Qnr = 'Q' . $i;
//echo '$Qnr = ' . $Qnr . '<br>';
${'Q'.$i} = $questions[$i-1];
// should be an array of 3 arrays, 3 results, 1 for each gender
${"men$i"} = displayAllQs($Qnr);
//echo 'This is ${"men$i"} <br>';
//$name = 'men' . $i;
//echo 'results array is ' . $name . '<br>';
//print_r(${"men$i"});
//echo '<br>';
${"menP$i"} = displayAllQs($Qnr);
$lenmenP = count(${"menP$i"});