Help Creating Feedback for Task

12 views
Skip to first unread message

Jordan Axt

unread,
Jan 13, 2022, 2:55:20 PM1/13/22
to Minno.js
Hello Minno Group,

I am working on a study with a decision-making task programmed in minno. Here is a link to the showfiles page, with the relevant files being test1.js - test12.js and debriefing.jst:

I would like to give my participants feedback on their performance on the task. The test.js files contain four trial types: accept_moreattractive, accept_lessattractive, reject_moreattractive, reject_lessattractive. 

Ideally, the feedback can look like this:

For applicants that were more qualified, you accepted [number of 'accept' responses given in trials called accept_moreattractive] of more physically attractive applicants and accepted [number of 'accept' responses given in trials called accept_lessattractive] less physically attractive applicants.

For applicants that were less qualified, you accepted [number of 'accept' responses given in trials called reject_moreattractive] of more physically attractive applicants and accepted [number of 'accept' responses given in trials called reject_lessattractive] less physically attractive applicants.

I believe we do something similar for AMP feedback (e.g., "After Black faces, you rated X symbols as positive and Y symbols as negative"), but I cannot figure out how to adapt that code to my own task.

Any help or resources to pass along would be greatly appreciated. And do let me know if you need any more info from me.

Jordan



--
Jordan Axt

Mayan Navon

unread,
Jan 16, 2022, 3:58:29 AM1/16/22
to Jordan Axt, Minno.js
Hi Jordan,

I think you should create 4 counters, one for each trial type:
current.acceptMore = 0;
current.acceptLess = 0;
current.rejectMore = 0;
current.rejectLess = 0;

Then, increase the counters depending on the interactions, for example:
  interactions: [
            // Display the target stimulus.
            {conditions:[{type:'begin'}],
                actions: [{type:'showStim', handle: 'target'},
                         {type:"setInput",input:{handle:"targetOut",on:"timeout",duration:15000}}]
            },
            // Correct response actions
            {conditions: [
                    {type:'inputEqualsTrial',property:'group'}
                ],
                actions: [
                    {type:'setTrialAttr', setter:{score:1}},
                    {type:'setGlobalAttr', setter:function(global){ global.current.acceptMore++;}},
                    {type:'trigger', handle:'ITI'},
                    {type:'log'}
                ]
            },
            // Incorrect response actions
            {conditions: [
                    {type:'inputEqualsTrial',property:'group',negate:true},
                    {type:'inputEquals',value:['reject','accept']}
                ],
                actions: [
                    {type:'setTrialAttr', setter:{score:0}},
                    {type:'removeInput',handle:['reject','accept','targetOut']},
                    {type:'trigger', handle:'ITI'},
                    {type:'log'}
                ]
            },
            // Timeouts
            {conditions: [{type:"inputEquals",value:'targetOut'}],
            actions: [
                {type:'removeInput',handle:['accept','reject', 'targetOut']},
                {type:"hideStim",handle:"target"}, // hide the stimulus
                {type:"showStim",handle:"warning"},// and show the warning
                {type:'setTrialAttr', setter:{score:0}},
                {type:"setInput",input:{handle:"ITI", on:"timeout",duration:300}},
                {type:'log'}] //End the trial in 250ms (show the warning until then)
        },                
            // Inter trial interval
            {conditions: [{type:'inputEquals', value:'ITI'}],
                actions:[
                    {type:'hideStim',handle:'All'},
                    {type:'removeInput',handle:['reject','accept','targetOut']},
                    {type:'trigger', handle:'end',duration:200}
                ]
            },
            // End trial
            {conditions: [{type:'inputEquals', value:'end'}],
                actions:[
                    {type:'endTrial'}
                ]
            }
        ]
The easiest way to do that separately for each trial type is to create different trials for each type (4 overall).

Then, you just need to present the value of each counter in your feedback.

Let me know if that helps.



--
You received this message because you are subscribed to the Google Groups "Minno.js" group.
To unsubscribe from this group and stop receiving emails from it, send an email to minnojs+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/minnojs/CAN9p%3DakFB2O17LwZwJLabhSBsfnmFrSZzxkqZcbm__dsbsgpHw%40mail.gmail.com.

Yoav Bar-Anan

unread,
Jan 16, 2022, 4:22:55 AM1/16/22
to Mayan Navon, Jordan Axt, Minno.js
Hi Jordan, 

In addition to what Mayan suggsted, another option is indeed to look at the code of the AMP extension. Search for "computeAMPScore". You will see that at the end of the task, we send to that function the logs that Minno has collected throughout the task. We go over those logs, and create the feedback based on the responses we find in the logs.I hope that helps. 

Yoav

Mayan Navon

unread,
Jan 20, 2022, 3:40:13 AM1/20/22
to Jordan Axt, Minno.js
Hi Jordan,

a) You'll need to put your counters' definition at the beginning of your script, right after var API = new APIconstructor();.
Also, note that we no longer need to use the logger setting (API.addSettings('logger'...), and it actually could create bugs in your data logging.
b) You'll need to call the task where you saved these variables. So, for example, if you saved current.acceptMore in test1.js, the way to call it later, in a different task, would be: <%=global.test1.acceptMore%>.

Best,
Mayan


On Wed, 19 Jan 2022 at 21:21, Jordan Axt <jorda...@gmail.com> wrote:
Hi Mayan,

Thank you very much for your help here! It is very much appreciated. I think I am quite close to figuring this out. I believe I have correctly updated my test files to have the four trial types, each with their own counter, based on the code you sent along. I also think I have set up my debriefing to refer to the correct values.

My only issue is that I cannot figure out where and how to define my four counters (current.acceptmore, current.acceptless, current.rejectmore, current.rejectless). Could you help me with a) letting me know where and how to define these counters in my test files? and b) let me know if I have correctly set up the reference to those values in my debriefing (see lines 8 and 10 of the debriefing file)?


Thanks again,
Jordan
--
Jordan Axt

Mayan Navon

unread,
Jan 20, 2022, 11:20:36 AM1/20/22
to Jordan Axt, Minno.js
No worries.

Here is how I would define these counters, at the beginning of your script:

define(['pipAPI'], function(APIconstructor) {

var global = API.getGlobal();
var current = API.getCurrent();


current.acceptMore = 0;
current.acceptLess = 0;
current.rejectMore = 0;
current.rejectLess = 0;

you can test these anytime during the task using console.log()
console.log(current.acceptMore);

Let me know if that worked for you.



On Thu, 20 Jan 2022 at 17:55, Jordan Axt <jorda...@gmail.com> wrote:
Hi Mayan,

I am sorry. I am still having trouble. I have tried defining my counter in two ways, both of which return zero errors but neither of which actually let's me run my task. Can you tell me what my issue is? I have tried the following:

Option 1
var acceptMore = 0;
var acceptLess = 0;
var rejectMore = 0;
var rejectLess = 0;

API.addCurrent(acceptMore);
API.addCurrent(acceptLess);
API.addCurrent(rejectMore);
API.addCurrent(rejectLess);

Option 2
API.addCurrent('acceptMore',{
    value: 0});

API.addCurrent('acceptLess',{
    value: 0);

API.addCurrent('rejectMore',{
    value: 0});

API.addCurrent('rejectLess',{
    value: 0});

Thank you,
Jordan
--
Jordan Axt
Reply all
Reply to author
Forward
0 new messages