<aside>
⏰ Recommended Duration: 2.5 hours
</aside>
Overview
Your task is to implement the frontend portion for a small feature of Granted. We want to show a form where an AI system dynamically generates each question. When a user replies to a question, the server validates the answer, determines the next question, and responds with the information necessary for the frontend to display the next question. You will focus on defining the API contract for the backend server and building the frontend for the dynamic form.
Your implementation should support the following question types:
- A text input
- A multiple-choice question:
- One version where only one option is selectable.
- One version where multiple options are selectable.
Here is a video showing one possible implementation:
Screen Recording 2024-08-19 at 4.38.16 PM.mov
Things to keep in mind
- The form has a beginning and an end, and the server decides the number and sequence of questions. Your front end should respond dynamically to whatever the API requests.
- Questions should be displayed one at a time, and the next question should not be displayed until a valid answer for the current question is submitted.
- Validations should be performed on the server, and error messages should be displayed on the front end.
- Each question has a title and a description/prompt for the user.
- Some of the responses may be pre-populated by the server.
- The user should be able to return to previous questions.