Watts-Lab / surveys

Library of surveys for deliberation experiments
MIT License
3 stars 4 forks source link

James add sha #104

Closed JamesPHoughton closed 1 year ago

JamesPHoughton commented 1 year ago

Addresses https://github.com/Watts-Lab/surveys/issues/102

Hash (using SHA1) the contents of both the survey .json file and the score function .score.js, and store these hashes in sha.json file in the survey directory:

{
  "survey": "b09a8ef115b917affcf1bf33809d59613e8df64d",
  "score": "ff72e4a62610fc5a1aceb23c7f4cd1eba2a80f4e"
}

The survey produces a data object which includes each of these shas:

image

Including separate shas means that we have better traceability into what changed if two datapoints have different shas.

JamesPHoughton commented 1 year ago

Also fixes an unrelated bug involving survey item names.

JamesPHoughton commented 1 year ago

Agree about needing a GH test to make sure SHAs are up to date. Adding an issue (https://github.com/Watts-Lab/surveys/issues/106) to track that action item.