1.0.6 • Published 7 months ago

@blueabel/assesment_utils v1.0.6

Weekly downloads
-
License
MIT
Repository
-
Last release
7 months ago

Rating Scale Library

This library provides functionalities related to rating scales. The core functions allow for determining the rating scale of choices, translating scores between different scales, and aggregating scores based on provided answers.

Functions

setRatingScale(choices)

  • Description: Determines the rating scale of an array of choices based on a lookup table and adds it as a key.
  • Input:
    • choices: An array of choice objects with a required score property and any other optional properties.
  • Output: The array with choice objects having a rating_scale property.

translateScore(score, fromScale, toScale)

  • Description: Translates a score from one rating scale to another.
  • Input:
    • score: The score to be translated.
    • fromScale: The original rating scale of the score (e.g., "7_point").
    • toScale: The target rating scale to which the score should be translated (e.g., "5_point").
  • Output: The translated score rounded to three decimal places.

calculateResult(answers, context)

  • Description: Calculates aggregated scores for each domain based on provided answers.
  • Input:
    • answers: An array of answers where each answer contains a score, domain_id, optional facet_id, and an optional rating scale.
    • context: Contextual information for processing the answers. The desired rating scale to which all answers should be translated (e.g., "5_point").
  • Output: An object where each key is a domain_id and each value contains aggregated scores.

Notes

  • Facets will not be processed if domain_id is an array in the calculateResult function.

Usage

const { setRatingScale, translateScore, calculateResult } = require('@blueabel/assesment_utils');
1.0.6

7 months ago

1.0.5

7 months ago

1.0.4

7 months ago

1.0.3

7 months ago

1.0.2

7 months ago

1.0.1

7 months ago

1.0.0

7 months ago