diff --git a/help/Example.html b/help/Example.html index 27f3748..e63eba3 100644 --- a/help/Example.html +++ b/help/Example.html @@ -48,9 +48,9 @@ async function main() { "more_data": "bla" }); - const data = await couchDB.get("login"); + const data = await couchDB.get("xample"); console.log(JSON.stringify(data)); - //Gibt { "username": "bla", "password": "bla" } wieder + //Gibt { "my_data": 1, "more_data": "bla" } wieder } main(); diff --git a/help/data_xample.js b/help/data_xample.js index 301ee14..9affdee 100644 --- a/help/data_xample.js +++ b/help/data_xample.js @@ -55,10 +55,21 @@ async function createTemp() { "type": "emoji" } ], + "result_history": [ + { + "date": "2025-12-27", + "questions": [ + ["Gut, aber ...", 5], + ["Schlecht", 1] + ] + } + ], "result": [ ["YES", "YES", 5, 2], ["YES", "YES", 1, 3] - ] + ], + "start_date": "2025-12-23", + "expire_date": "2025-12-27" }); await couchDB.set("course:weiche_ware", { "title": "Weiche Ware", @@ -74,9 +85,20 @@ async function createTemp() { "type": "scala" } ], + "result_history": [ + { + "date": "2025-12-27", + "questions": [ + ["Gut, aber ...", 5], + ["Schlecht", 1] + ] + } + ], "result": [ ["Gut, aber ...", 5], ["Schlecht", 1] - ] + ], + "start_date": "2025-12-23", + "expire_date": "2025-12-27" }); } \ No newline at end of file diff --git a/help/documentation.md b/help/documentation.md index 49163f6..a600f9c 100644 --- a/help/documentation.md +++ b/help/documentation.md @@ -70,3 +70,10 @@ async function getUserData(couchDB) -> Map?; //Setze den Nutzer, welcher unter der Variable userData verfügbar sein wird async function setUserData(couchDB) -> bool; ``` + +##Nützliche CSS-Klassen +- .profile = Runde Profilbox +- overlay = Overlay +- .header_bar_1 = Headerbar +- .header_bar_1_placeholder = Platzhalter für Headerbar +- .add_button = Runder "Hinzufügen"-Knopf \ No newline at end of file diff --git a/lib/basic.css b/lib/basic.css index db5e77b..21653b3 100644 --- a/lib/basic.css +++ b/lib/basic.css @@ -72,6 +72,8 @@ overlay { left: 50%; min-width: 250px; min-height: 150px; + max-height: 95%; + max-width: 95%; transform: translate(-50%, -50%); background: var(--accent_color_bg_o); backdrop-filter: blur(10px); @@ -117,6 +119,7 @@ overlay { } .header_bar_1 > div:nth-child(1) { text-align: left; + width: 100%; } .header_bar_1 > div:nth-child(2) { text-align: center; @@ -124,6 +127,7 @@ overlay { } .header_bar_1 > div:nth-child(3) { text-align: right; + width: 100%; } .header_bar_1_placeholder { diff --git a/lib/basic.js b/lib/basic.js index c1b8faf..363623e 100644 --- a/lib/basic.js +++ b/lib/basic.js @@ -330,6 +330,7 @@ function getURLArgsMap() { } return res; } + async function getUserData(couchDB) { const username = getURLArgsMap()["user"]; if (!username) return null; @@ -341,6 +342,7 @@ async function getUserData(couchDB) { "name": username }; } + var userData = null; async function setUserData(couchDB) { const res = await getUserData(couchDB); diff --git a/login.html b/login.html index f5d7dde..7d50240 100644 --- a/login.html +++ b/login.html @@ -1,6 +1,8 @@ + + Login diff --git a/prof/auswertung.html b/prof/auswertung.html new file mode 100644 index 0000000..a7d91bf --- /dev/null +++ b/prof/auswertung.html @@ -0,0 +1,33 @@ + + + + + + + + + + + + + +
+
+
⇦
+   Meine Kurse +
+
Auswertungen
+
+ +
+
+
+ + + + \ No newline at end of file diff --git a/prof/uebersicht.html b/prof/uebersicht.html index 759c5c0..547e65a 100644 --- a/prof/uebersicht.html +++ b/prof/uebersicht.html @@ -2,13 +2,13 @@ + Übersicht @@ -43,7 +43,7 @@ setUserData(couchDB); .edit_course .evaluations { overflow-y: auto; text-align: center; - max-height: 400px; + max-height: 300px; border: 2px solid grey; padding: 10px; border-radius: var(--border-radius); @@ -90,11 +90,15 @@ setUserData(couchDB);

+Beschreibung:

+Feedback-Fragen:

+Start-Termin:
+Abgabe-Termin:

@@ -111,12 +115,14 @@ async function showEditCourse(name) { const elm = getOverlay("edit_course"); - const title = elm.getElementsByTagName("input")[0]; + const inputs = elm.getElementsByTagName("input"); const description = elm.getElementsByTagName("textarea")[0]; - title.value = data.title; - title.setAttribute("oldID", name); + inputs[0].value = data.title; + inputs[0].setAttribute("oldID", name); description.value = data.description; + inputs[1].value = data["start_date"] ?? ""; + inputs[2].value = data["expire_date"] ?? ""; const evaluations = elm.querySelector(".evaluations > div"); @@ -148,13 +154,13 @@ function createEvaluation(question) { } async function saveEditCourse() { const elm = getOverlay("edit_course"); - const title = elm.getElementsByTagName("input")[0]; + const inputs = elm.getElementsByTagName("input"); const description = elm.getElementsByTagName("textarea")[0]; - const oldID = title.getAttribute("oldID"); + const oldID = inputs[0].getAttribute("oldID"); const data = await couchDB.get("course:" + oldID); - data["title"] = title.value; + data["title"] = inputs[0].value; data["description"] = description.value; const evaluations = elm.querySelector(".evaluations > div"); @@ -170,9 +176,20 @@ async function saveEditCourse() { }); } data["questions"] = questions; + evaluations.remove(); + + if (inputs[1].value.length > 0) { + let dateObject = new Date(inputs[1].value); + let dateString = dateObject.toISOString().split('T')[0]; + data["start_date"] = dateString; + } if (inputs[2].value.length > 0) { + let dateObject = new Date(inputs[2].value); + let dateString = dateObject.toISOString().split('T')[0]; + data["expire_date"] = dateString; + } await couchDB.delete("course:" + oldID); - await couchDB.set("course:" + title.value.toLowerCase(), data); + await couchDB.set("course:" + inputs[0].value.toLowerCase(), data); hideOverlay("edit_course"); }