A web form is an HTML interface that groups controls for collecting input and submitting it to a server. In a Flask application, a form can let a user start a question session or submit a quiz answer. section 6.2 section 7.2
A practical form workflow connects three pieces:
- The HTML template supplies controls such as submit buttons, radio inputs, and dynamic question content. section 7.2
- The form action and method determine where the submission goes; a POST request can trigger server-side work. section 6.2
- The Flask route checks the request method, performs the requested operation, and renders the updated template. section 6.2
- Jinja2 placeholders and blocks allow templates to combine fixed HTML with question data and other dynamic values. section 7.2
Start a question session
Add a POST form with a “Start Question Session” button. Configure the Flask route for GET and POST, start the session only when the request is POST, then render the page with the resulting data. Test the generated code, because the suggested implementation required importing request, indenting existing logic, and handling missing data before the page loaded correctly. section 6.2
<form action="/" method="POST"> <input type="submit" value="Start Question Session"> </form>
A minimal form demonstrates the action, POST method, and submit control used to start server-side work. section 6.2











