-
Notifications
You must be signed in to change notification settings - Fork 1
From Responses to Scores
Graham Powrie edited this page Jun 18, 2014
·
3 revisions
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.
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 inRedis
to provide data for the chart and further data processing. - The
Score
's finalvalue
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