judgeChoice

Judges a choice from the indices the reader selected and the indices of the correct options.

@internote/canvas-sdkFunction
On this page
import { judgeChoice } from '@internote/canvas-sdk';

With multiple off, the answer is correct only when the one selected option is a correct one. With multiple on, the fraction is correct picks minus wrong picks over the number of correct options, floored at zero, so selecting everything scores nothing.

#Signature

(
    selected: readonly number[],
    correct: readonly number[],
    multiple: boolean,
): ChoiceJudgement

#Parameters

selected
The indices the reader selected.
correct
The indices of the correct options.
multiple
Whether the question allows several selections.

Declared in packages/canvas-sdk/src/assess/judge.ts:468.

Last updated