This server handles assigning unique question set to the connected clients. The current settings helps to duplicate each question 3 times and assign 30 questions to a user and for a total of 50 users.
In order to make this work, we need to run serially→
- src/backend/random_generator.py → This file generates a list of 30 random questions for each of the 50 users. The generated data is stored in file → src/backend/data/question_list.json
- src/backend/create_db_entry.py → This file is responsible to upload the data into mongodb Database.
Important point: Before running this program make sure that mongo db docker container is running on the server. Use below command to run it →
docker run -d -p 27017:27017 --name prodigi-mongo mongo:latest
So far you can run these two files in your local system also. But you need to start Flask and WSGI server to enable the API endpoint by which qualtrics client can connect and obtain the question list. This API endpoint is →
/api/v1/questions
To run the Flask server in our Ubuntu server, we have a service which automatically runs the flask server. Please make sure that the service is active. The service automatically starts upon server restart. Check for error logs in case its not running.
/etc/systemd/system → citizen_backend.service
Revers proxy to the flask server has been implemented using Nginx. You can find more details about the file on the server.
/etc/nginx/sites-available → citizen-science.org
You can find the repository to create the survey here-->
https://github.com/saurabhprasun20/qualtrics-automation