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

    Result of useCoursePlayer.

    interface UseCoursePlayerResult {
        canComplete: boolean;
        commentOnLesson: (lessonId: string, input: CommentInput) => Promise<void>;
        completeAndContinue: () => void;
        completeCustom: (blockId: string, result?: BlockResult) => void;
        content: LessonContent | null | undefined;
        course: Course | null;
        courseComplete: boolean;
        currentLesson: LessonSummary | null;
        currentState: LessonState | null;
        enrollment: Enrollment | null;
        error: Error | null;
        goNext: () => void;
        goPrevious: () => void;
        lessons: LessonSummary[];
        loading: boolean;
        pending: PendingBlock[];
        preview: boolean;
        progress: Progress | null;
        recordBlock: (blockId: string, update: BlockProgressUpdate) => void;
        reply: (submissionId: string, input: CommentInput) => Promise<void>;
        resubmit: () => void;
        saveState: SaveState;
        selectLesson: (lessonId: string) => void;
        states: Record<string, LessonState>;
        submitQuiz: (quiz: QuizBlock, answers: QuizAnswers) => QuizScore | null;
        submitWork: (
            blockId: string,
            input: { kind: SubmissionKind; media?: MediaRef; text?: string },
        ) => Promise<void>;
    }
    Index

    Properties

    canComplete: boolean

    Whether the client can complete the current lesson now.

    commentOnLesson: (lessonId: string, input: CommentInput) => Promise<void>

    Ask a question or leave a note on the current lesson. Saved like submitWork.

    completeAndContinue: () => void
    completeCustom: (blockId: string, result?: BlockResult) => void
    content: LessonContent | null | undefined

    The current lesson's content; undefined while loading, null when it can't be read.

    course: Course | null
    courseComplete: boolean

    Whether every lesson is done (and approved where needed).

    currentLesson: LessonSummary | null
    currentState: LessonState | null
    enrollment: Enrollment | null
    error: Error | null
    goNext: () => void
    goPrevious: () => void
    lessons: LessonSummary[]
    loading: boolean
    pending: PendingBlock[]

    Required blocks still to finish in the current lesson.

    preview: boolean
    progress: Progress | null
    recordBlock: (blockId: string, update: BlockProgressUpdate) => void
    reply: (submissionId: string, input: CommentInput) => Promise<void>

    Reply to the provider's review of a submission. Saved like submitWork.

    resubmit: () => void
    saveState: SaveState
    selectLesson: (lessonId: string) => void
    states: Record<string, LessonState>
    submitQuiz: (quiz: QuizBlock, answers: QuizAnswers) => QuizScore | null
    submitWork: (
        blockId: string,
        input: { kind: SubmissionKind; media?: MediaRef; text?: string },
    ) => Promise<void>

    Submit work to a submission block in the current lesson. Resolves once the submission is recorded locally and a save has started; saveState shows how the save is going, and a failed save is retried and reported to onError once.