Constructor
new Marker(parent, conf)
Marker to Tests
Constructor for creating "Marker" objects. It supports a parameter with a configuration object with certain properties or attributes.
Parameters:
Name | Type | Description |
---|---|---|
parent |
Object | "Test" object |
conf |
Object | Configuration object (see |
- Source:
- See:
Members
conf :Object
Configuration Options
a Javascript object with follow structure:
{ container: "divMarker", digits: 4, precision: 2, nQ: 1, nA: 4, charset: "utf-8" }
Type:
- Object
- Source:
container :Object:HTMLElement
clone from conf.container
this must be equal to parent.markerContainer
Type:
- Object:HTMLElement
- Source:
currentQuestion :number
what is the current Question ?
Type:
- number
- Source:
element :Object:HTMLElement
own DOM element
Type:
- Object:HTMLElement
- Source:
num :number
Number of this Marker.
This is not equal to 'this.id' ( from 0 to +Infinity)
Type:
- number
- Source:
results :Object
counter for answers solution
These are only properties names, don't are booleans, don't are primitive types.
Your structure is:
{"true": 0, "false": 0, "null": 0, "blank": 0}
Type:
- Object
- Source:
root :namespace:testron
"testron" Ancestor object
Type:
- namespace:testron
- Source:
Methods
calcScore() → {number}
Calculates the solution for total score
- Source:
Returns:
updated score
- Type
- number
coefficientFailures() → {number}
Calculates the failures coefficient
It's based on total number of Questions and Answers. This coefficient will apply as multiplicand to the False Answers
- Source:
Returns:
failures coefficient
- Type
- number
coefficientSuccesses() → {number}
Calculates the successes coefficient
It's based on total Questions number. This coefficient will apply as multiplicand to the True Answers
- Source:
Returns:
successes coefficient
- Type
- number
filterConf(conf)
Filter the Configuration Options
The Configuration Options will are get from parent ("Test"), if not exists
Parameters:
Name | Type | Description |
---|---|---|
conf |
Object | Configuration object |
- Source:
- See:
filterDigits()
Filter a number to passed parameters.
It is used to filter a number to configuration properties: 'precision' and 'digits number'
- Source:
plusBlank() → {number}
Sum one to "blank" object counter
- Source:
Returns:
Return the current updated counter
- Type
- number
plusFalse() → {number}
Sum one to "false" object counter
- Source:
Returns:
Return the current updated counter
- Type
- number
plusNull() → {number}
Sum one to "null" object counter
- Source:
Returns:
Return the current updated counter
- Type
- number
plusTrue() → {number}
Sum one to "true" object counter
- Source:
Returns:
Return the current updated counter
- Type
- number
scoreFailures() → {number}
Calculates the score for False Answers
- Source:
Returns:
Failures score
- Type
- number
scoreSuccesses() → {number}
Calculates the score for True Answers
- Source:
Returns:
Successes score
- Type
- number
toHtml() → {Object:HTMLElement}
Create the HTML-UI
Create the HTML-UI for this Marker and return it as HTMLElement (HTMLUlElement)
- Source:
Returns:
- Type
- Object:HTMLElement
update(Object)
Updates the counters
Parameters:
Name | Type | Description |
---|---|---|
Object |
Object:Question | Question |
- Source: