vibe.paging¶
Group status computation for grouped interview mode.
This module provides functions to compute group statuses based on: - Question relevance (determined by template probing) - Current answers in session state - Validation errors
Group statuses: - not_relevant: No questions in this group are currently relevant - not_started: Group has relevant questions but none are answered - in_progress: Some questions answered or validation errors present - complete: All required relevant questions answered with no errors
ProgressCounts ¶
Required-question progress counts.
compute_group_status ¶
compute_group_status(group: GroupConfig, relevant_blocks: set[str], current_state: dict[str, Any], validation_errors: dict[str, Any], questions: dict[str, Any]) -> GroupStatus
Compute the status of a single group.
| Parameters: |
|
|---|
| Returns: |
|
|---|
compute_all_group_statuses ¶
compute_all_group_statuses(groups: list[GroupConfig], relevant_blocks: set[str], current_state: NestedValue, validation_errors: dict[str, Any], questions: dict[str, Any]) -> dict[str, GroupStatus]
Compute status for all groups.
| Parameters: |
|
|---|
| Returns: |
|
|---|
get_first_relevant_group ¶
get_first_relevant_group(groups: list[GroupConfig], relevant_blocks: set[str]) -> str | None
Get the ID of the first group that has at least one relevant question.
| Parameters: |
|
|---|
| Returns: |
|
|---|
get_next_relevant_group ¶
get_next_relevant_group(groups: list[GroupConfig], current_group_id: str, relevant_blocks: set[str]) -> str | None
Get the ID of the next group (after current) that has relevant questions.
| Parameters: |
|
|---|
| Returns: |
|
|---|
get_prev_relevant_group ¶
get_prev_relevant_group(groups: list[GroupConfig], current_group_id: str, relevant_blocks: set[str]) -> str | None
Get the ID of the previous group (before current) that has relevant questions.
| Parameters: |
|
|---|
| Returns: |
|
|---|
get_group_by_id ¶
get_group_by_id(groups: list[GroupConfig], group_id: str) -> GroupConfig | None
Get a GroupConfig by its ID.
| Parameters: |
|
|---|
| Returns: |
|
|---|
build_paged_context ¶
build_paged_context(template: TemplateData, current_group_id: str, relevant_blocks: Collection[str], current_state: NestedValue, validation_errors: dict[str, Any]) -> dict[str, Any]
Build the full paged context dict for template rendering.
| Parameters: |
|
|---|
| Returns: |
|
|---|
compute_group_progresses ¶
compute_group_progresses(groups: list[GroupConfig], relevant_blocks: set[str], current_state: NestedValue, questions: dict[str, Any]) -> dict[str, ProgressCounts]
Compute required-question progress counts for all groups.
Only relevant questions are counted.
compute_overall_progress ¶
compute_overall_progress(relevant_blocks: Iterable[str], current_state: NestedValue, questions: dict[str, Any]) -> ProgressCounts
Compute required-question progress across all relevant questions.