So if you want to do it in the form submit way (whole page refresh), You can create one cloud page instead of multiple cloud pages (one for each question). the trick is that if you don't specify action
in < form > it should just submit to the same cloud page. so you want to capture the form data in RequestParameter, include the previous questionid and answer, so you can dynamically create HTML element with next questionid as well as creating html elements for next question depend on previous answer.
[%
VAR @subscriberKey, @pageId, @pageAnswer, @insertCount, @submitAction
SET @subscriberKey = AttributeValue(_subscriberKey)
SET @submitAction = RequestParameter("submitAction")
SET @questionId = RequestParameter("questionId")
SET @questionAnswer = RequestParameter("pageAnswer")
/* Insert answers to DE */
IF @submitAction == "submit" AND NOT EMPTY(@questionId) AND NOT EMPTY(@questionAnswer) THEN
SET @insertCount = insertData("MyDE","SubscriberKey", @subscriberKey, "questionId",@questionId, "questionAnswer",@questionAnswer)
ENDIF
IF @questionId == "" THEN
/* first time page load, it is empty, so it should be set to 1 */
set @questionId = "1"
ELSE
/* Increase questionId by 1 */
set @questionId = FormatNumber(@questionId, "G") + 1
ENDIF
%]
<html>
<head>
<script src="" /> // load your js library
</head>
<body>
<form>
<input id="submitAction" name="submitAction" type="hidden" value="submit" />
<input id="questionId" name="questionId" type="hidden" value="%%=v(@questionId)=%%" />
[%
IF @questionId == "1" THEN
%]
<div>
<!-- Create HTMl elements for question 1, render stars element etc -->
</div>
[%
ENDIF
%]
[%
IF @questionId == "2" THEN
%]
<div>
[%
IF @questionAnswer == "choiceA" THEN
%]
<!-- Create HTMl elements for question 2 base on question 1's answer of Choice A -->
[%
ELSEIF @questionAnswer == "choiceB" THEN
%]
<!-- Create HTMl elements for question 2 base on question 1's answer of Choice B -->
[%
ENDIF
%]
</div>
[%
ENDIF
%]
<!-- This input captures the answer for current question, you should use JS to populate the answer from html element interaction, it can be visible or hidden depend on the design -->
<input id="questionAnswer" name="questionAnswer" type="text" value="" />
<input type="submit" value="submit" />
</form>
<script>
// load your js code etc
</script>
</body>
</html>
Another way to design this is ajax style: create two cloud pages, 1st page to render question and answers in a div, and use js e.g. jquery to submit form inputs to 2nd cloud page, 2nd cloud page is just a "request process" page that takes input parameter , update DE, then response with JSON data, then in 1st page you can capture the ajax response then render the next question, rinse and repeat until you have all the questions html code designed and handled by ajax response.