Class: searcher

searcher

A supporting class used to check answers against the values that were parsed from the question file. It can test the answer, check for an exact match and return positive and negative messages based on the testing.

It serves as a base class for other inheriting searchers. (except lociSearcher).

new searcher(regEx, foundMsg, notFoundMsg)

Constructor for a new Searcher
Parameters:
Name Type Description
regEx RegExp the regular expression used to test the answers with.
foundMsg String the message to return when the test is true.
notFoundMsg String the message to return when the test is false.
Source:
Tutorials:
See:

Methods

getfoundMsg() → {String}

Source:
Returns:
Type
String

getNotFoundMsg() → {String}

Source:
Returns:
Type
String

getRegExp() → {RegExp}

Source:
Returns:
Type
RegExp

getRegExpString() → {String}

Source:
Returns:
Type
String
Uses its regular expression to test an answer and will return the approriate message from the question file.
Parameters:
Name Type Description
answer String the input to test
Source:
Returns:
Type
String

<protected> test(answer,) → {Booean}

Tests an answer to determine its correctness.
Parameters:
Name Type Description
answer, String the input to test
Source:
Returns:
True if the answer is correct. False otherwise.
Type
Booean