23 Commits

Author SHA1 Message Date
fierke 66596b530b [feat:] im- and export (pdf/json) 2026-06-04 18:59:01 +02:00
fierke 5ef41b21b0 [gui:] buttons for im- and exporting 2026-06-04 18:58:32 +02:00
fierke c291ed1788 [file:] included fonts 2026-06-04 18:58:03 +02:00
fierke 78d25e6231 [fix:] Sport ids 2026-06-01 21:28:07 +02:00
fierke 73af2039ba [file:] added fonts 2026-06-01 21:27:29 +02:00
fierke c5be9d2c6e [feat:] frontend to edit courses (ai-slop) 2026-06-01 17:00:55 +02:00
fierke c46417c56d [chore:] single-semester-side limiting of courses 2026-06-01 17:00:39 +02:00
fierke 895c55a52f [chore:] cleaned up some rubbish 2026-06-01 13:14:03 +02:00
fierke e54e2e7840 [chore:] logo integration 2026-06-01 12:45:35 +02:00
fierke 0a710bea8b [chore:] window icon integration 2026-06-01 12:28:59 +02:00
fierke d4de543d71 [file:] added logo.ico 2026-06-01 12:25:33 +02:00
fierke a0eac4ae95 Merge pull request '[chore:] better crafting' (#5) from bettercrafting into main
Reviewed-on: #5
2026-05-30 11:33:11 +00:00
fierke 22e9377062 [chore:] better crafting 2026-05-29 12:52:02 +02:00
fierke 11e6aab8fd [fix:] removed triple-calling of OptimizeStudentWishCoverage() 2026-04-22 07:25:46 +02:00
fierke 13f313d4a0 Merge remote-tracking branch 'origin/main' 2026-04-21 14:14:07 +02:00
fierke 64951c579f [fix:] massive bug that prevented correct course crafting (sports's id was always 0) 2026-04-21 14:13:54 +02:00
fierke 4130c36335 [chore:] import function that won't be called 2026-04-21 14:13:14 +02:00
fierke 7f2fc99d0b [gui:] import-button in the menu 2026-04-21 14:12:54 +02:00
fierke eb640ff749 [chore:] file picker, but currently not using the file itself 2026-04-21 14:12:40 +02:00
fierke 54a564df04 [chore:] tiny little comment to prevent confusion 2026-04-21 14:11:51 +02:00
fierke 71dc63f2a2 [file:] added logo 2026-04-18 16:04:14 +02:00
fierke 68f673c8d7 Update README.md 2026-04-15 11:48:44 +00:00
fierke d5b7fd7af3 [file:] uploaded app-screenshots 2026-04-15 13:45:37 +02:00
18 changed files with 1212 additions and 411 deletions
+41 -8
View File
@@ -3,7 +3,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="spplus.MainWindow" WindowState="Maximized"
x:Class="spplus.MainWindow" WindowState="Maximized" Icon="res/logo.ico"
Title="spplus">
<Border>
<Grid RowDefinitions="30,*">
@@ -12,6 +12,7 @@
<!-- <MenuItem Click="MnuSettings_OnClick" x:Name="MnuSettings" Header="Einstellungen" /> -->
<!-- <Separator /> -->
<MenuItem x:Name="MnuExpSettings" Header="Einstellungen exportieren" Click="MnuExpSettings_OnClick" />
<MenuItem x:Name="MnuImpResult" Header="Berechnung importieren" Click="MnuImpResult_OnClick" />
<MenuItem x:Name="MnuExit" Header="Beenden" Click="MnuExit_OnClick"/>
</MenuItem>
<MenuItem Header="Hilfe">
@@ -195,8 +196,20 @@
</Grid>
<Line />
<Grid ColumnDefinitions="*,3*">
<Label Content="Maximale Sportkursanzahl pro Semester"></Label>
<NumericUpDown Grid.Column="1" x:Name="NudSportMaxPerSemester" ValueChanged="NudSportMaxPerSemester_OnValueChanged"></NumericUpDown>
<Label Content="Maximale Sportkursanzahl Semester 1"></Label>
<NumericUpDown Grid.Column="1" x:Name="NudSportMaxPerSemester1" ValueChanged="NudSportMaxPerSemester1_OnValueChanged"></NumericUpDown>
</Grid>
<Grid ColumnDefinitions="*,3*">
<Label Content="Maximale Sportkursanzahl Semester 2"></Label>
<NumericUpDown Grid.Column="1" x:Name="NudSportMaxPerSemester2" ValueChanged="NudSportMaxPerSemester2_OnValueChanged"></NumericUpDown>
</Grid>
<Grid ColumnDefinitions="*,3*">
<Label Content="Maximale Sportkursanzahl Semester 3"></Label>
<NumericUpDown Grid.Column="1" x:Name="NudSportMaxPerSemester3" ValueChanged="NudSportMaxPerSemester3_OnValueChanged"></NumericUpDown>
</Grid>
<Grid ColumnDefinitions="*,3*">
<Label Content="Maximale Sportkursanzahl Semester 4"></Label>
<NumericUpDown Grid.Column="1" x:Name="NudSportMaxPerSemester4" ValueChanged="NudSportMaxPerSemester4_OnValueChanged"></NumericUpDown>
</Grid>
</StackPanel>
</Grid>
@@ -209,23 +222,43 @@
<Label FontSize="20" Content="Ergebnisse" VerticalContentAlignment="Center" />
</StackPanel>
</TabItem.Header>
<Grid ColumnDefinitions="*,*" RowDefinitions="50,2*,*">
<ListBox Grid.RowSpan="2" x:Name="LbResult" Margin="0,10,10,10"></ListBox>
<Grid Grid.Row="0" Grid.Column="1" Grid.ColumnDefinitions="*,*">
<Button Grid.Column="0" Margin="0,10,0,0" x:Name="BtnExportCoursePDF" VerticalAlignment="Top" Height="35" HorizontalAlignment="Stretch" Click="BtnExportCoursePDF_OnClick" HorizontalContentAlignment="Center">
<Grid ColumnDefinitions="*,*" RowDefinitions="100,2*,*">
<ListBox Grid.RowSpan="2" x:Name="LbResult" Margin="0,10,10,10" PointerPressed="LbResult_OnPointerPressed">
<ListBox.ContextMenu>
<ContextMenu>
<MenuItem Header="Ändern" x:Name="MnuChange" />
</ContextMenu>
</ListBox.ContextMenu>
</ListBox>
<Grid Grid.Row="0" Grid.Column="1" RowDefinitions="*,*" ColumnDefinitions="*,*">
<Button Grid.Row="0" Grid.Column="0" Margin="0,10,5,0" x:Name="BtnExportCoursePDF" VerticalAlignment="Top" Height="35" HorizontalAlignment="Stretch" Click="BtnExportCoursePDF_OnClick" HorizontalContentAlignment="Center">
<StackPanel Orientation="Horizontal">
<LucideIcon Kind="FileText" Width="24" Height="24" />
<Label Content="Export (PDF)..." VerticalContentAlignment="Center" FontSize="12"
FontWeight="Bold" />
</StackPanel>
</Button>
<Button Grid.Column="1" Margin="5,10,0,0" x:Name="BtnExportCourseCSV" VerticalAlignment="Top" Height="35" HorizontalAlignment="Stretch" Click="BtnExportCourseCSV_OnClick" HorizontalContentAlignment="Center">
<Button Grid.Row="0" Grid.Column="1" Margin="5,10,0,0" x:Name="BtnExportCourseCSV" VerticalAlignment="Top" Height="35" HorizontalAlignment="Stretch" Click="BtnExportCourseCSV_OnClick" HorizontalContentAlignment="Center">
<StackPanel Orientation="Horizontal">
<LucideIcon Kind="FileJson" Width="24" Height="24" />
<Label Content="Export (CSV)..." VerticalContentAlignment="Center" FontSize="12"
FontWeight="Bold" />
</StackPanel>
</Button>
<Button Grid.Row="1" Grid.Column="0" Margin="0,5,5,0" x:Name="BtnExportConfiguration" VerticalAlignment="Top" Height="35" HorizontalAlignment="Stretch" Click="MnuExpSettings_OnClick" HorizontalContentAlignment="Center">
<StackPanel Orientation="Horizontal">
<LucideIcon Kind="FileJson" Width="24" Height="24" />
<Label Content="Konfiguration exportieren..." VerticalContentAlignment="Center" FontSize="12"
FontWeight="Bold" />
</StackPanel>
</Button>
<Button Grid.Row="1" Grid.Column="1" Margin="5,5,0,0" x:Name="BtnImportResults" VerticalAlignment="Top" Height="35" HorizontalAlignment="Stretch" Click="MnuImpResult_OnClick" HorizontalContentAlignment="Center">
<StackPanel Orientation="Horizontal">
<LucideIcon Kind="Import" Width="24" Height="24" />
<Label Content="Ergebnisse importieren..." VerticalContentAlignment="Center" FontSize="12"
FontWeight="Bold" />
</StackPanel>
</Button>
</Grid>
<ScrollViewer Grid.Row="1" Grid.Column="1" Margin="0,5,0,10" Background="#44CCCCCC">
<TextBlock x:Name="TbResultStatistics"></TextBlock>
+233 -11
View File
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using Avalonia.Controls;
using Avalonia.Input;
using Avalonia.Interactivity;
@@ -12,6 +13,26 @@ public partial class MainWindow : Window
{
public static MainWindow Instance { get; set; }
public static string ApplicationVersion = "v1.2.24";
private sealed class ResultEntry
{
public Student Student { get; }
public int Semester { get; }
public string CourseName { get; }
public ResultEntry(Student student, int semester, string? courseName)
{
Student = student;
Semester = semester;
CourseName = courseName ?? string.Empty;
}
public override string ToString()
{
return $"{Student.Name} ({Student.ID}) - {Semester}. Semester: {CourseName}";
}
}
public MainWindow()
{
InitializeComponent();
@@ -20,13 +41,111 @@ public partial class MainWindow : Window
RefreshCoursesList();
try
{
NudSportMaxPerSemester.Value = Settings.Instance.NumCoursesPerSemester;
NudSportMaxPerSemester1.Value = Settings.Instance.NumCoursesPerSemester[0];
NudSportMaxPerSemester2.Value = Settings.Instance.NumCoursesPerSemester[1];
NudSportMaxPerSemester3.Value = Settings.Instance.NumCoursesPerSemester[2];
NudSportMaxPerSemester4.Value = Settings.Instance.NumCoursesPerSemester[3];
} catch {}
}
private void MnuExpSettings_OnClick(object? sender, RoutedEventArgs e)
private void RegenerateContextMenu()
{
var res = MessageBox.Show(this, "Dieses Feature ist noch nicht implementiert", "Fehlend");
MnuChange.Items.Clear();
foreach (var sport in Settings.Instance.Sports)
{
var item = new MenuItem { Header = sport.Name };
item.Click += (_, _) => ChangeStudentCourse(sport);
MnuChange.Items.Add(item);
}
}
private void ChangeStudentCourse(Sport targetSport)
{
if (LbResult.SelectedItem is not ResultEntry selectedEntry)
return;
try
{
if (ApplyStudentCourseChange(selectedEntry.Student, selectedEntry.Semester, targetSport))
{
CourseCrafter.ReloadResult();
RefreshResultView();
RegenerateContextMenu();
}
}
catch (Exception ex)
{
Console.WriteLine(ex.Message + "\n" + ex.StackTrace);
}
}
private bool ApplyStudentCourseChange(Student student, int semester, Sport targetSport)
{
if (semester < 1 || semester > 4)
return false;
var semesterCourses = CourseCrafter.GeneratedCourses
.Where(course => course.Semester == semester)
.ToList();
var currentCourses = semesterCourses
.Where(course => course.Instance.Students.Contains(student.ID))
.ToList();
CourseCrafter.CourseInstance? targetCourse = currentCourses
.FirstOrDefault(course => course.Instance.Sport.Name == targetSport.Name)
.Instance;
if (targetCourse == null)
{
targetCourse = semesterCourses
.Where(course => course.Instance.Sport.Name == targetSport.Name)
.OrderBy(course => course.Instance.Students.Count)
.Select(course => course.Instance)
.FirstOrDefault();
}
bool changed = false;
foreach (var course in currentCourses)
{
if (targetCourse != null && ReferenceEquals(course.Instance, targetCourse))
continue;
if (course.Instance.Students.Remove(student.ID))
changed = true;
}
int removedEmptyCourses = CourseCrafter.GeneratedCourses.RemoveAll(course =>
course.Semester == semester &&
course.Instance.Students.Count == 0 &&
!ReferenceEquals(course.Instance, targetCourse));
if (removedEmptyCourses > 0)
changed = true;
if (targetCourse == null)
{
var newCourse = new CourseCrafter.CourseInstance
{
Sport = targetSport,
Students = new List<string> { student.ID }
};
CourseCrafter.GeneratedCourses.Add((semester, newCourse));
changed = true;
}
else if (!targetCourse.Students.Contains(student.ID))
{
targetCourse.Students.Add(student.ID);
changed = true;
}
return changed;
}
private async void MnuExpSettings_OnClick(object? sender, RoutedEventArgs e)
{
await ExportConfigurationAsync();
}
private void MnuExit_OnClick(object? sender, RoutedEventArgs e)
@@ -159,6 +278,21 @@ public partial class MainWindow : Window
//TbiResults.Focus();
}
private void LbResult_OnPointerPressed(object? sender, PointerPressedEventArgs e)
{
if (!e.GetCurrentPoint(LbResult).Properties.IsRightButtonPressed)
return;
if (e.Source is Control control && control.DataContext is ResultEntry entry)
{
LbResult.SelectedItem = entry;
}
else
{
LbResult.SelectedItem = null;
}
}
private void RefreshResultView()
{
LbResult.Items.Clear();
@@ -168,7 +302,7 @@ public partial class MainWindow : Window
{
for(int i = 0; i<s.Result.Length;i++)
{
LbResult.Items.Add($"{s.Name} ({s.ID}) - {i+1}. Semester: {s.Result[i]}");
LbResult.Items.Add(new ResultEntry(s, i + 1, s.Result[i]));
}
}
catch (Exception ex)
@@ -262,6 +396,7 @@ public partial class MainWindow : Window
{
LbSportCourses.Items.Add(sp);
}
RegenerateContextMenu();
}
@@ -298,6 +433,7 @@ public partial class MainWindow : Window
try
{
((Sport)LbSportCourses.SelectedItem).Name = TbSportName.Text;
RegenerateContextMenu();
} catch {}
}
@@ -411,16 +547,53 @@ public partial class MainWindow : Window
} catch (Exception ex){}
}
private void BtnExportCoursePDF_OnClick(object? sender, RoutedEventArgs e)
private async void BtnExportCoursePDF_OnClick(object? sender, RoutedEventArgs e)
{
// Export as PDF
var topLevel = GetTopLevel(this);
var file = await topLevel!.StorageProvider.SaveFilePickerAsync(new FilePickerSaveOptions
{
Title = "PDF-Datei speichern",
SuggestedFileName = "spplus_kurse.pdf",
SuggestedFileType = new FilePickerFileType(".pdf-Datei")
{
Patterns = new[] { "*.pdf" }
}
});
if (file == null) return;
PdfExportUtility.ExportGeneratedCourses(file.Path.LocalPath);
}
private void NudSportMaxPerSemester_OnValueChanged(object? sender, NumericUpDownValueChangedEventArgs e)
private void NudSportMaxPerSemester1_OnValueChanged(object? sender, NumericUpDownValueChangedEventArgs e)
{
try
{
Settings.Instance.NumCoursesPerSemester = Convert.ToInt32(NudSportMaxPerSemester.Value);
Settings.Instance.NumCoursesPerSemester[0] = Convert.ToInt32(NudSportMaxPerSemester1.Value);
} catch {}
}
private void NudSportMaxPerSemester2_OnValueChanged(object? sender, NumericUpDownValueChangedEventArgs e)
{
try
{
Settings.Instance.NumCoursesPerSemester[1] = Convert.ToInt32(NudSportMaxPerSemester2.Value);
} catch {}
}
private void NudSportMaxPerSemester3_OnValueChanged(object? sender, NumericUpDownValueChangedEventArgs e)
{
try
{
Settings.Instance.NumCoursesPerSemester[2] = Convert.ToInt32(NudSportMaxPerSemester3.Value);
} catch {}
}
private void NudSportMaxPerSemester4_OnValueChanged(object? sender, NumericUpDownValueChangedEventArgs e)
{
try
{
Settings.Instance.NumCoursesPerSemester[3] = Convert.ToInt32(NudSportMaxPerSemester4.Value);
} catch {}
}
@@ -430,16 +603,65 @@ public partial class MainWindow : Window
var file = await topLevel!.StorageProvider.SaveFilePickerAsync(new FilePickerSaveOptions
{
Title = "CSV-Datei speichern",
SuggestedFileType = new FilePickerFileType(".csv-Datei")
SuggestedFileName = "spplus_ergebnisse.json",
SuggestedFileType = new FilePickerFileType(".json-Datei")
{
Patterns = new[] { "*.csv" }
Patterns = new[] { "*.json" }
}
});
if (file == null) return;
ExportUtility.ExportToCSV(file.Path.AbsolutePath);
ExportUtility.ExportResultsToJson(file.Path.LocalPath);
}
private async void MnuImpResult_OnClick(object? sender, RoutedEventArgs e)
{
var topLevel = GetTopLevel(this);
var file = await topLevel!.StorageProvider.OpenFilePickerAsync(new FilePickerOpenOptions
{
Title = "Ergebnis-CSV laden",
AllowMultiple = false,
FileTypeFilter = new[]
{
new FilePickerFileType(".json-Datei")
{
Patterns = new[] { "*.json" }
}
}
});
if (file == null || file.Count == 0) return;
var imported = import.ImportResultFromJson(file[0].Path.LocalPath.ToString());
if (imported != null && imported.Count > 0)
{
CourseCrafter.GeneratedCourses = imported
.OrderBy(c => c.Semester)
.ThenBy(c => c.Instance.Sport.Name)
.ToList();
CourseCrafter.ReloadResult();
RefreshResultView();
}
}
private async System.Threading.Tasks.Task ExportConfigurationAsync()
{
var topLevel = GetTopLevel(this);
var file = await topLevel!.StorageProvider.SaveFilePickerAsync(new FilePickerSaveOptions
{
Title = "Konfiguration speichern",
SuggestedFileName = "spplus_konfiguration.json",
SuggestedFileType = new FilePickerFileType(".json-Datei")
{
Patterns = new[] { "*.json" }
}
});
if (file == null) return;
ExportUtility.ExportConfigurationToJson(file.Path.LocalPath);
}
}
+1 -1
View File
@@ -2,7 +2,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" SizeToContent="WidthAndHeight"
mc:Ignorable="d" SizeToContent="WidthAndHeight" Icon="res/logo.ico"
x:Class="spplus.MessageBox" WindowStartupLocation="CenterScreen"
Title="MessageBox">
<StackPanel>
+10 -2
View File
@@ -1,5 +1,7 @@
using Avalonia;
using System;
using PdfSharp;
using PdfSharp.Fonts;
namespace spplus;
@@ -9,8 +11,14 @@ class Program
// SynchronizationContext-reliant code before AppMain is called: things aren't initialized
// yet and stuff might break.
[STAThread]
public static void Main(string[] args) => BuildAvaloniaApp()
.StartWithClassicDesktopLifetime(args);
public static void Main(string[] args)
{
// Initialize PdfSharp font resolver before any PDF operations
GlobalFontSettings.FontResolver = new CustomFontResolver();
BuildAvaloniaApp()
.StartWithClassicDesktopLifetime(args);
}
// Avalonia configuration, don't remove; also used by visual designer.
public static AppBuilder BuildAvaloniaApp()
+4
View File
@@ -2,6 +2,8 @@
Plattformunabhängiger (Windows, Linux, Mac), interaktiver Sportkursplaner für Oberstufen auf Basis einer Sportkurswahl durch SuS.
![spplus-Hauptbildschirm](img/spplus_planung.png)
## Features
* \+ Import von CSV-Dateien mit Kurswahl
* \+ Wahlansicht
@@ -21,3 +23,5 @@ Plattformunabhängiger (Windows, Linux, Mac), interaktiver Sportkursplaner für
* Suche `spplus` bzw. `spplus.exe` und führe aus
* Linux/MacOS evl.: `chmod +x spplus`
![spplus-Sportkursübersicht](img/spplus_sport.png)
+694 -323
View File
File diff suppressed because it is too large Load Diff
+48
View File
@@ -1,9 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Text.Json;
namespace spplus;
public static class ExportUtility
{
private sealed class ConfigurationExport
{
public List<Sport> Sports { get; set; } = [];
public int[] NumCoursesPerSemester { get; set; } = [];
}
public static void ExportToCSV(string filepath)
{
char separator = ',';
@@ -16,4 +26,42 @@ public static class ExportUtility
File.WriteAllText(filepath, output);
}
private sealed class ResultExportEntry
{
public int Semester { get; set; }
public string SportName { get; set; } = string.Empty;
public List<string> Students { get; set; } = new();
}
public static void ExportResultsToJson(string filepath)
{
var list = CourseCrafter.GeneratedCourses
.Select(g => new ResultExportEntry
{
Semester = g.Semester,
SportName = g.Instance.Sport.Name,
Students = g.Instance.Students.ToList()
})
.ToList();
var json = JsonSerializer.Serialize(list, new JsonSerializerOptions { WriteIndented = true });
File.WriteAllText(filepath, json);
}
public static void ExportConfigurationToJson(string filepath)
{
var export = new ConfigurationExport
{
Sports = Settings.Instance.Sports,
NumCoursesPerSemester = Settings.Instance.NumCoursesPerSemester
};
var json = JsonSerializer.Serialize(export, new JsonSerializerOptions
{
WriteIndented = true
});
File.WriteAllText(filepath, json);
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 194 KiB

+78
View File
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Text.Json;
using System.Linq;
namespace spplus;
@@ -47,4 +48,81 @@ public static class import
return result;
}
public static List<Student> ImportResultFromFile(string path)
{
var dict = new Dictionary<string, string[]>(StringComparer.OrdinalIgnoreCase);
foreach (var line in File.ReadLines(path).Skip(1)) // Header überspringen
{
if (string.IsNullOrWhiteSpace(line))
continue;
var parts = line.Split(',', StringSplitOptions.None);
if (parts.Length < 5)
continue;
var studentId = parts[0].Trim();
dict[studentId] = new[]
{
parts[1].Trim(),
parts[2].Trim(),
parts[3].Trim(),
parts[4].Trim()
};
}
return dict
.Select(entry => new Student(entry.Key, string.Empty, new List<string>())
{
Result = entry.Value
})
.ToList();
}
private sealed class ResultImportEntry
{
public int Semester { get; set; }
public string SportName { get; set; } = string.Empty;
public List<string> Students { get; set; } = new();
}
public static List<(int Semester, CourseCrafter.CourseInstance Instance)> ImportResultFromJson(string path)
{
try
{
var json = File.ReadAllText(path);
var entries = JsonSerializer.Deserialize<List<ResultImportEntry>>(json);
if (entries == null) return new();
var result = new List<(int Semester, CourseCrafter.CourseInstance Instance)>();
foreach (var e in entries)
{
if (string.IsNullOrWhiteSpace(e.SportName))
continue;
var sport = Settings.Instance.Sports.FirstOrDefault(s =>
string.Equals(s.Name, e.SportName, StringComparison.OrdinalIgnoreCase) ||
s.AlternativeNames.Any(a => string.Equals(a, e.SportName, StringComparison.OrdinalIgnoreCase)));
if (sport == null)
continue;
var ci = new CourseCrafter.CourseInstance
{
Sport = sport,
Students = e.Students.Distinct().ToList()
};
result.Add((e.Semester, ci));
}
return result;
}
catch
{
return new();
}
}
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 106 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

+34
View File
@@ -5,6 +5,7 @@
<Nullable>enable</Nullable>
<ApplicationManifest>app.manifest</ApplicationManifest>
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
<ApplicationIcon>res/logo.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
@@ -19,4 +20,37 @@
</PackageReference>
<PackageReference Include="Lucide.Avalonia" Version="0.1.35"/>
</ItemGroup>
<ItemGroup>
<Reference Include="PdfSharp">
<HintPath>lib/pdfsharp/PdfSharp.dll</HintPath>
<Private>true</Private>
</Reference>
<Reference Include="PdfSharp.System">
<HintPath>lib/pdfsharp/PdfSharp.System.dll</HintPath>
<Private>true</Private>
</Reference>
<Reference Include="Microsoft.Extensions.Logging.Abstractions">
<HintPath>lib/pdfsharp/Microsoft.Extensions.Logging.Abstractions.dll</HintPath>
<Private>true</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<None Remove="res\logo.ico"/>
<AvaloniaResource Include="res\logo.ico">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</AvaloniaResource>
<None Remove="res\logo.png"/>
<AvaloniaResource Include="res\logo.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</AvaloniaResource>
</ItemGroup>
<ItemGroup>
<None Include="res/fonts/*.ttf">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>
+17 -14
View File
@@ -85,7 +85,7 @@ public class Settings
public List<Student> Students { get; set; } = [];
public List<Sport> Sports { get; set; } = [];
public int NumCoursesPerSemester { get; set; } = 10;
public int[] NumCoursesPerSemester { get; set; } = [10,10,11,11]; // Exact Amount of courses, not a maximum
public Settings()
{
@@ -99,19 +99,22 @@ public class Settings
public static void ImportInitial()
{
Instance.Sports.Add(new Sport("Tischtennis"){ AlternativeNames = {"Sport_TT"}});
Instance.Sports.Add(new Sport("Badminton"){ AlternativeNames = {"Sport_BM"}});
Instance.Sports.Add(new Sport("Gymnastik/Tanz"){ AlternativeNames = {"Sport_Gym"}});
Instance.Sports.Add(new Sport("Schwimmen"){ AlternativeNames = {"Sport_SW"}, Semester = [1, 1, 1, 1], MaxStudents = 18});
Instance.Sports.Add(new Sport("Bouldern"){ AlternativeNames = {"Sport_BO"}, Semester = [1, 1, 1, 1]});
Instance.Sports.Add(new Sport("Basketball"){ AlternativeNames = {"Sport_BS"}});
Instance.Sports.Add(new Sport("Fitness"){ AlternativeNames = {"Sport_Fit"}});
Instance.Sports.Add(new Sport("Fußball"){ AlternativeNames = {"Sport_Fuß"}, Semester = [1, 0, 1, 0]});
Instance.Sports.Add(new Sport("Handball"){ AlternativeNames = {"Sport_HB"}});
Instance.Sports.Add(new Sport("Leichtathletik"){ AlternativeNames = {"Sport_LA"}, Semester = [1, 0, 1, 0], MaxStudents = 18});
Instance.Sports.Add(new Sport("Tennis"){ AlternativeNames = {"Sport_Te"}});
Instance.Sports.Add(new Sport("Turnen"){ AlternativeNames = {"Sport_Tur"}});
Instance.Sports.Add(new Sport("Volleyball"){ AlternativeNames = {"Sport_VB"}});
Instance.Sports.Clear();
int id = 1;
Instance.Sports.Add(new Sport("Tischtennis"){ ID = id++, AlternativeNames = {"Sport_TT"}});
Instance.Sports.Add(new Sport("Badminton"){ ID = id++, AlternativeNames = {"Sport_BM"}});
Instance.Sports.Add(new Sport("Gymnastik/Tanz"){ ID = id++, AlternativeNames = {"Sport_Gym"}});
Instance.Sports.Add(new Sport("Schwimmen"){ ID = id++, AlternativeNames = {"Sport_SW"}, Semester = [1, 1, 1, 1], MaxStudents = 18});
Instance.Sports.Add(new Sport("Bouldern"){ ID = id++, AlternativeNames = {"Sport_BO"}, Semester = [1, 1, 1, 1]});
Instance.Sports.Add(new Sport("Basketball"){ ID = id++, AlternativeNames = {"Sport_BS"}});
Instance.Sports.Add(new Sport("Fitness"){ ID = id++, AlternativeNames = {"Sport_Fit"}});
Instance.Sports.Add(new Sport("Fußball"){ ID = id++, AlternativeNames = {"Sport_Fuß"}, Semester = [1, 0, 1, 0]});
Instance.Sports.Add(new Sport("Handball"){ ID = id++, AlternativeNames = {"Sport_HB"}});
Instance.Sports.Add(new Sport("Leichtathletik"){ ID = id++, AlternativeNames = {"Sport_LA"}, Semester = [1, 0, 1, 0], MaxStudents = 18});
Instance.Sports.Add(new Sport("Tennis"){ ID = id++, AlternativeNames = {"Sport_Te"}});
Instance.Sports.Add(new Sport("Turnen"){ ID = id++, AlternativeNames = {"Sport_Tur"}});
Instance.Sports.Add(new Sport("Volleyball"){ ID = id++, AlternativeNames = {"Sport_VB"}});
}
public static string? GetSportNameFromID(int id)