A public classroom lab for shared polls, chance simulations, and real data.
Try the student app: https://opshion.lefthanddev.com
Start a room, project its QR code, and let students contribute from their phones. No accounts or names are required. Every room has a six-character code; a QR link includes both the code and the activity. Anyone can start a room and try it.
- Coin toss lab: fair virtual coin tosses, individually or in batches of 10 or 100.
- Real coin tally: enter observed heads and tails, or tap each result.
- Real chance experiments: share observed counts for dice, coin pairs, spinners, tile bags, cup draws, surveys, ring toss, and second-hand readings. Each book experiment keeps its own pool.
- Class measurements: resting pulse, height, commute time, five-rent averages, one song, and four-song totals.
- Record activities: alphabet timing, school-day sleep, randomized distance guesses, paper-plane distances, and trips to school. Choose which fields to share; later submissions preserve earlier fields.
- Combined entry pages: pulse with commute, height with pulse, and one song with a four-song playlist. These write the same measurement pools used by the individual activities and textbook.
Real observations and simulated tosses use separate pools. Each device contributes its own tally, value, or record per activity; resubmitting replaces only the answers it sends. Results refresh every five seconds, and can be downloaded as CSV. Opening the distance-guess activity asks the server to assign this device a question; the app shows only that assigned prompt. Class comparisons and CSV remain hidden until the student submits a guess. Other answers are sent when the student acts. Failed writes remain on the device with a retry action.
Node 22.13 or newer:
npm ci
npm run build
npm testThe API tests use Node's built-in SQLite and exercise actual SQL, including validation, class creation, aggregation, rate limits, teacher keys and origin restrictions.
For the complete two-student browser check:
python -m pip install playwright opencv-python-headless
python -m playwright install chromium
npm run test:browserThe browser suite starts an ephemeral local test server with in-memory SQLite. It checks QR decoding, fresh devices, multiple contributors, reloads, numeric and record updates, all four record field kinds, assigned-prompt privacy, real tally entry, combined activity pools, CSV downloads, invalid codes, and phone layout. This test harness is never deployed.
The production app is a Cloudflare Worker with a D1 database, served at https://opshion.lefthanddev.com. npm run build bundles the frontend and API into dist/server/index.js; the Worker expects one D1 binding named DB.
To deploy to your own Cloudflare account:
npm ci && npm run build
npx wrangler login
npx wrangler d1 create opshion # note the database_id it prints
cp wrangler.example.jsonc wrangler.jsonc # paste the database_id; set your own hostname
npx wrangler d1 execute opshion --remote --file drizzle/0000_class_data.sql
npx wrangler deploywrangler.example.jsonc shows the DB binding and a custom-domain route. Your copy wrangler.jsonc holds your database ID and is gitignored. The custom hostname's zone must be on the same Cloudflare account; Wrangler creates the DNS record for a custom_domain route.
drizzle/0000_class_data.sql is the initial production migration. Append future migrations rather than modifying applied SQL. migrations/ retains the individual API migrations used by the inherited regression suite.
Public GitHub pushes do not publish the app automatically. Deploy a tested source commit with npx wrangler deploy, then verify the public endpoint (/api/catalog, then create a room).
Link directly to an activity:
https://opshion.lefthanddev.com/?code=ABC234&activity=coin-sim
https://opshion.lefthanddev.com/?code=ABC234&activity=coin-real
https://opshion.lefthanddev.com/?code=ABC234&activity=pulse
Create a room in opSHion first; ABC234 is an example. Room codes belong to this app's database. Existing bookSHelf codes are not automatically migrated.
The public catalog at /api/catalog includes every scalar, tally, and record topic from functions/_lib/classdata_topics.js, with the registry IDs retained in links. Combined entry links use pulse-commute, height-pulse, and playlist. The /api/classdata/ routes retain the bookSHelf contract for numeric values, outcome tallies and structured records. The deployed book at https://oerbookshelf.app is allowed to create rooms and read or submit class data through a restricted CORS policy. Other browser origins remain blocked. Student QR links open this app directly. The book’s 5.1 pulse histogram reads the same pool as the opSHion pulse entry page.
The service stores numbers and outcome counts, not student names or email addresses. A browser keeps a random device ID; the server stores its hash scoped to the room. Clearing browser storage creates a new device, so this is a classroom exploration tool, not authenticated assessment. Room codes permit anyone who knows the code to contribute and see the shared results.
Teacher keys stay on the creating device and are never included in QR links. The service applies per-network and per-class write limits. Class data expires after 400 days and is cleaned up when new rooms are created. Unlinked record activities (alphabet, sleep, and planes) show and export one field at a time so answers cannot be matched into individual records. Trip and distance-guess activities retain their intended linked rows. Clock values appear as times and decimals stay in display units in results and CSV. Numeric results are anonymous but visible to room participants; avoid entering identifying data. This initial frontend does not expose teacher moderation or custom question authoring.
The class-data API and regression tests were extracted from the author's bookSHelf project. The bundled QR encoder retains its upstream license in web/qrcode.LICENSE.txt. No textbook chapters, media, production database identifiers, credentials, or student data are included.