{"slug": "quiz-gate-answer-questions-before-merging-code", "title": "Quiz Gate: Answer questions before merging code", "summary": "A third-party GitHub Action called PR Comprehension Quiz Gate requires pull request authors to answer an AI-generated quiz about their own code changes before merging. The Action uses Copilot or Claude to write and grade the quiz, defaults to advisory mode with up to 3 questions and 3 attempts per PR revision, and can be set to required mode to block merges via the quiz-gate status check. The provider receives changed-file contents, diffs, and human PR comments but cannot run code or use tools, and the tool is not certified by GitHub.", "body_md": "# PR Comprehension Quiz Gate\n\nActions\n## About\n\n## Tags\n\n(2)\nA GitHub Action that asks PR authors to explain their changes before merging. Copilot or Claude writes the quiz and grades written answers. Multiple-choice answers are checked directly.\n\n1. Add a `COPILOT_GITHUB_TOKEN` repository secret using a fine-grained personal\ntoken with**Account permissions → Copilot Requests → Read** and active Copilot\naccess. See the[token instructions](https://github.github.com/gh-aw/reference/auth/#copilot_github_token) .\n2. Copy [the Copilot workflow](https://github.com/not-a-feature/pr-quiz-gate/blob/main/examples/quiz-gate-copilot.yml) to`.github/workflows/quiz-gate.yml` on your default branch. Set the Action reference\nto`not-a-feature/pr-quiz-gate@COMMIT_SHA` with a tested SHA, and set`mode: required` .\nKeep the example's events, permissions, and concurrency settings.\n3. In your branch rules, require the **`quiz-gate`** status from GitHub Actions and\nup-to-date checks. Choose the status rather than the workflow job, and leave\nbypass actors empty to enforce the rule for administrators too.\n\nPrefer Claude? Use [the Claude workflow](https://github.com/not-a-feature/pr-quiz-gate/blob/main/examples/quiz-gate.yml) with an\n`ANTHROPIC_API_KEY` secret.\n\nOr preview a setup PR with the installer:\n\n```\nuv run python install.py OWNER/REPO --action not-a-feature/pr-quiz-gate@COMMIT_SHA\n```\n\nAdd `--apply` to create it. You'll need an authenticated `gh` CLI and the provider\ntoken in your environment. Set branch rules separately.\n\nThe bot posts a quiz with code links and an answer form. Copy the form into your\nown PR comment, answer every question, and check **Submit answers** when ready.\n\nYou can also submit numbered answers:\n\n```\n/quiz answer CURRENT_QUIZ_ID\n1: B\n2: Explain the implementation and what you intend.\n```\n\nOnly the PR author can answer. By default, passing takes a majority of correct answers, and any unresolved decisions still block merging even with a passing score. Results explain what needs work. New commits need a new quiz. To submit another attempt, post a new comment rather than editing a graded one.\n\n| Command | What it does | \n|---|---|\n| `/quiz` | Start a missing or outdated quiz | \n| `/quiz retry` | Get fresh questions after failing | \n| `/quiz override REASON` | Override as a maintainer or admin, when enabled | \n\nThe default mode is `advisory`. Use `required` to block merging. Defaults allow\nup to 3 questions and 3 attempts per PR revision, with maintainer overrides enabled.\nSee [action.yml](https://github.com/not-a-feature/pr-quiz-gate/blob/main/action.yml) for models, score thresholds, and all other inputs.\nSet a stable `state-key` to keep quizzes valid when rotating the provider token.\n\nThe provider receives changed-file contents, diffs, and human PR comments, but cannot run code or use tools. Answer keys are encrypted in bot comments and tied to the PR revision and author.\n\nBinary files and changes over the context budget cause an error. Unchanged dependencies, review threads, and local agent sessions are excluded. Grading can be wrong, and authors can use AI to answer. Merge queues are unsupported. Bot-authored PRs need an override.\n\n```\nuv sync --locked\nuv run python -m unittest discover -s tests -v\n```\n\nTests mock the providers and GitHub APIs. See [integration testing](https://github.com/not-a-feature/pr-quiz-gate/blob/main/INTEGRATION_TESTING.md)\nto test a branch or commit without a Marketplace release. Choose a commit with\ncheckbox support, since older tags keep their original behavior.\n\n**PR Comprehension Quiz Gate** is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.", "url": "https://wpnews.pro/news/quiz-gate-answer-questions-before-merging-code", "canonical_source": "https://github.com/marketplace/actions/pr-comprehension-quiz-gate", "published_at": "2026-10-07 10:01:26+00:00", "updated_at": "2026-10-07 10:20:12.440318+00:00", "lang": "en", "topics": ["ai-tools", "developer-tools", "ai-agents"], "entities": ["GitHub", "PR Comprehension Quiz Gate", "Copilot", "Claude", "Anthropic", "GitHub Actions"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/quiz-gate-answer-questions-before-merging-code", "markdown": "https://wpnews.pro/news/quiz-gate-answer-questions-before-merging-code.md", "text": "https://wpnews.pro/news/quiz-gate-answer-questions-before-merging-code.txt", "jsonld": "https://wpnews.pro/news/quiz-gate-answer-questions-before-merging-code.jsonld"}}