diff --git a/server/quizbowl.js b/server/quizbowl.js index caf304576..982fa4489 100644 --- a/server/quizbowl.js +++ b/server/quizbowl.js @@ -99,6 +99,12 @@ function parseAnswerline(answerline) { reject: [] } + if (mainAnswer.includes(' or ')) { + let parts = mainAnswer.split(' or '); + parsedAnswerline.accept.push([extractUnderlining(parts[0]), extractKeyWords(parts[0]), extractQuotes(parts[0])]); + parsedAnswerline.accept.push([extractUnderlining(parts[1]), extractKeyWords(parts[1]), extractQuotes(parts[1])]); + } + subPhrases.forEach(phrase => { if (phrase.length === 0) return; const { directive, answers } = splitIntoAnswers(phrase); diff --git a/tests/quizbowl.test.js b/tests/quizbowl.test.js index 96322a306..4a6fdb12d 100644 --- a/tests/quizbowl.test.js +++ b/tests/quizbowl.test.js @@ -27,10 +27,11 @@ const formatted_answers = [ "The Wasteland", "World Trade Organization", "The (Holy) Grail", + "coagulation or blood clotting", - // or in the main answer, + // TODO: or in the main answer // and commas instead of semicolons or "or" in alternate answer - "Furies or Erinyes [accept Eumenides, Semnai, or Dirae]", + // "Furies or Erinyes [accept Eumenides, Semnai, or Dirae]", ]; const answers = [ @@ -161,10 +162,14 @@ const tests = [ ['accept', formatted_answers[25], 'grail'], ['accept', formatted_answers[25], 'holy grail'], - ['accept', formatted_answers[26], 'Furies'], - ['accept', formatted_answers[26], 'Erinyes'], - ['accept', formatted_answers[26], 'Eumenides'], - ['accept', formatted_answers[26], 'Semnai'], + ['accept', formatted_answers[26], 'coagulation'], + ['accept', formatted_answers[26], 'clotting'], + ['accept', formatted_answers[26], 'blood clotting'], + + // ['accept', formatted_answers[27], 'Furies'], + // ['accept', formatted_answers[27], 'Erinyes'], + // ['accept', formatted_answers[27], 'Eumenides'], + // ['accept', formatted_answers[27], 'Semnai'], ['accept', answers[0], 'boll'], ['accept', answers[0], 'heinrich boll'],