Payoff Matrix - Feedback Counter (Tidy up script)

Caleb J. Picker dbzgtfan4ever at gmail.com
Wed Jan 12 04:12:45 UTC 2011


Hello,

This is what I ended up using.  It is really quite beautiful (Thanks, 
David)!  The script below sets up a counter based on three different 
attributes (i.e. TestType,TestCondition,and Accuracy).  Dependent upon these 
attributes either 0 points, Points_HR or Points_CR are awarded.  The latter 
two variables are set up in my MasterList List object.  At the bottom of the 
TestSlideOLDNEW (the object that collects responses), there is a textbox 
that display the counter variable, thus keeping a "Running Total" of 
accumulated points.  Also, there is a FeedbackDisplay that displays the 
number of points awarded based on a correct (either Points_HR or Points_CR) 
or incorrect (0 points) response.

Thanks!

Caleb

**********************************************************************
Dim x As SlideText
Dim PayoffMatrix(1,2,1) as integer

'First dimension = Test Type
'Second Dimension = Test Condition
'Third Dimension = TestSlideAccuracy

If c.getattrib("TestType") = "OldNew" then
c.setattrib "TestType", "0"
Elseif c.getattrib("TestType") = "PDP" then
c.setattrib "TestType","1"
Else MsgBox "TestType Set attribute error"
End if

If c.getattrib("TestCondition") = "Inclusion" then
c.setattrib "TestCondition", "0"
Elseif c.getattrib("TestCondition") = "Exclusion" then
c.setattrib "TestCondition", "1"
Elseif c.getattrib("TestCondition") = "New" then
c.setattrib "TestCondition", "2"
Else
MsgBox "TestCondition Set attribute error"
End if

For y = 0 to 1
For k = 0 to 2
PayoffMatrix(y,k,0) = 0
Next k,y

'Payoff Matrix (OldNew,Inclusion-Exclusion-New,Acc=1)
Payoffmatrix(0,0,1) = c.getattrib("Points_HR")
PayoffMatrix(0,1,1) = c.getattrib("Points_HR")
PayoffMatrix(0,2,1) = c.getattrib("Points_CR")
'PayoffMatrix(PDP,Inclusion-Exclusion-New,Acc=1)
PayoffMatrix(1,0,1) = c.getattrib("Points_HR")
PayoffMatrix(1,1,1) = c.getattrib("Points_CR")
PayoffMatrix(1,2,1) = c.getattrib("Points_CR")

AccuracyDisplay = AccuracyDisplay + PayoffMatrix(CInt(c.getattrib 
("TestType")),_
CInt(c.getattrib("TestCondition")), TestSlideOLDNEW.ACC ) 

c.setattrib "Accuracy", AccuracyDisplay

Set x = 
CSlideText(TestSlideOLDNEW.States(TestSlideOLDNEW.ActiveState).Objects("Text4"))
If Not x Is Nothing Then
   x.Text = "Running Total: " & c.getattrib("Accuracy")
End if

'Debug.Print AccuracyDisplay

If TestSlideOLDNEW.ACC = 1 then
FeedbackDisplay1.ActiveState = "Correct"
Set x = 
CSlideText(FeedbackDisplay1.States(FeedbackDisplay1.ActiveState).Objects("Text2"))
If Not x Is Nothing Then
x.Text = "You have received " & PayoffMatrix(CInt(c.getattrib 
("TestType")),_
CInt(c.getattrib("TestCondition")), TestSlideOLDNEW.ACC ) & " Points!"
End if
Elseif TestSlideOLDNEW.ACC = 0 then
FeedbackDisplay1.ActiveState = "Incorrect"
Else Msgbox "FeedbackDisplay1 Error!"
End if

*********************************************************************

-- 
You received this message because you are subscribed to the Google Groups "E-Prime" group.
To post to this group, send email to e-prime at googlegroups.com.
To unsubscribe from this group, send email to e-prime+unsubscribe at googlegroups.com.
For more options, visit this group at http://groups.google.com/group/e-prime?hl=en.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.linguistlist.org/pipermail/eprime/attachments/20110111/c62f43e2/attachment.htm>


More information about the Eprime mailing list