ropensci / qualtRics

Download ⬇️ Qualtrics survey data directly into R!
https://docs.ropensci.org/qualtRics
Other
216 stars 70 forks source link

Error parsing file: The file does not appear to be a valid survey. Save as qsf - am I doing it wrong? import doesn't work #335

Closed saritpery closed 4 months ago

saritpery commented 11 months ago

Hi, I save all my surveys (in a loop) in qsf format: qsfS <- try(fetch_qsf(surveyID = surveys$id[i], file = surveys$qsfFileName[i], save = TRUE)) However, when I try to import it into Qualtrics, it issues an error: Error parsing file: The file does not appear to be a valid survey.

saritpery commented 11 months ago

I checked it further, and it works well for most surveys but not all. When I manually (via Qualtrics) export the survey, it restores well from the .qsf file, but, the .qsf file that was generated by fetch_qsf, doesn't restore and issues the error. I can send both .qsf files for your inspection if this might help, or a link to the survey, or anything you wish :) Thank you very much for creating fetch_qsf() and the entire package.

jmobrien commented 11 months ago

Sure. So long as they don't contain anything sensitive/private (in any sense applicable to what you do), I'd be happy to take a look at a pair of qsf's from the same survey--one working, web-downloaded one, plus one non-working one from fetch_qsf().

Might also be useful if you have a pair of web-download/fetch_qsf() qsf's from a different survey, where as you mention both methods work fine. That could help with better distinguishing insignificant variations between the two methods from whatever thing(s) is/are causing these issues.

BTW, what platform are you working from (Windows/Mac/Linux)? Not sure if that will be relevant but it can sometimes comes into play when we're generating files like we are here.

saritpery commented 11 months ago

Hi, Thank you so much!!!! The surveys themselves aren't confidential, so I have no issue sharing them.

. Per your request, I have attached 3 surveys with their .qsf files generated by fetch_qsf() and manually from the survey builder.

s34 - working (partially) Both files can be restored, but the fetch_qsf() uses UTF-8 encoding, which causes us another problem (see below). s35 - working and not working This survey is identical to the former s34, except it initially asks for the preferred language, and if it's Hebrew, it opens s34. All the rest of the questions are the same but are in a different language (English). s1 - working and not working (another example)

Encoding: There is another huge issue for us: we work a lot in Hebrew and Arabic. The encoding (for both QSF and the data exported) is UTF-8. So, the Hebrew text becomes gibberish. I still don't know how to handle it.

I had to zip the files because GitHub won't accept .qsf file attachments.

ezyzip.zip

Again, thank you so much for creating the package, fetch_qsf(), and for your assistance. Sarit

jmobrien commented 11 months ago

Thanks. I just realized you mentioned fetch_qsf(), which was an older trial function. We still haven't fully implemented its replacement write_qsf(), but it approaches the task a bit differently, including being more explicit about the intended encoding. Not sure if it's going to fix your issue, but it's a better place to consider things at the moment.

The open PR is #319. Given you're already working w/a function from a previous PR, I assume you know how to install from that branch?

saritpery commented 11 months ago

Hurray - one down :) I didn't test all of them, but the ones I tested save qsf files, that can be restored into Qualtrics. Thank you! However, I'm still stuck with the encoding issue. Is there a way to add to write_qsf() a parameter for the encoding? Do you wish I close this one, and open the encoding issue on the write_qsf() branch?

juliasilge commented 4 months ago

Let us know if you have further questions! 🙌