Skip to content

Commit 6078222

Browse files
committed
Test corrections in schedule - Resolves #37
1 parent f56d161 commit 6078222

File tree

4 files changed

+23
-10
lines changed

4 files changed

+23
-10
lines changed

rollup.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ export default {
9393
// Watch the `public` directory and refresh the
9494
// browser on changes when not in production
9595
// TODO: Not include this delay
96-
!production && livereload({watch: 'public', delay: 25000,}),
96+
!production && livereload({watch: 'public', delay: 10000,}),
9797

9898
// If we're building for production (npm run build
9999
// instead of npm run dev), minify

src/Meeting.svelte

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,8 @@
143143
<p>Je obvezno: <b>{meetingData.IsMandatory ? "Ja" : "Ne"}</b></p>
144144
<p>Je ocenjevanje znanja: <b>{meetingData.IsGrading ? "Ja" : "Ne"}</b></p>
145145
{#if meetingData.IsGrading}
146-
<p>Je pisno ocenjevanje znanja: <b>{meetingData.IsWrittenAssessment}</b></p>
146+
<p>Je pisno ocenjevanje znanja: <b>{meetingData.IsWrittenAssessment ? "Ja" : "Ne"}</b></p>
147+
<p>Je popravni izpit (drugi rok): <b>{meetingData.IsCorrectionTest ? "Ja" : "Ne"}</b></p>
147148
{/if}
148149
<p>Je preverjanje znanja: <b>{meetingData.IsTest ? "Ja" : "Ne"}</b></p>
149150
<p>Je nadomeščanje: <b>{meetingData.IsSubstitution ? "Ja" : "Ne"}</b></p>

src/MeetingCard.svelte

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
3333
.test { border-top: 20px solid green; }
3434
.substitution { border-top: 20px solid red; }
35+
.correctionTest { border-top: 20px solid yellowgreen; }
3536
.notMandatory { border-top: 20px solid blue; }
3637
.grading { border-top: 20px solid pink; }
3738
.beta { border-top: 20px solid orange; }
@@ -62,7 +63,7 @@
6263
{/each}
6364
</span>
6465
<div
65-
class="triangle {n.IsSubstitution ? 'substitution' : ''} {n.IsGrading ? 'grading' : ''} {n.IsTest ? 'test' : ''} {n.IsBeta ? 'beta' : ''} {!n.IsMandatory ? 'notMandatory' : ''}"
66+
class="triangle {n.IsSubstitution ? 'substitution' : ''} {n.IsGrading ? 'grading' : ''} {n.IsTest ? 'test' : ''} {n.IsCorrectionTest ? 'correctionTest' : ''} {n.IsBeta ? 'beta' : ''} {!n.IsMandatory ? 'notMandatory' : ''}"
6667
></div>
6768
<span class="classroom">
6869
{n.Location}
@@ -82,6 +83,9 @@
8283
{#if n.IsWrittenAssessment}
8384
<b>Srečanje je pisno ocenjevanje</b><br>
8485
{/if}
86+
{#if n.IsCorrectionTest}
87+
<b>Srečanje je popravni izpit (drugi rok)</b><br>
88+
{/if}
8589
{/if}
8690
{#if n.IsTest}
8791
<b>Srečanje je preverjanje znanja</b><br>

src/NewMeeting.svelte

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,10 @@
3232
let isWrittenAssessment: boolean = false;
3333
let isTest: boolean = false;
3434
let isRepetitive: boolean = false;
35+
let isCorrectionTest: boolean = false;
3536
3637
let subjects: Subject[] = [];
37-
let subjectId: number = undefined;
38+
let subjectId: string = undefined;
3839
3940
export let editId;
4041
@@ -92,11 +93,12 @@
9293
isGrading = json.data.IsGrading;
9394
isTest = json.data.IsTest;
9495
location = json.data.Location;
96+
isCorrectionTest = json.data.IsCorrectionTest;
9597
},
9698
);
9799
}
98100
99-
function createNew() {
101+
async function createNew() {
100102
if (date === "") {
101103
console.log("Date is empty");
102104
date = ""
@@ -132,11 +134,10 @@
132134
fd.append("repeat_cycle", repeatCycle.toString())
133135
fd.append("last_date", fmtDate(new Date(lastDate)))
134136
fd.append("location", location);
135-
fetch(`${baseurl}/${(editId === undefined ? "meetings/new" : "meetings/new/" + editId)}`,
137+
fd.append("is_correction_test", isCorrectionTest.toString());
138+
await fetch(`${baseurl}/${(editId === undefined ? "meetings/new" : "meetings/new/" + editId)}`,
136139
{headers: {"Authorization": "Bearer " + Cookies.get("key")}, body: fd, method: editId === undefined ? "POST" : "PATCH"})
137-
.then((r) => r.json())
138-
.then((r) => console.log(r))
139-
.then(() => navigate("/"))
140+
navigate("/")
140141
}
141142
142143
getSubjects();
@@ -221,6 +222,13 @@ Izberite uro:
221222
</FormField>
222223
{/if}
223224
<p/>
225+
{#if isGrading}
226+
<FormField>
227+
<Switch bind:checked={isCorrectionTest} />
228+
Je popravni izpit (drugi rok)
229+
</FormField>
230+
{/if}
231+
<p/>
224232
{#if !isGrading}
225233
<FormField>
226234
<Switch bind:checked={isTest} />
@@ -245,7 +253,7 @@ Izberite uro:
245253
</Textfield>
246254
{/if}
247255
<p/><hr><p/>
248-
<Button on:click={() => createNew()}>
256+
<Button on:click={() => setTimeout(createNew, 200)}>
249257
<Icon class="material-icons">add</Icon>
250258
<Label>Dodaj</Label>
251259
</Button>

0 commit comments

Comments
 (0)