I have written a function to generate fake data for testing my survey system. In actual use, the system will take data from survey done by interviewee and plot graphs. However, before publishing the system, we would need fake data to demonstrate how the plot graph function works to the interviewer.
Currently I am using rand()
to generate a number. For example, if there is a multiple-choice question with 4 choices, I will map the result of rand(0,3)
with choice 1-4.
The problem is that when I generate a number of fake survey (around 1000, and is not a big number in my opinion), the possibility of getting different choice is the same. This makes the pie chart looks the same for all questions. Is there a way I can randomly generate data with different possibility of getting different choice?
Aucun commentaire:
Enregistrer un commentaire