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. |
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
-
<protected> search(answer) → {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