PBQ-analysis-plugin

PBQ Analysis — Google Sheets Add-on

A Google Sheets sidebar add-on for visualizing student response patterns from Pattern-Based Question (PBQ) checkbox questions in Google Forms.

After students submit responses, the sidebar reads the linked form, lets you mark the correct answer(s), and generates a column chart showing all answer-combination frequencies sorted by Hamming distance from the correct answer — most-wrong combinations on the left.


What it does


Setup (for a new spreadsheet)

  1. Open your Google Sheet containing Form response data
  2. Go to Extensions → Apps Script
  3. Copy in PBQCode.gs, Sidebar.html, and appsscript.json from this repo
  4. In the Apps Script editor, enable Google Sheets API under Services (Advanced Services)
  5. Save and reload the spreadsheet — a PBQ Analysis menu will appear

Usage

  1. PBQ Analysis → Open PBQ Panel to open the sidebar
  2. For each response tab, click Link form and paste the Google Form URL — this is stored permanently per tab
  3. Select the PBQ question column from the dropdown
  4. Verify the answer options (auto-filled from the form)
  5. Select the correct answer(s) (A/B/C/D tiles)
  6. Click Generate Chart

When switching tabs, click ↺ Refresh for this tab to reload the sidebar for the new tab’s form and columns.


Development workflow (clasp)

This project uses clasp to sync between local files and the Apps Script project.

npm install -g @google/clasp
clasp login

Create .clasp.json in the project root (not committed — see .gitignore):

{
  "scriptId": "<your-script-id>",
  "rootDir": "."
}

Your script ID is in the Apps Script editor under Project Settings → Script ID.

clasp push          # push local changes to Apps Script
clasp push --watch  # auto-push on every file save
clasp pull          # pull changes made in the Apps Script editor

Files

File Description
PBQCode.gs All server-side logic: column detection, FormApp option discovery, bitmask encoding, chart generation, PropertiesService tracking
Sidebar.html Full sidebar UI — HTML, CSS, and client-side JS
appsscript.json Apps Script manifest: OAuth scopes, Google Sheets Advanced API

Requirements


Privacy Policy Terms of Service