Klausurvarianten, Bonuspunkte und Wiederholungen ergänzen
This commit is contained in:
1 parent
54ad7f7419
commit
431d023c1a
22 files changed
+522
-40
No files matched your search
@@ -0,0 +1,34 @@
|
||||
using LehrerApp.Core.Models;
|
||||
using LehrerApp.Core.Services;
|
||||
using LehrerApp.Desktop.ViewModels.Groups;
|
||||
using Xunit;
|
||||
|
||||
namespace LehrerApp.Desktop.Tests;
|
||||
|
||||
public class ExamVariantScoringTests
|
||||
{
|
||||
[Fact]
|
||||
public void Fassungswechsel_BerechnetPunkteUndNoteNeu()
|
||||
{
|
||||
var tasks = new List<ExamTask>
|
||||
{
|
||||
new() { Nr = 1, MaxPoints = 10 },
|
||||
new() { Nr = 2, MaxPoints = 5, Variant = ExamVariant.A },
|
||||
new() { Nr = 3, MaxPoints = 8, Variant = ExamVariant.B },
|
||||
new() { Nr = 4, MaxPoints = 2, IsBonus = true },
|
||||
};
|
||||
var existing = new ExamResult { Points = [8, 5, 8, 2] };
|
||||
var row = new ExamResultRow(Guid.NewGuid(), "Test", tasks, existing,
|
||||
GradingService.DefaultKey1To6(), 15, new GradingService());
|
||||
|
||||
Assert.Equal(15, row.TotalPoints);
|
||||
Assert.False(row.Cells[2].IsApplicable);
|
||||
|
||||
row.VariantName = "B";
|
||||
|
||||
Assert.Equal(18, row.TotalPoints);
|
||||
Assert.False(row.Cells[1].IsApplicable);
|
||||
Assert.True(row.Cells[2].IsApplicable);
|
||||
Assert.Equal(ExamVariant.B, row.ToModel(Guid.NewGuid()).Variant);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user