Skip to content

Commit

Permalink
Test corrections in schedule - Resolves #37
Browse files Browse the repository at this point in the history
  • Loading branch information
mytja committed Sep 24, 2022
1 parent f56d161 commit 6078222
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 10 deletions.
2 changes: 1 addition & 1 deletion rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export default {
// Watch the `public` directory and refresh the
// browser on changes when not in production
// TODO: Not include this delay
!production && livereload({watch: 'public', delay: 25000,}),
!production && livereload({watch: 'public', delay: 10000,}),

// If we're building for production (npm run build
// instead of npm run dev), minify
Expand Down
3 changes: 2 additions & 1 deletion src/Meeting.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@
<p>Je obvezno: <b>{meetingData.IsMandatory ? "Ja" : "Ne"}</b></p>
<p>Je ocenjevanje znanja: <b>{meetingData.IsGrading ? "Ja" : "Ne"}</b></p>
{#if meetingData.IsGrading}
<p>Je pisno ocenjevanje znanja: <b>{meetingData.IsWrittenAssessment}</b></p>
<p>Je pisno ocenjevanje znanja: <b>{meetingData.IsWrittenAssessment ? "Ja" : "Ne"}</b></p>
<p>Je popravni izpit (drugi rok): <b>{meetingData.IsCorrectionTest ? "Ja" : "Ne"}</b></p>
{/if}
<p>Je preverjanje znanja: <b>{meetingData.IsTest ? "Ja" : "Ne"}</b></p>
<p>Je nadomeščanje: <b>{meetingData.IsSubstitution ? "Ja" : "Ne"}</b></p>
Expand Down
6 changes: 5 additions & 1 deletion src/MeetingCard.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
.test { border-top: 20px solid green; }
.substitution { border-top: 20px solid red; }
.correctionTest { border-top: 20px solid yellowgreen; }
.notMandatory { border-top: 20px solid blue; }
.grading { border-top: 20px solid pink; }
.beta { border-top: 20px solid orange; }
Expand Down Expand Up @@ -62,7 +63,7 @@
{/each}
</span>
<div
class="triangle {n.IsSubstitution ? 'substitution' : ''} {n.IsGrading ? 'grading' : ''} {n.IsTest ? 'test' : ''} {n.IsBeta ? 'beta' : ''} {!n.IsMandatory ? 'notMandatory' : ''}"
class="triangle {n.IsSubstitution ? 'substitution' : ''} {n.IsGrading ? 'grading' : ''} {n.IsTest ? 'test' : ''} {n.IsCorrectionTest ? 'correctionTest' : ''} {n.IsBeta ? 'beta' : ''} {!n.IsMandatory ? 'notMandatory' : ''}"
></div>
<span class="classroom">
{n.Location}
Expand All @@ -82,6 +83,9 @@
{#if n.IsWrittenAssessment}
<b>Srečanje je pisno ocenjevanje</b><br>
{/if}
{#if n.IsCorrectionTest}
<b>Srečanje je popravni izpit (drugi rok)</b><br>
{/if}
{/if}
{#if n.IsTest}
<b>Srečanje je preverjanje znanja</b><br>
Expand Down
22 changes: 15 additions & 7 deletions src/NewMeeting.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@
let isWrittenAssessment: boolean = false;
let isTest: boolean = false;
let isRepetitive: boolean = false;
let isCorrectionTest: boolean = false;
let subjects: Subject[] = [];
let subjectId: number = undefined;
let subjectId: string = undefined;
export let editId;
Expand Down Expand Up @@ -92,11 +93,12 @@
isGrading = json.data.IsGrading;
isTest = json.data.IsTest;
location = json.data.Location;
isCorrectionTest = json.data.IsCorrectionTest;
},
);
}
function createNew() {
async function createNew() {
if (date === "") {
console.log("Date is empty");
date = ""
Expand Down Expand Up @@ -132,11 +134,10 @@
fd.append("repeat_cycle", repeatCycle.toString())
fd.append("last_date", fmtDate(new Date(lastDate)))
fd.append("location", location);
fetch(`${baseurl}/${(editId === undefined ? "meetings/new" : "meetings/new/" + editId)}`,
fd.append("is_correction_test", isCorrectionTest.toString());
await fetch(`${baseurl}/${(editId === undefined ? "meetings/new" : "meetings/new/" + editId)}`,
{headers: {"Authorization": "Bearer " + Cookies.get("key")}, body: fd, method: editId === undefined ? "POST" : "PATCH"})
.then((r) => r.json())
.then((r) => console.log(r))
.then(() => navigate("/"))
navigate("/")
}
getSubjects();
Expand Down Expand Up @@ -221,6 +222,13 @@ Izberite uro:
</FormField>
{/if}
<p/>
{#if isGrading}
<FormField>
<Switch bind:checked={isCorrectionTest} />
Je popravni izpit (drugi rok)
</FormField>
{/if}
<p/>
{#if !isGrading}
<FormField>
<Switch bind:checked={isTest} />
Expand All @@ -245,7 +253,7 @@ Izberite uro:
</Textfield>
{/if}
<p/><hr><p/>
<Button on:click={() => createNew()}>
<Button on:click={() => setTimeout(createNew, 200)}>
<Icon class="material-icons">add</Icon>
<Label>Dodaj</Label>
</Button>

0 comments on commit 6078222

Please sign in to comment.