Hi Bobby,
No apology necessary. This latest message gave a very good description of the pertinent information.
(1) You only need a single loop.
(2) You only need two routines within that loop: one to present the rating scale and one after that to present the feedback of the running total.
(3) This structure will allow the randomisation you need (just set the loop type to random).
(4) I'm not really familiar with the rating scale options, so it is quite possible that there are more efficient ways to display what I'm about to describe.
(5) I'm not sure if the interval between amounts will always be $1, so I've incorporated a 'step' value to capture what it might be (e.g. if on some trials the interval might be $5 or $10). If it is always $1, you can eliminate that bit.
The trickiest bit is actually the labelling above and below the rating scale. I'm not sure what the options are there, so will just assume that you can just use two separate text components, one above and one below the rating scale, and change its text size and inter-value padding with space characters to get it to line up. This may take quite some tweaking to get right, or even specifying the text size trial-by-trial if the values differ quite a bit in terms of number of digits per value.
Your conditions file should look something like this:
self_value other_value step
85 50 1
200 150 5
etc for 15 rows of values
Insert a code component in the first (rating) routine, above the other components. In its "begin routine" tab, put something like this:
# initialise blank label strings:
self_label = str(self_value)
other_label = str(other_value)
# construct the rest:
# could be modified to set attributes of the rating scale directly?
# use more spaces/dashes to pad between numbers as required:
for i in range(1, 9):
self_label = self_label + ' - ' + str(self_value + i * step)
other_label = other_label + ' - ' + str(other_label - i * step)
Then in the text components, put $self_label and $other_label as required, set to update on every routine.
I'm going to assume that the rating scale is simply set to have fixed response values of 0 to 8 on every trial. In the code component's "begin experiment" tab, put this to initialise the running total:
other_total = 0
self_total = 0 # not sure you need this but anyway...
And in the "end routine" tab, something like this:
# get the first element of the response list.
# Not sure if actually need to convert to a number?
response = val(s1.getRating()[0])
# calculate running totals:
other_total = other_total + (other_value - (response * step))
self_total = self_total + (self_total + (response * step))
# save the current running values on each trial:
# (the rating response is automatically saved):
thisExp.addData('other_total', other_total)
thisExp.addData('self_total', self_total)
Then on the second routine, you can use $other_total in a text field to give feedback to the subject of the current running total.
Make sense?
(NB this is completely untested code: CHECK, to make sure there aren't any off-by-one errors in particular).
Regards,
Michael