I assume, the question is a dropdown?
Please give this here a try:
$code= value('PR01'); //PR01 is a random generator
if ($code==1){
replace('%question%', '%input:PS01%');
} elseif ($code==2) {
replace('%question%', '%input:PS02%');
} // ...
Then use %question% as placeholder in your HTML table. I am not perfectly sure if the replacement will work recursively, but it should do two steps. If that does not work, please let me known.