Add functional simulation question review
This commit is contained in:
@@ -119,6 +119,24 @@ public class ExamSimulationReadinessResponse
|
||||
public bool HasActiveSimulation { get; set; }
|
||||
}
|
||||
|
||||
public class CompletedExamSimulationSummary
|
||||
{
|
||||
public string Id { get; set; } = "";
|
||||
public DateTime CompletedUtc { get; set; }
|
||||
public int PredictedScore { get; set; }
|
||||
public int RangeLow { get; set; }
|
||||
public int RangeHigh { get; set; }
|
||||
public int Correct { get; set; }
|
||||
public int Total { get; set; }
|
||||
public int SeenCount { get; set; }
|
||||
}
|
||||
|
||||
public class CompletedExamSimulationPage
|
||||
{
|
||||
public List<CompletedExamSimulationSummary> Items { get; set; } = [];
|
||||
public DateTime? NextBefore { get; set; }
|
||||
}
|
||||
|
||||
public class Step3Outcome
|
||||
{
|
||||
[BsonId]
|
||||
|
||||
@@ -62,6 +62,24 @@ public class QuestionResponse
|
||||
};
|
||||
}
|
||||
|
||||
public static QuestionResponse FromModelWithChoices(
|
||||
Question question,
|
||||
IReadOnlyCollection<string> presentedChoiceIds,
|
||||
int questionElo = 1000)
|
||||
{
|
||||
var response = FromModel(question, questionElo: questionElo, includeChoicePool: true);
|
||||
var ids = presentedChoiceIds.ToHashSet(StringComparer.Ordinal);
|
||||
response.Choices = presentedChoiceIds
|
||||
.Select(id => question.Choices.FirstOrDefault(choice => choice.Id == id))
|
||||
.Where(choice => choice is not null)
|
||||
.Cast<QuestionChoice>()
|
||||
.ToList();
|
||||
response.ChoiceExplanations = response.ChoiceExplanations.Where(entry => ids.Contains(entry.Key)).ToDictionary();
|
||||
response.WrongAnswerFollowups = response.WrongAnswerFollowups.Where(entry => ids.Contains(entry.Key)).ToDictionary();
|
||||
response.ChoiceSelectionPercentages = response.ChoiceSelectionPercentages.Where(entry => ids.Contains(entry.Key)).ToDictionary();
|
||||
return response;
|
||||
}
|
||||
|
||||
private static List<QuestionChoice> SelectLegacyChoices(Question question)
|
||||
{
|
||||
if (question.Choices.Count <= 5)
|
||||
|
||||
Reference in New Issue
Block a user