Class: spectroAnalyzer

spectroAnalyzer

Inherits from analyzerBase and provides Spectroscopy specific feedback, scoring and syntax checking.

Extends

Members

category :String

The category of the question. Example: ethers for orgnom, or empty for spectroscopy. defaults to the 'category' cookie value
Type:
  • String
Inherited From:
Source:

fclass :String

Functional Class of the Analyzer. Example: orgnom or spectroscopy,
used, in part, to determine the location of the question files. defaults to the 'fclass' cookie value
Type:
  • String
Inherited From:
Source:

questionNum :String

The question number, from the category, being analyzed. defaults to the 'question' cookie value
Type:
  • String
Inherited From:
Source:

questionScore

The question score for this question only
Source:

Methods

calcScore()

This method should be called by either spectroAnalyzer.getCorrect(), or by spectroAnalyzer.forfeitQuestion() only. It uses the cookie values to calculate the average score for the section. It keeps, in cookies, the total score and the number of questions tried and simply calculates the average. It sets the resultant average by calling analyzerBase.setScore.
Source:

checkSyntax()

Overrides analyzerBase checkSyntax
Source:
Returns:
the empty String as syntax validation is not done for spectroscopy This method is called in getFeedback(String).

<protected> clearComplete()

Clear the complete flag for the question.
Inherited From:
Source:

forfeitQuestion()

Gives the question a zero and calculates the new average for the category.
Source:

<protected> getAnswerURL() → {String}

Inherited From:
Source:
Returns:
the URL to the question File
Type
String

<protected> getCommonSearcher() → {searcher}

Inherited From:
Source:
Returns:
The first common searcher in the array of common searchers or null if no common searchers are present.
Type
searcher

<protected> getCommonSearchers() → {searcher}

Inherited From:
Source:
Returns:
[] The array of common searchers or null if no common searchers are present.
Type
searcher

getCorrect()

getCorrect() deals with all scoring. getCorrect must be called for any scoring to be be dealt with. Side affect: will calculate the score on the first and only the first correct answer.
Source:

<protected> getCorrectAnswer() → {String}

Inherited From:
Source:
Returns:
for the reqular expression
Type
String

<protected> getCorrectMsg() → {String}

Inherited From:
Source:
Returns:
the Message from the question file for a correct answer.
Type
String

<protected> getDifficulty() → {String}

Inherited From:
Source:
Returns:
representing the relative path to the image to use for the difficulty img on the question page. The path is built based on the difficulty value in the question file.
Type
String

getFeedback(answer)

Overrides analyzerBase getFeedback to provide feedback for Spectroscopy answers.
Parameters:
Name Type Description
answer String
Source:
Returns:
a string of feedback based on the answer content. This method should be called from the presentation layer.

getHelpURL() → {String}

Getter for the Help URL from the question file.
Inherited From:
Source:
Returns:
the help URL
Type
String

getJme()

Inherited From:
Source:
Returns:
the JME string found in the question file. access protected

<protected> getLociSearcher() → {lociSearcher}

Inherited From:
Source:
Returns:
the loci searcher for the question
Type
lociSearcher

<protected> getMaxAttempts()

Inherited From:
Source:
Returns:
the maximum attempts for this question. Used to determine when to show the solution and allow another question to be selected.

<protected> getQuestionFile()

AJAX (made globally Synchronous) to get the question file. we have to do synchronous because the jsmeonLoand function needs this.jme to be set and available before it(jsmeOnloand) is called. This method should be called from the children of analyzerBase in their constructors. After construction, children should only use the loadQuestionFile(qClass, category,qnum) method.
Inherited From:
Source:
See:

<protected> getScore() → {Number}

Inherited From:
Source:
Returns:
the Question Score if the question was completed zero otherwise.
Type
Number

<protected> getSearchers() → {Array.<searcher>}

Inherited From:
Source:
Returns:
the array of Searchers other than common, correct and loci.
Type
Array.<searcher>

getTokens()

returns the tokens as parsed by Smidge.js
Source:

<protected> getType() → {String}

Inherited From:
Source:
Returns:
the type message from the question file.
Type
String

<protected> isCompleted() → {Boolean}

Inherited From:
Source:
Returns:
Type
Boolean

<protected> isCorrect(answer) → {Boolean}

checks that answer is an exact case insensitive match with any one of the acceptable answers found in the question file.
Parameters:
Name Type Description
answer String a string trimmed of leading and trailing whitespace prior to calling this method.
Inherited From:
Source:
Returns:
true if it is an exact match.
Type
Boolean

<protected> loadError()

Global AJAX callback for failed AJAX requests. Most likely cause of the failure would be file not found.
Inherited From:
Source:
Throws:
  • config.AF_LOAD_ERROR;
    Type
    String
  • 'File Not Fund Error'

<protected> loadQuestionFile(qClass, category, qnum)

Reloads the analyzer with a new questiod, based on functional class, category and qnum. Resets the the cookies for each parameter if the parameter is not NUll. If this method is called with all Null parameters it will reload the current question file.
Parameters:
Name Type Description
qClass string
category string
qnum string
Inherited From:
Source:

<protected> reset()

Called by loadQuestion file. Resets the class in preperation to make a call to getQuestionFile so that parseQuestionFile will populate the searchers and other information properly from the new question file information.
Inherited From:
Source:

<protected> setCategory(value)

Sets the Category
Parameters:
Name Type Description
value String
Inherited From:
Source:

<protected> setComplete()

Set the complete flag for the question.
Inherited From:
Source:

<protected> setfclass(value)

Sets the Functional Class
Parameters:
Name Type Description
value String
Inherited From:
Source:

<protected> setQuestionNum(value)

Sets the question number (for the cateory)
Parameters:
Name Type Description
value String
Inherited From:
Source:

<protected> setScore(value)

Set the question score. Used by inheriting classes.
Parameters:
Name Type Description
value Number
Inherited From:
Source:

<protected> setURL(value)

Sets the URL for the question file location. Use with caution
Parameters:
Name Type Description
value String
Inherited From:
Source: