Hi Dave,
I would really appreciate if you can help me solve the following issue with my script.
It uses a list of multipliers at / items = (1, 1, -1) to set probabilities for the score to go up or down. However, it says "Guess was
Correct" in the feedback screen after a trial had a multiplier of -1, but I want it to say "Guess was
Incorrect" for -1 multipliers and "Guess was
Correct" for +1 multipliers.
It reports the difference in the feedback screen correctly, so that's not an issue.
I've tried to add && values.multiplier = 1 to the condition in the first line of /ontrialend, so it becomes: if (trial.trial1.correct && values.multiplier =1), but that doesn't seem to resolve the issue either.
The script is as follows:
<values>
/ score = 0
/ multiplier = 0
/ diff = 0
/ acc = ""
/ ncorrect = 0
/ n = 0
/ cx = 50%
</values>
<list prob>
/ items = (1, 1, -1)
/ selectionmode = random
/ replace = true
</list>
<trial trial1>
/ ontrialbegin = [
values.n += 1;
values.ncorrect += trial.trial1.correct;
values.multiplier = list.prob.nextvalue;
]
/ ontrialend = [
if (trial.trial1.correct) {
values.multiplier = list.prob.nextvalue;
values.score += values.multiplier * 10;
values.diff = 0;
values.diff = values.multiplier * 10;
values.acc = "Correct";
}
else {
values.score += values.multiplier * 5;
values.diff = 0;
values.diff += values.multiplier * 5;
values.acc = "Incorrect";
}
]
/ stimulusframes = [1=stim, score]
/ inputdevice = keyboard
/ validresponse = ("z", "x")
/ correctresponse = ("z")
/ branch = [
{
trial.feedback
}
]
</trial>
<text stim>
/ items = ("A", "E", "I", "O", "U")
/ hposition = values.cx
</text>
<list x>
/ items = (50%)
/ selectionrate = always
</list>
<trial feedback>
/ stimulusframes = [1=clearscreen, fb, score, diff, acc]
/ timeout = 3500
</trial>
<text fb>
/ items = ("Performance: <%values.ncorrect%> out of <%values.n%> trials correct.")
/ fontstyle = ("Arial", 21pt, true)
/ size = (80%, 10%)
/ erase = false
/ position = (50%, 85%)
</text>
<text diff>
/ items = ("Score changed by: <%values.diff%>")
/ fontstyle = ("Arial", 21pt, true)
/ position = (50%, 50%)
</text>
<text acc>
/ items = ("Guess was: <%values.acc%>")
/ fontstyle = ("Arial", 21pt, true)
/ color = black
/ size = (80%, 20%)
/ position = (50%, 35%)
</text>
<text score>
/ items = ("Score: <%values.score%>")
/ fontstyle = ("Arial", 21pt, true)
/ size = (80%, 20%)
/ erase = false
/ position = (50%, 75%)
</text>
<block start>
/ trials = [1-30 = trial1]
</block>
Your help will be much appreciated!