High level design question, Survey App

Been tasked with a new DB request. Its a survey application and a couple of the main requirements are being able to dynamically create a survey with any number of questions and have questions skipped based on previous question answers.

Haven’t started coding anything yet just thinking about the app flow in my head.

I want to do a wizard type approach. One question per “page”

User selects an answer then clicks “next” until no more questions are left and then clicks “Submit” to finish.

The servers are running 8.5.1 but no one in the organization has used XPages before. I’ve played with tutorials but nothing serious.

Getting approval for anything new here is very hard. Have to have a very good reason to go that route.

I’ve played with John Mackey’s tutorial: http://www.jmackey.net/groupwareinc/johnblog/johnblog.nsf/d6plinks/SurveyToolSample

Which has a lot of relevant points. Mostly the way he creates survey questions and displays them as they are created.

Because of the weird approval process here I’m making my primary plan without xpages.

Just wanted to see if its nutso or if Im doing something weird.

For displaying the survey Im planning on having one form(frmSurveyTaker) with a header, footer, body, and a WQO agent.

When a user goes to the Survey some token ID/Doc ID will be passed into the URL and the WQO agent will use that to find a Survey document which has a list of Doc IDs that correspond to questions. So one Question Doc per question.

The WQO agent will take the first Question Doc in the list and build HTML for that question and answer config info.

The HTML will be dumped into a field in the body of frmSurveyTaker.

Below will be a “Next” button thats hidden by div tags if no answer selection has been made.

“Next” will submit the doc and fire off another agent which grabs the HTML question by tag and figures out what the user selected.

It saves the selected answer into a hidden Answers field on the frmSurveyTaker doc.

Based on the answer and config info in the Question Doc it will calculate which question is next. Setting another hidden field in the frmSurveyTaker that the WQO agent will pick up to know which Question Doc to grab and generate HTML for.

This can keep repeating until no questions are left. Then the “Submit” button is displayed to save the last answered question and save the doc.

That make any sense?

Using XPages, how can I avoid writing that HTML generating agent? Is there a way, not XPages, that can avoid that?

Apologize for the brain dump and thanks in advance for anyone’s input.