diff --git a/lib/index.ts b/lib/index.ts index 911a69b..fdac23b 100644 --- a/lib/index.ts +++ b/lib/index.ts @@ -3,4 +3,6 @@ import QuizVideo from "./ui_kit/VideoIframe/VideoIframe"; export type { QuizSettings, QuizConfig } from "@model/settingsData"; export type * from "./model/widget"; +export type * from "@model/questionTypes"; + export { QuizAnswerer, QuizVideo }; diff --git a/lib/model/questionTypes/index.ts b/lib/model/questionTypes/index.ts new file mode 100644 index 0000000..b99e3bd --- /dev/null +++ b/lib/model/questionTypes/index.ts @@ -0,0 +1,13 @@ +export * from "./date"; +export * from "./emoji"; +export * from "./file"; +export * from "./images"; +export * from "./number"; +export * from "./page"; +export * from "./rating"; +export * from "./result"; +export * from "./select"; +export * from "./shared"; +export * from "./text"; +export * from "./variant"; +export * from "./varimg"; diff --git a/lib/model/questionTypes/shared.ts b/lib/model/questionTypes/shared.ts index 067a120..6f77a51 100644 --- a/lib/model/questionTypes/shared.ts +++ b/lib/model/questionTypes/shared.ts @@ -1,4 +1,3 @@ -import { nanoid } from "nanoid"; import type { QuizQuestionDate } from "./date"; import type { QuizQuestionEmoji } from "./emoji"; import type { QuizQuestionFile } from "./file"; @@ -64,6 +63,7 @@ export type QuestionType = | "result"; export interface QuizQuestionBase { + backendId: number; /** Stable id, generated on client */ id: string; quizId: number; @@ -109,25 +109,3 @@ type FilterQuestionsWithVariants = T extends { : never; export type QuizQuestionsWithVariants = FilterQuestionsWithVariants; - -export const createBranchingRuleMain: (targetId: string, parentId: string) => QuestionBranchingRuleMain = ( - targetId, - parentId -) => ({ - next: targetId, - or: false, - rules: [ - { - question: parentId, - answers: [] as string[], - }, - ], -}); - -export const createQuestionVariant: () => QuestionVariant = () => ({ - id: nanoid(), - answer: "", - extendedText: "", - hints: "", - originalImageUrl: "", -}); diff --git a/package.json b/package.json index f83b86c..0c4cce5 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@frontend/squzanswerer", - "version": "1.0.46", + "version": "1.0.47", "type": "module", "main": "./dist-package/index.js", "module": "./dist-package/index.js",