Giving participant visual feedback and delaying trial end after response #3517
Unanswered
sarahfeng02
asked this question in
Q&A
Replies: 1 comment
-
Hi! Regarding the first question, I have had a similar experience. It is likely that by the time on_finish is called, all elements have been discarded. Therefore, you cannot access these elements using Sorry for writing in Japanese, but this article might be helpful. Just by reading the code section, you can probably understand it. Best regards, |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello all,
I hope you're well! I'm working on a psych experiment in which the participant sees 5 buttons on-screen. However, they're not allowed to click; they must respond using corresponding keyboard presses. Each of the 5 allowed keys corresponds to one of the buttons. After they click, I want the corresponding button to light up in green/red depending on if it is correct or not (I compare the response to an answer key). I also want the screen to linger for 1000ms after the response is made so that the user can see the feedback. I am encountering two issues:
1. The color change is not happening
I used console.log to print out what's going on. The browser is tracking the user's keyboard press and mapping it accurately to a button ID, but when I try to print out the ID of 'selectedButton' (see code below'), it returns 'null'. Not sure if there's some kind of a timing issue in jsPsych where things aren't being rendered in the right order.
2. After the response is made, it doesn't wait 1000ms; it waits the full length of the trial duration, even though I want it to basically end the trial 1000ms after the response
I set response_ends_trial to false so that it would linger and added the timeout thing at the end, but it it's still going for the full 6000ms (trial_dur) but I don't want it to after the user makes a response.
Thank you in advance for any help, have been struggling for a while :)
Code here:
Beta Was this translation helpful? Give feedback.
All reactions