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.
10 lines
443 B
C#
10 lines
443 B
C#
namespace QuestionsApi.Services;
|
|
|
|
// Pure student-visibility decision for a question, kept dependency-free (like FlashcardScheduling)
|
|
// so it's unit testable without a controller or Mongo. Consolidates what used to be duplicated
|
|
// inline across QuestionsController/QuestionReportsController.
|
|
public static class QuestionVisibility
|
|
{
|
|
public static bool IsVisibleToStudent(bool isPublished, bool isFlagged) => isPublished && !isFlagged;
|
|
}
|