Add a review-flag state for questions, independent of publish status
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.
This commit is contained in:
@@ -111,6 +111,30 @@ public class QuestionResponse
|
||||
}
|
||||
}
|
||||
|
||||
// Admin-only shape for the flag/unflag/list-flagged endpoints - deliberately separate from
|
||||
// QuestionResponse (which is student-facing and never exposes IsPublished or the flag fields).
|
||||
public class QuestionFlagResponse
|
||||
{
|
||||
public string Id { get; set; } = "";
|
||||
public string ExternalId { get; set; } = "";
|
||||
public string Stem { get; set; } = "";
|
||||
public bool IsPublished { get; set; }
|
||||
public DateTime? FlaggedForReviewUtc { get; set; }
|
||||
public string FlagReason { get; set; } = "";
|
||||
public string FlaggedByUserId { get; set; } = "";
|
||||
|
||||
public static QuestionFlagResponse FromModel(Question question) => new()
|
||||
{
|
||||
Id = question.Id ?? "",
|
||||
ExternalId = question.ExternalId,
|
||||
Stem = question.Stem,
|
||||
IsPublished = question.IsPublished,
|
||||
FlaggedForReviewUtc = question.FlaggedForReviewUtc,
|
||||
FlagReason = question.FlagReason,
|
||||
FlaggedByUserId = question.FlaggedByUserId
|
||||
};
|
||||
}
|
||||
|
||||
public class FirstQuestionAttemptResponse
|
||||
{
|
||||
public string QuestionExternalId { get; set; } = "";
|
||||
|
||||
Reference in New Issue
Block a user