Class: Marker

Marker

A class to build Markers for Tests, configurable and dynamically

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 conf)

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:

id :string

Exclusive id (+ or -)

Type:
  • string
Source:

intents :number

it counts the intents

Type:
  • number
Source:

num :number

Number of this Marker.

This is not equal to 'this.id' ( from 0 to +Infinity)

Type:
  • number
Source:

parent :Object:Test

"Test" Parent object

Type:
  • Object:Test
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:

score :number

score compute

Type:
  • number
Source:

utils :Object

clone of testron.utils"

Type:
  • Object
Source:

valid :boolean

is valid this Marker ?

Type:
  • boolean
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:

getCounter()

Get the self own-counter

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

reset()

Reset the counters

Source:
See:

resetResults()

Reset full the object counter

Source:
See:

sanitizeResults()

Checking the results object

Source:
See:

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:

based on the 'Doctron template'   by
Δ