Add core game retry flow and question stats
This commit is contained in:
@@ -126,6 +126,8 @@ public class QuestionsController : ControllerBase
|
||||
return "correctChoiceId must match a choice id";
|
||||
if (string.IsNullOrWhiteSpace(req.Explanation))
|
||||
return "explanation required";
|
||||
if (req.ChoiceSelectionPercentages.Any(entry => entry.Value is < 0 or > 100))
|
||||
return "choiceSelectionPercentages values must be between 0 and 100";
|
||||
if (string.IsNullOrWhiteSpace(req.System))
|
||||
return "system required";
|
||||
if (string.IsNullOrWhiteSpace(req.Discipline))
|
||||
|
||||
@@ -16,6 +16,7 @@ public class Question
|
||||
public string CorrectChoiceId { get; set; } = "";
|
||||
public string Explanation { get; set; } = "";
|
||||
public Dictionary<string, string> ChoiceExplanations { get; set; } = [];
|
||||
public Dictionary<string, int> ChoiceSelectionPercentages { get; set; } = [];
|
||||
public string Discipline { get; set; } = "";
|
||||
public string System { get; set; } = "";
|
||||
public int Difficulty { get; set; } = 1;
|
||||
|
||||
@@ -19,6 +19,7 @@ public class UpsertQuestionRequest
|
||||
public string CorrectChoiceId { get; set; } = "";
|
||||
public string Explanation { get; set; } = "";
|
||||
public Dictionary<string, string> ChoiceExplanations { get; set; } = [];
|
||||
public Dictionary<string, int> ChoiceSelectionPercentages { get; set; } = [];
|
||||
public string Discipline { get; set; } = "";
|
||||
public string System { get; set; } = "";
|
||||
public int Difficulty { get; set; } = 1;
|
||||
|
||||
@@ -10,6 +10,7 @@ public class QuestionResponse
|
||||
public string CorrectChoiceId { get; set; } = "";
|
||||
public string Explanation { get; set; } = "";
|
||||
public Dictionary<string, string> ChoiceExplanations { get; set; } = [];
|
||||
public Dictionary<string, int> ChoiceSelectionPercentages { get; set; } = [];
|
||||
public string Discipline { get; set; } = "";
|
||||
public string System { get; set; } = "";
|
||||
public int Difficulty { get; set; }
|
||||
@@ -27,6 +28,7 @@ public class QuestionResponse
|
||||
CorrectChoiceId = question.CorrectChoiceId,
|
||||
Explanation = question.Explanation,
|
||||
ChoiceExplanations = question.ChoiceExplanations,
|
||||
ChoiceSelectionPercentages = question.ChoiceSelectionPercentages,
|
||||
Discipline = question.Discipline,
|
||||
System = question.System,
|
||||
Difficulty = question.Difficulty,
|
||||
|
||||
@@ -133,6 +133,7 @@ public class QuestionStore
|
||||
CorrectChoiceId = req.CorrectChoiceId.Trim(),
|
||||
Explanation = req.Explanation.Trim(),
|
||||
ChoiceExplanations = req.ChoiceExplanations,
|
||||
ChoiceSelectionPercentages = req.ChoiceSelectionPercentages,
|
||||
Discipline = req.Discipline.Trim(),
|
||||
System = req.System.Trim(),
|
||||
Difficulty = req.Difficulty,
|
||||
|
||||
Reference in New Issue
Block a user