Letter-memory test data


Author
Message
BobRamakers
BobRamakers
Expert (1.1K reputation)Expert (1.1K reputation)Expert (1.1K reputation)Expert (1.1K reputation)Expert (1.1K reputation)Expert (1.1K reputation)Expert (1.1K reputation)Expert (1.1K reputation)Expert (1.1K reputation)
Group: Forum Members
Posts: 10, Visits: 51
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>


Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 105K
BobRamakers - Tuesday, May 30, 2017
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>


I'm not sure what the relevance of the code snippets you posted is. There is no "recall_letter2" trial in the original script, so I must assume you modified the script and probably broke it. I cannot assess that on the basis of incomplete excerpts. Note that values.countCorrectLetters and values.correct are updated in <trial recall_end> in the original. If you don't run that <trial> during the test block, this will obviously not happen.

Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 105K
Dave - Wednesday, May 31, 2017
BobRamakers - Tuesday, May 30, 2017
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>


I'm not sure what the relevance of the code snippets you posted is. There is no "recall_letter2" trial in the original script, so I must assume you modified the script and probably broke it. I cannot assess that on the basis of incomplete excerpts. Note that values.countCorrectLetters and values.correct are updated in <trial recall_end> in the original. If you don't run that <trial> during the test block, this will obviously not happen.

So, to fix this -- in essence -- set up a trial called <trial recall_end2> like so:
----
<trial recall_end2>
/ 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){
values.correct = 0;
} else {
values.correct = 1;
};
list.accuracy.insertitem(values.correct, 1);
]
/ validresponse = (0)
/ recorddata = true
/ trialduration = 0
</trial>

and then /branch to it from <trial recall_letter2>

<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"){
trial.recall_end2;}
else
trial.recall_letter2;
]

/ recorddata = true
</trial>
----

<trial recall_end2> displays no feedback or other visual stimuli and does not require a response -- its only purpose is to perform the values.correct, values.countCorrectLetters, etc. calculations, i.e. serve the same function as <trial recall_end> in the "practice" section minus the on-screen performance feedback.

BobRamakers
BobRamakers
Expert (1.1K reputation)Expert (1.1K reputation)Expert (1.1K reputation)Expert (1.1K reputation)Expert (1.1K reputation)Expert (1.1K reputation)Expert (1.1K reputation)Expert (1.1K reputation)Expert (1.1K reputation)
Group: Forum Members
Posts: 10, Visits: 51
Dear Dave,

Thank you for your help.
It looks like the test is working well and all data is being recorded now :-)

Thank you!

Best regards,

Bob Ramakers
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search