The WeBWorK script and the SCORM adapter are the last real uses of jQuery on an HTML page, and Runestone no longer needs it
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 55/100
- Tipo di issue
- Refactoring
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- javascript
- Ambito
- backend-api-design, frontend
Direzione di ricerca
Read js/src/pretext-webwork.js and js/ptx_scorm_events.js, focusing on handleWW, WWshowCorrect, and installWeBWorKAjaxIntercept; compare the documented Runestone event handling at the referenced commit. Replace the page's jQuery request and event hooks with the described native events, preserve the SCORM check-only behavior, then rebuild js/dist/pretext-webwork.js and js/dist/ptx_scorm_events.js. Done means PreTeXt's page scripts no longer rely on page jQuery while iframe jQuery calls still work.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
What happens
Two scripts depend on the jQuery that every HTML page loads at xsl/pretext-html.xsl, line 14892, where the comment says it is "Required by the WeBWorK integration scripts and by Runestone". Line numbers at ac611425.
js/src/pretext-webwork.js:
- line 153, in
handleWW, sends the problem form with$.post(url, ..., "json")(the call closes at line 489); - line 337, also in
handleWW, fires$("body").trigger('runestone_ww_check', data)after a check, and line 497, inWWshowCorrect, fires$("body").trigger("runestone_show_correct", {...}).
Lines 471-472 and 560 call iframe.contentWindow.jQuery, the copy the WeBWorK server loads inside the problem iframe, and are not affected.
js/ptx_scorm_events.js, in installWeBWorKAjaxIntercept (lines 1724-1816, SCORM packages only), registers jQuery's global ajaxSend and ajaxComplete handlers to catch the check submissions made by that $.post, and retries at load when window.jQuery is not yet defined. The comment at line 1715 says jQuery "is loaded by the Runestone bundle asynchronously", which is no longer the case.
Runestone no longer needs the page's jQuery. In RunestoneInteractive/rs at 31fbb2b7 (2026-11-03), bases/rsptx/interactives/runestone/webwork/js/webwork.js lines 213-247 take the payload from either a jQuery event's extra argument or a native event's detail, and register with addEventListener when window.jQuery is absent; no component source there imports jQuery, and the webpack configuration lists it only as an external a page may provide. SageCell bundles its own copy.
Once this and #3301 are done, nothing of PreTeXt's own references the page's jQuery.
Suggested change
$.postbecomesfetchwithmethod: "POST", the same URL-encoded body, andresponse.json(); the callback body is unchanged.- The two
triggercalls becomedocument.body.dispatchEvent(new CustomEvent("runestone_ww_check", { detail: data })), and likewise forrunestone_show_correct. Runestone's handler readsdetailwhen no extra argument arrives. - The SCORM intercept listens for a native event instead of jQuery's AJAX events:
pretext-webwork.jsdispatches one event, saypretext_ww_response, carrying the action and the parsed response indetailafter every successful fetch, andinstallWeBWorKAjaxInterceptbecomes a plainaddEventListenerfor it, keeping its check-only filter. Theloadretry and the stale comment go. - Rebuild
js/dist(pretext-webwork.jsandptx_scorm_events.js).
Environment: commit ac611425 (2026-11-03); Runestone at 31fbb2b7 (2026-11-03).
Claude Fable 5.1, acting as a coding assistant for Rob Beezer
- Lingua principale
- XSLT
- Stelle
- 466
- Fork
- 251
- Merge medio
- 4m
- PR unite (30g)
- 13
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di PreTeXtBook/pretext
-
The print preview leaves writing space short by the margins of hidden headers, footers and solutionsAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
PreTeXtBook/pretext#3329 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 82/100
PreTeXtBook/pretext#3305 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
PreTeXtBook/pretext#3297 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
PreTeXtBook/pretext#3285 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
PreTeXtBook/pretext#3283 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di PreTeXtBook/pretext
Issue simili
-
adapter bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
Olanetsoft/agent-lookout#353 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
I maintainer di solito rispondono entro 1 giorno
-
notify: voice_queue rows are deleted only at startup, so a hub that stays up grows it without boundAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
mattabate/life-distributable#232 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 86/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
sfbrigade/pocket-gardens#60 ·
I maintainer di solito rispondono entro 5 giorni