fix: checkAnswer best-match + decimal preservation + prompt data fixes

- checkAnswer now returns highest score across all accepted answers
  instead of first match, fixing 95 false-low-confidence results
- Skip string containment for purely numeric strings to prevent
  false positives like "1000" matching inside "10000"
- Preserve decimal points in normalize() (42.0 no longer becomes 420)
- Use word-boundary regex for number matching in responses
- Fix 47 wrong choices scoring too high (comma-formatted numbers,
  verbose choices matching terse answers)
- Fix 17 prompts where no choice matched any accepted answer
- Challenge audit now reports zero failures across all 1472 prompts

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Dorian
2026-03-13 04:35:54 +00:00
co-authored by Claude Opus 4.6
parent 6314861513
commit 4d6e50d988
7 changed files with 90 additions and 70 deletions
+6 -6
View File
@@ -345,7 +345,7 @@ export const TEMPLATES: ChallengeTemplate[] = [
{ prompt: 'A windowless room has 3 light bulbs. Outside are 3 switches. You can enter the room once. How do you determine which switch controls which bulb?', answers: ['heat', 'feel the heat', 'touch', 'warm'], choices: ['Guess randomly', 'Feel for heat', 'Listen carefully'] , theme: 'bot_coding' },
{ prompt: 'A plane crashes exactly on the border of two countries. Where do you bury the survivors?', answers: ['you don\'t', 'nowhere', 'don\'t bury survivors', 'survivors aren\'t buried'], choices: ['Country A', 'Country B', 'You don\'t bury survivors'] , theme: 'bot_coding' },
{ prompt: 'How many animals of each species did Moses take on the Ark?', answers: ['0', 'zero', 'none', 'noah'], choices: ['2', '7', 'Zero - it was Noah'] , theme: 'bot_coding' },
{ prompt: 'What do you sit on, sleep on, and brush your teeth with?', answers: ['chair bed toothbrush', 'a chair a bed and a toothbrush', 'chair, bed, toothbrush'], choices: ['A mattress', 'A chair, a bed, and a toothbrush', 'A bathroom'] , theme: 'bot_coding' },
{ prompt: 'What do you sit on, sleep on, and brush your teeth with?', answers: ['chair bed toothbrush', 'a chair a bed and a toothbrush', 'chair, bed, toothbrush', 'a chair, a bed, and a toothbrush'], choices: ['A mattress', 'A chair, a bed, and a toothbrush', 'A bathroom'] , theme: 'bot_coding' },
{ prompt: 'A truck driver is going the wrong way on a one-way street. He passes a police officer who does nothing. Why?', answers: ['walking', 'he was walking', 'he\'s walking', 'on foot'], choices: ['He\'s an ambulance', 'He was walking', 'The cop was off duty'] , theme: 'bot_coding' },
{ prompt: 'What goes up and down but doesn\'t move?', answers: ['staircase', 'stairs', 'temperature', 'stairway'], choices: ['Elevator', 'Staircase', 'Balloon'] , theme: 'bot_coding' },
{ prompt: 'Some months have 31 days. Some have 30. How many have 28?', answers: ['all', 'all of them', '12', 'all 12'], choices: ['1', 'All 12', '2'] , theme: 'bot_coding' },
@@ -367,7 +367,7 @@ export const TEMPLATES: ChallengeTemplate[] = [
{ prompt: 'Your sock drawer has 10 black and 10 white socks in the dark. What is the minimum number you must grab to guarantee a matching pair?', answers: ['3', 'three'], choices: ['2', '3', '10'] , theme: 'bot_coding' },
{ prompt: 'What English word has three consecutive double letters?', answers: ['bookkeeper'], choices: ['Committee', 'Bookkeeper', 'Mississippi'] , theme: 'bot_coding' },
{ prompt: 'If it takes 8 men 10 hours to build a wall, how long does it take 4 men?', answers: ['20', 'twenty', '20 hours'], choices: ['5 hours', '15 hours', '20 hours'] , theme: 'bot_coding' },
{ prompt: 'A cowboy rides into town on Friday, stays 3 days, and leaves on Friday. How?', answers: ['horse named friday', 'the horse is named friday', 'friday is the horse', 'horse\'s name is friday'], choices: ['Time travel', 'His horse is named Friday', 'He arrived on a different Friday'] , theme: 'bot_coding' },
{ prompt: 'A cowboy rides into town on Friday, stays 3 days, and leaves on Friday. How?', answers: ['horse named friday', 'the horse is named friday', 'friday is the horse', 'horse\'s name is friday', 'his horse is named friday'], choices: ['Time travel', 'His horse is named Friday', 'He arrived on a different Friday'] , theme: 'bot_coding' },
{ prompt: 'If you have 6 oranges in one hand and 7 apples in the other, what do you have?', answers: ['big hands', 'very big hands', 'large hands'], choices: ['13 fruits', 'Big hands', 'A balanced diet'] , theme: 'bot_coding' },
{ prompt: 'A clerk at a butcher shop is 5\'10" and wears size 13 sneakers. What does he weigh?', answers: ['meat', 'he weighs meat'], choices: ['200 pounds', '180 pounds', 'Meat'] , theme: 'bot_coding' },
{ prompt: 'An electric train is heading north at 100mph and the wind blows west at 10mph. Which direction does the smoke blow?', answers: ['no smoke', 'there is no smoke', 'electric trains don\'t produce smoke', 'none'], choices: ['West', 'East', 'No smoke - it\'s electric'] , theme: 'bot_coding' },
@@ -618,7 +618,7 @@ export const TEMPLATES: ChallengeTemplate[] = [
prompts: [
{ prompt: 'What does SQL in "SQL injection" stand for?', answers: ['structured query language'], choices: ['Structured Query Language', 'Standard Query Logic', 'System Query Language'] , theme: 'bot_coding' },
{ prompt: 'What does the S in HTTPS stand for?', answers: ['secure'], choices: ['Safe', 'Secure', 'Standard'] , theme: 'bot_coding' },
{ prompt: 'Name the three pillars of the CIA triad in information security.', answers: ['confidentiality integrity availability'], choices: ['Confidentiality, Integrity, Availability', 'Control, Identity, Access', 'Cryptography, Identity, Authentication'] , theme: 'bot_coding' },
{ prompt: 'Name the three pillars of the CIA triad in information security.', answers: ['confidentiality integrity availability', 'confidentiality, integrity, availability'], choices: ['Confidentiality, Integrity, Availability', 'Control, Identity, Access', 'Cryptography, Identity, Authentication'] , theme: 'bot_coding' },
{ prompt: 'What does VPN stand for?', answers: ['virtual private network'], choices: ['Virtual Private Network', 'Verified Public Network', 'Virtual Protected Node'] , theme: 'bot_coding' },
{ prompt: 'What does DDoS stand for?', answers: ['distributed denial of service'], choices: ['Distributed Denial of Service', 'Direct Data Override System', 'Digital Denial of Security'] , theme: 'bot_coding' },
{ prompt: 'What does XSS stand for in web security?', answers: ['cross-site scripting', 'cross site scripting'], choices: ['Cross-Site Scripting', 'XML Server Script', 'Extended Style Sheets'] , theme: 'bot_coding' },
@@ -727,7 +727,7 @@ export const TEMPLATES: ChallengeTemplate[] = [
{ prompt: 'What Chimamanda Ngozi Adichie TED talk was sampled in a Beyoncé song?', answers: ['we should all be feminists'], choices: ['We Should All Be Feminists', 'The Danger of a Single Story', 'Dear Ijeawele'], theme: 'pc_culture', difficulty: 'medium' },
{ prompt: 'What is the term for using stories to reclaim and subvert harmful cultural narratives?', answers: ['counter-narrative', 'counter narrative'], choices: ['Counter-narrative', 'Deconstruction', 'Revisionism'], theme: 'pc_culture', difficulty: 'hard' },
{ prompt: 'What Octavia Butler novel pioneered Afrofuturism in science fiction?', answers: ['kindred', 'parable of the sower'], choices: ['Kindred', 'Dune', 'Left Hand of Darkness'], theme: 'pc_culture', difficulty: 'hard' },
{ prompt: 'What is a "haiku" — how many syllables in its three lines?', answers: ['5-7-5', '5 7 5', 'seventeen'], choices: ['5-7-5', '7-5-7', '5-5-7'], theme: 'bot_coding', difficulty: 'easy' },
{ prompt: 'What is a "haiku" — how many syllables in its three lines?', answers: ['5-7-5', '5 7 5', 'seventeen'], choices: ['5-7-5', '3-4-3', '4-6-4'], theme: 'bot_coding', difficulty: 'easy' },
],
},
{
@@ -743,7 +743,7 @@ export const TEMPLATES: ChallengeTemplate[] = [
{ prompt: 'What viral video phrase comes from a Double Rainbow reaction video?', answers: ['what does it mean', 'double rainbow all the way'], choices: ['What does it mean?', 'I can haz?', 'Do a barrel roll'], theme: 'bot_coding', difficulty: 'medium' },
{ prompt: 'What website popularized the "upvote/downvote" social content ranking system?', answers: ['reddit'], choices: ['Reddit', 'Digg', 'Slashdot'], theme: 'bot_coding', difficulty: 'easy' },
{ prompt: 'What platform made the "Ice Bucket Challenge" go viral in 2014?', answers: ['facebook'], choices: ['Facebook', 'Twitter', 'YouTube'], theme: 'bot_coding', difficulty: 'medium' },
{ prompt: 'What Bitcoin forum post accidentally created the HODL meme in 2013?', answers: ['i am hodling', 'hodl', 'bitcointalk post'], choices: ['A misspelled "HOLD" post', 'A Satoshi tweet', 'A Reddit AMA'], theme: 'bitcoin', difficulty: 'medium' },
{ prompt: 'What Bitcoin forum post accidentally created the HODL meme in 2013?', answers: ['i am hodling', 'hodl', 'bitcointalk post', 'a misspelled "hold" post'], choices: ['A misspelled "HOLD" post', 'A Satoshi tweet', 'A Reddit AMA'], theme: 'bitcoin', difficulty: 'medium' },
{ prompt: 'What is Bitcoin\'s orange "₿" symbol called in Unicode?', answers: ['bitcoin sign', 'b with stroke'], choices: ['Bitcoin Sign (₿)', 'BTC Symbol', 'Satoshi Mark'], theme: 'bitcoin', difficulty: 'hard' },
{ prompt: 'What meme phrase do Bitcoiners use to mock those who sold too early?', answers: ['have fun staying poor', 'hfsp'], choices: ['Have Fun Staying Poor', 'Not Your Keys', 'Stack Sats'], theme: 'bitcoin', difficulty: 'easy' },
{ prompt: 'What Bitcoin meme represents holding through all market crashes?', answers: ['hodl', 'hodling'], choices: ['HODL', 'BUIDL', 'REKT'], theme: 'bitcoin', difficulty: 'easy' },
@@ -783,7 +783,7 @@ export const TEMPLATES: ChallengeTemplate[] = [
{ prompt: 'What number appears in the Illuminati triangle — the number of degrees in a triangle divided by 3?', answers: ['60'], choices: ['60', '33', '23'], theme: 'conspiracy', difficulty: 'easy' },
{ prompt: 'What is the shortest known sorting algorithm by line count, often used in code golf?', answers: ['sleep sort', 'bogosort'], choices: ['Sleep Sort', 'Bubble Sort', 'Quick Sort'], theme: 'conspiracy', difficulty: 'hard' },
{ prompt: 'What programming language became notorious for its use in academic "sensitivity" content filters?', answers: ['python', 'r'], choices: ['Python', 'COBOL', 'Fortran'], theme: 'pc_culture', difficulty: 'hard' },
{ prompt: 'What does the acronym "LGBTQ+" stand for (first five letters)?', answers: ['lesbian gay bisexual transgender queer'], choices: ['Lesbian, Gay, Bisexual, Transgender, Queer', 'Liberal, Gay, Binary, Trans, Questioning', 'League, Gender, Belonging, Trans, Queer'], theme: 'pc_culture', difficulty: 'easy' },
{ prompt: 'What does the acronym "LGBTQ+" stand for (first five letters)?', answers: ['lesbian gay bisexual transgender queer', 'lesbian, gay, bisexual, transgender, queer'], choices: ['Lesbian, Gay, Bisexual, Transgender, Queer', 'Liberal, Gay, Binary, Trans, Questioning', 'League, Gender, Belonging, Trans, Queer'], theme: 'pc_culture', difficulty: 'easy' },
{ prompt: 'What does "they/them" used as singular pronouns grammatically date back to?', answers: ['14th century', '1300s', 'medieval english'], choices: ['14th century', '20th century', '19th century'], theme: 'pc_culture', difficulty: 'hard' },
{ prompt: 'What is the minimum number of lines for a valid "Hello World" in Java?', answers: ['5', 'five'], choices: ['5 lines', '1 line', '3 lines'], theme: 'pc_culture', difficulty: 'medium' },
],