Survey, then pass {"survey": {"presentation": "group"}} to .humanize().
Grouped presentation requires support in both your installed EDSL version and the hosted survey interface. Preview with the same schema to check that the intended questions appear together.
Create a two-page survey
This example puts two background questions on the first page and two feedback questions on the second.
Preview with the same schema you intend to use when creating the survey:
presentation, or set it to "question", for the default question-by-question mode.
Set group boundaries
survey.add_question_group(start_question, end_question, group_name) accepts question names or question objects and returns the survey for chaining.
- Each group includes both endpoints and every question between them.
- Groups must not overlap. A one-question page uses the same question for both endpoints.
- Names must be unique Python identifiers, such as
background, and must not match a question name. - Pages follow question order in the survey.
- Assign every question you want displayed to a group. With groups defined, the current grouped navigator skips questions outside those groups.
work_location, define its group with survey.add_question_group("work_location", "work_location", "location_page") on a survey where that question is not already grouped.
Inspect navigation locally
Usesurvey.next_group() to inspect which questions belong on the next page for a given set of answers, without publishing the survey. This is useful when checking a route that should skip a page. For a visual check of the participant experience, use survey.preview() instead.
With the two-page survey constructed above:
include_instructions=False to return questions only.
See Humanize for retrieving responses and Humanize schema for styling and other presentation options.
Plan branching around pages
The navigator uses the answers supplied when a page is requested to filter skipped questions. After a page is submitted, it applies the normal navigation rules from that group’s last renderable question to choose the next page. Put page-level jump or stop rules on that question. If a later question depends on an earlier answer, put the dependent question on a later page so that answer is available when the page is selected. The navigation API does not establish live, within-page updates to conditional questions. For example, starting with the two-page survey above, omit the improvement question for satisfied respondents:- A group with no remaining questions is skipped.
- A jump into the middle of a group starts at the target question; earlier questions in that group are omitted.
- Relevant instructions before or within the selected group are included by default.
