Hi everyone,
I have a question concerning an modified version of the Math Effort Task which is meant to be adaptive.
Participants have to calculate the sum of 5 digits appearing one after the other on the screen (it is possible to change the number of digits). There are five levels of increasing difficulty depending on the range and the duration of the presentation. What I would like to do is make the task adaptive, so that a correct response increases the difficulty of the next level by one and a wrong response decreases the difficulty of the next level.
What I tried so far works, but the level switch is delayed.
I would be very happy for any suggestions! Thanks a lot!
Here is my script:
<trial numberPresentations>
/ ontrialbegin = [
values.countTotalTrials += 1;
values.countTrialsCurrentLevel += 1;
if (values.currentLevel == 1) {
values.number1 = list.level1.nextvalue;
values.number2 = list.level1.nextvalue;
values.number3 = list.level1.nextvalue;
values.number4 = list.level1.nextvalue;
values.number5 = list.level1.nextvalue;
values.countLevel1 += 1;
} else if (values.currentLevel == 2) {
values.number1 = list.level2.nextvalue;
values.number2 = list.level2.nextvalue;
values.number3 = list.level2.nextvalue;
values.number4 = list.level2.nextvalue;
values.number5 = list.level2.nextvalue;
values.countLevel2 += 1;
} else if (values.currentLevel == 3) {
values.number1 = list.level3.nextvalue;
values.number2 = list.level3.nextvalue;
values.number3 = list.level3.nextvalue;
values.number4 = list.level3.nextvalue;
values.number5 = list.level3.nextvalue;
values.countlevel3 += 1;
} else if (values.currentLevel == 4) {
values.number1 = list.level4.nextvalue;
values.number2 = list.level4.nextvalue;
values.number3 = list.level4.nextvalue;
values.number4 = list.level4.nextvalue;
values.number5 = list.level4.nextvalue;
values.countLevel4 += 1;
} else if (values.currentLevel == 5) {
values.number1 = list.level5.nextvalue;
values.number2 = list.level5.nextvalue;
values.number3 = list.level5.nextvalue;
values.number4 = list.level5.nextvalue;
values.number5 = list.level5.nextvalue;
values.countLevel5 += 1;
};
if (values.nrDigits < 5){
values.number5 = 0;
};
if (values.nrDigits < 4){
values.number4 = 0;
};
if (values.nrDigits < 3){
values.number3 = 0;
};
trial.numberPresentations.insertstimulustime(clearscreen, (0*parameters.ISI + 1*parameters.numberDuration));
trial.numberPresentations.insertstimulustime(text.number2, (1*parameters.numberDuration + 1*parameters.ISI));
if (values.nrDigits > 2){
trial.numberPresentations.insertstimulustime(clearscreen, (1*parameters.ISI + 2*parameters.numberDuration));
trial.numberPresentations.insertstimulustime(text.number3, (2*parameters.numberDuration + 2*parameters.ISI));
};
if (values.nrDigits > 3){
trial.numberPresentations.insertstimulustime(clearscreen, (2*parameters.ISI + 3*parameters.numberDuration));
trial.numberPresentations.insertstimulustime(text.number4, (3*parameters.numberDuration + 3*parameters.ISI));
};
if (values.nrDigits > 4){
trial.numberPresentations.insertstimulustime(clearscreen, (3*parameters.ISI + 4*parameters.numberDuration));
trial.numberPresentations.insertstimulustime(text.number5, (4*parameters.numberDuration + 4*parameters.ISI));
};
]
/ontrialbegin = [
if (values.previouscorrect == 1) {values.currentLevel += 1}
else if (values.previouscorrect == 0 > 1) {values.currentLevel -= 1}
]
/ontrialbegin = [
if (values.correctprevioustrial == 1) {values.numberDuration -= 20}
else if (values.correctprevioustrial == 0) {values.numberDuration += 20}
]
/ stimulustimes = [0 = number1]
/ trialduration = (values.nrDigits*parameters.numberDuration + (values.nrDigits-1)*parameters.ISI)
/ ontrialend = [
trial.numberPresentations.resetstimulusframes();
values.solution = values.number1 + values.number2 + values.number3 + values.number4 + values.number5;
]
/ branch = [
surveypage.response;
]
/ recorddata = false
</trial>
<surveypage response>
/ questions = [1 = response]
/ fontstyle = ("Arial", 3.5%, true, false, false, false, 5, 1)
/ itemfontstyle = ("Arial", 3%, true, false, false, false, 5, 1)
/ responsefontstyle = ("Arial", 2.5%, false, false, false, false, 5, 1)
/ timeout = parameters.RW
/ showbackbutton = false
/ showmousecursor = true
/ showpagenumbers = false
/ showquestionnumbers = false
/ ontrialend = [
values.response = textbox.response.response;
if (monkey.monkeymode && replace(0,1) == 1){
values.response = values.solution;
};
if (values.response == values.solution) {
values.correct = 1;
} else {
values.correct = 0;
};
if (values.response == values.solution) {
values.correctcount += 1;
} else {
values.correctcount -= 1;
};
if (values.currentLevel == 1) {
values.countcorrectLevel1 += values.correct;
} else if (values.currentLevel == 2) {
values.countcorrectLevel2 += values.correct;
} else if (values.currentLevel == 3) {
values.countcorrectLevel3 += values.correct;
} else if (values.currentLevel == 4) {
values.countcorrectLevel4 += values.correct;
} else if (values.currentLevel == 5) {
values.countcorrectLevel5 += values.correct;
};
values.rt = surveypage.response.latency;
]
/ontrialend = [if (values.response == values.solution) values.previouscorrect = 1 else values.previouscorrect = 0]
/ branch = [
trial.getReady;
]
/ nextbuttonposition = (45%, 70%)
/ finishlabel = "submit"
/ recorddata = true
</surveypage>