# IQuizStateService

- File ID: file:savadk:iquizstateservice-cs
- Path: NexusReader.UI.Shared/Services/IQuizStateService.cs
- Role: service
- Layer: frontend

## Purpose

Defines the UI-shared contract for a quiz state service used by frontend components to read quiz state, request quizzes, and signal updates.

## Key Details

Interface defines UI-facing quiz state contract with async methods and events; no implementation details here.

## Symbols

- IQuizStateService: Defines the UI-shared contract for a quiz state service used by frontend components to read quiz state, request quizzes, and signal updates.
- CurrentQuizBlockId(): Read-only property exposing the current quiz block identifier.
- CurrentQuiz(): Read-only property exposing the current Quiz DTO.
- IsHydrating(): Read-only property indicating whether the service is currently hydrating state.
- HasNewQuiz(): Read-only property indicating whether there is a new/unseen quiz.
- OnQuizRequested(): Event raised when a quiz is requested (carries blockId), consumers can subscribe to handle requests.
- OnQuizUpdated(): Event raised when the quiz state is updated, consumers can subscribe to react to updates.
- RequestQuiz(): Async contract to request loading or activation of a quiz by block id.
- SetQuiz(): Async contract to set or clear the current quiz and associated block id.
- SetHydrating(): Async contract to set the hydrating flag (state loading indicator).
- MarkQuizAsSeen(): Async contract to mark the current quiz as seen/read by the user.

## Dependencies

- No resolved dependencies.

## Calls

- No resolved calls.

## Unresolved References

- dependency-target: NexusReader.Application.Queries (QuizDto)

## Coverage

- Symbols: 11
- Executable symbols: 10
- Executable symbols with control flow: 10
- Grounded edges: 11
- Unresolved references: 1
- Control-flow fragments: 10
- Unresolved jumps: 0
- Unsupported constructs: 0
- Control-flow coverage: 100%
- Required diagrams: 2
- Generated diagrams: 2

## Control Flow Fragments

- CurrentQuizBlockId: 3 nodes, 2 edges, 0 jumps, 0 unsupported constructs
- CurrentQuiz: 3 nodes, 2 edges, 0 jumps, 0 unsupported constructs
- IsHydrating: 3 nodes, 2 edges, 0 jumps, 0 unsupported constructs
- HasNewQuiz: 3 nodes, 2 edges, 0 jumps, 0 unsupported constructs
- OnQuizRequested: 3 nodes, 2 edges, 0 jumps, 0 unsupported constructs
- OnQuizUpdated: 3 nodes, 2 edges, 0 jumps, 0 unsupported constructs
- RequestQuiz: 7 nodes, 7 edges, 0 jumps, 0 unsupported constructs
- SetQuiz: 3 nodes, 2 edges, 0 jumps, 0 unsupported constructs
- SetHydrating: 3 nodes, 2 edges, 0 jumps, 0 unsupported constructs
- MarkQuizAsSeen: 3 nodes, 2 edges, 0 jumps, 0 unsupported constructs

## Diagrams

### IQuizStateService Neighborhood

```mermaid
flowchart LR
    class_36xxdc_iquizstateservice("IQuizStateService")
    file_savadk_iquizstateservice_cs("IQuizStateService")
    method_1iqnx8z_ishydrating[["IsHydrating()"]]
    method_1pa87x9_onquizupdated[["OnQuizUpdated()"]]
    method_1pu32eo_hasnewquiz[["HasNewQuiz()"]]
    method_1s6rrbj_onquizrequested[["OnQuizRequested()"]]
    method_2bqrkc_markquizasseen[["MarkQuizAsSeen()"]]
    method_5hhpkw_setquiz[["SetQuiz()"]]
    method_dz8xj4_currentquiz[["CurrentQuiz()"]]
    method_pd4yo_sethydrating[["SetHydrating()"]]
    method_tuoc3y_requestquiz[["RequestQuiz()"]]
    method_vdmrat_currentquizblockid[["CurrentQuizBlockId()"]]
```

### IQuizStateService Execution Overview

```mermaid
flowchart TD
    class_36xxdc_iquizstateservice("IQuizStateService")
    method_1iqnx8z_ishydrating[["IsHydrating()"]]
    method_1pa87x9_onquizupdated[["OnQuizUpdated()"]]
    method_1pu32eo_hasnewquiz[["HasNewQuiz()"]]
    method_1s6rrbj_onquizrequested[["OnQuizRequested()"]]
    method_2bqrkc_markquizasseen[["MarkQuizAsSeen()"]]
    method_5hhpkw_setquiz[["SetQuiz()"]]
    method_dz8xj4_currentquiz[["CurrentQuiz()"]]
    method_pd4yo_sethydrating[["SetHydrating()"]]
    method_tuoc3y_requestquiz[["RequestQuiz()"]]
    method_vdmrat_currentquizblockid[["CurrentQuizBlockId()"]]
    class_36xxdc_iquizstateservice -->|contains| method_1iqnx8z_ishydrating
    class_36xxdc_iquizstateservice -->|contains| method_1pa87x9_onquizupdated
    class_36xxdc_iquizstateservice -->|contains| method_1pu32eo_hasnewquiz
    class_36xxdc_iquizstateservice -->|contains| method_1s6rrbj_onquizrequested
    class_36xxdc_iquizstateservice -->|contains| method_2bqrkc_markquizasseen
    class_36xxdc_iquizstateservice -->|contains| method_5hhpkw_setquiz
    class_36xxdc_iquizstateservice -->|contains| method_dz8xj4_currentquiz
    class_36xxdc_iquizstateservice -->|contains| method_pd4yo_sethydrating
    class_36xxdc_iquizstateservice -->|contains| method_tuoc3y_requestquiz
    class_36xxdc_iquizstateservice -->|contains| method_vdmrat_currentquizblockid
```

## Diagram Validation

- Status: pass
