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
+14 -11
View File
@@ -223,21 +223,24 @@ UpsertQuestionRequest Build(Seed seed)
id => id,
id => id == "A"
? seed.Explanation
: $"This choice does not address the decisive finding: {seed.Discriminator}. {seed.Pitfall2}.");
var wrongFollowups = ids.Skip(1).ToDictionary(
id => id,
id => new WrongAnswerFollowup
: $"{choices.Single(choice => choice.Id == id).Text} does not address the decisive finding: {seed.Discriminator}. {seed.Pitfall2}.");
var distractorIds = ids.Skip(1).ToArray();
var wrongFollowups = distractorIds.ToDictionary(id => id, id =>
{
var index = Array.IndexOf(distractorIds, id);
var alternatives = new[] { distractorIds[(index + 1) % distractorIds.Length], distractorIds[(index + 2) % distractorIds.Length] };
return new WrongAnswerFollowup
{
Prompt = $"In this same vignette, which finding most strongly favors {seed.Correct} over {choices.Single(c => c.Id == id).Text}?",
Prompt = $"Which limitation of option {id} should have ruled it out in this case?",
Choices =
[
new() { Id = "1", Text = seed.Discriminator },
new() { Id = "2", Text = seed.Pitfall1 },
new() { Id = "3", Text = "The patient's age by itself" }
new() { Id = "1", Text = explanations[id] },
new() { Id = "2", Text = explanations[alternatives[0]] },
new() { Id = "3", Text = explanations[alternatives[1]] }
],
CorrectChoiceId = "1",
TeachingPoint = seed.Takeaway
});
CorrectChoiceId = "1", TeachingPoint = explanations[id]
};
});
return new UpsertQuestionRequest
{