Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Add] Add a new attribute to allow the plugin "html-button-response" to delay the display of the button #3289

Closed
thtTNT opened this issue May 10, 2024 · 7 comments

Comments

@thtTNT
Copy link
Contributor

thtTNT commented May 10, 2024

Hi JsPsych Amazing Team,

Recently, our project team asked us to delay the display of a button,
For example, participants were asked to recall something and were only allowed to click the button after 30 seconds.

I think this is a pretty common request in psychology experiments, so I'd like to add an attribute to do this, what do you think?

I can do that, and if you allow me to do that, what would you like the attribute to be called?

@jodeleeuw
Copy link
Member

Hey @thtTNT,

The way that I would do this currently is to stack two trials sequentially (one with a fixed trial_duration and no response option, the second with a button). But I can see the value in making this easier to do.

Do you imagine having the buttons disabled or the buttons hidden? My instinct is that disabled is a better default, but if there's a good reason for them to be hidden I'm open to considering.

enable_buttons_after or show_buttons_after could be clear parameter names.

If you add this to html-button-response would you be willing to add it to all the other -button-response plugins for consistency?

@thtTNT
Copy link
Contributor Author

thtTNT commented May 12, 2024

Hi @jodeleeuw ,

Thank you for your prompt reply.

I'm working on "audio-button-response" and "video-button-response" but the problem is that they already have a attribute called "response_allowed_while_playing". So What I plan to do is that start the timer of delay only after the playback is over.

Please allow me to confirm this to you. If you don't think this is a good idea, please let me know.

@jodeleeuw
Copy link
Member

That's tricky! I think if response_allowed_while_playing is true then the timer should start right away. Does that match your intuition?

@anasophiarc
Copy link

Hi @thtTNT I am a student who is new to jsPsych and I really want to use your attribute for a video button response trial (it would make it difficult to stack 2 trials seamlessly). Would u mind briefly explaining how I could include your attribute into my work?

@thtTNT
Copy link
Contributor Author

thtTNT commented May 24, 2024

Hi @anasophiarc, so happy to see my work help you. It's a good start that checking the document of each plugin (https://www.jspsych.org/7.3/plugins/html-button-response/)
I don't think here is a good place to talk about this. Maybe you can create a new issue with more detail? That's really helpful for me.

@anasophiarc
Copy link

Hi @thtTNT I can do that! I guess my main question is what I have to include in my script to be able to use your attribute. Right now I have <script src="https://unpkg.com/@jspsych/plugin-video-button-response@1.1.3"></script> as one of the plugins included at the top of my script. And then in my trial I am trying to use the attribute - is this all I need to do to use the attribute?

var cue = { type: jsPsychVideoButtonResponse, stimulus: jsPsych.timelineVariable('video'), choices: ['Blast'], enable_button_after: 1000, //this is the feature I want to add ==> Not sure if another plugin is needed? response_allowed_while_playing: true, response_ends_trial: true, trial_ends_after_video: true, width: 800, height: 450 }

@thtTNT
Copy link
Contributor Author

thtTNT commented May 24, 2024

@anasophiarc, I think you have already found the problem. The 'enable_button_after' attribute is only available in 1.2.0+. So upgrade the plugin should help you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants