Schülerberichte und erweiterte Deckblatt-Bausteine ergänzen
CI / build-and-test (push) Canceled after 0s
CI / build-and-test (push) Canceled after 0s
This commit is contained in:
1 parent
336869e75f
commit
e2f019667a
31 files changed
+961
-14
No files matched your search
@@ -180,10 +180,31 @@ public partial class DesignerViewModel : ObservableObject
|
||||
/// später in der Hauptapp.</summary>
|
||||
private static ITemplateDataProvider FitSampleData(LoadedTemplate template, ITemplateDataProvider provider)
|
||||
{
|
||||
var values = provider.GetValues();
|
||||
if (values.GetValueOrDefault(ExamPointsTableDrawing.PlaceholderName) is not DrawingValue) return provider;
|
||||
return new DesignerDataProvider(new Dictionary<string, PlaceholderValue>(values, StringComparer.Ordinal)
|
||||
{ [ExamPointsTableDrawing.PlaceholderName] = ExamCoverPlaceholders.SampleTable(template) });
|
||||
var values = new Dictionary<string, PlaceholderValue>(provider.GetValues(), StringComparer.Ordinal);
|
||||
if (values.GetValueOrDefault(ExamPointsTableDrawing.PlaceholderName) is DrawingValue)
|
||||
values[ExamPointsTableDrawing.PlaceholderName] = ExamCoverPlaceholders.SampleTable(template);
|
||||
foreach (var name in StudentReportTemplate.Drawings.Append(ReportTextDrawing.RepeatInfo))
|
||||
if (values.GetValueOrDefault(name) is DrawingValue)
|
||||
values[name] = StudentReportTemplate.SampleDrawing(name, DrawingBoxLocator.Find(template, name));
|
||||
return new DesignerDataProvider(values);
|
||||
}
|
||||
|
||||
public void SetUpStudentReport()
|
||||
{
|
||||
var reportType = MetadataItems.FirstOrDefault(x => x.Name.Trim().Equals(TemplateMetadataKeys.ReportType, StringComparison.OrdinalIgnoreCase));
|
||||
if (reportType is null) MetadataItems.Add(new(TemplateMetadataKeys.ReportType, TemplateReportTypes.StudentReport));
|
||||
else reportType.Value = TemplateReportTypes.StudentReport;
|
||||
var conflicts = new List<string>();
|
||||
foreach (var known in StudentReportTemplate.Create().Manifest.Placeholders)
|
||||
{
|
||||
var existing = Placeholders.FirstOrDefault(p => p.Name.Trim() == known.Name);
|
||||
if (existing is null) Placeholders.Add(new(known.Name, known.Type, false,
|
||||
known.Name == "Report.Period" ? "01.08.2025 - 31.01.2026" : known.Name == "Student.Name" ? "Erika Beispiel" : known.Name == "Group.Name" ? "9 Ch G" : ""));
|
||||
else if (existing.Type != known.Type) conflicts.Add(known.Name);
|
||||
}
|
||||
CanExport = false;
|
||||
SetStatus(conflicts.Count == 0 ? "Als Schülerbericht eingerichtet. Bausteine stehen unter LehrerApp-Sonderinhalte."
|
||||
: "Abweichender Platzhaltertyp: " + string.Join(", ", conflicts), conflicts.Count > 0);
|
||||
}
|
||||
|
||||
public bool IsExamCover => MetadataItems.Any(x =>
|
||||
@@ -796,6 +817,24 @@ public static class SpecialContentCatalog
|
||||
new("Fehltage nach Datum", "Student.AbsenceDays",
|
||||
"Chronologische Liste mit Datum, Fehlzeit oder ganzem Fehltag sowie Entschuldigungsstatus.",
|
||||
"FLOWDRAWBOX", "170", "140"),
|
||||
new("Wiederholungsarbeit", ReportTextDrawing.RepeatInfo,
|
||||
"Erste Arbeit, bisherige Note und Bewertungsregel; wird bei normalen Arbeiten leer gelassen.",
|
||||
"FLOWDRAWBOX", "165", "150", "fit=content", InContentFlow: true),
|
||||
new("Notenzwischenstand", ReportTextDrawing.InterimGrades,
|
||||
"Mündlich, schriftlich und vorläufige Zeugnisnote aus einem beim Druck gewählten gespeicherten Durchgang.",
|
||||
"FLOWDRAWBOX", "165", "150", "fit=content", InContentFlow: true),
|
||||
new("Mitarbeitsgraph (Schülerbericht)", StudentReportTemplate.Participation,
|
||||
"Gewichtete Mitarbeit und Einzelaspekte im gewählten Zeitraum auf der gemeinsamen -2 bis +2-Achse.",
|
||||
"FLOWDRAWBOX", "170", "230", "fit=content", InContentFlow: true),
|
||||
new("Kompetenzen (Schülerbericht)", StudentReportTemplate.Competencies,
|
||||
"Kompetenzbewertungen aus Klausuren und Mitarbeit im gewählten Zeitraum.",
|
||||
"FLOWDRAWBOX", "170", "230", "fit=content", InContentFlow: true),
|
||||
new("Hausaufgaben (Schülerbericht)", StudentReportTemplate.Homework,
|
||||
"Hausaufgabenkontrollen mit Datum und aktuellem Nachreichstatus.",
|
||||
"FLOWDRAWBOX", "170", "230", "fit=content", InContentFlow: true),
|
||||
new("Klassenbucheinträge (Schülerbericht)", StudentReportTemplate.Documentation,
|
||||
"Freigegebene Dokumentation und Unterrichtsnotizen für einen Schüler und eine Lerngruppe.",
|
||||
"FLOWDRAWBOX", "170", "230", "fit=content", InContentFlow: true),
|
||||
new("Punktetabelle (Klausur-Deckblatt)", ExamPointsTableDrawing.PlaceholderName,
|
||||
"Aufgabe / Max. Punktzahl / Punktzahl mit festen Spaltenbreiten; bei vielen Aufgaben folgt ein weiterer Block, und die Elemente darunter im Content-Flow wandern mit. Die Breite bestimmt, wie viele Aufgaben nebeneinander passen (165 = sechs).",
|
||||
"FLOWDRAWBOX", "165", "150", "fit=content", InContentFlow: true),
|
||||
@@ -824,7 +863,12 @@ public static class SpecialContentCatalog
|
||||
new DrawString(42, 27, "Ganzer Fehltag", 7, "#374151"),
|
||||
new DrawString(116, 27, "Entschuldigt", 7, "#2E7D32"),
|
||||
], 38),
|
||||
ReportTextDrawing.RepeatInfo => ReportTextDrawing.Build("Wiederholungsarbeit",
|
||||
["Erste Arbeit: Atombau vom 18.12.2025", "Note der ersten Arbeit: 4", "Für die Bewertung zählt die bessere Note aus beiden Arbeiten."]),
|
||||
ReportTextDrawing.InterimGrades => ReportTextDrawing.Build("Vorläufiger Notenzwischenstand",
|
||||
["Stichtag: 15.01.2026 · Sprechtag", "Mündlich: 2", "Schriftlich: 3", "Vorläufige Zeugnisnote: 2-3"]),
|
||||
ExamPointsTableDrawing.PlaceholderName => ExamPointsTableDrawing.Build(ExamCoverPlaceholders.SampleColumns, 165),
|
||||
_ when StudentReportTemplate.Drawings.Contains(placeholderName) => StudentReportTemplate.SampleDrawing(placeholderName),
|
||||
_ => DesignerPlaceholder.GenericSampleDrawing(),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -85,6 +85,7 @@
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
<Button Content="Markierten Metadateneintrag entfernen" HorizontalAlignment="Left" Click="OnRemoveMetadata"/>
|
||||
<Button Content="Als Schülerbericht einrichten" HorizontalAlignment="Left" Click="OnSetUpStudentReport"/>
|
||||
<Button Content="Als Klausur-Deckblatt einrichten" HorizontalAlignment="Left" Click="OnSetUpExamCover"
|
||||
ToolTip.Tip="Setzt report-type=exam-cover und legt alle Platzhalter an, die die LehrerApp für Deckblätter befüllt (Exam.*, Result.*, …) — mit Beispielwerten für die Vorschau."/>
|
||||
</StackPanel>
|
||||
|
||||
@@ -38,6 +38,7 @@ public partial class MainWindow : Window
|
||||
if (_viewModel.SelectedMetadata is not { } selected) return;
|
||||
_viewModel.MetadataItems.Remove(selected); _viewModel.SelectedMetadata = null; _viewModel.CanExport = false;
|
||||
}
|
||||
private void OnSetUpStudentReport(object? sender, RoutedEventArgs e) => _viewModel.SetUpStudentReport();
|
||||
private void OnSetUpExamCover(object? sender, RoutedEventArgs e) => _viewModel.SetUpExamCover();
|
||||
private void OnRemovePlaceholder(object? sender, RoutedEventArgs e) => _viewModel.RemoveSelectedPlaceholder();
|
||||
private void OnBoldSelection(object? sender, RoutedEventArgs e) => WrapPlaceholderSelection("[b]", "[/b]");
|
||||
|
||||
Reference in new issue
Block a user