aboutsummaryrefslogtreecommitdiff
path: root/src/components/FileUploads.svelte
diff options
context:
space:
mode:
authorFurkan Sahin <furkan-dev@proton.me>2022-08-01 18:13:53 -0500
committerFurkan Sahin <furkan-dev@proton.me>2022-08-01 18:13:53 -0500
commit441b3085fab7f0c83e8eb2df388661d6e18c0120 (patch)
tree2359c78a50cd714aaf308c5764460cead7d551b9 /src/components/FileUploads.svelte
parentf05396f0e86f68ee45e8c25d79401b6f54979dba (diff)
WiP parsing of office hours
Diffstat (limited to 'src/components/FileUploads.svelte')
-rw-r--r--src/components/FileUploads.svelte24
1 files changed, 22 insertions, 2 deletions
diff --git a/src/components/FileUploads.svelte b/src/components/FileUploads.svelte
index e5df56f..5f072ea 100644
--- a/src/components/FileUploads.svelte
+++ b/src/components/FileUploads.svelte
@@ -7,8 +7,9 @@
import {
parseDatabaseFile,
parseLabScheduleFile,
+ parseOfficeHoursFile,
parsePTFile,
- readQuestionairre,
+ readQuestionnaire,
} from "../logic/EditorActions";
import { labStore, ptStore } from "../stores";
@@ -16,6 +17,7 @@
let labSchedule: FileList | null;
let dbFile: FileList | null;
let questionairreFile: FileList | null;
+ let officehoursFiles: FileList | null;
let snackbar: Snackbar;
let snackbarText;
@@ -85,7 +87,13 @@
$: {
if (questionairreFile?.length) {
- readQuestionairre(questionairreFile[0]);
+ readQuestionnaire(questionairreFile[0]);
+ }
+ }
+
+ $: {
+ if (officehoursFiles?.length) {
+ parseOfficeHoursFile(officehoursFiles[0]);
}
}
@@ -193,6 +201,18 @@
bind:files={questionairreFile}
/>
</Card>
+
+ <Card
+ title="Office Hours"
+ desc="Upload the office hours output file for it to be parsed. Currently we accept a CSV file representation of a Strawpoll output"
+ >
+ <UploadButton
+ color="btn-warn"
+ accept="text/csv"
+ multiple={false}
+ bind:files={officehoursFiles}
+ /></Card
+ >
</div>
<!-- https://github.com/saadeghi/daisyui/issues/221 -->