Plain English description of calculator for OBI scores
brew opened this issue · 1 comments
Explain how the calculator calculates the OBI score. Confirm that the numbers it generates are correct given the issue with the “n/a” and “-1” (#119).
Each country on the ranking page will receive a display score out of 100.
This score is calculated by the reportgenerator.js module. Specifically in the calculateScore
method:
ibp-explorer/explorer/views/reportgenerator.js
Lines 116 to 132 in 015a29c
calculateScore
takes country data from the main data object (_EXPLORER_DATASET
in ibp_dataset.js) and a question set.
Questions may be answered with a non-score-contributing value ('e' with a value of -1). These answer values are excluded from the ranking calculations. Answer values of 0 or above are used in the score calculation. These answers are 'scorable'.
For each question in the questionset, scoreable answer values are summed, then divided by the total number of 'scoreable' questions in the questionset. This value is then rounded to provide the final country score for display.
If a country has no scoreable answers (all provided answers are -1), its final score is set to -1, and displayed as 'N/A'.