# SubmitAnswerCommandHandler

- File ID: file:hc4koi:submitanswercommandhandler-cs
- Path: NexusReader.Application/Commands/Quiz/SubmitAnswerCommandHandler.cs
- Role: handler
- Layer: application

## Purpose

Handles quiz answer submission: verifies the selected answer against the correct index, triggers a platform vibration on correct answers, and returns a success/failure Result.

## Key Details

Uses FluentResults.Result for success/failure; relies on IPlatformService for haptic feedback; trivial constructor injects dependency (_platformService at line 9).

## Symbols

- SubmitAnswerCommandHandler: Handles quiz answer submission: verifies the selected answer against the correct index, triggers a platform vibration on correct answers, and returns a success/failure Result.
- Handle(): Checks the submitted answer; vibrates the device and returns success if correct, otherwise returns a failure Result.

## Dependencies

- No resolved dependencies.

## Calls

- No resolved calls.

## Unresolved References

- dependency-target: NexusReader.Application.Abstractions.Services/IPlatformService.cs
- dependency-target: NexusReader.Application.Commands.Quiz/SubmitAnswerCommand.cs
- call-target: NexusReader.Application.Abstractions.Services/IPlatformService.cs
- interaction-target: _platformService.VibrateAsync(50) invoked to provide haptic feedback on correct answer

## Coverage

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

## Control Flow Fragments

- Handle: 16 nodes, 17 edges, 1 jumps, 0 unsupported constructs

## Diagrams

### SubmitAnswerCommandHandler Neighborhood

```mermaid
flowchart LR
    class_andjgd_submitanswercommandhandler("SubmitAnswerCommandHandler")
    file_hc4koi_submitanswercommandhandler_cs("SubmitAnswerCommandHandler")
    method_e8akyb_handle[["Handle()"]]
```

### SubmitAnswerCommandHandler Execution Overview

```mermaid
flowchart TD
    class_andjgd_submitanswercommandhandler("SubmitAnswerCommandHandler")
    method_e8akyb_handle[["Handle()"]]
    unresolved_unresolved_gdtbd6_call_target{"Unresolved: VibrateAsync"}
    unresolved_unresolved_h9q2v9_interaction_target{"Unresolved: _platformService.VibrateAsync(50) invoked to provide haptic feedback on correct answer"}
    class_andjgd_submitanswercommandhandler -->|contains| method_e8akyb_handle
    class_andjgd_submitanswercommandhandler -->|unresolved interaction| unresolved_unresolved_h9q2v9_interaction_target
    method_e8akyb_handle -->|unresolved call| unresolved_unresolved_gdtbd6_call_target
```

### Handle() Control Flow

```mermaid
flowchart TD
    method_e8akyb_handle__call_20_VibrateAsync[["VibrateAsync"]]
    method_e8akyb_handle__action_18_guard_clause_18__condition{"request.SelectedIndex == request.CorrectIndex"}
    method_e8akyb_handle__action_18_guard_clause_18__false("incorrect -> return failure")
    method_e8akyb_handle__action_18_guard_clause_18__merge("merge")
    method_e8akyb_handle__action_18_guard_clause_18__true("correct -> vibrate and return success")
    method_e8akyb_handle__action_18_handle_branch_18_0__condition{"request.SelectedIndex == request.CorrectIndex"}
    method_e8akyb_handle__action_18_handle_branch_18_0__false("false")
    method_e8akyb_handle__action_18_handle_branch_18_0__merge("merge")
    method_e8akyb_handle__action_18_handle_branch_18_0__true("true")
    method_e8akyb_handle__action_20_handle_await_20_1__await[["Waits for async work"]]
    method_e8akyb_handle__entry(["Handle entry"])
    method_e8akyb_handle__action_20_external_call_20__linear("platform vibrate")
    method_e8akyb_handle__action_21_handle_return_21_2__return(["Returns result"])
    method_e8akyb_handle__action_21_return_21__return(["success-return"])
    method_e8akyb_handle__action_24_handle_return_24_3__return(["Returns result"])
    method_e8akyb_handle__action_24_return_24__return(["failure-return"])
    method_e8akyb_handle__action_18_guard_clause_18__condition -->|incorrect -> return failure| method_e8akyb_handle__action_18_guard_clause_18__false
    method_e8akyb_handle__action_18_guard_clause_18__condition -->|correct -> vibrate and return success| method_e8akyb_handle__action_18_guard_clause_18__true
    method_e8akyb_handle__action_18_guard_clause_18__false -->|next| method_e8akyb_handle__action_18_guard_clause_18__merge
    method_e8akyb_handle__action_18_guard_clause_18__merge -->|next| method_e8akyb_handle__action_20_handle_await_20_1__await
    method_e8akyb_handle__action_18_guard_clause_18__true -->|next| method_e8akyb_handle__action_18_guard_clause_18__merge
    method_e8akyb_handle__action_18_handle_branch_18_0__condition -->|false| method_e8akyb_handle__action_18_handle_branch_18_0__false
    method_e8akyb_handle__action_18_handle_branch_18_0__condition -->|true| method_e8akyb_handle__action_18_handle_branch_18_0__true
    method_e8akyb_handle__action_18_handle_branch_18_0__false -->|next| method_e8akyb_handle__action_18_handle_branch_18_0__merge
    method_e8akyb_handle__action_18_handle_branch_18_0__merge -->|next| method_e8akyb_handle__action_18_guard_clause_18__condition
    method_e8akyb_handle__action_18_handle_branch_18_0__true -->|next| method_e8akyb_handle__action_18_handle_branch_18_0__merge
    method_e8akyb_handle__action_20_external_call_20__linear -->|50 int milliseconds| method_e8akyb_handle__call_20_VibrateAsync
    method_e8akyb_handle__action_20_handle_await_20_1__await -->|next| method_e8akyb_handle__action_20_external_call_20__linear
    method_e8akyb_handle__action_21_handle_return_21_2__return -->|return| method_e8akyb_handle__action_24_handle_return_24_3__return
    method_e8akyb_handle__action_21_return_21__return -->|return| method_e8akyb_handle__action_21_handle_return_21_2__return
    method_e8akyb_handle__action_24_handle_return_24_3__return -->|return| method_e8akyb_handle__action_24_return_24__return
    method_e8akyb_handle__call_20_VibrateAsync -->|return| method_e8akyb_handle__action_21_return_21__return
    method_e8akyb_handle__entry -->|next| method_e8akyb_handle__action_18_handle_branch_18_0__condition
```

## Diagram Validation

- Status: warn
- Warning: Control-flow extraction left 1 unresolved jumps.
