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-20 19:08:48 +00:00
|
|
|
theme: '',
|
2023-08-05 05:48:32 +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-08-05 05:48:32 +01:00
|
|
|
export const currentOrgPath = derived(currentOrg, ($currentOrg) =>
|
|
|
|
|
$currentOrg.siteName ? `/org/${$currentOrg.siteName}` : ''
|
2023-05-20 23:53:28 +00:00
|
|
|
);
|
2023-06-17 19:11:29 +00:00
|
|
|
|
|
|
|
|
// Quiz
|
|
|
|
|
export const createQuizModal = writable({
|
|
|
|
|
open: false,
|
|
|
|
|
openEdit: false,
|
|
|
|
|
title: '',
|
2023-08-05 05:48:32 +01:00
|
|
|
id: null
|
2023-06-17 19:11:29 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
export const deleteModal = writable({
|
|
|
|
|
id: null,
|
|
|
|
|
open: false,
|
2023-08-05 05:48:32 +01:00
|
|
|
isQuestion: false
|
2023-06-17 19:11:29 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
export const quizesStore = writable([]);
|
|
|
|
|
|
|
|
|
|
export const quizStore = writable({
|
|
|
|
|
uuid: '',
|
|
|
|
|
title: '',
|
|
|
|
|
questions: [],
|
|
|
|
|
timelimit: '10s',
|
|
|
|
|
theme: 'standard',
|
2023-08-05 05:48:32 +01:00
|
|
|
pin: ''
|
2023-06-17 19:11:29 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
export const playQuizStore = writable({
|
2023-08-05 05:48:32 +01:00
|
|
|
step: STEPS.CONNECT_TO_PLAY
|
2023-06-17 19:11:29 +00:00
|
|
|
});
|