Skip to content

FAC-135.2 feat: submission generator count cap and prompt theming #354

Description

@y4nder

Summary

Two UX enhancements + a safety fix for the admin submission generator:

  1. 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.
  2. 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.
  3. 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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions