diff --git a/frontend/fic/src/lib/components/ExerciceDownloads.svelte b/frontend/fic/src/lib/components/ExerciceDownloads.svelte index 6da12ad5..14ae7e7e 100644 --- a/frontend/fic/src/lib/components/ExerciceDownloads.svelte +++ b/frontend/fic/src/lib/components/ExerciceDownloads.svelte @@ -9,7 +9,6 @@ ListGroupItem, } from '@sveltestrap/sveltestrap'; - import { hasDownloaded } from '$lib/stores/downloaded.js'; import FileSize from './FileSize.svelte'; export let files = []; @@ -28,8 +27,8 @@ {#each files as file, index} - hasDownloaded.update((u) => {u[file.path] = true; return u;})}> -

+ +

diff --git a/frontend/fic/src/lib/components/ExerciceFlags.svelte b/frontend/fic/src/lib/components/ExerciceFlags.svelte index c5c8e24c..a84360e4 100644 --- a/frontend/fic/src/lib/components/ExerciceFlags.svelte +++ b/frontend/fic/src/lib/components/ExerciceFlags.svelte @@ -17,7 +17,6 @@ import { my } from '$lib/stores/my.js'; import { settings } from '$lib/stores/settings.js'; - import { submissions } from '$lib/stores/submissions.js'; import { timeouted, waitDiff, waitInProgress } from '$lib/wait.js'; import DateFormat from './DateFormat.svelte'; @@ -37,20 +36,6 @@ message = ""; last_submission = JSON.parse(JSON.stringify(responses)); - submissions.update((u) => { - for (const k in last_submission.flags) { - u.flags[k] = last_submission.flags[k]; - } - - for (const k in last_submission.mcqs) { - u.mcqs[k] = last_submission.mcqs[k]; - } - - for (const k in last_submission.justifications) { - u.justifications[k] = last_submission.justifications[k]; - } - }) - if ($my && $my.team_id === 0) { let allGoodResponse = true; for (const f in flags) { diff --git a/frontend/fic/src/lib/components/FlagKey.svelte b/frontend/fic/src/lib/components/FlagKey.svelte index 411aa26b..a1084965 100644 --- a/frontend/fic/src/lib/components/FlagKey.svelte +++ b/frontend/fic/src/lib/components/FlagKey.svelte @@ -9,7 +9,6 @@ import { my } from '$lib/stores/my.js'; import { settings } from '$lib/stores/settings.js'; - import { submissions } from '$lib/stores/submissions.js'; export { className as class }; let className = ''; @@ -248,15 +247,6 @@ title="Flag trouvé à {flag.found}" value={value} > - {:else if $submissions && $submissions.flags && $submissions.flags[flag.id]} - {:else} { - update(u); - if (window.localStorage) localStorage.setItem("downloadedStore", JSON.stringify(init)); - }, - } -} - -export const hasDownloaded = createDownloadedStore(); diff --git a/frontend/fic/src/lib/stores/submissions.js b/frontend/fic/src/lib/stores/submissions.js deleted file mode 100644 index c4b5abd8..00000000 --- a/frontend/fic/src/lib/stores/submissions.js +++ /dev/null @@ -1,33 +0,0 @@ -import { writable } from 'svelte/store'; - -function createSubmissionsStore() { - let init = { - flags: { }, - mcqs: { }, - justifications: { }, - }; - try { - if (window.localStorage && window.localStorage.getItem("submissionsStore")) { - init = JSON.parse(window.localStorage.getItem("submissionsStore")); - } - } catch { - init = { - flags: { }, - mcqs: { }, - justifications: { }, - }; - } - - const { subscribe, set, update } = writable(init); - - return { - subscribe, - - update: (u) => { - update(u); - if (window.localStorage) localStorage.setItem("submissionsStore", JSON.stringify(init)); - }, - } -} - -export const submissions = createSubmissionsStore();