Skip to content

Commit

Permalink
Allow look at student's gradings - Part of #10
Browse files Browse the repository at this point in the history
  • Loading branch information
mytja committed Apr 22, 2022
1 parent b0b50d6 commit 534e501
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Settings.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
let parentViewGrades = false;
let parentViewAbsences = false;
let parentViewHomework = false;
let parentViewGradings = false;
function getConfiguration() {
fetch(`${baseurl}/admin/config/get`, {headers: {"Authorization": "Bearer " + localStorage.getItem("key")}})
Expand All @@ -31,6 +32,7 @@
parentViewGrades = config["parent_view_grades"];
parentViewHomework = config["parent_view_homework"];
parentViewAbsences = config["parent_view_absences"];
parentViewGradings = config["parent_view_gradings"];
},
);
}
Expand All @@ -45,6 +47,7 @@
fd.append("parent_view_grades", parentViewGrades.toString());
fd.append("parent_view_homework", parentViewHomework.toString());
fd.append("parent_view_absences", parentViewAbsences.toString());
fd.append("parent_view_gradings", parentViewGradings.toString());
fetch(`${baseurl}/admin/config/get`,
{headers: {"Authorization": "Bearer " + localStorage.getItem("key")}, body: fd, method: "PATCH"})
.then((r) => r.json())
Expand Down Expand Up @@ -88,5 +91,10 @@
<Switch bind:checked={parentViewGrades} on:SMUISwitch:change={() => updateConfig()} />
Dovoli pregled nad učenčevimi ocenami
</FormField>
<br>
<FormField>
<Switch bind:checked={parentViewGradings} on:SMUISwitch:change={() => updateConfig()} />
Dovoli pregled nad učenčevimi ocenjevanji znanj
</FormField>
</main>
</AppContent>

0 comments on commit 534e501

Please sign in to comment.