feat: convert all human fights to multiple choice, remove text input
Creative challenges (roast_battle, creative_writing, meme_war, code_golf, wrestling_match) now auto-generate multiple choice options from per-type response pools: 1 good answer + 3 weaker distractors. The free text input UI is commented out but preserved for future use. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
4dc350dc9e
commit
3c95adb545
@@ -157,7 +157,7 @@ const CREATIVE_POOLS: Record<string, { good: string[]; medium: string[]; bad: st
|
||||
],
|
||||
bad: [
|
||||
"print('hello world')",
|
||||
"pass # TODO: implement",
|
||||
"x=input();print(len(x))",
|
||||
"x = 42 # the answer",
|
||||
"return True # ship it",
|
||||
"// no idea what to write",
|
||||
@@ -200,8 +200,8 @@ function generateChoices(challenge: Challenge): string[] {
|
||||
// Text answer — pick distractors from same challenge type
|
||||
const pool = getAnswerPool(challenge.type)
|
||||
const correctLower = challenge.answers.map(a => a.toLowerCase())
|
||||
const candidates = pool.filter(a => !correctLower.includes(a.toLowerCase()))
|
||||
shuffle(candidates)
|
||||
let candidates = pool.filter(a => !correctLower.includes(a.toLowerCase()))
|
||||
candidates = shuffle(candidates)
|
||||
|
||||
if (candidates.length >= 2) {
|
||||
return shuffle([correct, candidates[0], candidates[1]])
|
||||
@@ -314,3 +314,10 @@ export function getPendingChallenge(
|
||||
choices: entry.choices,
|
||||
}
|
||||
}
|
||||
|
||||
/** Get the accepted answers for a pending challenge (for correctness feedback) */
|
||||
export function getPendingAnswers(fightId: string, botId: string): string[] | undefined {
|
||||
const key = `${fightId}:${botId}`
|
||||
const entry = pending.get(key)
|
||||
return entry?.challenge.answers
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user