Dear Dave,
I am using the letter-memory test for about 2 months now but it appeared that 'recallDuration', 'values.correct', 'values.countCorrectLetters' and 'list.correctLetters.itemcount' are only being saved for the practice trials (the first 3 trials) and not for the test trials (the following 12 trials).
I assume that the fault should be in the below part of the script.
Can you please check?
We would like for the test trials to only record data, not give any feedback after each trial.
I look forward to hearing from you.
Best regards,
Bob Ramakers
<trial recall_letter1>
/ ontrialbegin = [
values.last3 = substring(values.presentedLetters, length(values.presentedLetters) - 3, 3);
values.recallCount += 1;
if (values.recallCount == 1){
values.RecallStart = script.elapsedtime;
};
]
/ stimulusframes = [1=WhiteScreen, B, C, D, F, G, H, J, K, L, M, N, P, Q, R, S, T, V, W, X, Z, _, clear, exit, recalledletters, recallprompt]
/ validresponse = (B, C, D, F, G, H, J, K, L, M, N, P, Q, R, S, T, V, W, X, Z, _, clear, exit)
/ monkeyresponse = ("B", "C", "D", "F", "G", "H", "J", "K", "L", "M", "N", "P", "Q", "R", "S", "T", "V", "W", "X", "Z", "exit")
/ ontrialend = [
if(trial.recall_letter1.response!="exit" && trial.recall_letter1.response!="clear") {
values.recalledletters=concat(values.recalledletters, trial.recall_letter1.response);
values.recalledletters = substring(values.recalledletters, 0, 3);
};
if(trial.recall_letter1.response=="clear") {
values.recalledletters="";
};
if (trial.recall_letter1.response == "exit"){
values.RecallEnd = script.elapsedtime;
};
]
/ responsemessage = (B, clickB, 150)
/ responsemessage = (C, clickC, 150)
/ responsemessage = (D, clickD, 150)
/ responsemessage = (F, clickF, 150)
/ responsemessage = (G, clickG, 150)
/ responsemessage = (H, clickH, 150)
/ responsemessage = (J, clickJ, 150)
/ responsemessage = (K, clickK, 150)
/ responsemessage = (L, clickL, 150)
/ responsemessage = (M, clickM, 150)
/ responsemessage = (N, clickN, 150)
/ responsemessage = (P, clickP, 150)
/ responsemessage = (Q, clickQ, 150)
/ responsemessage = (R, clickR, 150)
/ responsemessage = (S, clickS, 150)
/ responsemessage = (T, clickT, 150)
/ responsemessage = (V, clickV, 150)
/ responsemessage = (W, clickW, 150)
/ responsemessage = (X, clickX, 150)
/ responsemessage = (Z, clickZ, 150)
/ responsemessage = (clear, clickclear, 150)
/ responsemessage = (exit, clickexit, 150)
/ responsemessage = (_, click_, 150)
/ branch = [
if(trial.recall_letter1.response=="exit"){
trial.recall_end;
} else
trial.recall_letter1;
]
/ recorddata = true
</trial>
<trial recall_letter2>
/ ontrialbegin = [
values.last3 = substring(values.presentedLetters, length(values.presentedLetters) - 3, 3);
values.recallCount += 1;
if (values.recallCount == 1){
values.RecallStart = script.elapsedtime;
};
]
/ stimulusframes = [1=WhiteScreen, B, C, D, F, G, H, J, K, L, M, N, P, Q, R, S, T, V, W, X, Z, _, clear, exit, recalledletters, recallprompt]
/ validresponse = (B, C, D, F, G, H, J, K, L, M, N, P, Q, R, S, T, V, W, X, Z, _, clear, exit)
/ monkeyresponse = ("B", "C", "D", "F", "G", "H", "J", "K", "L", "M", "N", "P", "Q", "R", "S", "T", "V", "W", "X", "Z", "exit")
/ ontrialend = [
if(trial.recall_letter2.response!="exit" && trial.recall_letter2.response!="clear") {
values.recalledletters=concat(values.recalledletters, trial.recall_letter2.response);
values.recalledletters = substring(values.recalledletters, 0, 3);
};
if(trial.recall_letter2.response=="clear") {
values.recalledletters="";
};
if (trial.recall_letter2.response == "exit"){
values.RecallEnd = script.elapsedtime;
};
]
/ responsemessage = (B, clickB, 150)
/ responsemessage = (C, clickC, 150)
/ responsemessage = (D, clickD, 150)
/ responsemessage = (F, clickF, 150)
/ responsemessage = (G, clickG, 150)
/ responsemessage = (H, clickH, 150)
/ responsemessage = (J, clickJ, 150)
/ responsemessage = (K, clickK, 150)
/ responsemessage = (L, clickL, 150)
/ responsemessage = (M, clickM, 150)
/ responsemessage = (N, clickN, 150)
/ responsemessage = (P, clickP, 150)
/ responsemessage = (Q, clickQ, 150)
/ responsemessage = (R, clickR, 150)
/ responsemessage = (S, clickS, 150)
/ responsemessage = (T, clickT, 150)
/ responsemessage = (V, clickV, 150)
/ responsemessage = (W, clickW, 150)
/ responsemessage = (X, clickX, 150)
/ responsemessage = (Z, clickZ, 150)
/ responsemessage = (clear, clickclear, 150)
/ responsemessage = (exit, clickexit, 150)
/ responsemessage = (_, click_, 150)
/ branch = [
if(trial.recall_letter2.response=="exit")
else
trial.recall_letter2;
]
/ recorddata = true
</trial>
Note: trial.recall_end
* presents feedback
* evaluates the accuracy of the response (uses the first three letters entered by participant - any additional letters are ignored)
* order of letters is not important
* adds an ITI as the posttrialpause
<trial recall_end>
/ ontrialbegin = [
values.recallDuration = values.RecallEnd - values.RecallStart;
values.temp_last3 = values.last3;
values.recalledletters = concat(values.recalledletters, " ");
if (contains(values.temp_last3, substring(values.recalledletters, 0, 1))){
values.countCorrectLetters += 1;
values.temp_last3 = replaceall(values.temp_last3, substring(values.recalledletters, 0, 1), "");
};
if (contains(values.temp_last3, substring(values.recalledletters, 1, 1))){
values.countCorrectLetters += 1;
values.temp_last3 = replaceall(values.temp_last3, substring(values.recalledletters, 1, 1), "");
};
if (contains(values.temp_last3, substring(values.recalledletters, 2, 1))){
values.countCorrectLetters += 1;
values.temp_last3 = replaceall(values.temp_last3, substring(values.recalledletters, 2, 1), "");
};
list.correctLetters.insertitem(values.countCorrectLetters, 1);
if (values.countCorrectLetters != 3){
trial.recall_end.insertstimulusframe(text.errorFeedback, 1);
values.correct = 0;
} else {
trial.recall_end.insertstimulusframe(text.correctFeedback, 1);
values.correct = 1;
};
list.accuracy.insertitem(values.correct, 1);
]
/ stimulusframes = [1 = clearscreen, Verder]
/ validresponse = (Verder)
/ recorddata = true
/ posttrialpause = parameters.ITI
</trial>
**************************************************************************************************************
**************************************************************************************************************
BLOCKS
**************************************************************************************************************
**************************************************************************************************************
Note: practice presents 3 trials (one per set size)
<block lettermemory_practice>
/ preinstructions = (intro)
/ trials = [1-3 = sequence(fixation, show_letter, recall_letter1)]
</block>
Note: the test presents 12 trials (4 per set size)
<block lettermemory>
/ preinstructions = (testIntro)
/ onblockbegin = [
list.correctLetters.reset();
list.accuracy.reset();
]
/ trials = [1-12 = sequence(fixation, show_letter, recall_letter2)]
</block>