All the questions and their details (answers, images, tips, how dangerous) are stored in src/data/
and as a single file for each language or location.
See this file for example:
https://github.com/fablabbcn/iscape-air-pollution-quiz/blob/express/src/data/en.js
There is also a helper file for translations here
Example:
If you select the first suggestion in a question:
"I live in a house near a busy highway"
You get the first item from the results:
‘Pollution is typically higher’,
and the first image, the first tip etc.
If you need to add a question, we recommend you copy and paste a question and then edit it, to make sure that all the commas and curly braces are intact. A single question is everything inside, along with the curly braces {}
When you are done, you can make a Pull request on Github, and we will review it and put it in production.
This will list the steps needed to make a normal Raspberry Pi run and auto play the iScape quiz offline.
-
Make sure you have a Raspberry Pi with the Raspbian OS
-
Install required software
cd
git clone https://github.com/fablabbcn/iscape-air-pollution-quiz
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
export NVM_DIR="$HOME/.nvm"
nvm install 8
cd iscape-air-pollution-quiz
nvm use 8
npm i
-
Start the quiz locally automatically on reboot.
Add the following line to the bottom of.bashrc
cd iscape-air-pollution-quiz/ && npm run logger &
-
Start a browser in full screen
Edit.config/lxsession/LXDE-pi/autostart
and make sure it has the following:#@xscreensaver -no-splash
@xset s noblank
@xset s off
@xset -dpms
@point-rpi
@/usr/bin/chromium-browser --incognito --kiosk http://localhost:3000This disables the screensaver and blank screen and starts it in full screen ‘kiosk’ mode.
-
Reboot the kit
https://learn.adafruit.com/adding-a-real-time-clock-to-raspberry-pi/set-rtc-time
- Enable i2c on the Pi
- Add
dtoverlay=i2c-rtc,pcf8523
to/boot/config.txt
The log files should be at ~/log.txt
They are in the format:
- StartDate, EndDate, TotalExposure, Each questions Guess [0 or 1]
- The site does not load right away.
- This is normal. It takes time to start the whole app on a Raspberry Pi. It will load within a minute.
- Black border around screen on Raspberry Pi. This can happen on some TV screens or monitors.
- Uncomment
disable_overscan=1
line in/boot/config.txt
See: https://www.raspberrypi.org/forums/viewtopic.php?t=47152
- Uncomment