raven
|
|
Group: Forum Members
Posts: 52,
Visits: 110
|
+x+x+x/ skip = [ if (script.currentblock == "block_1" && values.trial_a_criterion_learned) { return true; }; if (script.currentblock == "block_2" && values.trial_b_criterion_learned) { return true; }; ] Hi Dave, thanks for your reply. I tried running the following code with three conditions, but when the first condition is met, it skips both the first and second conditions, and just keeps looping through trial_c instead. / skip = [ if (script.currentblock == "block_1" && values.trial_a_criterion_learned) { return true; }; if (script.currentblock == "block_2" && values.trial_b_criterion_learned) { return true; }; if (script.currentblock == "block_3" && values.trial_c_criterion_learned) { return true; }; ] Any ideas? Post runnable code. I managed to find a workaround. Thanks!
|
|
|
Dave
|
|
Group: Administrators
Posts: 13K,
Visits: 104K
|
+x+x/ skip = [ if (script.currentblock == "block_1" && values.trial_a_criterion_learned) { return true; }; if (script.currentblock == "block_2" && values.trial_b_criterion_learned) { return true; }; ] Hi Dave, thanks for your reply. I tried running the following code with three conditions, but when the first condition is met, it skips both the first and second conditions, and just keeps looping through trial_c instead. / skip = [ if (script.currentblock == "block_1" && values.trial_a_criterion_learned) { return true; }; if (script.currentblock == "block_2" && values.trial_b_criterion_learned) { return true; }; if (script.currentblock == "block_3" && values.trial_c_criterion_learned) { return true; }; ] Any ideas? Post runnable code.
|
|
|
raven
|
|
Group: Forum Members
Posts: 52,
Visits: 110
|
+x/ skip = [ if (script.currentblock == "block_1" && values.trial_a_criterion_learned) { return true; }; if (script.currentblock == "block_2" && values.trial_b_criterion_learned) { return true; }; ] Hi Dave, thanks for your reply. I tried running the following code with three conditions, but when the first condition is met, it skips both the first and second conditions, and just keeps looping through trial_c instead. / skip = [ if (script.currentblock == "block_1" && values.trial_a_criterion_learned) { return true; }; if (script.currentblock == "block_2" && values.trial_b_criterion_learned) { return true; }; if (script.currentblock == "block_3" && values.trial_c_criterion_learned) { return true; }; ] Any ideas?
|
|
|
Dave
|
|
Group: Administrators
Posts: 13K,
Visits: 104K
|
/ skip = [ if (script.currentblock == "block_1" && values.trial_a_criterion_learned) { return true; }; if (script.currentblock == "block_2" && values.trial_b_criterion_learned) { return true; }; ]
|
|
|
raven
|
|
Group: Forum Members
Posts: 52,
Visits: 110
|
+x+x+x+x+xHi Dave, Given the code below: 1. How can I make it so that when the response is "a" 3 or more times for both/either the a1 and a2 trials, both the a1 and a2 trials are skipped when that criterion is met. The same applies for the b1 and b2 trials. Despite the fact that the a2 trial's correct response is "b", and the b2 trial's correct response is "a"? So, essentially, regardless of the correct response for trials a1 and a2, the criterion should be based on the desired response, which is "a" for the a_trials, and "b" for the b_trials. 2. Is there a way to counterbalance for odd/even participant numbers using expt so that the desired responses are switched (e.g., for even numbered participants, the desired response for the a1 and a2 trials is now "b", and the desired response for the b1 and b2 trials is now "a"? <values> / num_a_trials_response_a = 0; / num_a1_correct = 0; / num_a2_correct = 0;
/ num_b_trials_response_b = 0; / num_b1_correct = 0; / num_b2_correct = 0; </values>
<expt one> / blocks = [1=block.learning_block1] / subjects = (1 of 2) </expt>
<expt two> / blocks = [1=block.learning_block2] / subjects = (2 of 2) </expt>
<values> / a_learned = false / a1_learned = false / a2_learned = false
/ b_learned = false / b1_learned = false / b2_learned = false </values>
<values> / a_trial_count = trial.a1_trial.trialcount + trial.a2_trial.trialcount / b_trial_count = trial.b1_trial.trialcount + trial.b2_trial.trialcount </values>
<page blocksummary> ^Number of A trials in this block: <%values.a_trial_count%> ^Number of A trials in this block where 'A' was the response: <%???%> ^A desired response: <%values.a_learned%>
^Number of A1 trials in this block: <%trial.a1_trial.trialcount%> ^Number correct A1 trials in this block: <%trial.a1_trial.percentcorrect%> ^A1 learned: <%values.a1_learned%>
^Number of A2 trials in this block: <%trial.a2_trial.trialcount%> ^Number correct A2 trials in this block: <%trial.a2_trial.percentcorrect%> ^A2 learned: <%values.a2_learned%>
^Number of B trials in this block: <%values.b_trial_count%> ^Number of B trials in this block where 'A' was the response: <%???%> ^B desired response: <%values.b_learned%>
^Number of B1 trials in this block: <%trial.b1_trial.trialcount%> ^Number correct B1 trials in this block: <%trial.b1_trial.percentcorrect%> ^B1 learned: <%values.b1_learned%>
^Number of B2 trials in this block: <%trial.b2_trial.trialcount%> ^Number correct B2 trials in this block: <%trial.b2_trial.percentcorrect%> ^B2 learned: <%values.b2_learned%> </page>
<block learning_block1> / postinstructions = (page.blocksummary) / onblockend = [ if (values.num_a_trials_response_a >= 3) { values.a1_learned = true; values.a2_learned = true; }; if (values.num_b_trials_response_b >= 3) { values.b1_learned = true; values.b2_learned = true; } ] / trials=[1-18=noreplace(trial.a1_trial, trial.a1_trial, trial.a2_trial, trial.b1_trial, trial.b2_trial, trial.b2_trial)] / branch = [ if (!values.a1_learned || !values.a2_learned || !values.b1_learned || !values.b2_learned) { // if either hasn't been learned, run another learning block return block.learning_block; } ] </block>
<trial a1_trial> / skip = [ values.a1_learned; ] / ontrialend = [ values.num_a1_correct = trial.a1_trial.correctCount ]
/ stimulusframes = [1=clearscreen, a1_trial_stimulus] / inputdevice = keyboard / validresponse = ("a", "b") / correctresponse = ("a") / branch = [ { return trial.feedback_screen } ] </trial>
<text a1_trial_stimulus> / items = ("Stimulus A1") / hposition = 50% </text>
<trial a2_trial> / skip = [ values.a2_learned; ] / ontrialend = [ values.num_a2_correct = trial.a2_trial.correctCount ]
/ stimulusframes = [1=clearscreen, a2_trial_stimulus] / inputdevice = keyboard / validresponse = ("a", "b") / correctresponse = ("b") / branch = [ { return trial.feedback_screen } ] </trial>
<text a2_trial_stimulus> / items = ("Stimulus A2") / hposition = 50% </text>
<trial b1_trial> / skip = [ values.b1_learned; ]
/ ontrialend = [ values.num_b1_correct = trial.b1_trial.correctCount ] / stimulusframes = [1=clearscreen, b1_trial_stimulus] / inputdevice = keyboard / validresponse = ("a", "b") / correctresponse = ("b") / branch = [ { return trial.feedback_screen } ] </trial>
<text b1_trial_stimulus> / items = ("Stimulus B1") / hposition = 50% </text>
<trial b2_trial> / skip = [ values.b2_learned; ]
/ ontrialend = [ values.num_b2_correct = trial.b2_trial.correctCount ] / stimulusframes = [1=clearscreen, b2_trial_stimulus] / inputdevice = keyboard / validresponse = ("a", "b") / correctresponse = ("a") / branch = [ { return trial.feedback_screen } ] </trial>
<text b2_trial_stimulus> / items = ("Stimulus B2") / hposition = 50% </text>
<trial feedback_screen> / stimulustimes = [0=clearscreen; 50=feedback_screen; 100=num_a1_correct; 100=num_a2_correct; 200=num_b1_correct; 200=num_b2_correct] / timeout = 1500 </trial>
<text feedback_screen> / items = ("Feedback Screen") / fontstyle = ("Courier", 18pt, true) / color = blue / size = (80%, 20%) / position = (50%, 30%) </text>
<text num_a1_correct> / items = ("Percentage Stimulus A1 Correct: <%values.num_a1_correct%>") / fontstyle = ("Courier", 18pt, true) / color = blue / size = (80%, 20%) / position = (50%, 40%) </text>
<text num_a2_correct> / items = ("Percentage Stimulus A2 Correct: <%values.num_a2_correct%>") / fontstyle = ("Courier", 18pt, true) / color = blue / size = (80%, 20%) / position = (50%, 50%) </text>
<text num_b1_correct> / items = ("Percentage Stimulus B1 Correct: <%values.num_b1_correct%>") / fontstyle = ("Courier", 18pt, true) / color = blue / size = (80%, 20%) / position = (50%, 60%) </text>
<text num_b2_correct> / items = ("Percentage Stimulus B2 Correct: <%values.num_b2_correct%>") / fontstyle = ("Courier", 18pt, true) / color = blue / size = (80%, 20%) / position = (50%, 70%) </text>
<data> / columns = (date time subject group session blocknum blockcode trialnum trialcode stimulusitem stimulusitem response latency correct values.num_a1_correct values.num_a2_correct values.num_b1_correct values.num_b2_correct trial.a1_trial.percentcorrect trial.a2_trial.percentcorrect trial.b1_trial.percentcorrect trial.b2_trial.percentcorrect values.a1_learned, values.a2_learned, values.b1_learned values.b2_learned) </data>
Thanks! You count things up in variables and skip on that basis. As simple as that. As for counterbalancing, parameterize the correct responses, define two expt elements, set the correct responses to the applicable values /onexptbegin respectively. Thanks! Would it be a case of using an IF statement to count if the desired key was pressed in each trial, or is there a more efficient way to achieve this? For example, if the desired response is "z" (scan code 44): / ontrialend = [ if (trial.a_trial.response == 44) { values.num_a_correct += 1; } else { values.num_a_correct += 0; } ] Yes, as you can clearly see in the example code I gave you. No, there isn't a more eficient way, and there is nothing inefficient about using conditional logic in the first place Ok, sounds good. Thanks for all your help so far! :) Hi Dave, Is it possible to have conditional statements within /skip? For example, in the following code, I'd like the trial to be skipped if either the block_1 trial_a has been learned, or the block_2 trial_b has been learned: / skip = [ block.block_1 && values.trial_a_criterion_learned; block.block_2 && values.trial_b_criterion_learned; ] Thanks!
|
|
|
raven
|
|
Group: Forum Members
Posts: 52,
Visits: 110
|
+x+x+x+xHi Dave, Given the code below: 1. How can I make it so that when the response is "a" 3 or more times for both/either the a1 and a2 trials, both the a1 and a2 trials are skipped when that criterion is met. The same applies for the b1 and b2 trials. Despite the fact that the a2 trial's correct response is "b", and the b2 trial's correct response is "a"? So, essentially, regardless of the correct response for trials a1 and a2, the criterion should be based on the desired response, which is "a" for the a_trials, and "b" for the b_trials. 2. Is there a way to counterbalance for odd/even participant numbers using expt so that the desired responses are switched (e.g., for even numbered participants, the desired response for the a1 and a2 trials is now "b", and the desired response for the b1 and b2 trials is now "a"? <values> / num_a_trials_response_a = 0; / num_a1_correct = 0; / num_a2_correct = 0;
/ num_b_trials_response_b = 0; / num_b1_correct = 0; / num_b2_correct = 0; </values>
<expt one> / blocks = [1=block.learning_block1] / subjects = (1 of 2) </expt>
<expt two> / blocks = [1=block.learning_block2] / subjects = (2 of 2) </expt>
<values> / a_learned = false / a1_learned = false / a2_learned = false
/ b_learned = false / b1_learned = false / b2_learned = false </values>
<values> / a_trial_count = trial.a1_trial.trialcount + trial.a2_trial.trialcount / b_trial_count = trial.b1_trial.trialcount + trial.b2_trial.trialcount </values>
<page blocksummary> ^Number of A trials in this block: <%values.a_trial_count%> ^Number of A trials in this block where 'A' was the response: <%???%> ^A desired response: <%values.a_learned%>
^Number of A1 trials in this block: <%trial.a1_trial.trialcount%> ^Number correct A1 trials in this block: <%trial.a1_trial.percentcorrect%> ^A1 learned: <%values.a1_learned%>
^Number of A2 trials in this block: <%trial.a2_trial.trialcount%> ^Number correct A2 trials in this block: <%trial.a2_trial.percentcorrect%> ^A2 learned: <%values.a2_learned%>
^Number of B trials in this block: <%values.b_trial_count%> ^Number of B trials in this block where 'A' was the response: <%???%> ^B desired response: <%values.b_learned%>
^Number of B1 trials in this block: <%trial.b1_trial.trialcount%> ^Number correct B1 trials in this block: <%trial.b1_trial.percentcorrect%> ^B1 learned: <%values.b1_learned%>
^Number of B2 trials in this block: <%trial.b2_trial.trialcount%> ^Number correct B2 trials in this block: <%trial.b2_trial.percentcorrect%> ^B2 learned: <%values.b2_learned%> </page>
<block learning_block1> / postinstructions = (page.blocksummary) / onblockend = [ if (values.num_a_trials_response_a >= 3) { values.a1_learned = true; values.a2_learned = true; }; if (values.num_b_trials_response_b >= 3) { values.b1_learned = true; values.b2_learned = true; } ] / trials=[1-18=noreplace(trial.a1_trial, trial.a1_trial, trial.a2_trial, trial.b1_trial, trial.b2_trial, trial.b2_trial)] / branch = [ if (!values.a1_learned || !values.a2_learned || !values.b1_learned || !values.b2_learned) { // if either hasn't been learned, run another learning block return block.learning_block; } ] </block>
<trial a1_trial> / skip = [ values.a1_learned; ] / ontrialend = [ values.num_a1_correct = trial.a1_trial.correctCount ]
/ stimulusframes = [1=clearscreen, a1_trial_stimulus] / inputdevice = keyboard / validresponse = ("a", "b") / correctresponse = ("a") / branch = [ { return trial.feedback_screen } ] </trial>
<text a1_trial_stimulus> / items = ("Stimulus A1") / hposition = 50% </text>
<trial a2_trial> / skip = [ values.a2_learned; ] / ontrialend = [ values.num_a2_correct = trial.a2_trial.correctCount ]
/ stimulusframes = [1=clearscreen, a2_trial_stimulus] / inputdevice = keyboard / validresponse = ("a", "b") / correctresponse = ("b") / branch = [ { return trial.feedback_screen } ] </trial>
<text a2_trial_stimulus> / items = ("Stimulus A2") / hposition = 50% </text>
<trial b1_trial> / skip = [ values.b1_learned; ]
/ ontrialend = [ values.num_b1_correct = trial.b1_trial.correctCount ] / stimulusframes = [1=clearscreen, b1_trial_stimulus] / inputdevice = keyboard / validresponse = ("a", "b") / correctresponse = ("b") / branch = [ { return trial.feedback_screen } ] </trial>
<text b1_trial_stimulus> / items = ("Stimulus B1") / hposition = 50% </text>
<trial b2_trial> / skip = [ values.b2_learned; ]
/ ontrialend = [ values.num_b2_correct = trial.b2_trial.correctCount ] / stimulusframes = [1=clearscreen, b2_trial_stimulus] / inputdevice = keyboard / validresponse = ("a", "b") / correctresponse = ("a") / branch = [ { return trial.feedback_screen } ] </trial>
<text b2_trial_stimulus> / items = ("Stimulus B2") / hposition = 50% </text>
<trial feedback_screen> / stimulustimes = [0=clearscreen; 50=feedback_screen; 100=num_a1_correct; 100=num_a2_correct; 200=num_b1_correct; 200=num_b2_correct] / timeout = 1500 </trial>
<text feedback_screen> / items = ("Feedback Screen") / fontstyle = ("Courier", 18pt, true) / color = blue / size = (80%, 20%) / position = (50%, 30%) </text>
<text num_a1_correct> / items = ("Percentage Stimulus A1 Correct: <%values.num_a1_correct%>") / fontstyle = ("Courier", 18pt, true) / color = blue / size = (80%, 20%) / position = (50%, 40%) </text>
<text num_a2_correct> / items = ("Percentage Stimulus A2 Correct: <%values.num_a2_correct%>") / fontstyle = ("Courier", 18pt, true) / color = blue / size = (80%, 20%) / position = (50%, 50%) </text>
<text num_b1_correct> / items = ("Percentage Stimulus B1 Correct: <%values.num_b1_correct%>") / fontstyle = ("Courier", 18pt, true) / color = blue / size = (80%, 20%) / position = (50%, 60%) </text>
<text num_b2_correct> / items = ("Percentage Stimulus B2 Correct: <%values.num_b2_correct%>") / fontstyle = ("Courier", 18pt, true) / color = blue / size = (80%, 20%) / position = (50%, 70%) </text>
<data> / columns = (date time subject group session blocknum blockcode trialnum trialcode stimulusitem stimulusitem response latency correct values.num_a1_correct values.num_a2_correct values.num_b1_correct values.num_b2_correct trial.a1_trial.percentcorrect trial.a2_trial.percentcorrect trial.b1_trial.percentcorrect trial.b2_trial.percentcorrect values.a1_learned, values.a2_learned, values.b1_learned values.b2_learned) </data>
Thanks! You count things up in variables and skip on that basis. As simple as that. As for counterbalancing, parameterize the correct responses, define two expt elements, set the correct responses to the applicable values /onexptbegin respectively. Thanks! Would it be a case of using an IF statement to count if the desired key was pressed in each trial, or is there a more efficient way to achieve this? For example, if the desired response is "z" (scan code 44): / ontrialend = [ if (trial.a_trial.response == 44) { values.num_a_correct += 1; } else { values.num_a_correct += 0; } ] Yes, as you can clearly see in the example code I gave you. No, there isn't a more eficient way, and there is nothing inefficient about using conditional logic in the first place Ok, sounds good. Thanks for all your help so far! :)
|
|
|
Dave
|
|
Group: Administrators
Posts: 13K,
Visits: 104K
|
+x+x+xHi Dave, Given the code below: 1. How can I make it so that when the response is "a" 3 or more times for both/either the a1 and a2 trials, both the a1 and a2 trials are skipped when that criterion is met. The same applies for the b1 and b2 trials. Despite the fact that the a2 trial's correct response is "b", and the b2 trial's correct response is "a"? So, essentially, regardless of the correct response for trials a1 and a2, the criterion should be based on the desired response, which is "a" for the a_trials, and "b" for the b_trials. 2. Is there a way to counterbalance for odd/even participant numbers using expt so that the desired responses are switched (e.g., for even numbered participants, the desired response for the a1 and a2 trials is now "b", and the desired response for the b1 and b2 trials is now "a"? <values> / num_a_trials_response_a = 0; / num_a1_correct = 0; / num_a2_correct = 0;
/ num_b_trials_response_b = 0; / num_b1_correct = 0; / num_b2_correct = 0; </values>
<expt one> / blocks = [1=block.learning_block1] / subjects = (1 of 2) </expt>
<expt two> / blocks = [1=block.learning_block2] / subjects = (2 of 2) </expt>
<values> / a_learned = false / a1_learned = false / a2_learned = false
/ b_learned = false / b1_learned = false / b2_learned = false </values>
<values> / a_trial_count = trial.a1_trial.trialcount + trial.a2_trial.trialcount / b_trial_count = trial.b1_trial.trialcount + trial.b2_trial.trialcount </values>
<page blocksummary> ^Number of A trials in this block: <%values.a_trial_count%> ^Number of A trials in this block where 'A' was the response: <%???%> ^A desired response: <%values.a_learned%>
^Number of A1 trials in this block: <%trial.a1_trial.trialcount%> ^Number correct A1 trials in this block: <%trial.a1_trial.percentcorrect%> ^A1 learned: <%values.a1_learned%>
^Number of A2 trials in this block: <%trial.a2_trial.trialcount%> ^Number correct A2 trials in this block: <%trial.a2_trial.percentcorrect%> ^A2 learned: <%values.a2_learned%>
^Number of B trials in this block: <%values.b_trial_count%> ^Number of B trials in this block where 'A' was the response: <%???%> ^B desired response: <%values.b_learned%>
^Number of B1 trials in this block: <%trial.b1_trial.trialcount%> ^Number correct B1 trials in this block: <%trial.b1_trial.percentcorrect%> ^B1 learned: <%values.b1_learned%>
^Number of B2 trials in this block: <%trial.b2_trial.trialcount%> ^Number correct B2 trials in this block: <%trial.b2_trial.percentcorrect%> ^B2 learned: <%values.b2_learned%> </page>
<block learning_block1> / postinstructions = (page.blocksummary) / onblockend = [ if (values.num_a_trials_response_a >= 3) { values.a1_learned = true; values.a2_learned = true; }; if (values.num_b_trials_response_b >= 3) { values.b1_learned = true; values.b2_learned = true; } ] / trials=[1-18=noreplace(trial.a1_trial, trial.a1_trial, trial.a2_trial, trial.b1_trial, trial.b2_trial, trial.b2_trial)] / branch = [ if (!values.a1_learned || !values.a2_learned || !values.b1_learned || !values.b2_learned) { // if either hasn't been learned, run another learning block return block.learning_block; } ] </block>
<trial a1_trial> / skip = [ values.a1_learned; ] / ontrialend = [ values.num_a1_correct = trial.a1_trial.correctCount ]
/ stimulusframes = [1=clearscreen, a1_trial_stimulus] / inputdevice = keyboard / validresponse = ("a", "b") / correctresponse = ("a") / branch = [ { return trial.feedback_screen } ] </trial>
<text a1_trial_stimulus> / items = ("Stimulus A1") / hposition = 50% </text>
<trial a2_trial> / skip = [ values.a2_learned; ] / ontrialend = [ values.num_a2_correct = trial.a2_trial.correctCount ]
/ stimulusframes = [1=clearscreen, a2_trial_stimulus] / inputdevice = keyboard / validresponse = ("a", "b") / correctresponse = ("b") / branch = [ { return trial.feedback_screen } ] </trial>
<text a2_trial_stimulus> / items = ("Stimulus A2") / hposition = 50% </text>
<trial b1_trial> / skip = [ values.b1_learned; ]
/ ontrialend = [ values.num_b1_correct = trial.b1_trial.correctCount ] / stimulusframes = [1=clearscreen, b1_trial_stimulus] / inputdevice = keyboard / validresponse = ("a", "b") / correctresponse = ("b") / branch = [ { return trial.feedback_screen } ] </trial>
<text b1_trial_stimulus> / items = ("Stimulus B1") / hposition = 50% </text>
<trial b2_trial> / skip = [ values.b2_learned; ]
/ ontrialend = [ values.num_b2_correct = trial.b2_trial.correctCount ] / stimulusframes = [1=clearscreen, b2_trial_stimulus] / inputdevice = keyboard / validresponse = ("a", "b") / correctresponse = ("a") / branch = [ { return trial.feedback_screen } ] </trial>
<text b2_trial_stimulus> / items = ("Stimulus B2") / hposition = 50% </text>
<trial feedback_screen> / stimulustimes = [0=clearscreen; 50=feedback_screen; 100=num_a1_correct; 100=num_a2_correct; 200=num_b1_correct; 200=num_b2_correct] / timeout = 1500 </trial>
<text feedback_screen> / items = ("Feedback Screen") / fontstyle = ("Courier", 18pt, true) / color = blue / size = (80%, 20%) / position = (50%, 30%) </text>
<text num_a1_correct> / items = ("Percentage Stimulus A1 Correct: <%values.num_a1_correct%>") / fontstyle = ("Courier", 18pt, true) / color = blue / size = (80%, 20%) / position = (50%, 40%) </text>
<text num_a2_correct> / items = ("Percentage Stimulus A2 Correct: <%values.num_a2_correct%>") / fontstyle = ("Courier", 18pt, true) / color = blue / size = (80%, 20%) / position = (50%, 50%) </text>
<text num_b1_correct> / items = ("Percentage Stimulus B1 Correct: <%values.num_b1_correct%>") / fontstyle = ("Courier", 18pt, true) / color = blue / size = (80%, 20%) / position = (50%, 60%) </text>
<text num_b2_correct> / items = ("Percentage Stimulus B2 Correct: <%values.num_b2_correct%>") / fontstyle = ("Courier", 18pt, true) / color = blue / size = (80%, 20%) / position = (50%, 70%) </text>
<data> / columns = (date time subject group session blocknum blockcode trialnum trialcode stimulusitem stimulusitem response latency correct values.num_a1_correct values.num_a2_correct values.num_b1_correct values.num_b2_correct trial.a1_trial.percentcorrect trial.a2_trial.percentcorrect trial.b1_trial.percentcorrect trial.b2_trial.percentcorrect values.a1_learned, values.a2_learned, values.b1_learned values.b2_learned) </data>
Thanks! You count things up in variables and skip on that basis. As simple as that. As for counterbalancing, parameterize the correct responses, define two expt elements, set the correct responses to the applicable values /onexptbegin respectively. Thanks! Would it be a case of using an IF statement to count if the desired key was pressed in each trial, or is there a more efficient way to achieve this? For example, if the desired response is "z" (scan code 44): / ontrialend = [ if (trial.a_trial.response == 44) { values.num_a_correct += 1; } else { values.num_a_correct += 0; } ] Yes, as you can clearly see in the example code I gave you. No, there isn't a more eficient way, and there is nothing inefficient about using conditional logic in the first place
|
|
|
raven
|
|
Group: Forum Members
Posts: 52,
Visits: 110
|
+x+xHi Dave, Given the code below: 1. How can I make it so that when the response is "a" 3 or more times for both/either the a1 and a2 trials, both the a1 and a2 trials are skipped when that criterion is met. The same applies for the b1 and b2 trials. Despite the fact that the a2 trial's correct response is "b", and the b2 trial's correct response is "a"? So, essentially, regardless of the correct response for trials a1 and a2, the criterion should be based on the desired response, which is "a" for the a_trials, and "b" for the b_trials. 2. Is there a way to counterbalance for odd/even participant numbers using expt so that the desired responses are switched (e.g., for even numbered participants, the desired response for the a1 and a2 trials is now "b", and the desired response for the b1 and b2 trials is now "a"? <values> / num_a_trials_response_a = 0; / num_a1_correct = 0; / num_a2_correct = 0;
/ num_b_trials_response_b = 0; / num_b1_correct = 0; / num_b2_correct = 0; </values>
<expt one> / blocks = [1=block.learning_block1] / subjects = (1 of 2) </expt>
<expt two> / blocks = [1=block.learning_block2] / subjects = (2 of 2) </expt>
<values> / a_learned = false / a1_learned = false / a2_learned = false
/ b_learned = false / b1_learned = false / b2_learned = false </values>
<values> / a_trial_count = trial.a1_trial.trialcount + trial.a2_trial.trialcount / b_trial_count = trial.b1_trial.trialcount + trial.b2_trial.trialcount </values>
<page blocksummary> ^Number of A trials in this block: <%values.a_trial_count%> ^Number of A trials in this block where 'A' was the response: <%???%> ^A desired response: <%values.a_learned%>
^Number of A1 trials in this block: <%trial.a1_trial.trialcount%> ^Number correct A1 trials in this block: <%trial.a1_trial.percentcorrect%> ^A1 learned: <%values.a1_learned%>
^Number of A2 trials in this block: <%trial.a2_trial.trialcount%> ^Number correct A2 trials in this block: <%trial.a2_trial.percentcorrect%> ^A2 learned: <%values.a2_learned%>
^Number of B trials in this block: <%values.b_trial_count%> ^Number of B trials in this block where 'A' was the response: <%???%> ^B desired response: <%values.b_learned%>
^Number of B1 trials in this block: <%trial.b1_trial.trialcount%> ^Number correct B1 trials in this block: <%trial.b1_trial.percentcorrect%> ^B1 learned: <%values.b1_learned%>
^Number of B2 trials in this block: <%trial.b2_trial.trialcount%> ^Number correct B2 trials in this block: <%trial.b2_trial.percentcorrect%> ^B2 learned: <%values.b2_learned%> </page>
<block learning_block1> / postinstructions = (page.blocksummary) / onblockend = [ if (values.num_a_trials_response_a >= 3) { values.a1_learned = true; values.a2_learned = true; }; if (values.num_b_trials_response_b >= 3) { values.b1_learned = true; values.b2_learned = true; } ] / trials=[1-18=noreplace(trial.a1_trial, trial.a1_trial, trial.a2_trial, trial.b1_trial, trial.b2_trial, trial.b2_trial)] / branch = [ if (!values.a1_learned || !values.a2_learned || !values.b1_learned || !values.b2_learned) { // if either hasn't been learned, run another learning block return block.learning_block; } ] </block>
<trial a1_trial> / skip = [ values.a1_learned; ] / ontrialend = [ values.num_a1_correct = trial.a1_trial.correctCount ]
/ stimulusframes = [1=clearscreen, a1_trial_stimulus] / inputdevice = keyboard / validresponse = ("a", "b") / correctresponse = ("a") / branch = [ { return trial.feedback_screen } ] </trial>
<text a1_trial_stimulus> / items = ("Stimulus A1") / hposition = 50% </text>
<trial a2_trial> / skip = [ values.a2_learned; ] / ontrialend = [ values.num_a2_correct = trial.a2_trial.correctCount ]
/ stimulusframes = [1=clearscreen, a2_trial_stimulus] / inputdevice = keyboard / validresponse = ("a", "b") / correctresponse = ("b") / branch = [ { return trial.feedback_screen } ] </trial>
<text a2_trial_stimulus> / items = ("Stimulus A2") / hposition = 50% </text>
<trial b1_trial> / skip = [ values.b1_learned; ]
/ ontrialend = [ values.num_b1_correct = trial.b1_trial.correctCount ] / stimulusframes = [1=clearscreen, b1_trial_stimulus] / inputdevice = keyboard / validresponse = ("a", "b") / correctresponse = ("b") / branch = [ { return trial.feedback_screen } ] </trial>
<text b1_trial_stimulus> / items = ("Stimulus B1") / hposition = 50% </text>
<trial b2_trial> / skip = [ values.b2_learned; ]
/ ontrialend = [ values.num_b2_correct = trial.b2_trial.correctCount ] / stimulusframes = [1=clearscreen, b2_trial_stimulus] / inputdevice = keyboard / validresponse = ("a", "b") / correctresponse = ("a") / branch = [ { return trial.feedback_screen } ] </trial>
<text b2_trial_stimulus> / items = ("Stimulus B2") / hposition = 50% </text>
<trial feedback_screen> / stimulustimes = [0=clearscreen; 50=feedback_screen; 100=num_a1_correct; 100=num_a2_correct; 200=num_b1_correct; 200=num_b2_correct] / timeout = 1500 </trial>
<text feedback_screen> / items = ("Feedback Screen") / fontstyle = ("Courier", 18pt, true) / color = blue / size = (80%, 20%) / position = (50%, 30%) </text>
<text num_a1_correct> / items = ("Percentage Stimulus A1 Correct: <%values.num_a1_correct%>") / fontstyle = ("Courier", 18pt, true) / color = blue / size = (80%, 20%) / position = (50%, 40%) </text>
<text num_a2_correct> / items = ("Percentage Stimulus A2 Correct: <%values.num_a2_correct%>") / fontstyle = ("Courier", 18pt, true) / color = blue / size = (80%, 20%) / position = (50%, 50%) </text>
<text num_b1_correct> / items = ("Percentage Stimulus B1 Correct: <%values.num_b1_correct%>") / fontstyle = ("Courier", 18pt, true) / color = blue / size = (80%, 20%) / position = (50%, 60%) </text>
<text num_b2_correct> / items = ("Percentage Stimulus B2 Correct: <%values.num_b2_correct%>") / fontstyle = ("Courier", 18pt, true) / color = blue / size = (80%, 20%) / position = (50%, 70%) </text>
<data> / columns = (date time subject group session blocknum blockcode trialnum trialcode stimulusitem stimulusitem response latency correct values.num_a1_correct values.num_a2_correct values.num_b1_correct values.num_b2_correct trial.a1_trial.percentcorrect trial.a2_trial.percentcorrect trial.b1_trial.percentcorrect trial.b2_trial.percentcorrect values.a1_learned, values.a2_learned, values.b1_learned values.b2_learned) </data>
Thanks! You count things up in variables and skip on that basis. As simple as that. As for counterbalancing, parameterize the correct responses, define two expt elements, set the correct responses to the applicable values /onexptbegin respectively. Thanks! Would it be a case of using an IF statement to count if the desired key was pressed in each trial, or is there a more efficient way to achieve this? For example, if the desired response is "z" (scan code 44): / ontrialend = [ if (trial.a_trial.response == 44) { values.num_a_correct += 1; } else { values.num_a_correct += 0; } ]
|
|
|
Dave
|
|
Group: Administrators
Posts: 13K,
Visits: 104K
|
+x+xHi Dave, Given the code below: 1. How can I make it so that when the response is "a" 3 or more times for both/either the a1 and a2 trials, both the a1 and a2 trials are skipped when that criterion is met. The same applies for the b1 and b2 trials. Despite the fact that the a2 trial's correct response is "b", and the b2 trial's correct response is "a"? So, essentially, regardless of the correct response for trials a1 and a2, the criterion should be based on the desired response, which is "a" for the a_trials, and "b" for the b_trials. 2. Is there a way to counterbalance for odd/even participant numbers using expt so that the desired responses are switched (e.g., for even numbered participants, the desired response for the a1 and a2 trials is now "b", and the desired response for the b1 and b2 trials is now "a"? <values> / num_a_trials_response_a = 0; / num_a1_correct = 0; / num_a2_correct = 0;
/ num_b_trials_response_b = 0; / num_b1_correct = 0; / num_b2_correct = 0; </values>
<expt one> / blocks = [1=block.learning_block1] / subjects = (1 of 2) </expt>
<expt two> / blocks = [1=block.learning_block2] / subjects = (2 of 2) </expt>
<values> / a_learned = false / a1_learned = false / a2_learned = false
/ b_learned = false / b1_learned = false / b2_learned = false </values>
<values> / a_trial_count = trial.a1_trial.trialcount + trial.a2_trial.trialcount / b_trial_count = trial.b1_trial.trialcount + trial.b2_trial.trialcount </values>
<page blocksummary> ^Number of A trials in this block: <%values.a_trial_count%> ^Number of A trials in this block where 'A' was the response: <%???%> ^A desired response: <%values.a_learned%>
^Number of A1 trials in this block: <%trial.a1_trial.trialcount%> ^Number correct A1 trials in this block: <%trial.a1_trial.percentcorrect%> ^A1 learned: <%values.a1_learned%>
^Number of A2 trials in this block: <%trial.a2_trial.trialcount%> ^Number correct A2 trials in this block: <%trial.a2_trial.percentcorrect%> ^A2 learned: <%values.a2_learned%>
^Number of B trials in this block: <%values.b_trial_count%> ^Number of B trials in this block where 'A' was the response: <%???%> ^B desired response: <%values.b_learned%>
^Number of B1 trials in this block: <%trial.b1_trial.trialcount%> ^Number correct B1 trials in this block: <%trial.b1_trial.percentcorrect%> ^B1 learned: <%values.b1_learned%>
^Number of B2 trials in this block: <%trial.b2_trial.trialcount%> ^Number correct B2 trials in this block: <%trial.b2_trial.percentcorrect%> ^B2 learned: <%values.b2_learned%> </page>
<block learning_block1> / postinstructions = (page.blocksummary) / onblockend = [ if (values.num_a_trials_response_a >= 3) { values.a1_learned = true; values.a2_learned = true; }; if (values.num_b_trials_response_b >= 3) { values.b1_learned = true; values.b2_learned = true; } ] / trials=[1-18=noreplace(trial.a1_trial, trial.a1_trial, trial.a2_trial, trial.b1_trial, trial.b2_trial, trial.b2_trial)] / branch = [ if (!values.a1_learned || !values.a2_learned || !values.b1_learned || !values.b2_learned) { // if either hasn't been learned, run another learning block return block.learning_block; } ] </block>
<trial a1_trial> / skip = [ values.a1_learned; ] / ontrialend = [ values.num_a1_correct = trial.a1_trial.correctCount ]
/ stimulusframes = [1=clearscreen, a1_trial_stimulus] / inputdevice = keyboard / validresponse = ("a", "b") / correctresponse = ("a") / branch = [ { return trial.feedback_screen } ] </trial>
<text a1_trial_stimulus> / items = ("Stimulus A1") / hposition = 50% </text>
<trial a2_trial> / skip = [ values.a2_learned; ] / ontrialend = [ values.num_a2_correct = trial.a2_trial.correctCount ]
/ stimulusframes = [1=clearscreen, a2_trial_stimulus] / inputdevice = keyboard / validresponse = ("a", "b") / correctresponse = ("b") / branch = [ { return trial.feedback_screen } ] </trial>
<text a2_trial_stimulus> / items = ("Stimulus A2") / hposition = 50% </text>
<trial b1_trial> / skip = [ values.b1_learned; ]
/ ontrialend = [ values.num_b1_correct = trial.b1_trial.correctCount ] / stimulusframes = [1=clearscreen, b1_trial_stimulus] / inputdevice = keyboard / validresponse = ("a", "b") / correctresponse = ("b") / branch = [ { return trial.feedback_screen } ] </trial>
<text b1_trial_stimulus> / items = ("Stimulus B1") / hposition = 50% </text>
<trial b2_trial> / skip = [ values.b2_learned; ]
/ ontrialend = [ values.num_b2_correct = trial.b2_trial.correctCount ] / stimulusframes = [1=clearscreen, b2_trial_stimulus] / inputdevice = keyboard / validresponse = ("a", "b") / correctresponse = ("a") / branch = [ { return trial.feedback_screen } ] </trial>
<text b2_trial_stimulus> / items = ("Stimulus B2") / hposition = 50% </text>
<trial feedback_screen> / stimulustimes = [0=clearscreen; 50=feedback_screen; 100=num_a1_correct; 100=num_a2_correct; 200=num_b1_correct; 200=num_b2_correct] / timeout = 1500 </trial>
<text feedback_screen> / items = ("Feedback Screen") / fontstyle = ("Courier", 18pt, true) / color = blue / size = (80%, 20%) / position = (50%, 30%) </text>
<text num_a1_correct> / items = ("Percentage Stimulus A1 Correct: <%values.num_a1_correct%>") / fontstyle = ("Courier", 18pt, true) / color = blue / size = (80%, 20%) / position = (50%, 40%) </text>
<text num_a2_correct> / items = ("Percentage Stimulus A2 Correct: <%values.num_a2_correct%>") / fontstyle = ("Courier", 18pt, true) / color = blue / size = (80%, 20%) / position = (50%, 50%) </text>
<text num_b1_correct> / items = ("Percentage Stimulus B1 Correct: <%values.num_b1_correct%>") / fontstyle = ("Courier", 18pt, true) / color = blue / size = (80%, 20%) / position = (50%, 60%) </text>
<text num_b2_correct> / items = ("Percentage Stimulus B2 Correct: <%values.num_b2_correct%>") / fontstyle = ("Courier", 18pt, true) / color = blue / size = (80%, 20%) / position = (50%, 70%) </text>
<data> / columns = (date time subject group session blocknum blockcode trialnum trialcode stimulusitem stimulusitem response latency correct values.num_a1_correct values.num_a2_correct values.num_b1_correct values.num_b2_correct trial.a1_trial.percentcorrect trial.a2_trial.percentcorrect trial.b1_trial.percentcorrect trial.b2_trial.percentcorrect values.a1_learned, values.a2_learned, values.b1_learned values.b2_learned) </data>
Thanks! You count things up in variables and skip on that basis. As simple as that. As for counterbalancing, parameterize the correct responses, define two expt elements, set the correct responses to the applicable values /onexptbegin respectively. These are all the exact same techniques that have already been discussed in this very thread. <values> / num_a_trials_response_a = 0; / num_a1_correct = 0; / num_a2_correct = 0;
/ num_b_trials_response_b = 0; / num_b1_correct = 0; / num_b2_correct = 0; </values>
<parameters> / a1_correctkey = "?" / a2_correctkey = "?" / b1_correctkey = "?" / b2_correctkey = "?" </parameters>
<expt one> / onexptbegin = [ parameters.a1_correctkey = "a"; parameters.a2_correctkey = "b"; parameters.b1_correctkey = "b"; parameters.b2_correctkey = "a"; ] / blocks = [1=block.learning_block] / subjects = (1 of 2) </expt>
<expt two> / onexptbegin = [ parameters.a1_correctkey = "b"; parameters.a2_correctkey = "a"; parameters.b1_correctkey = "a"; parameters.b2_correctkey = "b"; ] / blocks = [1=block.learning_block] / subjects = (2 of 2) </expt>
<values> / a_skip = false / b_skip = false / a_responsecount = 0 / b_responsecount = 0 / a_trial_count = 0 / b_trial_count = 0 </values>
<page blocksummary> ^Number of A trials in this block: <%values.a_trial_count%> ^Number of A trials in this block where 'A' was the response: <%values.a_responsecount%>
^Number of B trials in this block: <%values.b_trial_count%> ^Number of B trials in this block where 'B' was the response: <%values.b_responsecount%> </page>
<block learning_block> / postinstructions = (page.blocksummary) / trials=[1-18=noreplace(trial.a1_trial, trial.a1_trial, trial.a2_trial, trial.b1_trial, trial.b2_trial, trial.b2_trial)] </block>
<trial a1_trial> / skip = [ values.a_skip; ] / ontrialend = [ values.a_trial_count += 1; if (trial.a1_trial.responsetext == "a") { values.a_responsecount += 1; }; if (values.a_responsecount >= 3) { values.a_skip = true; }; ] / stimulusframes = [1=clearscreen, a1_trial_stimulus] / inputdevice = keyboard / validresponse = ("a", "b") / correctresponse = (parameters.a1_correctkey) / branch = [ { return trial.feedback_screen } ] </trial>
<text a1_trial_stimulus> / items = ("Stimulus A1") / hposition = 50% </text>
<trial a2_trial> / skip = [ values.a_skip; ] / ontrialend = [ values.a_trial_count += 1; if (trial.a2_trial.responsetext == "a") { values.a_responsecount += 1; }; if (values.a_responsecount >= 3) { values.a_skip = true; }; ] / stimulusframes = [1=clearscreen, a2_trial_stimulus] / inputdevice = keyboard / validresponse = ("a", "b") / correctresponse = (parameters.a2_correctkey) / branch = [ { return trial.feedback_screen } ] </trial>
<text a2_trial_stimulus> / items = ("Stimulus A2") / hposition = 50% </text>
<trial b1_trial> / skip = [ values.b_skip; ] / ontrialend = [ values.b_trial_count += 1; if (trial.b1_trial.responsetext == "b") { values.b_responsecount += 1; }; if (values.b_responsecount >= 3) { values.b_skip = true; }; ] / stimulusframes = [1=clearscreen, b1_trial_stimulus] / inputdevice = keyboard / validresponse = ("a", "b") / correctresponse = (parameters.b1_correctkey) / branch = [ { return trial.feedback_screen } ] </trial>
<text b1_trial_stimulus> / items = ("Stimulus B1") / hposition = 50% </text>
<trial b2_trial> / skip = [ values.b_skip; ] / ontrialend = [ values.b_trial_count += 1; if (trial.b2_trial.responsetext == "b") { values.b_responsecount += 1; }; if (values.b_responsecount >= 3) { values.b_skip = true; }; ] / stimulusframes = [1=clearscreen, b2_trial_stimulus] / inputdevice = keyboard / validresponse = ("a", "b") / correctresponse = (parameters.b2_correctkey) / branch = [ { return trial.feedback_screen } ] </trial>
<text b2_trial_stimulus> / items = ("Stimulus B2") / hposition = 50% </text>
<trial feedback_screen> / stimulustimes = [0=clearscreen; 50=feedback_screen; 100=num_a1_correct; 100=num_a2_correct; 200=num_b1_correct; 200=num_b2_correct] / timeout = 1500 </trial>
<text feedback_screen> / items = ("Feedback Screen") / fontstyle = ("Courier", 18pt, true) / color = blue / size = (80%, 20%) / position = (50%, 30%) </text>
<text num_a1_correct> / items = ("Percentage Stimulus A1 Correct: <%trial.a1_trial.percentcorrect%>") / fontstyle = ("Courier", 18pt, true) / color = blue / size = (80%, 20%) / position = (50%, 40%) </text>
<text num_a2_correct> / items = ("Percentage Stimulus A2 Correct: <%trial.a2_trial.percentcorrect%>") / fontstyle = ("Courier", 18pt, true) / color = blue / size = (80%, 20%) / position = (50%, 50%) </text>
<text num_b1_correct> / items = ("Percentage Stimulus B1 Correct: <%trial.b1_trial.percentcorrect%>") / fontstyle = ("Courier", 18pt, true) / color = blue / size = (80%, 20%) / position = (50%, 60%) </text>
<text num_b2_correct> / items = ("Percentage Stimulus B2 Correct: <%trial.b2_trial.percentcorrect%>") / fontstyle = ("Courier", 18pt, true) / color = blue / size = (80%, 20%) / position = (50%, 70%) </text>
<data> / columns = (date time subject group session blocknum blockcode trialnum trialcode stimulusitem stimulusitem response latency correct trial.a1_trial.percentcorrect trial.a2_trial.percentcorrect trial.b1_trial.percentcorrect trial.b2_trial.percentcorrect values.a_responsecount, values.b_responsecount, values.a_skip, values.b_skip) </data>
|
|
|
Dave
|
|
Group: Administrators
Posts: 13K,
Visits: 104K
|
+xHi Dave, Given the code below: 1. How can I make it so that when the response is "a" 3 or more times for both/either the a1 and a2 trials, both the a1 and a2 trials are skipped when that criterion is met. The same applies for the b1 and b2 trials. Despite the fact that the a2 trial's correct response is "b", and the b2 trial's correct response is "a"? So, essentially, regardless of the correct response for trials a1 and a2, the criterion should be based on the desired response, which is "a" for the a_trials, and "b" for the b_trials. 2. Is there a way to counterbalance for odd/even participant numbers using expt so that the desired responses are switched (e.g., for even numbered participants, the desired response for the a1 and a2 trials is now "b", and the desired response for the b1 and b2 trials is now "a"? <values> / num_a_trials_response_a = 0; / num_a1_correct = 0; / num_a2_correct = 0;
/ num_b_trials_response_b = 0; / num_b1_correct = 0; / num_b2_correct = 0; </values>
<expt one> / blocks = [1=block.learning_block1] / subjects = (1 of 2) </expt>
<expt two> / blocks = [1=block.learning_block2] / subjects = (2 of 2) </expt>
<values> / a_learned = false / a1_learned = false / a2_learned = false
/ b_learned = false / b1_learned = false / b2_learned = false </values>
<values> / a_trial_count = trial.a1_trial.trialcount + trial.a2_trial.trialcount / b_trial_count = trial.b1_trial.trialcount + trial.b2_trial.trialcount </values>
<page blocksummary> ^Number of A trials in this block: <%values.a_trial_count%> ^Number of A trials in this block where 'A' was the response: <%???%> ^A desired response: <%values.a_learned%>
^Number of A1 trials in this block: <%trial.a1_trial.trialcount%> ^Number correct A1 trials in this block: <%trial.a1_trial.percentcorrect%> ^A1 learned: <%values.a1_learned%>
^Number of A2 trials in this block: <%trial.a2_trial.trialcount%> ^Number correct A2 trials in this block: <%trial.a2_trial.percentcorrect%> ^A2 learned: <%values.a2_learned%>
^Number of B trials in this block: <%values.b_trial_count%> ^Number of B trials in this block where 'A' was the response: <%???%> ^B desired response: <%values.b_learned%>
^Number of B1 trials in this block: <%trial.b1_trial.trialcount%> ^Number correct B1 trials in this block: <%trial.b1_trial.percentcorrect%> ^B1 learned: <%values.b1_learned%>
^Number of B2 trials in this block: <%trial.b2_trial.trialcount%> ^Number correct B2 trials in this block: <%trial.b2_trial.percentcorrect%> ^B2 learned: <%values.b2_learned%> </page>
<block learning_block1> / postinstructions = (page.blocksummary) / onblockend = [ if (values.num_a_trials_response_a >= 3) { values.a1_learned = true; values.a2_learned = true; }; if (values.num_b_trials_response_b >= 3) { values.b1_learned = true; values.b2_learned = true; } ] / trials=[1-18=noreplace(trial.a1_trial, trial.a1_trial, trial.a2_trial, trial.b1_trial, trial.b2_trial, trial.b2_trial)] / branch = [ if (!values.a1_learned || !values.a2_learned || !values.b1_learned || !values.b2_learned) { // if either hasn't been learned, run another learning block return block.learning_block; } ] </block>
<trial a1_trial> / skip = [ values.a1_learned; ] / ontrialend = [ values.num_a1_correct = trial.a1_trial.correctCount ]
/ stimulusframes = [1=clearscreen, a1_trial_stimulus] / inputdevice = keyboard / validresponse = ("a", "b") / correctresponse = ("a") / branch = [ { return trial.feedback_screen } ] </trial>
<text a1_trial_stimulus> / items = ("Stimulus A1") / hposition = 50% </text>
<trial a2_trial> / skip = [ values.a2_learned; ] / ontrialend = [ values.num_a2_correct = trial.a2_trial.correctCount ]
/ stimulusframes = [1=clearscreen, a2_trial_stimulus] / inputdevice = keyboard / validresponse = ("a", "b") / correctresponse = ("b") / branch = [ { return trial.feedback_screen } ] </trial>
<text a2_trial_stimulus> / items = ("Stimulus A2") / hposition = 50% </text>
<trial b1_trial> / skip = [ values.b1_learned; ]
/ ontrialend = [ values.num_b1_correct = trial.b1_trial.correctCount ] / stimulusframes = [1=clearscreen, b1_trial_stimulus] / inputdevice = keyboard / validresponse = ("a", "b") / correctresponse = ("b") / branch = [ { return trial.feedback_screen } ] </trial>
<text b1_trial_stimulus> / items = ("Stimulus B1") / hposition = 50% </text>
<trial b2_trial> / skip = [ values.b2_learned; ]
/ ontrialend = [ values.num_b2_correct = trial.b2_trial.correctCount ] / stimulusframes = [1=clearscreen, b2_trial_stimulus] / inputdevice = keyboard / validresponse = ("a", "b") / correctresponse = ("a") / branch = [ { return trial.feedback_screen } ] </trial>
<text b2_trial_stimulus> / items = ("Stimulus B2") / hposition = 50% </text>
<trial feedback_screen> / stimulustimes = [0=clearscreen; 50=feedback_screen; 100=num_a1_correct; 100=num_a2_correct; 200=num_b1_correct; 200=num_b2_correct] / timeout = 1500 </trial>
<text feedback_screen> / items = ("Feedback Screen") / fontstyle = ("Courier", 18pt, true) / color = blue / size = (80%, 20%) / position = (50%, 30%) </text>
<text num_a1_correct> / items = ("Percentage Stimulus A1 Correct: <%values.num_a1_correct%>") / fontstyle = ("Courier", 18pt, true) / color = blue / size = (80%, 20%) / position = (50%, 40%) </text>
<text num_a2_correct> / items = ("Percentage Stimulus A2 Correct: <%values.num_a2_correct%>") / fontstyle = ("Courier", 18pt, true) / color = blue / size = (80%, 20%) / position = (50%, 50%) </text>
<text num_b1_correct> / items = ("Percentage Stimulus B1 Correct: <%values.num_b1_correct%>") / fontstyle = ("Courier", 18pt, true) / color = blue / size = (80%, 20%) / position = (50%, 60%) </text>
<text num_b2_correct> / items = ("Percentage Stimulus B2 Correct: <%values.num_b2_correct%>") / fontstyle = ("Courier", 18pt, true) / color = blue / size = (80%, 20%) / position = (50%, 70%) </text>
<data> / columns = (date time subject group session blocknum blockcode trialnum trialcode stimulusitem stimulusitem response latency correct values.num_a1_correct values.num_a2_correct values.num_b1_correct values.num_b2_correct trial.a1_trial.percentcorrect trial.a2_trial.percentcorrect trial.b1_trial.percentcorrect trial.b2_trial.percentcorrect values.a1_learned, values.a2_learned, values.b1_learned values.b2_learned) </data>
Thanks! You count things up in variables and skip on that basis. As simple as that. As for counterbalancing, parameterize the correct responses, define two expt elements, set the correct responses to the applicable values /onexptbegin respectively.
|
|
|