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
- Enter answer, accepted, caseSensitive, trim. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- 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 field | Meaning and units | Accepted input |
|---|---|---|
| answer | Answer | Required. Text; maximum UTF-16 length 8192. |
| accepted | Accepted | Required. Array of text; maximum UTF-16 length 8192; maximum items 256. |
| caseSensitive | Case Sensitive | Required. Boolean. |
| trim | Trim | Required. Boolean. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| correct | Correct | Required. Boolean. |
| matchedIndex | Matched Index | Required. Safe integer. |
{
"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
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.