@coorpacademy/progression-engine
Version:
20 lines (18 loc) • 1.62 kB
Flow
// @flow
import type {Question, BasicQuestion, TemplateQuestion, PartialCorrection, AnswerCorrection, AcceptedAnswers, Answer, Config} from "./types";
import FuzzyMatching from "fuzzy-matching";
import zip from "lodash/fp/zip";
import trim from "lodash/fp/trim";
import toLower from "lodash/fp/toLower";
import split from "lodash/fp/split";
import some from "lodash/fp/some";
import reverse from "lodash/fp/reverse";
import pipe from "lodash/fp/pipe";
import maxBy from "lodash/fp/maxBy";
import map from "lodash/fp/map";
import join from "lodash/fp/join";
import includes from "lodash/fp/includes";
import get from "lodash/fp/get";
import filter from "lodash/fp/filter";
import every from "lodash/fp/every";
declare export default function(config: {answerBoundaryLimit: number, lives: number, livesDisabled: boolean, maxTypos: number, remainingLifeRequests: number, slidesToComplete: number, starsPerAskingClue: number, starsPerCorrectAnswer: number, starsPerResourceViewed: number, version: string}, question: {content: {answers: Array<Array<string>>}, type: "qcm"} | {content: {answers: Array<Array<string>>}, type: "qcmGraphic"} | {content: {answers: Array<Array<string>>, matchOrder: boolean}, type: "qcmDrag"} | {content: {answers: Array<Array<string>>}, type: "slider"} | {content: {answers: Array<Array<string>>, maxTypos?: ?number}, type: "basic"} | {content: {answers: Array<Array<string>>, choices: Array<{type: "text" | "select"}>, matchOrder: boolean, maxTypos?: ?number}, type: "template"}, givenAnswer: Array<string>): {corrections: Array<{answer: string | void, isCorrect: ?boolean}>, isCorrect: boolean};