Skip to content

Frq - #383

Merged
saa938 merged 8 commits into
mainfrom
frq
Aug 21, 2026
Merged

Frq#383
saa938 merged 8 commits into
mainfrom
frq

Conversation

@saa938

@saa938 saa938 commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

saa938 and others added 7 commits August 21, 2026 09:53
…t taking

FRQTemplate carried neither prompt content nor a rubric, so the editor had
nothing to persist and the test renderer fell back to hardcoded AP Human
Geography content for every FRQ. This adds the missing data model and fixes
the authoring and test-taking paths that depend on it.

Data model
- types/frq.ts: add criteria, prompt, answerType, status, timeLimitMinutes
- add src/lib/frq/template.ts to normalize legacy and partial template docs
  so older documents keep loading

Authoring and taking
- editorRenderer/editorFooter: actually persist questions and rubric
- testRenderer: render the real prompt and rubric, and persist drafts
- admin subject page: surface load errors, clean up references to deleted
  units, and tolerate partial fetch failures
- subject page, sidebar layout, and sidebar: add the missing FRQ links
- remove components/global/frqFooter.tsx, which had no remaining references

Rules and tooling
- firestore.rules: null-guard resource in the FRQ collections, where a
  missing document raised an evaluation error that surfaced to the client
  as "insufficient permissions"; let graders read templates, since the
  rubric and prompt they score against live there
- firestore.rules: also add the graded-frqs grades key here so the whole
  rules file lands in one PR. It is declarative and unused until the
  grading PR that builds on this branch.
- package.json: add deploy:rules
The grading queue read `gradableFrqSubmissions`, a collection name from an
earlier schema pass that nothing writes to, so the queue was permanently
empty no matter how many tests students submitted. The grader view itself
rendered mock data rather than the submission being graded.

- frq-grading list: read `ungraded-frqs`, the collection the student test
  writes to, and resolve templates through their real nested location
  instead of a flat `frqTemplates` collection
- frq-grading list: gate on grader/admin access, so a non-grader sees why
  the queue is empty rather than an unexplained blank page
- frq-grading/[id]: load the real submission and its template
- gradingRenderer: score against the template's rubric and write grades
  back, replacing the mock content

Builds on the data model and rules from the previous PR.
The student feedback page rendered `fallBackData.ts` — a fixture of sample
scores and comments — so every student saw the same placeholder feedback
regardless of what a grader had actually written.

- frq-feedback/[id]: load the student's real graded submission
- add src/lib/frq/feedbackDocument.ts to adapt a graded submission into the
  shape the feedback view renders, tolerating older graded documents
- feedbackRenderer and the feedback/* components: thread readOnly through,
  so a student cannot edit the rubric they are being shown
- delete feedback/fallBackData.ts, now unreferenced

Builds on the data model and rules from the first PR. Independent of the
grading PR — the two touch no files in common.
FRQ 1/3: give templates real prompt and rubric data; fix authoring and test taking
FRQ 2/3: point grading at the collection submissions are actually written to
FRQ 3/3: show students their real feedback instead of placeholder data
Copilot AI lite review requested due to automatic review settings August 21, 2026 21:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

main carries commit ff5fcdc, the blanket revert of PR #376 ("Frq feature").
The frq branch was then rebuilt from the pre-revert merge base c528939 and
the bugs that caused the revert were fixed in PRs #379-#382. Because the
rebuild produced new commit SHAs, git cannot relate the revert to the work
that supersedes it, so every FRQ file collides: 18 conflicts, plus 10 files
that main deleted and frq never touched, which git resolves silently as
deletions.

main has no independent changes since the merge base. Its only commits are
the #376 merge, the revert, and the #377 merge, so every conflicting hunk on
main's side is reverted pre-FRQ code that the fix PRs replace. The merge is
therefore resolved to the frq tree in full, which also restores the 10 files
that would otherwise have been dropped: firebase.json, firestore.indexes.json,
frqRefs.ts, responseEditor.tsx, FRQDropdown.tsx, FRQFooter.tsx, unitFrqs.tsx,
and feedback/header.tsx, feedback/leftSide.tsx, feedback/types.ts.

Verified: next build succeeds and emits all five FRQ routes (authoring,
taking, /frq-grading, /frq-grading/[id], /frq-feedback/[id]).
@saa938
saa938 merged commit 0624754 into main Aug 21, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants