Commit ·
239028e
1
Parent(s): a081612
Deploy: name a quiz retry after the question it re-asks
Browse filesFiles changed (2)
1223 unmodified lines12241225122612271228122912301223 unmodified linesi = wrong[0]st, co, fb = quiz[i]tries[i] += 1ans = await _ask_one(container, "### 🔁 **Quiz** — Try again", st, co, fb, image=_quiz_icon(i))correct = bool(ans == co)capped = tries[i] >= MAX_QUIZ_ATTEMPTSresponses.append(dict(quizIndex=i, position=-1, statement=st,1223 unmodified lines1224122512261227122812291230123112321233123412351223 unmodified linesi = wrong[0]st, co, fb = quiz[i]tries[i] += 1# Name the retry after the item it re-asks. Without this every re-ask landed in# the timing file as plain "quiz", so a row saying corr 0 could not be tied to the# question it belonged to, and two retries of two different items looked alike.ans = await _ask_one(container, "### 🔁 **Quiz** — Try again", st, co, fb,image=_quiz_icon(i),screen_name=f"quiz_q{i}_r{tries[i]}", screen_index=-1)correct = bool(ans == co)capped = tries[i] >= MAX_QUIZ_ATTEMPTSresponses.append(dict(quizIndex=i, position=-1, statement=st,
185 unmodified lines186187188185 unmodified lineswith caplog.at_level("WARNING"):asyncio.run(body())assert any("gitlab is down" in r.message for r in caplog.records)185 unmodified lines186187188189190191192193194195196197198199200201185 unmodified lineswith caplog.at_level("WARNING"):asyncio.run(body())assert any("gitlab is down" in r.message for r in caplog.records)def test_a_quiz_retry_names_the_question_it_re_asks():# The re-ask loop called _ask_one with no screen_name, so every retry was recorded as# plain "quiz". Two retries of two different items were then indistinguishable in the# timing file. Seen in the 2026-11-03 pilot: two rows named "quiz", corr 1, no item.import resrc = open("experiment_structure.py").read()retry = src[src.index("while wrong:"):src.index("nicewebrl.clear_element(container)",src.index("while wrong:"))]assert "_ask_one(" in retryassert re.search(r'screen_name=f"quiz_q\{i\}_r\{tries\[i\]\}"', retry), \"the quiz retry must name the item and the attempt"
experiment_structure.py+6-1
test_screen_timing.py+13