Skip to content

Commit c00c5c2

Browse files
fix(assessment): avoid duplicate global const ITEMS across script tags
Classic non-module scripts share one global lexical environment, so const ITEMS in the items block conflicted with const ITEMS in the main app block and threw before init(), leaving #app empty on GitHub Pages. Made-with: Cursor
1 parent 57cba49 commit c00c5c2

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

src/assessment.html

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
// ============================================================
5959
// IPIP-NEO-120 ITEMS — Johnson (2014)
6060
// ============================================================
61-
const ITEMS = [
61+
window.UNSTUCK_ITEMS = [
6262
// NEUROTICISM (N)
6363
// Facet 1: Anxiety
6464
{ num: 1, text: "Worry about things", domain: "N", facet: 1, keyed: "plus" },
@@ -228,11 +228,9 @@
228228
return Math.max(1, Math.min(5, Math.round(Number(n))));
229229
}
230230

231-
window.UNSTUCK_ITEMS = ITEMS;
232-
233231
window.buildFixtureAnswersFromFacetMeans = function (facetMeans) {
234232
const answers = {};
235-
for (const item of ITEMS) {
233+
for (const item of window.UNSTUCK_ITEMS) {
236234
const code = normalizeFacetKey(item.domain, item.facet);
237235
const T = facetMeans[code];
238236
if (T === undefined) {

0 commit comments

Comments
 (0)