Image-button-response in cognition.run #1422
-
Hi, everyone. I'm trying to create a variable of type "image-button-response" with some choice options below. I was able to do it perfectly in "Visual Studio Code" but I have the problem when trying to copy the code in "cognition.run" page. I suppose it is because the page cannot find the folder that I indicated in the stimulus. I'm totally new to programming so I don't know how I can solve it. Here is the code: var image = { Thanks in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
EDIT: I'm pretty sure my answer below is wrong. I think cognition.run ignores the stimulus file path and just looks to see if it can access the file name. Josh's answer below solved this problem.
var image = {
type: 'image-button-response',
stimulus: 'raven.png',
stimulus_height: 500,
choices: ['1', '2', '3', '4', '5', '6', '7', '8'],
}; |
Beta Was this translation helpful? Give feedback.
EDIT: I'm pretty sure my answer below is wrong. I think cognition.run ignores the stimulus file path and just looks to see if it can access the file name. Josh's answer below solved this problem.
Hi @ler93, your local directory structure isn't maintained on cognition.run, so if you upload any stimuli files, you can access them with just the file name. Try this in your cognition.run version: