diff --git a/trailer.html b/trailer.html index 65eb02b..e20d540 100644 --- a/trailer.html +++ b/trailer.html @@ -246,7 +246,7 @@ return d.state === "writing" || (s && !/^(drawn|failed)/.test(s)); } function busyRun() { - return RUN && /^(writing|reviewing|revising)$/.test(String(RUN.stage || "")); + return RUN && /^(writing|reviewing|revising|judging)$/.test(String(RUN.stage || "")); } // Work happens in the worker's memory and does not survive a deploy, so a // flag saying "in progress" is only believed while it is recent. @@ -338,6 +338,30 @@ return bits.join(" · "); } + // THE WRITERS SCORE EACH OTHER. Blind, against the checklist in the guide; + // nobody marks their own script; the winner becomes head writer. + function contestHtml() { + var ready = DRAFTS.filter(function (d) { return /^ready/.test(String(d.state)) && Number(d.iteration || 1) === Number(RUN.iteration || 1); }); + if (ready.length < 2) return ""; + var c = RUN.contest, label = {}; + DRAFTS.forEach(function (d) { label[d.writer] = d.label || d.writer; }); + var btn = RUN.stage === "judging" + ? 'The writers are reading and scoring each other’s scripts… a few minutes.' + : ''; + var table = ""; + if (c && (c.ranked || []).length) { + table = '' + + c.ranked.map(function (r, i) { + var n = (r.notes || [])[0] || {}; + return ''; }).join("") + + '
scriptscorewhat the other writers said
' + (i === 0 ? '★ ' : '') + '' + esc(label[r.writer] || r.writer) + + '' + esc(r.score) + '
' + esc((r.marks || []).join(", ")) + '
+ ' + + esc(n.best || "") + '
− ' + esc(n.worst || "") + '

The highest scoring script’s writer is now the head writer (★). You can still choose another.

'; + } + return '

Which script is best?

' + table + btn + '
'; + } + // One more writer on this run: same book, same notes, nobody else pays again. var ALLWRITERS = null; function addWriterHtml() { @@ -891,7 +915,7 @@ shots.forEach(function (s) { body += shotHtml(s, voice) + insertHtml(s.id); }); DRAFTNOW = draft; - return head + guideHtml(meta) + probs + '
' + barHtml(meta) + '
' + return head + contestHtml() + guideHtml(meta) + probs + '
' + barHtml(meta) + '
' + '
' + reelHtml() + '
' + spineHtml() + cutsHtml(meta) + reviewsHtml(meta) + wholeHtml() + castHtml + propsHtml() + body; } @@ -1527,6 +1551,12 @@ } return; } + if ((el = hit("data-judge"))) { + el.disabled = true; + r = await act("judge_scripts", { run_id: runId }); + if (r) { showMsg("msg", "Every writer is reading all " + r.scripts + " scripts, without knowing whose is whose. About $" + r.usd + ".", "ok"); await load(); } + return; + } if ((el = hit("data-review"))) { el.disabled = true; r = await act("start_review", { run_id: runId }); if (r) await refresh(); return;