Hiyve Components - v1.0.0
    Preparing search index...

    Interface UseDrillResult<Q>

    What useDrill returns.

    interface UseDrillResult<Q extends TheoryQuestion = TheoryQuestion> {
        answer: (choice: string, correct?: boolean) => void;
        drill: DrillState<Q>;
        finish: () => void;
        finished: boolean;
        index: number;
        length: number;
        next: () => void;
        question: Q | null;
        restart: (options?: { length?: number; seed?: number }) => void;
        round: DrillRound<Q> | null;
        summary: DrillSummary;
        total: number;
    }

    Type Parameters

    Index

    Properties

    answer: (choice: string, correct?: boolean) => void

    Answer the current round; the time since it was shown is recorded with it. correct says how an answer judged elsewhere went — one played on an instrument — otherwise the choice is checked against the question

    drill: DrillState<Q>

    The drill as it stands

    finish: () => void

    End the drill now, keeping the rounds answered: the summary is of what was done

    finished: boolean

    Every round has been asked, or the drill was finished early

    index: number

    The round being asked, from 0

    length: number

    Questions the drill was drawn with, however many were answered: for drillRecord

    next: () => void

    Move on to the next round

    question: Q | null

    The round's question, or null once the drill is finished

    restart: (options?: { length?: number; seed?: number }) => void

    Start over: the same drill again — all of it, though it was finished early — or another from a new seed or length

    round: DrillRound<Q> | null

    The round being asked, or null once the drill is finished

    summary: DrillSummary

    How the drill has gone so far

    total: number

    Questions in the drill — once finished early, those answered