empowerhack / DrawMyLife-Service

API and Admin system for the Draw My Life initiative - Volunteers: check README and GitHub Projects to get started.
https://github.com/empowerhack/DrawMyLife-Service/projects
MIT License
13 stars 0 forks source link

Hxl stats view 145 147 #180

Closed leungant closed 7 years ago

leungant commented 7 years ago

Change description:

Addresses #145 and #147:

http://.../hxlstats and http://.../hxlstats.json now show array of arrays conforming to Google spreadsheet

Any pointers/assistance much appreciated as I am a bit unfamiliar with the testing requirements.

Instructions:

rake db:migrate

or

rake db:migrate:up VERSION=20170601162837

will bring VERSION up to 20170601162837

The view is available at http://.../hxlstats.json

Sample output

.json:

[["Emotional State", "Stage of journey", "Country drawn in", "Total children affected", "Children who identify as female", "Children who identify as male", "Children who identify as neither female nor male", "Children between the ages of 5-12", "Children between the ages of 13-18", "Children under 5 years old", "Older than 18 years old"],
 ["#impact+indicator+code", "#affected+children", "#country+code", "#affected+children+total", "#affected+children+female", "#affected+children+male", "#affected+children+indicator", "#affected+children+age_5_12", "#affected+children+age_13_18", "#affected+children+age_under5", "#affected+children+age_18plus", "#affected+children+age_unknown"], 
[1, "At home", "AF", 1, 0, 0, 1, 0, 0, 1, 0, 1], 
[3, "At home", "AF", 2, 0, 1, 1, 0, 0, 2, 0, 2], 
[3, "In temporary shelter", "AF", 1, 0, 1, 0, 0, 0, 1, 0, 2], 
[3, "At home", "FR", 1, 0, 0, 1, 1, 0, 0, 0, 1], 
[2, "In temporary shelter", "AF", 1, 0, 1, 0, 1, 0, 0, 0, 1]]

image

leungant commented 7 years ago

Appreciate any further thoughts!

krissy commented 7 years ago

@leungant I reviewed the last couple of changes and QA'ed them locally. Had to add an extra 'unknown ages' column to the spreadsheet and HXL logic as age isn't compulsory in the form. All else looking fine so will get this merged!