How to integrate external html form with js-psych #663
-
Hi, I wonder what is the best way to combine js-psych with a html form? My prototype uses the js-psych survey plugins, however I realized my forms require excessive validation and instead of reinventing the wheel I want to use one of the many exisiting libraries for that. I found this thread: #135 but the form plugin seems to have never materialised? I already consider embedding js-psych in a vue JS app and handling all the forms in the vue universe but this seems to be a bit overkill... |
Beta Was this translation helpful? Give feedback.
Replies: 11 comments
-
You can combine your jsPsych experiment with any other HTML/JS/CSS stuff or web-library by using JATOS (jatos.org). E.g. your first component could be a survey using surveyjs.io and the second one your jsPsych experiment. |
Beta Was this translation helpful? Give feedback.
-
Hmm thanks @kristian-lange-tw JATOS seems interesting and I will keep it in mind for future projects. But it seems I would have to move my whole experiment to a different server for it and leave my comfortable maintained nginx server in exchange for a lot of functionality I don't really need. All I really want is my experiment to start with a self-written form and then somehow append these form contents to the js-psych data object. |
Beta Was this translation helpful? Give feedback.
-
Hm, your Nginx server has a lot of functionality your will never need ;) |
Beta Was this translation helpful? Give feedback.
-
tried Jatos yesterday night and it seems indeed easy to combine js-psych with other components there...but it seems I would have to organize and maintain my own server to host it :/ |
Beta Was this translation helpful? Give feedback.
-
That is true. If you cannot convince your IT to do it for you then you have to setup your own JATOS server. But if a server in the cloud is a possibility then JATOS is easily set up in Digital Ocean (http://www.jatos.org/JATOS-on-DigitalOcean.html). And if you just want to play around a bit you can also just expose your own computer to the internet (http://www.jatos.org/Expose-your-local-JATOS.html). Also, I'm curious, you seem to have a server with Nginx - why can't you install JATOS on this one? |
Beta Was this translation helpful? Give feedback.
-
one of my colleagues maintains a web server with SSL, a trustworthy sounding domain and nginx for other purposes. I am allowed to use this server to also run my experiments. Moving to JATOS would mean starting a long lasting process (with no success guarantee) with the IT department to get my own server up and running. External hosting is not a nice option for me as my experiments include patient data. So I feel kinda locked in on the tech stack :) |
Beta Was this translation helpful? Give feedback.
-
Agreed, patient data should not be in the cloud. And IT departments can be difficult to deal with (I myself am one of them). I wish you good luck! |
Beta Was this translation helpful? Give feedback.
-
Thank you, so I want to have the following: pre experiment survey - js psych experiment - post experiment survey.. Do you think it is a better idea to embed my experiment in a vue JS app handling the surveys and somehow saving them or would you rather go for custom js-psych plugins to include the surveys with nice validation? Maybe there is also an even better way I am overlooking. |
Beta Was this translation helpful? Give feedback.
-
Sorry, but I have no other idea for you :( |
Beta Was this translation helpful? Give feedback.
-
I think I found a solution now using |
Beta Was this translation helpful? Give feedback.
-
Try this component: https://github.com/HGGshiwo/jspsych-vue.git |
Beta Was this translation helpful? Give feedback.
I think I found a solution now using
jspsych-6.1.0/plugins/jspsych-survey-html-form.js
:)