Survey class and the question types you’ll use:
Explanation
- Import Modules: Import the necessary classes and question types from
roundtable-js. - Create Survey Instance: The
createSurveyfunction initializes a new survey with custom styles applied to the body, container, and buttons. - Create Pages: The
createPage1andcreatePage2functions define two pages of the survey. Page 1 collects demographic information, and Page 2 collects user feedback. - Run the Survey: The
runSurveyfunction handles the survey flow. It displays each page sequentially, retrieves responses, and completes the survey with a thank you message.
Customization
You can extend this example indefinitely. Here are some ideas:- Additional Pages: Create more pages with various question types like
MultiSelect,Grid, etc. - Conditional Logic: Add conditional logic to show or hide questions based on previous answers.
- Advanced Styling: Customize the survey further by defining more detailed styles for individual questions or error messages.

