Skip to content

Main content

Answer Key Multiple Accepted Token Tool

Calculate answer key multiple accepted token from explicit caller-supplied inputs.

Loading tool…

Description

Normalize answer and each accepted token by optional trim, then optional JavaScript lowercase when caseSensitive is false.

Assessment records use item identifiers, branch labels, hierarchy references and deadline metadata. Literal matching and position counting preserve the supplied conventions without validating content, actual eligibility or semantic answer equivalence.

Normalize answer and each accepted token by optional trim, then optional JavaScript lowercase when caseSensitive is false.

When to use this tool

Use Answer Key Multiple Accepted Token when checking an explicit assessment-record or answer-token rule.

How to use the tool and how it works

  1. Enter answer, accepted, caseSensitive, trim. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. Read correct, matchedIndex. Inspect correct before interpreting the associated values.

Normalize answer and each accepted token by optional trim, then optional JavaScript lowercase when caseSensitive is false. Return the first matching index and correct = matchedIndex >= 0.1

Input fieldMeaning and unitsAccepted input
answerAnswerRequired. Text; maximum UTF-16 length 8192.
acceptedAcceptedRequired. Array of text; maximum UTF-16 length 8192; maximum items 256.
caseSensitiveCase SensitiveRequired. Boolean.
trimTrimRequired. Boolean.
Output fieldInterpretationReturned shape
correctCorrectRequired. Boolean.
matchedIndexMatched IndexRequired. Safe integer.
json
{
  "input": {
    "answer": " YES ",
    "accepted": [
      "yes",
      "true"
    ],
    "caseSensitive": false,
    "trim": true
  },
  "output": {
    "correct": true,
    "matchedIndex": 0
  }
}

Limitations and assumptions

  • A missing match returns -1. This does not perform locale-specific case folding, Unicode normalization, numeric equivalence or semantic answer grading.
  • Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.

Alternative or Complementary methods

Review the actual record structure and approved grading policy when identity, content or official outcomes matter.

References

  1. Calculation and input contract: education/answer-key-multiple-accepted-token — tool.io

Similar or alternative tools

  • Assessment Branch Item Count

    Select records whose branch label occurs in selectedBranches; return selectedRecords, distinctItems and repeatedSelectedRecords = selectedRecords-distinctItems.

  • Assessment Option Position Index

    If option is found, index is its array position plus origin; otherwise found = false and index = -1.