Options
All
  • Public
  • Public/Protected
  • All
Menu

Module graders/FITBRegexGrader

For the FITB Regex grader, you'll need to be familiar with javascript regular expression syntax.

  • Tutorial/Documentation at https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions
  • Interactive tool for testing out regexes, really neat. https://regex101.com/ Make sure to select the "ECMAScript/Javascript" flavor on the left side.
  • Tip: Normally, the regex will match against any substring of what the student entered. If you want it to only match the WHOLE thing, use ^ and $. For example, if you're looking to match any decimal number /[\d\.]+ will match 6.2 and My answer is 6.2, whereas ^[\d\.]+$ will only match 6.2. Essentially ^ means "beginning of string" and $ means "end of string".

For now, refer to examples of existing graders. More thorough documentation coming.

Index

Type aliases

FITBRegexGradingResult: ImmutableGradingResult & { itemResults: readonly { matched: boolean; pointsEarned: number; explanation?: string }[] }
FITBRegexMatcher: { pattern: RegExp | readonly string[] | ((s: string) => boolean); points: number; explanation: string }

Type declaration

  • pattern: RegExp | readonly string[] | ((s: string) => boolean)
  • points: number
  • explanation: string
FITBRegexRubricItem: { blankIndex: number; points: number; title: string; description: string; patterns: FITBRegexMatcher[] }

Type declaration

  • blankIndex: number
  • points: number
  • title: string
  • description: string
  • patterns: FITBRegexMatcher[]
FITBRegexGraderSpecification: { grader_kind: "manual_regex_fill_in_the_blank"; rubric: readonly FITBRegexRubricItem[] }

Type declaration

  • Readonly grader_kind: "manual_regex_fill_in_the_blank"
  • Readonly rubric: readonly FITBRegexRubricItem[]

Generated using TypeDoc