So, what is the core of the project? In fact, this is a very very simple and short survey displaying the questions and their respective answer options from the questionnaire below:
Q1. What is your current age? - numeric field, 18+
Q2. What is your monthly income?
1. Under 1000EUR2. 1001-1500EUR3. 1501-2000EUR4. 2001-2500EUR5. 2501-3000EUR6. 3001-3500EUR7. 3501-4000EUR8. 4001+ EUR99. Prefer not to answerQ3. What activities do you like most?HikingAirsoftReadingComputer gamingBoard gamingWatching moviesOtherNone of the above - screen out if selectedQ3.1 What other activities do you like? - if selected "Other" at Q3Q3.2 On a scale 1 to 10, how would you rate the satisfaction of the activities you mentioned?HikingAirsoftReadingComputer gamingBoard gamingWatching moviesOther
There are a couple of key points that worth noting for this project.
Schema reading - here I have compiled the questionnaire as xml schema and I use the lxml module to extract all needed question details in order to use them in the survey. This is the moment where I made my first steps in OOP - most of my projects so far were written more or less procedurally and this is the first time I develop a class for my own idea, without following concrete tutorial. The class (QDetails) is located in lib.schema and contains one function - get_xml(). This function is extracting question text, question type, options texts and option ID numbers. I am planning to also add get_json() function with the purpose to extract the same details from json schema.
Database management - initially I planned to use MySQL for database engine, next I thought to move to PostgreSQL as the most modern SQL system nowadays but finally I ended with chosing SQLite. I think this is the most apropriate choice as this is lightweight and everything is in one file which is the best solution for autonomous survey projects. I use SQLiteStudio to visualize what happens in the table.
Data quality control - I have utilized quality control on two levels here:
- on-site data validation - I've developed a small library (located in lib.validate) which checks the data for each record right after it is collected in the backend but BEFORE being written to database. If collected data is invalid/incorrect, the functions in this library prevent incorrect data from writing to database.
- database data validation - I wrote a procedural checkscript (check_db.py) that can be run manuallty, separately from the Flask app. It's purpose is to verify the data stored in the database and if there is anything wrong Excel reports are generated in folder dv_report. I've based the script on pandas which is the most powerful Python data processing tool so far.
Here is how the entire thing works in action:
What's next? As mentioned above I am planning to add a function that extracts question details from json. I'm also thinking about eventual expanding it one centralized app with GUI allowing to launch multiple survey, questionnaire building GUI exporting it's schema in xml and json and a couple of other functionalities.
please can you continue the description of this survey i need it thank u
ОтговорИзтриване