// @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>}, type: "qcm"} | {content: {answers: Array>}, type: "qcmGraphic"} | {content: {answers: Array>, matchOrder: boolean}, type: "qcmDrag"} | {content: {answers: Array>}, type: "slider"} | {content: {answers: Array>, maxTypos?: ?number}, type: "basic"} | {content: {answers: Array>, choices: Array<{type: "text" | "select"}>, matchOrder: boolean, maxTypos?: ?number}, type: "template"}, givenAnswer: Array): {corrections: Array<{answer: string | void, isCorrect: ?boolean}>, isCorrect: boolean};