Skip to content

From Responses to Scores

Graham Powrie edited this page Jun 18, 2014 · 3 revisions

Short Story

Assuming a completed Entry, each Response value is an integer that can later be used in calculations for the parent Catalog. After calculation, the resultant Score is a simple integer value embedded into the Entry CouchDB document.

Long Story

The calculation process is setup to provide flexibility in the resulting data granularity using these techniques:

  • Score calculation is done in a separate job (Resque task), not a web process. This allows it to be non-blocking and long running if necessary.
  • Score components are stored in Redis to provide data for the chart and further data processing.
  • The Score's final value is stored as an integer on CouchDB for reference.

See #save_score to get an idea: https://github.com/lmerriam/CDAI/blob/master/app/catalogs/catalog_score.rb#L3

Clone this wiki locally