diff --git a/InfoWindow.axaml b/InfoWindow.axaml
new file mode 100644
index 0000000..c7fa303
--- /dev/null
+++ b/InfoWindow.axaml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
diff --git a/InfoWindow.axaml.cs b/InfoWindow.axaml.cs
new file mode 100644
index 0000000..e5afd29
--- /dev/null
+++ b/InfoWindow.axaml.cs
@@ -0,0 +1,15 @@
+using Avalonia;
+using Avalonia.Controls;
+using Avalonia.Markup.Xaml;
+
+namespace PLG_Exam;
+
+public partial class InfoWindow : Window
+{
+ public InfoWindow(string cnt)
+ {
+ InitializeComponent();
+
+ LblInfo.Content=cnt;
+ }
+}
\ No newline at end of file
diff --git a/MainWindow.axaml b/MainWindow.axaml
index c738624..92350c2 100644
--- a/MainWindow.axaml
+++ b/MainWindow.axaml
@@ -18,6 +18,7 @@
+
diff --git a/MainWindow.axaml.cs b/MainWindow.axaml.cs
index 2264d48..02e621c 100644
--- a/MainWindow.axaml.cs
+++ b/MainWindow.axaml.cs
@@ -83,6 +83,32 @@ namespace PLG_Exam
AddNewTab();
}
+ private void OnInfoClick(object? sender, RoutedEventArgs e)
+ {
+ new InfoWindow(CountTotalWords()).Show();
+ }
+
+ public int CountWords(string s)
+ {
+ s = s.Trim();
+ if (s == "")
+ return 0;
+ return s.Split(new char[] { ' ', '.', '?', '!', ',', '\n' }, StringSplitOptions.RemoveEmptyEntries).Length;
+ }
+
+ public string CountTotalWords(){
+ _ = GetCurrentExamDataAsJson();
+ string toReturn = "";
+ int totalWords = 0;
+ foreach (var tab in _currentExam.Tabs)
+ {
+ totalWords += CountWords(tab.Inhalt);
+ toReturn += "Aufgabe " + tab.Aufgabennummer + ": " + CountWords(tab.Inhalt) + "\n";
+ }
+
+ return $"Anzahl Wörter (insg.): {totalWords}\n" + toReturn;
+ }
+
private async void OnKeyDown(object? sender, Avalonia.Input.KeyEventArgs e)
{
if (e.KeyModifiers.HasFlag(Avalonia.Input.KeyModifiers.Control))