diff --git a/frontend/src/api/postUserformData.ts b/frontend/src/api/postUserformData.ts index ad39f5d..0ee076a 100644 --- a/frontend/src/api/postUserformData.ts +++ b/frontend/src/api/postUserformData.ts @@ -6,10 +6,14 @@ export const postUserformData = ( age: string, education: string, healthcare_personnel: string, - gender: string + gender: string, + has_answered_before: string, + county: string, + submit_date: string ): Promise => { let url = "http://localhost:8080/submituserform"; let personnel = healthcare_personnel == "Ja" ? true : false; + let answered_before = has_answered_before == "Ja" ? true : false; const response = fetch(url, { method: "POST", @@ -18,6 +22,9 @@ export const postUserformData = ( education: education, healthcare_personnel: personnel, gender: gender, + answered_before: answered_before, + county: county, + submit_date: submit_date, }), }) .then((response) => { diff --git a/frontend/src/routes/+page.svelte b/frontend/src/routes/+page.svelte index 60a865d..800c6a0 100644 --- a/frontend/src/routes/+page.svelte +++ b/frontend/src/routes/+page.svelte @@ -12,7 +12,8 @@
  • Empati: Evnen til å oppdage og erkjenne andres følelser og tanker.
  • Kunnskap: Nøyaktighet og relevans av den medisinske informasjonen gitt.
  • Hjelpsomhet: Evnen til å gi nyttig og praktisk råd eller støtte.
  • - + +
    @@ -36,8 +37,8 @@ margin-left: 2rem; font-size: large; } - p { - font-size: large; + p, li{ + font-size: larger; } button { font-size: large; diff --git a/frontend/src/routes/userform/+page.svelte b/frontend/src/routes/userform/+page.svelte index e25582b..532f52e 100644 --- a/frontend/src/routes/userform/+page.svelte +++ b/frontend/src/routes/userform/+page.svelte @@ -11,12 +11,17 @@ let education: string = "PhD" let healthcare_personnel: string = "Ja" let gender: string = "Mann" + let has_answered_before: string = "Nei" + let county: string = "Vestland" let firstUserQuestion: number = 0 - const handleUserformSubmit = async (age: string, education: string, healthcare_personnel: string, gender: string) => { + const handleUserformSubmit = async (age: string, education: string, healthcare_personnel: string, gender: string, has_answered_before: string, county: string) => { localStorage.clear() - const response = await postUserformData(age, education, healthcare_personnel, gender) + + const submitDate = new Date().toISOString() + + const response = await postUserformData(age, education, healthcare_personnel, gender, has_answered_before, county, submitDate) const userQuestions = await getUserQuestions(response.respondentID) goto("form/0") @@ -36,12 +41,14 @@
    age = e.detail} inputType="radio" label="Alder" options={["18-20", "20-30", "30-40", "40-50", "50-60"]}/> education = e.detail} inputType="select" label="Utdanningsgrad" options={["PhD", "Master", "Fagbrev", "Bachelor"]}/> + county = e.detail} inputType="select" label="Fylke" options={["Vestland", "Rogaland", "Møre og Romsdal", "Oslo", "Viken", "Nordland", "Trøndelag", "Innlandet", "Troms og Finnmark", "Vestfold og Telemark", "Agder"]}/> healthcare_personnel = e.detail} inputType="radio" label="Helsepersonell" options={["Ja", "Nei"]}/> gender = e.detail} inputType="radio" label="Kjønn" options={["Mann", "Kvinne", "Annet"]}/> + has_answered_before = e.detail} inputType="radio" label="Jeg har svart på denne undersøkelsen tidligere" options={["Ja", "Nei"]}/>
    - handleUserformSubmit(age, education, healthcare_personnel, gender)} /> + handleUserformSubmit(age, education, healthcare_personnel, gender, has_answered_before, county)} />
    @@ -56,6 +63,6 @@ font-size: large; } p { - font-size: large; + font-size: larger; } \ No newline at end of file