Adding trial


Author
Message
dillonk
dillonk
Associate Member (249 reputation)Associate Member (249 reputation)Associate Member (249 reputation)Associate Member (249 reputation)Associate Member (249 reputation)Associate Member (249 reputation)Associate Member (249 reputation)Associate Member (249 reputation)Associate Member (249 reputation)
Group: Forum Members
Posts: 17, Visits: 68
Hello, 
I am hoping to add trials to the Emotion Dot Probe. I am new to Millisecond and attempted to add an additional positive and negative trial. However, the edits I made did not seem to work. Attached is the task with my edits; could you take a look and let me know what I'll need to change to successfully add additional trials of positive and negative words? The programming in this task seems a bit more advanced and I keep running into the same issue. 
Thanks in advance for your help!


Attachments
emotiondotprobe.iqx (189 views, 58.00 KB)
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
dillonk - 10/21/2020
Hello, 
I am hoping to add trials to the Emotion Dot Probe. I am new to Millisecond and attempted to add an additional positive and negative trial. However, the edits I made did not seem to work. Attached is the task with my edits; could you take a look and let me know what I'll need to change to successfully add additional trials of positive and negative words? The programming in this task seems a bit more advanced and I keep running into the same issue. 
Thanks in advance for your help!


Add which trials to what? How many trials? Please be more specific, the question just isn't answerable as posed.

You should also, at a minimum, describe what exactly you did and why. Which things did you add? Where? Please refer to those things by their proper names, i.e. exactly as they are called in the code. Then explain what the *intended* behavior is -- nobody can glean your intentions from code that -- apparently -- isn't doing what you want it to be doing. Finally, when you say "the edits I made did not seem to work", please explain what exactly doesn't seem to work.

Edited 5 Years Ago by Dave
dillonk
dillonk
Associate Member (249 reputation)Associate Member (249 reputation)Associate Member (249 reputation)Associate Member (249 reputation)Associate Member (249 reputation)Associate Member (249 reputation)Associate Member (249 reputation)Associate Member (249 reputation)Associate Member (249 reputation)
Group: Forum Members
Posts: 17, Visits: 68
Sorry for any lack of clarity. I am hoping to edit the script by adding another test trial. So, in the test block, it will be 14 trials x 2 of the emotion words (positive, negative). I added new test trials (negativeEW1 and positiveEW1) under the TEST TRIALS section. I added the same blocks under the BLOCKS, and EXPERIMENT section. Since I edited several sections, it felt smarter to attach the entire file. I attached it to my reply. But, here are sections I added:
 
TEST TRIALS
(after <trial negativeEW>)
<trial negativeEW1>
/ ontrialbegin = [
    values.valence = "negative1";
    expressions.trialAssignments;

    trial.negativeEW1.insertstimulustime(text.negativeEW1, parameters.fixationDuration);
    trial.negativeEW1.insertstimulustime(text.negativeCTRL1, parameters.fixationDuration);
    if (parameters.runMask == true){
        trial.negativeEW1.insertstimulustime(text.Mask1, (parameters.fixationDuration + parameters.wordPresentationDuration));
        trial.negativeEW1.insertstimulustime(text.Mask2, (parameters.fixationDuration + parameters.wordPresentationDuration));        
    };
    trial.negativeEW1.insertstimulustime(text.Eraser1, (parameters.fixationDuration + parameters.wordPresentationDuration+ parameters.maskDuration));
    trial.negativeEW1.insertstimulustime(text.Eraser2, (parameters.fixationDuration + parameters.wordPresentationDuration+ parameters.maskDuration));    
    trial.negativeEW1.insertstimulustime(text.probe, (parameters.fixationDuration + parameters.wordPresentationDuration + parameters.maskDuration));        
    trial.negativeEW1.insertstimulustime(text.reminder, (parameters.fixationDuration + parameters.wordPresentationDuration + parameters.maskDuration+ parameters.reminderOnset));        

]
/ stimulustimes = [0 = fixation]
/ beginresponsetime = parameters.fixationDuration + parameters.wordPresentationDuration + parameters.maskDuration
/ responseinterrupt = immediate
/ validresponse = (parameters.probe1_responsekey, parameters.probe2_responsekey)
/ iscorrectresponse = [
    return(
    (trial.negativeEW1.responsetext == parameters.probe1_responsekey && values.probe == parameters.probe1) ||
    (trial.negativeEW1.responsetext == parameters.probe2_responsekey && values.probe == parameters.probe2));
]
/ ontrialend = [
    trial.negativeEW1.resetstimulusframes();
    values.EW = text.negativeEW1.currentitem;
    values.CTRL = text.negativeCTRL1.currentitem;
    
    if (values.congruence == 1){
        list.accuracy_negEW_congruent.appenditem(trial.negativeEW1.correct);
        if (trial.negativeEW1.correct){
            list.RT_negEW_congruent.appenditem(trial.negativeEW1.latency);
        };
    } else {
        list.accuracy_negEW_incongruent.appenditem(trial.negativeEW1.correct);
        if (trial.negativeEW1.correct){
            list.RT_negEW_incongruent.appenditem(trial.negativeEW1.latency);
        };
    };
]
/ posttrialpause = parameters.iti
/ errormessage = true(text.errorfeedback, 500)
</trial>

(after <trial positiveEW>)
<trial positiveEW1>
/ ontrialbegin = [
    values.valence = "positive1";
    expressions.trialAssignments;

    trial.positiveEW1.insertstimulustime(text.positiveEW1, parameters.fixationDuration);
    trial.positiveEW1.insertstimulustime(text.positiveCTRL1, parameters.fixationDuration);
    if (parameters.runMask == true){
        trial.positiveEW1.insertstimulustime(text.Mask1, (parameters.fixationDuration + parameters.wordPresentationDuration));
        trial.positiveEW1.insertstimulustime(text.Mask2, (parameters.fixationDuration + parameters.wordPresentationDuration));        
    };    
    trial.positiveEW1.insertstimulustime(text.Eraser1, (parameters.fixationDuration + parameters.wordPresentationDuration+ parameters.maskDuration));
    trial.positiveEW1.insertstimulustime(text.Eraser2, (parameters.fixationDuration + parameters.wordPresentationDuration+ parameters.maskDuration));    
    trial.positiveEW1.insertstimulustime(text.probe, (parameters.fixationDuration + parameters.wordPresentationDuration + parameters.maskDuration));        
    trial.positiveEW1.insertstimulustime(text.reminder, (parameters.fixationDuration + parameters.wordPresentationDuration + parameters.maskDuration+ parameters.reminderOnset));        

    ]
/ stimulustimes = [0 = fixation]
/ beginresponsetime = parameters.fixationDuration + parameters.wordPresentationDuration + parameters.maskDuration
/ responseinterrupt = immediate
/ validresponse = (parameters.probe1_responsekey, parameters.probe2_responsekey)
/ iscorrectresponse = [
    return(
    (trial.positiveEW1.responsetext == parameters.probe1_responsekey && values.probe == parameters.probe1) ||
    (trial.positiveEW1.responsetext == parameters.probe2_responsekey && values.probe == parameters.probe2));
]
/ ontrialend = [
    trial.positiveEW1.resetstimulusframes();
    values.EW = text.positiveEW1.currentitem;
    values.CTRL = text.positiveCTRL1.currentitem;
    
    if (values.congruence == 1){
        list.accuracy_posEW_congruent.appenditem(trial.positiveEW1.correct);
        if (trial.positiveEW1.correct){
            list.RT_posEW_congruent.appenditem(trial.positiveEW1.latency);
        };
    } else {
        list.accuracy_posEW_incongruent.appenditem(trial.positiveEW1.correct);
        if (trial.positiveEW1.correct){
            list.RT_posEW_incongruent.appenditem(trial.positiveEW1.latency);
        };
    };
]
/ posttrialpause = parameters.iti
/ errormessage = true(text.errorfeedback, 500)
</trial>

BLOCKS
<block negative1>
/ trials = [1-14 = negativeEW1]
</block>

<block positive1>
/ trials = [1-14 = positiveEW1]
</block>

EXPERIMENT 
For group 1:
/ blocks = [
    1 = intro;
    2 = negativePractice;
    3 = negative;
    4 = negative1;
    5 = break;
    6 = positivePractice;
    7 = positive;
    8 = positive1;
    9 = finish;

For group 2:
/ blocks = [
    1 = intro;
    2 = positivePractice;
    3 = positive;
    4 = positive1;
    5 = break;
    6 = negativePractice;
    7 = negative;
    8 = negative1;
    9 = finish;



Attachments
emotiondotprobe.iqx (156 views, 58.00 KB)
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
dillonk - 10/21/2020
Sorry for any lack of clarity. I am hoping to edit the script by adding another test trial. So, in the test block, it will be 14 trials x 2 of the emotion words (positive, negative). I added new test trials (negativeEW1 and positiveEW1) under the TEST TRIALS section. I added the same blocks under the BLOCKS, and EXPERIMENT section. Since I edited several sections, it felt smarter to attach the entire file. I attached it to my reply. But, here are sections I added:
 
TEST TRIALS
(after <trial negativeEW>)
<trial negativeEW1>
/ ontrialbegin = [
    values.valence = "negative1";
    expressions.trialAssignments;

    trial.negativeEW1.insertstimulustime(text.negativeEW1, parameters.fixationDuration);
    trial.negativeEW1.insertstimulustime(text.negativeCTRL1, parameters.fixationDuration);
    if (parameters.runMask == true){
        trial.negativeEW1.insertstimulustime(text.Mask1, (parameters.fixationDuration + parameters.wordPresentationDuration));
        trial.negativeEW1.insertstimulustime(text.Mask2, (parameters.fixationDuration + parameters.wordPresentationDuration));        
    };
    trial.negativeEW1.insertstimulustime(text.Eraser1, (parameters.fixationDuration + parameters.wordPresentationDuration+ parameters.maskDuration));
    trial.negativeEW1.insertstimulustime(text.Eraser2, (parameters.fixationDuration + parameters.wordPresentationDuration+ parameters.maskDuration));    
    trial.negativeEW1.insertstimulustime(text.probe, (parameters.fixationDuration + parameters.wordPresentationDuration + parameters.maskDuration));        
    trial.negativeEW1.insertstimulustime(text.reminder, (parameters.fixationDuration + parameters.wordPresentationDuration + parameters.maskDuration+ parameters.reminderOnset));        

]
/ stimulustimes = [0 = fixation]
/ beginresponsetime = parameters.fixationDuration + parameters.wordPresentationDuration + parameters.maskDuration
/ responseinterrupt = immediate
/ validresponse = (parameters.probe1_responsekey, parameters.probe2_responsekey)
/ iscorrectresponse = [
    return(
    (trial.negativeEW1.responsetext == parameters.probe1_responsekey && values.probe == parameters.probe1) ||
    (trial.negativeEW1.responsetext == parameters.probe2_responsekey && values.probe == parameters.probe2));
]
/ ontrialend = [
    trial.negativeEW1.resetstimulusframes();
    values.EW = text.negativeEW1.currentitem;
    values.CTRL = text.negativeCTRL1.currentitem;
    
    if (values.congruence == 1){
        list.accuracy_negEW_congruent.appenditem(trial.negativeEW1.correct);
        if (trial.negativeEW1.correct){
            list.RT_negEW_congruent.appenditem(trial.negativeEW1.latency);
        };
    } else {
        list.accuracy_negEW_incongruent.appenditem(trial.negativeEW1.correct);
        if (trial.negativeEW1.correct){
            list.RT_negEW_incongruent.appenditem(trial.negativeEW1.latency);
        };
    };
]
/ posttrialpause = parameters.iti
/ errormessage = true(text.errorfeedback, 500)
</trial>

(after <trial positiveEW>)
<trial positiveEW1>
/ ontrialbegin = [
    values.valence = "positive1";
    expressions.trialAssignments;

    trial.positiveEW1.insertstimulustime(text.positiveEW1, parameters.fixationDuration);
    trial.positiveEW1.insertstimulustime(text.positiveCTRL1, parameters.fixationDuration);
    if (parameters.runMask == true){
        trial.positiveEW1.insertstimulustime(text.Mask1, (parameters.fixationDuration + parameters.wordPresentationDuration));
        trial.positiveEW1.insertstimulustime(text.Mask2, (parameters.fixationDuration + parameters.wordPresentationDuration));        
    };    
    trial.positiveEW1.insertstimulustime(text.Eraser1, (parameters.fixationDuration + parameters.wordPresentationDuration+ parameters.maskDuration));
    trial.positiveEW1.insertstimulustime(text.Eraser2, (parameters.fixationDuration + parameters.wordPresentationDuration+ parameters.maskDuration));    
    trial.positiveEW1.insertstimulustime(text.probe, (parameters.fixationDuration + parameters.wordPresentationDuration + parameters.maskDuration));        
    trial.positiveEW1.insertstimulustime(text.reminder, (parameters.fixationDuration + parameters.wordPresentationDuration + parameters.maskDuration+ parameters.reminderOnset));        

    ]
/ stimulustimes = [0 = fixation]
/ beginresponsetime = parameters.fixationDuration + parameters.wordPresentationDuration + parameters.maskDuration
/ responseinterrupt = immediate
/ validresponse = (parameters.probe1_responsekey, parameters.probe2_responsekey)
/ iscorrectresponse = [
    return(
    (trial.positiveEW1.responsetext == parameters.probe1_responsekey && values.probe == parameters.probe1) ||
    (trial.positiveEW1.responsetext == parameters.probe2_responsekey && values.probe == parameters.probe2));
]
/ ontrialend = [
    trial.positiveEW1.resetstimulusframes();
    values.EW = text.positiveEW1.currentitem;
    values.CTRL = text.positiveCTRL1.currentitem;
    
    if (values.congruence == 1){
        list.accuracy_posEW_congruent.appenditem(trial.positiveEW1.correct);
        if (trial.positiveEW1.correct){
            list.RT_posEW_congruent.appenditem(trial.positiveEW1.latency);
        };
    } else {
        list.accuracy_posEW_incongruent.appenditem(trial.positiveEW1.correct);
        if (trial.positiveEW1.correct){
            list.RT_posEW_incongruent.appenditem(trial.positiveEW1.latency);
        };
    };
]
/ posttrialpause = parameters.iti
/ errormessage = true(text.errorfeedback, 500)
</trial>

BLOCKS
<block negative1>
/ trials = [1-14 = negativeEW1]
</block>

<block positive1>
/ trials = [1-14 = positiveEW1]
</block>

EXPERIMENT 
For group 1:
/ blocks = [
    1 = intro;
    2 = negativePractice;
    3 = negative;
    4 = negative1;
    5 = break;
    6 = positivePractice;
    7 = positive;
    8 = positive1;
    9 = finish;

For group 2:
/ blocks = [
    1 = intro;
    2 = positivePractice;
    3 = positive;
    4 = positive1;
    5 = break;
    6 = negativePractice;
    7 = negative;
    8 = negative1;
    9 = finish;



That still doesn't really answer the primary question: What isn't working?

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 - 10/21/2020
dillonk - 10/21/2020
Sorry for any lack of clarity. I am hoping to edit the script by adding another test trial. So, in the test block, it will be 14 trials x 2 of the emotion words (positive, negative). I added new test trials (negativeEW1 and positiveEW1) under the TEST TRIALS section. I added the same blocks under the BLOCKS, and EXPERIMENT section. Since I edited several sections, it felt smarter to attach the entire file. I attached it to my reply. But, here are sections I added:
 
TEST TRIALS
(after <trial negativeEW>)
<trial negativeEW1>
/ ontrialbegin = [
    values.valence = "negative1";
    expressions.trialAssignments;

    trial.negativeEW1.insertstimulustime(text.negativeEW1, parameters.fixationDuration);
    trial.negativeEW1.insertstimulustime(text.negativeCTRL1, parameters.fixationDuration);
    if (parameters.runMask == true){
        trial.negativeEW1.insertstimulustime(text.Mask1, (parameters.fixationDuration + parameters.wordPresentationDuration));
        trial.negativeEW1.insertstimulustime(text.Mask2, (parameters.fixationDuration + parameters.wordPresentationDuration));        
    };
    trial.negativeEW1.insertstimulustime(text.Eraser1, (parameters.fixationDuration + parameters.wordPresentationDuration+ parameters.maskDuration));
    trial.negativeEW1.insertstimulustime(text.Eraser2, (parameters.fixationDuration + parameters.wordPresentationDuration+ parameters.maskDuration));    
    trial.negativeEW1.insertstimulustime(text.probe, (parameters.fixationDuration + parameters.wordPresentationDuration + parameters.maskDuration));        
    trial.negativeEW1.insertstimulustime(text.reminder, (parameters.fixationDuration + parameters.wordPresentationDuration + parameters.maskDuration+ parameters.reminderOnset));        

]
/ stimulustimes = [0 = fixation]
/ beginresponsetime = parameters.fixationDuration + parameters.wordPresentationDuration + parameters.maskDuration
/ responseinterrupt = immediate
/ validresponse = (parameters.probe1_responsekey, parameters.probe2_responsekey)
/ iscorrectresponse = [
    return(
    (trial.negativeEW1.responsetext == parameters.probe1_responsekey && values.probe == parameters.probe1) ||
    (trial.negativeEW1.responsetext == parameters.probe2_responsekey && values.probe == parameters.probe2));
]
/ ontrialend = [
    trial.negativeEW1.resetstimulusframes();
    values.EW = text.negativeEW1.currentitem;
    values.CTRL = text.negativeCTRL1.currentitem;
    
    if (values.congruence == 1){
        list.accuracy_negEW_congruent.appenditem(trial.negativeEW1.correct);
        if (trial.negativeEW1.correct){
            list.RT_negEW_congruent.appenditem(trial.negativeEW1.latency);
        };
    } else {
        list.accuracy_negEW_incongruent.appenditem(trial.negativeEW1.correct);
        if (trial.negativeEW1.correct){
            list.RT_negEW_incongruent.appenditem(trial.negativeEW1.latency);
        };
    };
]
/ posttrialpause = parameters.iti
/ errormessage = true(text.errorfeedback, 500)
</trial>

(after <trial positiveEW>)
<trial positiveEW1>
/ ontrialbegin = [
    values.valence = "positive1";
    expressions.trialAssignments;

    trial.positiveEW1.insertstimulustime(text.positiveEW1, parameters.fixationDuration);
    trial.positiveEW1.insertstimulustime(text.positiveCTRL1, parameters.fixationDuration);
    if (parameters.runMask == true){
        trial.positiveEW1.insertstimulustime(text.Mask1, (parameters.fixationDuration + parameters.wordPresentationDuration));
        trial.positiveEW1.insertstimulustime(text.Mask2, (parameters.fixationDuration + parameters.wordPresentationDuration));        
    };    
    trial.positiveEW1.insertstimulustime(text.Eraser1, (parameters.fixationDuration + parameters.wordPresentationDuration+ parameters.maskDuration));
    trial.positiveEW1.insertstimulustime(text.Eraser2, (parameters.fixationDuration + parameters.wordPresentationDuration+ parameters.maskDuration));    
    trial.positiveEW1.insertstimulustime(text.probe, (parameters.fixationDuration + parameters.wordPresentationDuration + parameters.maskDuration));        
    trial.positiveEW1.insertstimulustime(text.reminder, (parameters.fixationDuration + parameters.wordPresentationDuration + parameters.maskDuration+ parameters.reminderOnset));        

    ]
/ stimulustimes = [0 = fixation]
/ beginresponsetime = parameters.fixationDuration + parameters.wordPresentationDuration + parameters.maskDuration
/ responseinterrupt = immediate
/ validresponse = (parameters.probe1_responsekey, parameters.probe2_responsekey)
/ iscorrectresponse = [
    return(
    (trial.positiveEW1.responsetext == parameters.probe1_responsekey && values.probe == parameters.probe1) ||
    (trial.positiveEW1.responsetext == parameters.probe2_responsekey && values.probe == parameters.probe2));
]
/ ontrialend = [
    trial.positiveEW1.resetstimulusframes();
    values.EW = text.positiveEW1.currentitem;
    values.CTRL = text.positiveCTRL1.currentitem;
    
    if (values.congruence == 1){
        list.accuracy_posEW_congruent.appenditem(trial.positiveEW1.correct);
        if (trial.positiveEW1.correct){
            list.RT_posEW_congruent.appenditem(trial.positiveEW1.latency);
        };
    } else {
        list.accuracy_posEW_incongruent.appenditem(trial.positiveEW1.correct);
        if (trial.positiveEW1.correct){
            list.RT_posEW_incongruent.appenditem(trial.positiveEW1.latency);
        };
    };
]
/ posttrialpause = parameters.iti
/ errormessage = true(text.errorfeedback, 500)
</trial>

BLOCKS
<block negative1>
/ trials = [1-14 = negativeEW1]
</block>

<block positive1>
/ trials = [1-14 = positiveEW1]
</block>

EXPERIMENT 
For group 1:
/ blocks = [
    1 = intro;
    2 = negativePractice;
    3 = negative;
    4 = negative1;
    5 = break;
    6 = positivePractice;
    7 = positive;
    8 = positive1;
    9 = finish;

For group 2:
/ blocks = [
    1 = intro;
    2 = positivePractice;
    3 = positive;
    4 = positive1;
    5 = break;
    6 = negativePractice;
    7 = negative;
    8 = negative1;
    9 = finish;



That still doesn't really answer the primary question: What isn't working?

Besides, I don't really understand why you felt the need to add <block> and <trial> elements instead of either running the already existing positive and negative blocks twice or increasing the number of trials in the existing positive and negative blocks from 14 to 28.
dillonk
dillonk
Associate Member (249 reputation)Associate Member (249 reputation)Associate Member (249 reputation)Associate Member (249 reputation)Associate Member (249 reputation)Associate Member (249 reputation)Associate Member (249 reputation)Associate Member (249 reputation)Associate Member (249 reputation)
Group: Forum Members
Posts: 17, Visits: 68
The method I outlined above wasn't working; the task didn't seem to be changed at all. I initially tried to increase the existing positive and negative blocks from 14 to 28, but that didn't work either, which is why I tried adding the block and trial elements. It would flash a word or two before ending the task. I'm new to both millisecond and editing scripts, so if you think it would be easier to increase the blocks, I'm happy to keep trying that.
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
dillonk - 10/21/2020
The method I outlined above wasn't working; the task didn't seem to be changed at all. I initially tried to increase the existing positive and negative blocks from 14 to 28, but that didn't work either, which is why I tried adding the block and trial elements. It would flash a word or two before ending the task. I'm new to both millisecond and editing scripts, so if you think it would be easier to increase the blocks, I'm happy to keep trying that.

I don't know what you're doing, but running the script -- unchanged, just as you attached it -- works perfectly fine. The attached data file is from a runthrough I just did and all the added blocks and trials are there exactly as they should be.

Attachments
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search