I have written some custom code that loops through a survey and will insert data from a comma delimited file. The Respondent information in the Respondent table is added and I can see that the answers are all inserted into the correct Response tables.
When I look at the Manage Responses screen it shows the new records or respondents. However, when I try to look at their individual response or export the raw data their answers are blank.
I must be missing some join or relationship key when I do the data insert. Can you point me in a direction that will allow me to find this relationship. All of the tables have the proper questionId and respondentId and corresponding TextValue/Value/OptionIndex/etc.
do you have the correct respondent id and response ids? These must be generated according to the information int he OPS_SequenceId table.
I strongly suggest using the opinio Java API to do this, to ensure that you are getting it right. If not, let me explain how the ids are handled in Opinio db:
The id's in the OPS_SequenceId are assigned in chunks of 50. So after a restart, opinio will look in this table, get the current id of an ID-type, and assign the next 50 ids to itself, and then update the table. That way, the next time it needs a new set of ids, it will need to look in the table again.
So if you need to generate your own ids, lets say for a certain id-type, the current id is 50. If you need 20 new ids, you can update this type to be 70. After you have updated in the db, you can safely use ids 50-69.
Update the id like this (and include the current id at the end): UPDATE OPS_SequenceID SET Id=? WHERE IdType=? AND Id=?
Then verify the id has changed properly: "SELECT Id FROM OPS_SequenceID WHERE IdType=?"; (to make sure another process has not changed it in the meantime)
can you post the sql statements you are using to insert the responses?