frontAnswerer/src/model/settingsData.ts

127 lines
2.7 KiB
TypeScript
Raw Normal View History

import { AnyTypedQuizQuestion } from "./questionTypes/shared";
export type QuizStartpageType = "standard" | "expanded" | "centered" | null;
export type QuizStartpageAlignType = "left" | "right" | "center";
export type QuizType = "quiz" | "form";
export type QuizResultsType = true | null;
export type QuizTheme =
| "StandardTheme"
| "StandardDarkTheme"
| "PinkTheme"
| "PinkDarkTheme"
| "BlackWhiteTheme"
| "OliveTheme"
| "YellowTheme"
| "GoldDarkTheme"
| "PurpleTheme"
| "BlueTheme"
| "BlueDarkTheme";
export type FCField = {
text: string;
innerText: string;
key: string;
required: boolean;
used: boolean;
};
export type QuizSettings = {
2024-02-02 14:35:02 +00:00
questions: AnyTypedQuizQuestion[];
settings: {
qid: string;
fp: boolean;
rep: boolean;
name: string;
lim: number;
due: number;
delay: number;
pausable: boolean;
cfg: QuizConfig;
};
cnt: number;
2024-02-02 14:35:02 +00:00
recentlyCompleted: boolean;
};
export interface QuizConfig {
type: QuizType;
noStartPage: boolean;
startpageType: QuizStartpageType;
results: QuizResultsType;
haveRoot: string;
theme: QuizTheme;
resultInfo: {
2024-01-10 18:02:37 +00:00
when: "email" | "";
share: boolean;
replay: boolean;
theme: string;
reply: string;
replname: string;
2024-01-10 18:02:37 +00:00
showResultForm: "before" | "after";
};
startpage: {
description: string;
button: string;
position: QuizStartpageAlignType;
favIcon: string | null;
logo: string | null;
originalLogo: string | null;
background: {
type: null | "image" | "video";
desktop: string | null;
originalDesktop: string | null;
mobile: string | null;
originalMobile: string | null;
video: string | null;
cycle: boolean;
};
};
formContact: {
title: string;
desc: string;
name: FCField;
email: FCField;
phone: FCField;
text: FCField;
address: FCField;
button: string;
2024-01-31 12:57:07 +00:00
fields: Record<FormContactFieldName, FormContactFieldData>;
};
info: {
phonenumber: string;
clickable: boolean;
orgname: string;
site: string;
law?: string;
};
meta: string;
}
2024-01-25 07:36:45 +00:00
export type FormContactFieldName =
2024-01-31 12:57:07 +00:00
| "name"
| "email"
| "phone"
| "text"
| "address";
2024-01-25 07:36:45 +00:00
type FormContactFieldData = {
2024-01-31 12:57:07 +00:00
text: string;
innerText: string;
key: string;
required: boolean;
used: boolean;
2024-01-25 07:36:45 +00:00
};
export interface QuizItems {
description: string;
id: number;
page: number;
required: boolean;
title: string;
type: string;
content: unknown;
}