diff options
| author | Furkan Sahin <furkan-dev@proton.me> | 2022-07-27 19:19:10 -0500 |
|---|---|---|
| committer | Furkan Sahin <furkan-dev@proton.me> | 2022-07-27 19:19:10 -0500 |
| commit | 09bbabb765d9e8c64b9455394295b5732622d3c3 (patch) | |
| tree | a26c8698acdcd5265e9c2467d0356c93119e0103 /src/components/FileUploads.svelte | |
| parent | c81c5f2ffeb037918429b4f279588161452d344b (diff) | |
Parse the `csv` questionnairre. Currently populates values for recently added attributes for only existing PTs.
Diffstat (limited to 'src/components/FileUploads.svelte')
| -rw-r--r-- | src/components/FileUploads.svelte | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/components/FileUploads.svelte b/src/components/FileUploads.svelte index 14b0be3..e5df56f 100644 --- a/src/components/FileUploads.svelte +++ b/src/components/FileUploads.svelte @@ -8,12 +8,14 @@ parseDatabaseFile, parseLabScheduleFile, parsePTFile, + readQuestionairre, } from "../logic/EditorActions"; import { labStore, ptStore } from "../stores"; let ptSchedules: FileList | null; let labSchedule: FileList | null; let dbFile: FileList | null; + let questionairreFile: FileList | null; let snackbar: Snackbar; let snackbarText; @@ -81,6 +83,12 @@ } } + $: { + if (questionairreFile?.length) { + readQuestionairre(questionairreFile[0]); + } + } + function dbStringify(): string { const peerTeachers = [...$ptStore.values()]; const labs = [...$labStore.values()]; @@ -173,6 +181,18 @@ >LocalStorage</button > </Card> + + <Card + title="Upload PTs from Questionnairre" + desc="Gather all data from the questionnairre results. Should be in CSV format" + > + <UploadButton + color="btn-info" + accept="text/csv" + multiple={false} + bind:files={questionairreFile} + /> + </Card> </div> <!-- https://github.com/saadeghi/daisyui/issues/221 --> |
