Flagged questions disappear from every student-facing surface (search, exam simulation sampling, the missed-question review queue, bookmarks, direct fetch) while staying published - flagging and unpublishing are now separate, reversible actions with their own audit trail (who flagged it, when, why). Backend-only for now: SUPER-only flag/unflag/ list endpoints, no client UI. Includes a one-time CLI sweep (flag-media-questions) to flag every existing question with an image so they can be reviewed.
79 lines
2.8 KiB
C#
79 lines
2.8 KiB
C#
using MongoDB.Bson;
|
|
using MongoDB.Bson.Serialization.Attributes;
|
|
|
|
namespace QuestionsApi.Models;
|
|
|
|
public class Question
|
|
{
|
|
[BsonId]
|
|
[BsonRepresentation(BsonType.ObjectId)]
|
|
public string? Id { get; set; }
|
|
|
|
public string ExternalId { get; set; } = "";
|
|
public string Stem { get; set; } = "";
|
|
public string LeadIn { get; set; } = "";
|
|
public List<QuestionChoice> Choices { get; set; } = [];
|
|
public string CorrectChoiceId { get; set; } = "";
|
|
public string Explanation { get; set; } = "";
|
|
public string KeyTakeaway { get; set; } = "";
|
|
public string UsmlePearl { get; set; } = "";
|
|
public List<QuestionReviewFollowup> ReviewFollowups { get; set; } = [];
|
|
public Dictionary<string, string> ChoiceExplanations { get; set; } = [];
|
|
public Dictionary<string, WrongAnswerFollowup> WrongAnswerFollowups { get; set; } = [];
|
|
public Dictionary<string, int> ChoiceSelectionPercentages { get; set; } = [];
|
|
public string Discipline { get; set; } = "";
|
|
public string System { get; set; } = "";
|
|
public string PerformanceCategory { get; set; } = "";
|
|
public int Difficulty { get; set; } = 1;
|
|
public List<QuestionLab> Labs { get; set; } = [];
|
|
public List<string> Media { get; set; } = [];
|
|
public List<string> Tags { get; set; } = [];
|
|
public List<QuestionReference> References { get; set; } = [];
|
|
public bool IsPublished { get; set; } = true;
|
|
public DateTime? FlaggedForReviewUtc { get; set; }
|
|
public string FlagReason { get; set; } = "";
|
|
public string FlaggedByUserId { get; set; } = "";
|
|
public DateTime CreatedUtc { get; set; } = DateTime.UtcNow;
|
|
public DateTime UpdatedUtc { get; set; } = DateTime.UtcNow;
|
|
}
|
|
|
|
public class QuestionChoice
|
|
{
|
|
public string Id { get; set; } = "";
|
|
public string Text { get; set; } = "";
|
|
}
|
|
|
|
public class QuestionLab
|
|
{
|
|
public string Name { get; set; } = "";
|
|
public string Value { get; set; } = "";
|
|
public string Unit { get; set; } = "";
|
|
public string Reference { get; set; } = "";
|
|
}
|
|
|
|
public class WrongAnswerFollowup
|
|
{
|
|
public string Prompt { get; set; } = "";
|
|
public List<QuestionChoice> Choices { get; set; } = [];
|
|
public string CorrectChoiceId { get; set; } = "";
|
|
public string TeachingPoint { get; set; } = "";
|
|
}
|
|
|
|
public class QuestionReviewFollowup
|
|
{
|
|
public string Prompt { get; set; } = "";
|
|
public List<QuestionChoice> Choices { get; set; } = [];
|
|
public string CorrectChoiceId { get; set; } = "";
|
|
public string TeachingPoint { get; set; } = "";
|
|
}
|
|
|
|
public class QuestionReference
|
|
{
|
|
public string Title { get; set; } = "";
|
|
public string Publisher { get; set; } = "";
|
|
public string Url { get; set; } = "";
|
|
public string Supports { get; set; } = "";
|
|
public string AccessedOn { get; set; } = "";
|
|
public string Reviewer { get; set; } = "";
|
|
}
|