Post by mpic on Jan 18, 2021 10:37:17 GMT
Hi all,
I need to integrate a Psytoolkit experiment into Qualtrics because I have other surveys and experiments that work better there. For that, I first created a survey in which I embedded the Psytoolkit experiment. Then, I embedded this survey into Qualtrics. To do all this I tried to adapt the steps they explain for lab.js labjs.readthedocs.io/en/latest/learn/deploy/3a-qualtrics.html#tutorial-deploy-third-party-qualtrics. However, I am having a few issues:
- First, once the experiment is finished, it gets stuck at the last screen and I therefore cannot continue with the next parts of the Qualtrics survey. I have asked some people about this issue, and they suggested I need a custom event to move to the next page; e.g. a brief timout or a button with the 'onclick' attribute set to clickNextButton. Do you know how to add either of this, or something else that will help with 'moving forward' once the participants are done with the experiment?
- Secondly, I would like to know how to retrieve the data from the survey and embed it into qualtrics, the way they do in the labjs link I shared with you with this code:
const page = this
page.hideNextButton()
// Listen for the study sending data
window.addEventListener('message', function _labjs_data_handler(event) {
// Make sure that the event is from lab.js, then ...
if (event.data.type === 'labjs.data') {
// ... extract the JSON data lab.js is sending.
const data = event.data.json
// ... save data and submit page
Qualtrics.SurveyEngine.setEmbeddedData('labjs-data', data)
window.removeEventListener('message', _labjs_data_handler)
page.clickNextButton()
}
})
I think the key change I would have to make is in the if statement, and in the event.data.type change that to the name of the variable that stores the data in Psytoolkit? Could you help me with that? What should I put there?
- Thirdly, I would like to know how to include the participant's ID that I transmit via the URL in Qualtrics. How can I retrieve information from the URL in Psytoolkit and associate it to that participant's response in Psytoolkit?
- Finally, www.psytoolkit.org/c/3.2.0/survey?s=VuTGd as you can see in this survey I created there's a scroll bar that I would like to avoid so that the page doesn't move. Is there a way to set the size of the window in which the experiment/survey will appear? Would it be possible to make it smaller, so it fits in the window? If so, how? There's also a region at the bottom of the page which is grey and unnecessary I would say... Is it possible to cut that?
Thank you very much!
I need to integrate a Psytoolkit experiment into Qualtrics because I have other surveys and experiments that work better there. For that, I first created a survey in which I embedded the Psytoolkit experiment. Then, I embedded this survey into Qualtrics. To do all this I tried to adapt the steps they explain for lab.js labjs.readthedocs.io/en/latest/learn/deploy/3a-qualtrics.html#tutorial-deploy-third-party-qualtrics. However, I am having a few issues:
- First, once the experiment is finished, it gets stuck at the last screen and I therefore cannot continue with the next parts of the Qualtrics survey. I have asked some people about this issue, and they suggested I need a custom event to move to the next page; e.g. a brief timout or a button with the 'onclick' attribute set to clickNextButton. Do you know how to add either of this, or something else that will help with 'moving forward' once the participants are done with the experiment?
- Secondly, I would like to know how to retrieve the data from the survey and embed it into qualtrics, the way they do in the labjs link I shared with you with this code:
const page = this
page.hideNextButton()
// Listen for the study sending data
window.addEventListener('message', function _labjs_data_handler(event) {
// Make sure that the event is from lab.js, then ...
if (event.data.type === 'labjs.data') {
// ... extract the JSON data lab.js is sending.
const data = event.data.json
// ... save data and submit page
Qualtrics.SurveyEngine.setEmbeddedData('labjs-data', data)
window.removeEventListener('message', _labjs_data_handler)
page.clickNextButton()
}
})
I think the key change I would have to make is in the if statement, and in the event.data.type change that to the name of the variable that stores the data in Psytoolkit? Could you help me with that? What should I put there?
- Thirdly, I would like to know how to include the participant's ID that I transmit via the URL in Qualtrics. How can I retrieve information from the URL in Psytoolkit and associate it to that participant's response in Psytoolkit?
- Finally, www.psytoolkit.org/c/3.2.0/survey?s=VuTGd as you can see in this survey I created there's a scroll bar that I would like to avoid so that the page doesn't move. Is there a way to set the size of the window in which the experiment/survey will appear? Would it be possible to make it smaller, so it fits in the window? If so, how? There's also a region at the bottom of the page which is grey and unnecessary I would say... Is it possible to cut that?
Thank you very much!