abullard1 commited on
Commit
0bc8c1a
·
verified ·
1 Parent(s): 60cdced

Deploy conversion @ d2b2018-space

Browse files
Files changed (4) hide show
  1. app.js +6 -3
  2. config.js +5 -2
  3. index.html +6 -6
  4. logic.mjs +9 -0
app.js CHANGED
@@ -24,8 +24,8 @@ import { oauthLoginUrl, oauthHandleRedirectIfPresent, uploadFiles, downloadFile,
24
  // the ?v= stamp — an unversioned nested import could load a stale module.
25
  import { keyOf, latestByKey, mergeEvents, orderItems, firstUngraded as
26
  firstUngradedPure, countComplete, stampClass, nextEpoch,
27
- standsDownTo, statusOf, classifyProbe, hasScopes }
28
- from "./logic.mjs?v=960f4e5-space";
29
 
30
  // Test seam: Playwright installs window.__testHub (an in-memory hub) before
31
  // any page script runs; production never defines it, so this is one inert
@@ -485,8 +485,11 @@ function renderItem() {
485
  state.onPushSuccess = null;
486
  const item = state.items[state.order[state.idx]];
487
  window.scrollTo(0, 0); // a new item always starts at its top
 
 
 
488
  main.append(el("div", "item-id",
489
- `${keyOf(item)} · ${state.idx + 1}/${state.order.length}`));
490
  if (item.warmup) {
491
  main.append(el("p", "warmup-note",
492
  "Warm-up item — discussable with the others; real items start after these and must be graded independently."));
 
24
  // the ?v= stamp — an unversioned nested import could load a stale module.
25
  import { keyOf, latestByKey, mergeEvents, orderItems, firstUngraded as
26
  firstUngradedPure, countComplete, stampClass, nextEpoch,
27
+ standsDownTo, statusOf, classifyProbe, hasScopes, displayId }
28
+ from "./logic.mjs?v=d2b2018-space";
29
 
30
  // Test seam: Playwright installs window.__testHub (an in-memory hub) before
31
  // any page script runs; production never defines it, so this is one inert
 
485
  state.onPushSuccess = null;
486
  const item = state.items[state.order[state.idx]];
487
  window.scrollTo(0, 0); // a new item always starts at its top
488
+ const shownId = item.warmup && !CONFIG.opaqueIds
489
+ ? "warm-up" // raw corpus qids never reach the screen
490
+ : displayId(keyOf(item), state.idx, CONFIG.opaqueIds);
491
  main.append(el("div", "item-id",
492
+ `${shownId} · ${state.idx + 1}/${state.order.length}`));
493
  if (item.warmup) {
494
  main.append(el("p", "warmup-note",
495
  "Warm-up item — discussable with the others; real items start after these and must be graded independently."));
config.js CHANGED
@@ -2,7 +2,7 @@ window.CONFIG = {
2
  task: "conversion",
3
  title: "Pass 2 · rewrite fidelity — 152 items",
4
  itemsPath: "conversion_items.json",
5
- build: "960f4e5-space",
6
  landing: "You will judge whether each rewritten exam question still asks the same "
7
  + "question as the original, and whether it stands on its own without the answer "
8
  + "options. 152 items plus 3 discussable warm-ups; expect roughly 1.5–2 hours, "
@@ -47,6 +47,9 @@ window.CONFIG = {
47
  { label: "original (with options)",
48
  text: item.original + "\n\n" + item.options.map((o,i)=>String.fromCharCode(65+i)+". "+o).join("\n") },
49
  { label: "reference answer", text: item.reference_answer, ref: true },
50
- { label: "rewritten (open-ended)", text: item.rewritten, count: true },
 
 
 
51
  ],
52
  };
 
2
  task: "conversion",
3
  title: "Pass 2 · rewrite fidelity — 152 items",
4
  itemsPath: "conversion_items.json",
5
+ build: "d2b2018-space",
6
  landing: "You will judge whether each rewritten exam question still asks the same "
7
  + "question as the original, and whether it stands on its own without the answer "
8
  + "options. 152 items plus 3 discussable warm-ups; expect roughly 1.5–2 hours, "
 
47
  { label: "original (with options)",
48
  text: item.original + "\n\n" + item.options.map((o,i)=>String.fromCharCode(65+i)+". "+o).join("\n") },
49
  { label: "reference answer", text: item.reference_answer, ref: true },
50
+ { label: item.rewritten.trim() === item.original.trim()
51
+ ? "rewritten (unchanged from the original)"
52
+ : "rewritten (open-ended)",
53
+ text: item.rewritten, count: true },
54
  ],
55
  };
index.html CHANGED
@@ -5,8 +5,8 @@
5
  <meta name="viewport" content="width=device-width, initial-scale=1">
6
  <meta http-equiv="Content-Security-Policy" content="default-src 'none'; script-src 'self'; style-src 'self'; style-src-attr 'unsafe-inline'; font-src 'self'; connect-src https://huggingface.co https://*.hf.co; img-src 'self' data:; base-uri 'none'; form-action 'none'">
7
  <title>LocalGate audit</title>
8
- <link rel="stylesheet" href="style.css?v=960f4e5-space">
9
- <link rel="stylesheet" href="katex/katex.min.css?v=960f4e5-space">
10
  </head>
11
  <body>
12
  <header>
@@ -22,9 +22,9 @@
22
  <pre id="rubric-body"></pre></details>
23
  </div>
24
  <div id="controls" hidden></div>
25
- <script src="katex/katex.min.js?v=960f4e5-space"></script>
26
- <script src="katex/auto-render.min.js?v=960f4e5-space"></script>
27
- <script src="config.js?v=960f4e5-space"></script>
28
- <script type="module" src="app.js?v=960f4e5-space"></script>
29
  </body>
30
  </html>
 
5
  <meta name="viewport" content="width=device-width, initial-scale=1">
6
  <meta http-equiv="Content-Security-Policy" content="default-src 'none'; script-src 'self'; style-src 'self'; style-src-attr 'unsafe-inline'; font-src 'self'; connect-src https://huggingface.co https://*.hf.co; img-src 'self' data:; base-uri 'none'; form-action 'none'">
7
  <title>LocalGate audit</title>
8
+ <link rel="stylesheet" href="style.css?v=d2b2018-space">
9
+ <link rel="stylesheet" href="katex/katex.min.css?v=d2b2018-space">
10
  </head>
11
  <body>
12
  <header>
 
22
  <pre id="rubric-body"></pre></details>
23
  </div>
24
  <div id="controls" hidden></div>
25
+ <script src="katex/katex.min.js?v=d2b2018-space"></script>
26
+ <script src="katex/auto-render.min.js?v=d2b2018-space"></script>
27
+ <script src="config.js?v=d2b2018-space"></script>
28
+ <script type="module" src="app.js?v=d2b2018-space"></script>
29
  </body>
30
  </html>
logic.mjs CHANGED
@@ -103,3 +103,12 @@ export const hasScopes = (grantedString, required) => {
103
  const granted = new Set(String(grantedString ?? "").split(/\s+/));
104
  return required.every((scope) => granted.has(scope));
105
  };
 
 
 
 
 
 
 
 
 
 
103
  const granted = new Set(String(grantedString ?? "").split(/\s+/));
104
  return required.every((scope) => granted.has(scope));
105
  };
106
+
107
+ // On-screen item label. Some tasks must not reveal their key's structure —
108
+ // calibration keys are "qid:rep", so five repeats of one question would be
109
+ // recognisable and put the annotator under consistency pressure the design
110
+ // otherwise avoids. The STORED key is always the real one; this is display
111
+ // only, derived from the annotator's own seeded position so two repeats never
112
+ // share a visible prefix.
113
+ export const displayId = (key, position, opaque) =>
114
+ opaque ? `${opaque}-${String(position + 1).padStart(3, "0")}` : key;