Problem importing JQuery study

14 views
Skip to first unread message

K Mou

unread,
Apr 13, 2021, 11:21:30 AM4/13/21
to JATOS
Dear all, 
I am trying to load a simple questionnaire (I have made a simple version for now just to test it) prepared on JQuery into my JATOS local space. I prepared the questionnaire and downloaded it but when I try to import it I get a "Study is invalid" message. I am able, however, to import the example JQuery questionnaire (the Self Regulation Survey)  that you provide on the JATOS website. I am wondering if there are any specific settings one must use for the JQuery study in order for it to be compatible with JATOS. 

Thank you for all your work! 
Karolina 

Elisa Filevich

unread,
Apr 13, 2021, 11:29:43 AM4/13/21
to JATOS
Hi Karolina, 

There are no settings in principle, if you included the correct functions in the HTML/JS. 
But your study needs to be a .jzip file for JATOS to be able to import it. More importantly, this .jzip file contains information about the study properties that JATOS creates automatically. This is a common point of confusion. It's not enough to just zip all your files together, you need to Press the New Study button in the header of your local JATOS. Then edit the study properties and add new components manually. All source code for your study has to got into the study assets folder you defined in the the study properties. The study assets folder is usually located in your JATOS installation folder.

So, In the JATOS GUI:
- create a new study
- create a new component (it sounds like you only have one)
- Provide the path to the HTML in the component properties
- Add your HTML (+ assets, including jQuery, etc) in the study assets folder. 
 
Then you should be able to run it. 

Or is this what you already did?
Best
Elisa


--
You received this message because you are subscribed to the Google Groups "JATOS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jatos+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jatos/ce262cec-ea25-4668-ad31-f4e57b90db1cn%40googlegroups.com.

K Mou

unread,
Apr 14, 2021, 5:01:33 AM4/14/21
to ja...@googlegroups.com
Thank you very much Elisa! I can now run my questionnaire by following the process you described. However, now my questionnaire takes my responses but doesn't complete the submission of the form at the end (it gets stuck). In JATOS the results line appears, but the file is empty. Is there a particular setting I should use in order to get my data into the JATOS database? 
Thank you very much for your help! 
All the best,
Karolina 
 


You received this message because you are subscribed to a topic in the Google Groups "JATOS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jatos/6D7-e6MYJkM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jatos+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jatos/A1AEE59F-414B-4DC3-B508-4AB52E5ED621%40gmail.com.

Elisa Filevich

unread,
Apr 14, 2021, 8:06:27 AM4/14/21
to JATOS
Hi, 

Great! That sounds like progress :)
It sounds like you collect your responses but don't submit them to JATOS. 
What you will need to do is identify the variable (actually, likely a javascript object) that contains all responses to the survey and send them to the server using 
jatos.endStudy(yourResponses)


Best
Elisa

K Mou

unread,
Apr 15, 2021, 4:27:09 AM4/15/21
to ja...@googlegroups.com
Hi Elisa, 
Thank you very much for your quick response. Unfortunately, I am not familiar at all with java and I didn't manage to figure out where to insert the JATOS code. I could not identify the variable that contains the responses. Has anyone already used JQuery with JATOS and could give me a hint on how to implement the code to download the responses to the JATOS server? 

Thank you again for your invaluable help! 
Karolina 



Elisa Filevich

unread,
Apr 15, 2021, 10:13:52 AM4/15/21
to ja...@googlegroups.com
Hi, if you send me your study (the jzip) I will try to have a look. 

Best

Sent from my iPhone

On 15. Apr 2021, at 10:27, K Mou <karolina.m...@gmail.com> wrote:



K Mou

unread,
Apr 15, 2021, 10:53:49 AM4/15/21
to ja...@googlegroups.com
Thank you very much!! Here it is. It's not really my study, just an example with two questions that I made as a test version. 

Elisa Filevich

unread,
Apr 15, 2021, 5:36:08 PM4/15/21
to ja...@googlegroups.com
Hi Karolina, 

Ah, I see. 
The short answer is I can't help you.
The long answer includes some pointers:

- Your code is missing two things: 
1. including the jatos.js library in the head of the HTML file and the jatos.onLoad function, which makes sure that some things happen only after the connection to the server was loaded
2. and jatos.endStudy, which submits the data to the server. 

- You aren't using jQuery, which is a very common toolbox for general JavaScript functionality and shortcuts. You're actually using jqueryform, which is a very specific library. You should check their documentation to see where the responses are stored. Only once you have that, will we be able to help you by showing you how to send those data to JATOS. Because each tool is idiosyncratic, we don't know how this one works. I had a look at your HTML and suspect that each of the elements in your form will have a subfield containing the response. But I couldn't find them by poking around quickly, so I can only recommend you check their docs. 

Best
Elisa

Reply all
Reply to author
Forward
0 new messages