From 630fb14e61c0354defefcd4b8245e3226eae031e Mon Sep 17 00:00:00 2001 From: annika koenig Date: Thu, 11 Jun 2026 14:59:15 +0200 Subject: [PATCH] notenrechner+textanalyse --- style.css => css/style.css | 0 eis_projekt.html | 23 +++++++++------- impressum.html | 23 +++++++++------- index.html | 23 +++++++++------- js/notenrechner.js | 43 +++++++++++++++++++++++++++++ script.js => js/script.js | 0 js/textanalyse.js | 27 +++++++++++++++++++ kontakt.html | 23 +++++++++------- notenrechner.html | 55 ++++++++++++++++++++++++++++++++++++++ textanalyse.html | 55 ++++++++++++++++++++++++++++++++++++++ ueber_uns.html | 23 +++++++++------- 11 files changed, 250 insertions(+), 45 deletions(-) rename style.css => css/style.css (100%) create mode 100644 js/notenrechner.js rename script.js => js/script.js (100%) create mode 100644 js/textanalyse.js create mode 100644 notenrechner.html create mode 100644 textanalyse.html diff --git a/style.css b/css/style.css similarity index 100% rename from style.css rename to css/style.css diff --git a/eis_projekt.html b/eis_projekt.html index d5fd461..46e8c9d 100644 --- a/eis_projekt.html +++ b/eis_projekt.html @@ -7,7 +7,7 @@ Projekt – Studienprojekt 2026 - + @@ -15,13 +15,18 @@ @@ -161,5 +166,5 @@ - + \ No newline at end of file diff --git a/impressum.html b/impressum.html index 390bc9b..a94bda2 100644 --- a/impressum.html +++ b/impressum.html @@ -7,7 +7,7 @@ Impressum – Studienprojekt 2026 - + @@ -16,13 +16,18 @@ @@ -94,5 +99,5 @@ - + \ No newline at end of file diff --git a/index.html b/index.html index 33fe9e9..16e04ce 100644 --- a/index.html +++ b/index.html @@ -5,7 +5,7 @@ Eis Projekt - + @@ -13,13 +13,18 @@ @@ -109,5 +114,5 @@ - + \ No newline at end of file diff --git a/js/notenrechner.js b/js/notenrechner.js new file mode 100644 index 0000000..8f45e2c --- /dev/null +++ b/js/notenrechner.js @@ -0,0 +1,43 @@ +// =============================== +// NOTENRECHNER +// =============================== + +window.berechneNote = function (punkte) { + if (punkte >= 90) return "sehr gut"; + if (punkte >= 75) return "gut"; + if (punkte >= 60) return "befriedigend"; + if (punkte >= 50) return "ausreichend"; + return "nicht bestanden"; +}; + +function leseZahl(text) { + const eingabe = prompt(text); + + if (eingabe === null || eingabe.trim() === "") return NaN; + + return Number(eingabe.trim().replace(",", ".")); +} + +window.startNotenrechner = function () { + const punkte = leseZahl("Wie viele Punkte hast du erreicht?"); + const max = leseZahl("Maximale Punktzahl?"); + + if ( + Number.isNaN(punkte) || + Number.isNaN(max) || + max <= 0 || + punkte < 0 || + punkte > max + ) { + alert("Bitte gültige Werte eingeben!"); + return; + } + + const prozent = (punkte / max) * 100; + const note = window.berechneNote(prozent); + + const text = `${punkte} von ${max} Punkten (${prozent.toFixed(1)}%) = ${note}`; + + console.log(text); + alert(text); +}; diff --git a/script.js b/js/script.js similarity index 100% rename from script.js rename to js/script.js diff --git a/js/textanalyse.js b/js/textanalyse.js new file mode 100644 index 0000000..f3b55fc --- /dev/null +++ b/js/textanalyse.js @@ -0,0 +1,27 @@ +window.analyseText = function (text) { + const sauberesText = text.trim(); + + const zeichen = sauberesText.length; + const wörter = sauberesText.split(/\s+/).filter(Boolean).length; + const upper = sauberesText.toUpperCase(); + + return ` +Zeichen: ${zeichen} +Wörter: ${wörter} +Großbuchstaben: ${upper} + `; +}; + +window.startAnalyse = function () { + const text = prompt("Gib einen Text ein:"); + + if (typeof text !== "string" || text.trim() === "") { + alert("Fehler: Kein gültiger Text eingegeben!"); + return; + } + + const result = window.analyseText(text); + + console.log(result); + alert(result); +}; \ No newline at end of file diff --git a/kontakt.html b/kontakt.html index 22a4805..2f0919e 100644 --- a/kontakt.html +++ b/kontakt.html @@ -7,7 +7,7 @@ Kontakt – Studienprojekt 2026 - + @@ -15,13 +15,18 @@