Since naka store man sa database imo question, ako solution would be like this...
/* DECLARE ARRAY FOR PREV_QUSTIONS nga SESSION */
if(!isset($_SESSION['rolled_pages'])){ $_SESSION['rolled_pages'] = array(); }
/* We will use the contents in the array to cross match sa imo query. This is to avoid the same question being queried again in the next page */
$q = mysql_query("select question_id, question from sample.qustionaire where question_id not in ('" . implode("', '", $_SESSION['rolled_pages']) . "') order by rand() limit $pageOffset, $rowsPerPage;");
$i = 1;
print "<table>";
while($row = $mysql_fetch_array($q)) {
print "<tr><td>$i</td><td>$row['question']</td></tr>";
/* ASSUMING NGA IMO SAD GI STORE IMO CHOICES UG DBASE W/ REFERENCE SA QUESTION ID */
$q2 = mysql_query("select choice_id, choices from sample.choices where question_id='$row[question_id]' order by rand();");
/* Kani, aside sa imo gi randomize imo questions, gi-randomize pa jud imong choices */
while($inner_row = mysql_fetch_array($q2)) {
print "<tr><td><input type=radio name='radio'></td><td>$inner_row['choices']></td></tr>";
}
$i++;
/* Insert the question_ids to the array, every loop */
array_push($_SESSION['rolled_pages'],$row['question_id']);
/* on the next page, i-implode nato ang content sa array, then simply query contents in your questionaire database that is not on the $_SESSION['rolled_pages'] (in which we declare it as an array)*/
}
print "</table>";
Now, you can use the same method to display previous pages, store the question_ids per page into a session, then "implode" it, crossmatch it to the your questionaire table...
Your next challenge is to tagged what is selected by the user (answer niya)... Sa ako part, I'd go for AJAX, onclick event sa radio, istore na niya sa user answer database...