Improve question review and image handling

This commit is contained in:
hz
2026-07-14 16:02:14 -05:00
parent 7529ed5863
commit 8aaf7d61e9
8 changed files with 391 additions and 17 deletions
@@ -9,6 +9,7 @@ public class QuestionSearchRequest
public int? DifficultyMax { get; set; }
public int Limit { get; set; } = 40;
public bool SupportsChoicePools { get; set; }
public bool RequireMedia { get; set; }
public List<string> ExcludeExternalIds { get; set; } = [];
}
@@ -37,6 +37,8 @@ public class QuestionStore
filters.Add(builder.Gte(q => q.Difficulty, req.DifficultyMin.Value));
if (req.DifficultyMax is not null)
filters.Add(builder.Lte(q => q.Difficulty, req.DifficultyMax.Value));
if (req.RequireMedia)
filters.Add(builder.Exists("Media.0", true));
var excludedIds = req.ExcludeExternalIds
.Where(id => !string.IsNullOrWhiteSpace(id))
.Select(id => id.Trim())