Show feedback based on slider response

URL of experiment: Pavlovia

Description of the problem:

I have a quiz that should show feedback if participants select the correct answer. The slider labels are taken from the csv, which also includes a “correct_answer” column.

I would like the feedback_text to only show when the correct answer is selected. I have tried the following:

In begin routine, adding

selected_answer = slider.getLabels()

Then in each frame:

if selected_answer == correct_answer:
    slider_correct = True

Then I set the feedback_text start condition as slider_correct, but I can’t find a way to make it work. Any help would be appreciated.

Hello

Am I right in assuming that

selected_answer = slider.getLabels()

is in a routine that follows the slider?

Best wishes Jens

Hi Jens,

They’re in the same routine

Hello

Ok, but you put

in the Begin routine tab. At this point in time no answer has be given. If you want to give feedback after a response has been given, create a feedback-routine following your reaction routine.

There insert in the Begin routine tab

selected_answer = slider.getLabels()
if selected_answer == correct_answer:
    slider_correct = True

Best wishes Jens

1 Like

So there is no way to present feedback in the same routine? I tried what you mentioned, but similarly, no text is presented.

I don’t know if slider.getLabels() is even the correct method for getting the label the participant has selected, or whether that returns all labels.

Hello

If you want to present the feedback in the same routine you need to check for the correct answer in Each frame.

Best wishes Jens

1 Like