If you don’t use E-Prime for psychological experiments, skip this post.
It’s written for the benefit of psychologists who have the misfortune of using E-Prime without a programmer husband to help them out.
E-Prime only allows you to display feedback after each stimulus:

What if you want to show feedback after each block? This won’t work:

Because in this case, only the last response in each block will be added to the statistics. Worse, the feedback screen will show “Correct” or “Incorrect”, according to that last response.
I succeeded to solve the problem by taking some of the Basic code generated by E-Studio and customizing it. This is the updated experiment:

As you see, Feedback now resides under Unreferenced objects, i.e., it doesn’t reside inside a procedure. To achieve this, either delete Feedback from the procedure it already resides in, or, if you haven’t created it yet, drag the FeedbackDisplay button to the background of the E-Prime window. In both cases Feedback will be unreferenced.
There are also two InLines. An InLine is a piece of code (program) that you can write yourself. When you double-click on an InLine, you get an empty page where you can write code. Here is the code you need in AddStats (note the small “copy to clipboard” link at the top):
'Add an observation to the accuracy stats Feedback.AccStats.AddObservation Stimulus.Acc 'Add an observation to the response time stats ' unless the user did not respond If Len(Stimulus.RESP) > 0 Then Feedback.RTStats.AddObservation Stimulus.RT Feedback.CorrectRTStats.AddObservation Stimulus.RT End If
Here is the code for ShowFeedback:
'Generate statistics text to be shown
'Note that if you add more text and then see that statistics appear in the wrong places,
'try changing the numbers in Objects(1) and Objects(2)
Set Feedback_SlideText = CSlideText(Feedback.States.Item("Correct").Objects(1))
Feedback_SlideText.Text = "" & _
Format$((Feedback.ACCStats.Mean / Feedback.ACCDivisor),Feedback.ACCFormat) & " Correct"
Set Feedback_SlideText = Nothing
Set Feedback_SlideText = CSlideText(Feedback.States.Item("Correct").Objects(2))
Feedback_SlideText.Text = "" & _
Format$((Feedback.RTStats.Mean / Feedback.RTDivisor), Feedback.RTFormat) & _
" Seconds Average Response Time"
Set Feedback_SlideText = Nothing
'You only need this part if you want to let the user close Feedback by pressing a key
Feedback.InputMasks.Reset
If Keyboard.GetState() = ebStateOpen Then
FeedbackEchoClients.RemoveAll
Feedback.InputMasks.Add Keyboard.CreateInputMask("{ANY}", "", CLng(Feedback.Duration), CLng("1"), ebEndResponseActionTerminate, CLogical("Yes"), "", "", "ResponseMode:All ProcessBackspace:Yes")
End If
' Show the window
Feedback.Run
If you name your feedback and stimulus objects some other names than Feedback and Stimulus, you’ll have to search for Feedback and Stimulus in the code and replace by the respective names you use. You can also customize your ShowFeedback code to modify the feedback text or to disable dismissing the feedback with the keyboard.
Tags: e-prime
October 2, 2009 at 2:41 pm
I just wanted to say a huge thanks for publishing this. I spent an hour doing this with my own maths, but something just wasn’t working. This is an elegant solution.
As an addition you might point out that the Feedback abject still needs am Input Object specifying, and if you wish to use it in subsequent blocks it need resetting between blocks.
Thanks again,
Tony.
April 12, 2010 at 5:43 pm
Thanks for the script.
But line 11 of ShowFeedback shouldn’t be
Format$((Feedback.RTStats.Mean / Feedback.RTDivisor), Feedback.RTFormat) & _
Cheers
April 12, 2010 at 11:02 pm
It should! Thanks.
September 30, 2010 at 3:15 pm
thank you – this script was very helpful !
is there an easy solution how to show 2 different feedback slides (e.g., if block mean accuracy > 85% show another feedback than if block mean accuracy < 85%) ?
October 2, 2010 at 10:40 pm
Thanks! You saved my day!
October 7, 2010 at 12:54 am
Big thank you for making this.
Some things that many may know, but I just figured out:
1) You can add more text to your Feedback slide by adding textboxes within the slide in your unreferenced e-object folder (e.g. I added something like “You answered…” at the very top of the slide)
2) You can alter the text that the ShowFeedback puts on the Feedback slide by changing the in-line (e.g. I switched ” Correct” in line 6 to “of the questions correctly”). However, it crashed if I tried to alter other places where it said “Correct” like on line 4.
October 16, 2010 at 12:15 pm
@cy. I haven’t worked with E-Prime for some time so I’m out of context
February 1, 2011 at 9:33 pm
This is fantastic, I don’t suppose that you know how to get E-Prime to stop after a certain level of accuracy has been achieved?
February 9, 2011 at 3:40 pm
I’ve done something similar, where overall feedback is given after a practice block. There are different screens, depending on the performance during the practice block (above or below 80%). In the Session Procedure, after the Practice Block, I’ve inserted an InLine text called “CheckAccuracy”. The InLine code is as follows:
If Feedback.ACCStats.Mean > .80 Then
StartTask.Text = “Great! You’re ready to start the task!”
Else
StartTask.Text = “You did not achieve the required 80% accuracy.” &_
“Now you’ll have another chance to practice before starting the task.”
Feedback.ACCStats.Reset
StartTask.Run
Goto StartPrac
End If
Note that Feedback.ACCStats is calculated automatically from other Feedback data, so in order for this to work there has to be feedback given on each trial. You might be able to change “Feedback.ACCStats” to “Stim.ACCStats” or some equivalent variable.
Note also that the second condition (less than 80%) sends the program back to “StartPrac”, which is a label just before the PracticeBlockList, and the Feedback Stats must be reset in this condition so that the subject can get separate accuracy statistics the second time through the practice.
Hope this is helpful!
March 13, 2011 at 2:32 pm
Thanks for this, it was very helpful.
I’m having a small problem though – what I want to do is to have a display, just at the end of the experiment, telling the participants how many they got correct.
It is a memory experiment – Stage 1: faces are displayed and participant memorises them. Stage 2: faces are displayed again but this time participant indicates whether they have seen the face from Stage 1.
I want to have a display at the end of the experiment to say: You remembered i.e. 50% of the faces..
Thanks
March 14, 2011 at 1:08 am
I believe that if you just put in a feedback object at the end of the trial it has an option to show that. I have a program at work with it…I’ll double check it tomorrow.
May 22, 2011 at 5:33 am
I have a trouble with this, in the line 274, column 21 of showfeedback, appears a trouble. It says that to the left of “.” (It means FeedbackEchoClients), must be an object, structure or dialog. I have no idea what have I done wrong.
May 22, 2011 at 10:27 pm
Are you trying to use a counter as well? I had difficulty because I hadn’t set my counter attributes as an integer.
May 24, 2011 at 9:15 am
I solved it, thx too much
January 20, 2012 at 12:58 am
How did yo solve the part regarding the ‘left of “.” must be an object, structure or dialog”? elchavodelovio?
January 20, 2012 at 12:59 am
*Elvhavodelocio
March 13, 2012 at 10:41 pm
Lev, you are amazing! You saved my dissertation!
April 15, 2012 at 12:31 pm
Reblogged this on Doraemon's pocket and commented:
This is helpful to me:) Really feel lucky to find this instruction here!!!
September 5, 2012 at 9:35 pm
Hi, Can anyone please guide me as how to have break between blocks. I have total 8 blocks of words list and after each block there is an additional block consisting of distractor task. In this way, it made up total 16 blocks. but ditractor task block is same throughout experiment and other experimental blocks contain different word list.
I want a selfpaced break after each block? how to do that.Please let me know if anyone know the solution.
Regards
September 5, 2012 at 10:01 pm
Hi Tabs, I have a program in my lab that does exactly this, but I won’t be over there until the end of the week. I’m fairly certain that I did it in the script with a counter. In the meantime they have some example scripts here…this is where I got the information on how to do mine:
http://step.psy.cmu.edu/scripts/
Good luck
September 6, 2012 at 11:44 am
Hi J Dickinson, Many thanks for the information. I am not in hurry, i will wait until you get back to your lab. It is good to see the example scripts In the interim. Thanks for sharing Link
Regards
January 30, 2013 at 11:31 pm
Hello! Can you please explain the input object that I need in the Feedback slide? Thank you!
February 2, 2013 at 9:51 am
I’ve long since forgotten all about this…
February 2, 2013 at 6:37 pm
Not a problem, I think I figured it out! Thank you for this helpful post.
February 9, 2013 at 12:10 am
Thank you so much! It was so helpful!
March 14, 2013 at 6:34 pm
Hi, thank you in advance for sharing this script. I’m trying to figure out what should be specified at “input object” of the Unreferenced Feedback.