Skip to content

Apply grading PR review feedback: PII, locking, trigger cleanup, perf, docs#5

Draft
Copilot wants to merge 2 commits into
gradingfrom
copilot/sub-pr-4
Draft

Apply grading PR review feedback: PII, locking, trigger cleanup, perf, docs#5
Copilot wants to merge 2 commits into
gradingfrom
copilot/sub-pr-4

Conversation

Copilot AI commented Feb 19, 2026

Copy link
Copy Markdown

Addresses all review comments from the grading PR (#4). Changes span correctness, privacy, performance, and documentation.

Privacy

  • AUTO_GRADE_STATE keyed by submission.userId instead of respondent email — avoids persisting PII in Script Properties accessible to all editors.
  • Submission is fetched before the "first attempt" check so userId is available early.

Correctness & Reliability

  • LockService.getScriptLock() wraps the state read-modify-write in handleAutoGradeFormSubmit — prevents concurrent trigger executions from racing and corrupting "first attempt" tracking.
  • Response sheet selection changed from .find() (first match) to .filter() + last element — ensures the most recently created "Form Responses" tab is used when multiple tabs exist.
  • Alert wording fixed: "Skipped (state not TURNED_IN)" → "Skipped (state neither TURNED_IN nor RETURNED)".

Trigger Quota

  • ensureAutoGradeTriggerForForm now deletes orphaned handleAutoGradeFormSubmit triggers whose form IDs are no longer in AUTO_GRADE_TARGETS, preventing accumulation against Apps Script trigger quotas.

Performance

  • getLatestResponseScoresByEmail reads only the header row first to locate Email/Score columns, then fetches just those two columns — avoids loading the entire sheet into memory for large response sets.

Docs

  • README and Questions.sheet-format.md: updated MCQ/MSQ → MCQ-only for answer image URL feature, consistent with MSQ removal.

🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Co-authored-by: LLOKAI <172426821+LLOKAI@users.noreply.github.com>
Copilot AI changed the title [WIP] Add grade-sync and auto-grading functionality for quizzes Apply grading PR review feedback: PII, locking, trigger cleanup, perf, docs Feb 19, 2026
Copilot AI requested a review from LLOKAI February 19, 2026 16:56
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