Quizzer-8: Migrating to .NET 10

This commit is contained in:
Karsten Jeppesen
2026-05-01 11:40:09 +02:00
parent 15445b6e4a
commit f22c7dfb0c
116 changed files with 79176 additions and 0 deletions

View File

@@ -0,0 +1,78 @@
using System.Collections.Generic;
namespace Quizzer.Models
{
/// <summary>
/// Collective knowledge of quizz answers
/// </summary>
public class Statistic
{
public string QuizzID { get; set; }
public int Version { get; set; }
public string StatsJson { get; set; }
public Statistic()
{
QuizzID = String.Empty;
Version = 0;
StatsJson = String.Empty;
}
}
public class StatisticsMC : Statistic
{
public List<StatisticsMCItem> MCList { get; set; }
public StatisticsMC()
{
MCList = new List<StatisticsMCItem>();
}
}
public class StatisticsMCItem
{
public string QuestionID { get; set; }
public List<int> Counter { get; set; }
public StatisticsMCItem()
{
Counter = new List<int>();
QuestionID = string.Empty;
}
}
public class StatisticsMCDN : StatisticsMC
{
public List<MCQuestion> Questions { get; set; }
public StatisticsMCDN()
{
Questions = new List<MCQuestion>();
}
}
public class StatisticsStudentByCategory
{
public string CategoryID { get; set; }
public string CategoryName { get; set; }
public int percentage { get; set; }
private int score;
private int max;
public StatisticsStudentByCategory()
{
score = 0;
max = 0;
percentage = 0;
}
public void Update (int theScore, int theMax)
{
score += theScore;
max += theMax;
percentage = (score * 100) / max;
}
}
}