Feedback at the end of the block

David McFarlane mcfarla9 at msu.edu
Mon Nov 18 20:12:40 UTC 2013


Fernanda,

Your puzzle interests me, but I cannot get to the puzzle itself 
because of problems in your code excerpts....


0) You did not say so, but I presume that you defined your Summation 
objects as global variables in the global User Script area, thus,

     Dim CorrectTimes as Summation
     Dim AverageAccuracy as Summation

Did you do that?


1) At one place your code uses "CorrecTimes", and at another 
"CorrectTimes".  Those are two different variable names, you have to 
pick one or the other (I presume you meant "CorrectTimes" for both).


2) Your code for after ResponseObject includes the line

     AverageAccuracy.AddObservation TempoResposta.ACC

but you have not used TempoResposta anywhere else.  I suppose you 
mean AverageAccuracy.ACC here, but you should clarify that.

While I am at it, I would change the code for CorrectTimes to merely

     If (ResponseObject.ACC = "1") Then CorrectTimes.AddObservation 
ResponseObject.RT

or even further to just

     If ResponseObject.ACC Then CorrectTimes.AddObservation ResponseObject.RT


3) Your code at the end of the block contains two syntax 
errors.  First, you have not closed off the quotes around the 0.00 at 
the end of your first line.  Second, CDbl() takes only one argument, 
but on the second line you have placed the parentheses around two 
arguments.  For that matter, you should not need the CDbl() and 
CString() conversions at all, the following should work just as well:

     c.SetAttrib "BlockRT", Format( CorrectTimes.Mean, "0.00" )
     c.SetAttrib "BlockACC", Format( (AverageAccuracy.Mean * 100), "0.00" )


I discovered all this merely by pasting your own code into E-Studio 
and attempting to compile, at which time I got compile-time 
errors.  When posting code to the Group, best to copy code excerpts 
directly from your E-Studio files rather than retyping into a 
message.  I had to give up any further exploration after running into 
all these errors because I do not know if any of those might cause 
your problem.

With that said, I will add one more thing that may affect your 
feedback calculation.  You must make sure that the code after 
ResponseObject does *not* execute until after ResponseObject gets a 
response!  You may do that in several ways:
     - Run another stimulus object between your ResponseObject and 
the inline code.
     - Set Duration of ResponseObject to "(infinite)" (and of course 
End Action to "Terminate").
     - Set PreRelease of ResponseObject to 0.
Otherwise, if your inline code runs during the presentation of 
ResponseObject but before it gets a response (very easy to do with 
PreRelease and a finite Duration), then the feedback calcuations will 
be wrong.  This has become a particular problem as users with habits 
learned in older versions of E-Prime move up to EP2.0.10 (I know, I 
got bit by this myself just last week!).

-----
David McFarlane
E-Prime training 
online:  http://psychology.msu.edu/Workshops_Courses/eprime.aspx
Twitter:  @EPrimeMaster (https://twitter.com/EPrimeMaster )

/----
Stock reminder:  1) I do not work for PST.  2) PST's trained staff 
take any and all questions at https://support.pstnet.com , and they 
strive to respond to all requests in 24-48 hours, so make full use of 
it.  3) In addition, PST offers several instructional videos on their 
YouTube channel (http://www.youtube.com/user/PSTNET ).  4) If you do 
get an answer from PST staff, please extend the courtesy of posting 
their reply back here for the sake of others.
\----


At 11/15/2013 03:52 PM Friday, Fernanda Sais wrote:
>Hi,
>
>I am trying to set a feedback to be displayed at the end of each 
>block. It works very well for the mean reaction time with different 
>methods, but for the average accuracy I always have the same problem 
>- the average accuracy displayed is far lower than expected for the 
>number of errors commited: it should display something like 90-99% 
>but it displays something like 60-79%, so I guess there is something 
>I'm missing about it. The accuracy information is computed correctly 
>into the data file, it is incorrect only in the feedback display.
>
>The code I'm using now is:
>
>'At Block Setup:
>
>Set CorrecTimes = New Summation
>Set AverageAccuracy = New Summation
>
>'After ResponseObject:
>
>If ResponseObject.ACC = "1" Then
>CorrectTimes.AddObservation c.GetAttrib("ResponseObject.RT")
>End If
>
>AverageAccuracy.AddObservation TempoResposta.ACC
>
>'At the End of the Block:
>
>c.SetAttrib"BlockRT", Format(CStr(CDbl(CorrectTimes.Mean)),"0.00)
>c.SetAttrib"BlockACC", Format(CStr(CDbl(AverageAccuracy.Mean*100,"0.00")
>
>Then there is Text Display like that:
>
>Your results for this block:
>Mean Reaction Time:
>[BlockRT]ms
>Average Accuracy:
>[BlockACC]% Correct Responses
>
>Thanks a lot for any comment on that - I'm really running out of ideas.
>
>Best wishes,
>
>Fernanda

-- 
You received this message because you are subscribed to the Google Groups "E-Prime" group.
To unsubscribe from this group and stop receiving emails from it, send an email to e-prime+unsubscribe at googlegroups.com.
To post to this group, send email to e-prime at googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/e-prime/528a74c4.6801320a.08e7.7ea4SMTPIN_ADDED_MISSING%40gmr-mx.google.com.
For more options, visit https://groups.google.com/groups/opt_out.



More information about the Eprime mailing list