Summary
Two UX enhancements + a safety fix for the admin submission generator:
- Optional
count parameter on preview — admins can cap how many submissions to generate via a random sample of available students, instead of always generating for everyone. Needed for targeted demo data, small test batches, and for staying under the HTTP body limit on commit.
- Optional
promptTheme parameter — free-text guidance that biases the OpenAI-generated qualitative comments toward a tone or topic (e.g., "mostly positive, emphasizes teaching clarity" or "mixed feedback with concerns about grading fairness"), so analytics screenshots and demos can showcase specific narratives.
- Body parser limit raised to 5MB — root-cause fix for the HTTP 413 seen on commit at ~80 students. Default Express limit (~100KB) was being exceeded once LLM comments were attached to 80+ rows.
Scope
GeneratePreviewRequestDto: optional count (int 1–500) and promptTheme (string ≤ 500 chars)
AdminGenerateService.GeneratePreview(): Fisher–Yates random sample when count < available; metadata.generatingCount now reflects the selected size, availableStudents reflects the full pool
CommentGeneratorService.GenerateComments(): promptTheme injected into the OpenAI user message alongside existing length instruction; system prompt (persona + language mix) is unchanged
main.ts: app.useBodyParser('json'|'urlencoded', { limit: '5mb' })
- Validation keeps existing
@ArrayMaxSize(200) on commit rows
Out of scope
- Preset theme chips (confirmed with stakeholder — free-text only for v1)
- Persisting previews server-side to avoid shipping rows back on commit (the raised body limit makes this unnecessary at current scale)
Summary
Two UX enhancements + a safety fix for the admin submission generator:
countparameter on preview — admins can cap how many submissions to generate via a random sample of available students, instead of always generating for everyone. Needed for targeted demo data, small test batches, and for staying under the HTTP body limit on commit.promptThemeparameter — free-text guidance that biases the OpenAI-generated qualitative comments toward a tone or topic (e.g., "mostly positive, emphasizes teaching clarity" or "mixed feedback with concerns about grading fairness"), so analytics screenshots and demos can showcase specific narratives.Scope
GeneratePreviewRequestDto: optionalcount(int 1–500) andpromptTheme(string ≤ 500 chars)AdminGenerateService.GeneratePreview(): Fisher–Yates random sample whencount < available;metadata.generatingCountnow reflects the selected size,availableStudentsreflects the full poolCommentGeneratorService.GenerateComments():promptThemeinjected into the OpenAI user message alongside existing length instruction; system prompt (persona + language mix) is unchangedmain.ts:app.useBodyParser('json'|'urlencoded', { limit: '5mb' })@ArrayMaxSize(200)on commit rowsOut of scope