Hi Dave,
Try this:
<values>
/ n = 0
/ ncorrect = 0
/ difference = 0
/ multiplier = 0
/ score = 0
</values>
<list lista>
/ items = (1, 1, -1)
/ selectionmode = random
/ replace = false
</list>
<list listb>
/ items = (1, -1, -1)
/ selectionmode = random
/ replace = false
</list>
<list listc>
/ items = (1, -1)
/ selectionmode = random
/ replace = false
</list>
<block start>
/ trials = [1-20 = noreplace(trial.one, trial.two)]
</block>
<trial one>
/ ontrialend = [
values.n += 1;
values.ncorrect += trial.one.correct;
if (trial.one.correct) {
values.multiplier = list.lista.nextvalue;
values.score += values.multiplier * 500; // if response is correct, increase the score by 500
values.difference = 0;
values.difference += 500; // this should reflect the difference between the new and old score, either +500 or -500
}
else {
values.multiplier = list.lista.nextvalue;
values.score += values.multiplier * 250; // if response is incorrect, increase the score by only 250
values.difference = 0;
values.difference += 250;
}
]
/ stimulusframes = [1=clearscreen, stimulusa, score]
/ inputdevice = keyboard
/ validresponse = ("y", "n")
/ correctresponse = ("y")
/ branch = [
if (trial.one.responsetext == "n") {
trial.fb
}
]
/ timeout = 3000
</trial>
<trial two>
/ ontrialend = [
values.n += 1;
values.ncorrect += trial.two.correct;
if (trial.two.correct) {
values.multiplier = list.listb.nextvalue;
values.score -= values.multiplier * 500; // if response is correct, decrease the score by 500 3/4 times or increase by 500 1/4 as per listb
values.difference = 0;
values.difference -= 500; // this should reflect the difference between the new and old score, either +500 or -500
}
else {
values.multiplier = list.listb.nextvalue;
values.score -= values.multiplier * 250; // if response is incorrect, decrease the score by only 250
values.difference = 0;
values.difference -= 250;
}
]
/ stimulusframes = [1=clearscreen, stimulusb, score]
/ inputdevice = keyboard
/ validresponse = ("y", "n")
/ correctresponse = ("n")
/ branch = [
if (trial.two.responsetext == "n") {
trial.fb
}
]
/ timeout = 3000
</trial>
<trial three>
/ ontrialend = [
values.n += 1;
values.ncorrect += trial.three.correct;
if (trial.three.correct) {
values.multiplier = list.listc.nextvalue;
values.score -= values.multiplier * 500; // if response is correct, decrease the score by 500 3/4 times or increase by 500 1/4 as per listb
values.difference = 0;
values.difference -= 500; // this should reflect the difference between the new and old score, either +500 or -500
}
else {
values.multiplier = list.listc.nextvalue;
values.score -= values.multiplier * 250; // if response is incorrect, decrease the score by only 250
values.difference = 0;
values.difference -= 250;
}
]
/ stimulusframes = [1=clearscreen, stimulusb, score]
/ inputdevice = keyboard
/ validresponse = ("y", "n")
/ correctresponse = ("n")
/ branch = [
if (trial.three.responsetext == "n") {
trial.fb
}
]
/ timeout = 3000
</trial>
<trial fb>
/ stimulusframes = [1=clearscreen, fbscreen]
/ timeout = 8000
</trial>
<text stimulusa>
/ items = ("A")
/ position = (40%, 50%)
</text>
<text stimulusb>
/ items = ("B")
/ position = (50%, 50%)
</text>
<text stimulusc>
/ items = ("C")
/ position = (60%, 50%)
</text>
<text fbscreen>
/ items = ("So far, you got <%values.ncorrect%> out of <%values.n%> trials correct.")
/ items = ("The difference between the last score and current score is <%values.difference%>.")
</text>
<text score>
/ items = ("Score: <%values.score%>")
/ erase = false
/ position = (10%, 90%)
</text>