Skip to content

obook/TeXify-Plickers

Repository files navigation

TeXify-Plickers

TeXify-Plickers logo

TeXify-Plickers renders mathematics inside Plickers, the classroom polling tool. Write LaTeX, MathML, or AsciiMath directly in your questions and answers, and the script displays them as proper formulas in the editor preview and in the live view your students see. Rendering relies on MathJax.

TeXify-Plickers is not a formula editor: you need to know the notation you use (LaTeX, MathML, or AsciiMath).

Screenshots

Question as typed in the Plickers editor:

Raw LaTeX code in the Plickers question editor

The same question rendered in the live view:

Rendered mathematics in the Plickers live view

Features

  • Inline rendering with $$ ... $$ delimiters, the notation chosen by Plickers. The historical [; ... ;] delimiters remain supported for questions written with earlier versions.
  • Accepts LaTeX, MathML, and AsciiMath input (MathJax TeX-MML-AM_CHTML configuration).
  • Adjustable font sizes for the question body and the answer choices.
  • Light on resources: the script only asks MathJax to typeset when the page contains unrendered math, and it never runs two passes at once.
  • Secure loading: MathJax 2.7.9 is fetched from the cdnjs CDN with a subresource integrity (SRI) hash, so a tampered file will not run.

Installation

  1. Install the ViolentMonkey extension for Firefox or ViolentMonkey for Chrome. Other userscript managers such as Tampermonkey or Greasemonkey should work as well.
  2. Install the TeXify-Plickers user script: opening the link is enough, your userscript manager will offer to install it.
  3. Open or reload plickers.com. The script starts automatically and logs a [TeXify-Plickers] STARTED line in the browser console.

Usage

Wrap your math in $$ ... $$, anywhere in a question or in an answer choice:

What is the domain of the function $$ f $$ defined by:
$$ f(x) = \sqrt{ (2x-1)(3x+1) - (2x-1)(x-2) } $$ ?

Formulas render inline, within the flow of the sentence, so they stay visible in every Plickers view, including the one-line rows of the library list.

Notes:

  • The historical [; ... ;] delimiters still work, so questions written with earlier versions of TeXify-Plickers keep rendering. They are deprecated: prefer $$ ... $$ for new questions.
  • Single dollar signs ($ ... $) are deliberately not interpreted, so a price such as 5$ never turns into math by accident. To display a literal dollar sign inside a formula context, escape it: \$.
  • The rendering runs in your browser only. Students looking at the projected live view see the formulas because the live view runs in your browser too; the Plickers servers never see the rendered output.

Settings

The main settings sit at the top of the script, editable from your userscript manager:

Variable Default Purpose
QUESTION_TEXT_SIZE "32px" Font size applied to the question body.
CHOICES_TEXT_SIZE "24px" Font size applied to the answer choices.
debugtexify false Verbose console logging for troubleshooting.

How it works

The script injects a MathJax configuration block and the MathJax 2.7.9 loader into plickers.com pages, then checks the page every 3 seconds. When it finds text containing unrendered delimiters, it queues a typeset pass; otherwise it does nothing, so an idle Plickers tab costs nearly nothing. Font sizes are reapplied only when Plickers resets them.

Security considerations

The script adds a <script> element pointing to a version-pinned MathJax file on the cdnjs CDN (cdnjs.cloudflare.com). Since version 18, this element carries an integrity hash: if the CDN, a DNS resolver, or any equipment on the path serves a file that differs from the expected bytes, the browser refuses to execute it. MathJax itself then loads its own components (fonts, extensions) from the same CDN.

Version 18 also upgraded MathJax from 2.7.1 to 2.7.9, which fixes CVE-2018-1999024, a cross-site scripting vulnerability in the \unicode{} macro that a maliciously crafted question could have triggered.

If your network blocks the CDN (common on school networks), the script detects the failure, reports it once in the console, and stops instead of retrying forever.

Troubleshooting

  • Nothing renders: open the browser console (F12) and look for [TeXify-Plickers] lines. A MATHJAX COULD NOT BE LOADED message means your network blocks cdnjs.cloudflare.com.
  • A formula stays as raw text: check the delimiters. Single dollars are not supported; use $$ ... $$ (or the legacy [; ... ;]).
  • Wrong font size: adjust QUESTION_TEXT_SIZE and CHOICES_TEXT_SIZE at the top of the script.

Repository layout

Directory Status Content
user-script/ Maintained The ViolentMonkey/Greasemonkey user script (version 18). This is the recommended way to use TeXify-Plickers.
web-extension/ Legacy A WebExtension variant. Its selectors target the pre-2018 Plickers interface and need a rewrite before use.
firefox-addon/ Legacy The original Firefox SDK add-on, kept for reference.

Changelog

Version 18

  • Upgrade MathJax to 2.7.9 (fixes CVE-2018-1999024) and pin it with an SRI hash.
  • Make $$ ... $$ the recommended delimiter pair, rendered inline; [; ... ;] is deprecated but still supported for existing questions.
  • Configure MathJax before it loads, removing a race that could leave formulas unrendered.
  • Detect CDN load failures and stop cleanly instead of polling forever.
  • Skip typeset passes when the page contains no new math; rewrite font sizes only when they change.
  • Resize answer choices during question editing, not only once all choices are complete.

Older versions (17 and below) are documented in the Git history.

License

MIT


Animated Plickers card

About

Add mathematics in Plickers.

Resources

License

Stars

7 stars

Watchers

3 watching

Forks

Packages

 
 
 

Contributors