Restore distractor-specific follow-up questions

This commit is contained in:
hz
2026-08-01 18:06:52 -05:00
parent 8c5aa17d89
commit c7f5006cb6
14 changed files with 76770 additions and 100 deletions
+15 -4
View File
@@ -61,11 +61,22 @@ UpsertQuestionRequest Build(Seed s)
var ids = Enumerable.Range(0, s.Answers.Length).Select(i => ((char)('A' + i)).ToString()).ToArray();
var choices = ids.Zip(s.Answers, (id, text) => new QuestionChoice { Id = id, Text = text }).ToList();
var explanations = ids.ToDictionary(id => id, id => id == "A" ? $"Correct. {s.Rationale}" : $"Incorrect. {choices.Single(c => c.Id == id).Text} does not fit the decisive finding: {s.KeyFact}. {s.Takeaway}");
var wrong = ids.Skip(1).ToDictionary(id => id, _ => new WrongAnswerFollowup
var distractorIds = ids.Skip(1).ToArray();
var wrong = distractorIds.ToDictionary(id => id, id =>
{
Prompt = $"Which finding most strongly supports {s.Answers[0]}?",
Choices = [new() { Id = "A", Text = s.KeyFact }, new() { Id = "B", Text = s.ContextFact }, new() { Id = "C", Text = s.NeutralFact }],
CorrectChoiceId = "A", TeachingPoint = s.Takeaway
var index = Array.IndexOf(distractorIds, id);
var alternatives = new[] { distractorIds[(index + 1) % distractorIds.Length], distractorIds[(index + 2) % distractorIds.Length] };
return new WrongAnswerFollowup
{
Prompt = $"Which limitation of option {id} should have ruled it out in this case?",
Choices =
[
new() { Id = "A", Text = explanations[id] },
new() { Id = "B", Text = explanations[alternatives[0]] },
new() { Id = "C", Text = explanations[alternatives[1]] }
],
CorrectChoiceId = "A", TeachingPoint = explanations[id]
};
});
var reference = References.For(s.Reference);
return new UpsertQuestionRequest