2023-06-17 19:11:29 +00:00
|
|
|
import cloneDeep from 'lodash/cloneDeep';
|
2023-05-20 23:53:28 +00:00
|
|
|
import { writable, derived } from 'svelte/store';
|
2023-06-17 19:11:29 +00:00
|
|
|
import { allOptions, STEPS, booleanOptions } from '../constants/quiz';
|
2023-01-03 09:26:08 +01:00
|
|
|
|
|
|
|
|
export const orgs = writable([]);
|
2023-04-22 20:00:37 +00:00
|
|
|
export const currentOrg = writable({
|
|
|
|
|
id: '',
|
|
|
|
|
name: '',
|
|
|
|
|
shortName: '',
|
|
|
|
|
siteName: '',
|
2023-05-02 23:55:26 +00:00
|
|
|
avatar_url: '',
|
2023-08-02 19:35:27 +01:00
|
|
|
memberId: '',
|
2023-04-22 20:00:37 +00:00
|
|
|
});
|
2023-04-23 22:28:18 +00:00
|
|
|
export const orgAudience = writable([]);
|
2023-05-02 23:55:26 +00:00
|
|
|
export const orgTeam = writable([]);
|
2023-05-20 23:53:28 +00:00
|
|
|
export const currentOrgPath = derived(
|
|
|
|
|
currentOrg,
|
|
|
|
|
($currentOrg) => `/org/${$currentOrg.siteName}`
|
|
|
|
|
);
|
2023-06-17 19:11:29 +00:00
|
|
|
|
|
|
|
|
// Quiz
|
|
|
|
|
export const createQuizModal = writable({
|
|
|
|
|
open: false,
|
|
|
|
|
openEdit: false,
|
|
|
|
|
title: '',
|
|
|
|
|
id: null,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
export const deleteModal = writable({
|
|
|
|
|
id: null,
|
|
|
|
|
open: false,
|
|
|
|
|
isQuestion: false,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
export const quizesStore = writable([]);
|
|
|
|
|
|
|
|
|
|
export const quizStore = writable({
|
|
|
|
|
uuid: '',
|
|
|
|
|
title: '',
|
|
|
|
|
questions: [],
|
|
|
|
|
timelimit: '10s',
|
|
|
|
|
theme: 'standard',
|
|
|
|
|
pin: '',
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
export const playQuizStore = writable({
|
|
|
|
|
step: STEPS.CONNECT_TO_PLAY,
|
|
|
|
|
});
|