Define correct answers in


Author
Message
L123
L123
posted Last Year HOT
New Member (14 reputation)New Member (14 reputation)New Member (14 reputation)New Member (14 reputation)New Member (14 reputation)New Member (14 reputation)New Member (14 reputation)New Member (14 reputation)New Member (14 reputation)
Group: Forum Members
Posts: 4, Visits: 10
Hey,

I have an experiment where I want to have users decide between 1, 2 or 3 (keyboard input). If they decide for a specific number (either 1 or 3), they should get a message of being correct or incorrect. If they decide for number 2, they should see another trial. This works fine so far, but now I want to specify the correct (and incorrect) numbers using a list. Unfortunately, it doesn't work and the correct number is not assigned in my data either. 


Here is the code: (copied the relevant parts only):

<item item_correct_answers>
/1 = "1"
/2 = "3"
/3 = "1"
/4 = "3"
</item>

<list correct_answers>
/ items = [item.item_correct_answers]
/ select = values.currentscenario
// select = 2
</list>

<item item_incorrect_answers>
/1 = "3"
/2 = "1"
/3 = "3"
/4 = "1"
</item>

<list incorrect_answers>
/ items = [item.item_incorrect_answers]
/ select = values.currentscenario
</list>

<values>
/ currentscenario = 0
</values>

<trial task_70>
/ stimulusframes = [1 = fixation; 100 = override_fixation, instruction, stimulus_70, orangeChoice, blueChoice, automationChoice, press_1, press_2, press_3]
/ inputdevice = keyboard
/ validresponse = ("1", "2", "3")
/ correctresponse = (list.correct_answers.currentvalue)
/ responsemessage = (list.correct_answers.currentvalue, feedback_correct, 1500)
/ responsetrial = ("2", task_70_advice)
/ responsemessage = (list.incorrect_answers.currentvalue, feedback_incorrect, 1500)
/ ontrialbegin = [
  values.currentscenario = values.currentscenario + 1;
]
</trial>

<block task>
/ trials = [1-4 = sequence(task_70)]
</block>

<expt>
/ blocks = [
    1 = task;
]
</expt>


Thanks in advance!
Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 12K, Visits: 95K
L123 - 8/1/2022
Hey,

I have an experiment where I want to have users decide between 1, 2 or 3 (keyboard input). If they decide for a specific number (either 1 or 3), they should get a message of being correct or incorrect. If they decide for number 2, they should see another trial. This works fine so far, but now I want to specify the correct (and incorrect) numbers using a list. Unfortunately, it doesn't work and the correct number is not assigned in my data either. 


Here is the code: (copied the relevant parts only):

<item item_correct_answers>
/1 = "1"
/2 = "3"
/3 = "1"
/4 = "3"
</item>

<list correct_answers>
/ items = [item.item_correct_answers]
/ select = values.currentscenario
// select = 2
</list>

<item item_incorrect_answers>
/1 = "3"
/2 = "1"
/3 = "3"
/4 = "1"
</item>

<list incorrect_answers>
/ items = [item.item_incorrect_answers]
/ select = values.currentscenario
</list>

<values>
/ currentscenario = 0
</values>

<trial task_70>
/ stimulusframes = [1 = fixation; 100 = override_fixation, instruction, stimulus_70, orangeChoice, blueChoice, automationChoice, press_1, press_2, press_3]
/ inputdevice = keyboard
/ validresponse = ("1", "2", "3")
/ correctresponse = (list.correct_answers.currentvalue)
/ responsemessage = (list.correct_answers.currentvalue, feedback_correct, 1500)
/ responsetrial = ("2", task_70_advice)
/ responsemessage = (list.incorrect_answers.currentvalue, feedback_incorrect, 1500)
/ ontrialbegin = [
  values.currentscenario = values.currentscenario + 1;
]
</trial>

<block task>
/ trials = [1-4 = sequence(task_70)]
</block>

<expt>
/ blocks = [
    1 = task;
]
</expt>


Thanks in advance!

<list correct_answers>
/ items = [item.item_correct_answers]
/ select = values.currentscenario
// select = 2
</list>

This is not how you define items in a list. Lists don't use <item> elements.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search