Hi Kelsey, <br><br>Have you defined the attribute globally on the user tab of the generated script? To count across multiple blocks or reference the counter variable at the highest level of the task, you need to define the variable on the user tab of the script. I can send an example scirpt where I have used counter variables like these, if you like. <br><br>Hope this helps, <br>Holly<br><br>On Wednesday, June 5, 2013 9:47:58 AM UTC-4, kelsey.lei...@gmail.com wrote:<blockquote class="gmail_quote" style="margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">Hi all,<div> In my experiment there is a condition where the subject can choice between two responses (either "n" or "b" key presses). I want to keep track of how many times the participant selects each key (n or b) and present a total for each key type at the end of each block. I've inserted my code here showing how I am counting response selection. As you can see I am setting two separate attributes: c.SetAttrib "total_b" and c.SetAttrib "total_n". I've tried to reference these attributes later in a Text Object, but E prime says, "no such attribute". </div><div><br></div><div><div>' choice_selection</div><div>If ((c.GetAttrib("Cue") = "E") And (currentresponse = ("n"))) Then</div><div>count_n = count_n +1 </div><div>Else If ((c.GetAttrib("Cue") = "E") And (currentresponse = ("b"))) Then</div><div>count_b = count_b +1 </div><div>End If</div><div>End If</div><div><br></div><div>If ((c.GetAttrib("Cue") = "E") And (currentresponse = ("n"))) Then</div><div>c.SetAttrib "total_n", count_n </div><div>Else If ((c.GetAttrib("Cue") = "E") And (currentresponse = ("b"))) Then</div><div>c.SetAttrib "total_b", count_b </div><div>End If</div><div>End If</div></div><div><br></div><div>If there is anything I can clarify please let me know. Thanks for your time and answers.</div><div>Best,</div><div>Kelsey</div></blockquote>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups "E-Prime" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an email to e-prime+unsubscribe@googlegroups.com.<br />
To post to this group, send email to e-prime@googlegroups.com.<br />
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/e-prime/f0f238de-39a9-49d8-956f-1e5f1a459978%40googlegroups.com?hl=en-US">https://groups.google.com/d/msgid/e-prime/f0f238de-39a9-49d8-956f-1e5f1a459978%40googlegroups.com?hl=en-US</a>.<br />
For more options, visit <a href="https://groups.google.com/groups/opt_out">https://groups.google.com/groups/opt_out</a>.<br />
<br />
<br />