Reply To: html layout/event times/selector vs. scale/ compatibility

PennController for IBEX Forums Support html layout/event times/selector vs. scale/ compatibility Reply To: html layout/event times/selector vs. scale/ compatibility

#7947
HPI
Participant

Dear Jeremy,

I am back after having run some pilots and I wish to implement some modifications.

Recap:
I show to the participant a picture, then a sentence, then a question requesting to rate the sentence that describes the picture, then I load a canvas with 3 emoticons corresponding to 3 keys V (bad) N (so and so) N (good).

I have a theoretical prediction on how the participant should evaluate each sentence, so in the template, there is a column “Right_Key” which contains the expected key.

So far I have managed to obtain data on the overall accuracy of responses of the participant.

I have created a trial before the experiment that sets the counter to 0, when the participant selects a key that matches the expected one, the counter adds 1.

Running the analysis of the pilot I have noticed that I would like to count and have already the counted variable on one side of the single item:

If the participant presses the expected key I would like to see a hit (1), if the participant pressed one of the other 2 keys I would like this variable to stay (0).

So I thought to add a trial before the experimental one, set an “item_score” variable to 0 when there is a success the “item_score” makes +1, I log the value, I set the value again to 0 at the end of the trial.

This is what I had:

newTrial("score_experiment_0", 
    newVar("exp_score") // #this is the overall accuracy
    .global()
    .set(0) 
    )  

Template("stimuli.csv", variable =>
    newTrial("experimental_trial",


// ....

.test.selected({ V: getImage("inappropriate"), B: getImage("infelicitous"), N: getImage("appropriate") }[variable.Right_Key]) // Increment if correct answer
    .success( getVar("exp_score").set(s_exp=>s_exp+1)) 

// ....

at the end when I log all the conditions I added .log("Accuracy", getVar("exp_score"))

This works.

Now I want to add the second counter (the new trial is added to the sequence on top):

newTrial("score_experiment_0", 
    newVar("exp_score")  // #global accuracy
    .global()
    .set(0) 
    )  
    
newTrial("score_item_0", 
    newVar("item_score") #new variable that must go 0 or 1
    .global()
    .set(0) 
    )  

Template("stimuli.csv", variable =>
    newTrial("experimental_trial",

// ........

.test.selected({ V: getImage("inappropriate"), B: getImage("infelicitous"), N: getImage("appropriate") }[variable.Right_Key]) // Increment if correct answer
    .success( getVar("exp_score").set(s_exp=>s_exp+1)) 
    .and( getVar("item_score").set(sc_i=>sc_i+1))

Here I tried to set it directly to 1 .set(sc_i=>1)) but it didn’t work, so I chose to go +1 because at trial 1 it’s a 0, it goes 1 then I want to save it and set it back to 0.

getVar("item_score")
    .log()
    ,

// ...

(getVar("item_score").set(sc_i=>0)).

It tells me that the variable “item_score” doesn’t exist, (but it does) and doesn’t compute correctly neither the item_score nor the global exp_score like this, so I guess it doesn’t compute correctly .success

Is there a way to correctly write “more than one action to do after a success?”

.success — do this; .and —- ; and —

Or after .success is it possible to have one command?

————————————————

With the same principle, I would like to have in the output the counter of how many V, or B, or N, they clicked, so after the selection, I would like to add

“if” .test.selected({ V: getImage(“inappropriate”), B: getImage(“infelicitous”), N: getImage(“appropriate”) } “N”) // Increment if the participant presses N

the variable “count_N”. (getVar(“count_N”).set(sc_i=>sc_i+1)).

But also in this case I would have to test:
-if it matches right_key then do +1 on the entire experiment;
-if it matches right_key then do +1 on the item then set it back to 0;
-if it matches “N” then do +1 on the entire experiment;
-if it matches “B” then do +1 on the entire experiment;
-if it matches “V” then do +1 on the entire experiment;

after the line .test.selected

Is it possible to have multiple tests after the selection and save the values of the variables?

Thanks!

(then we would like to implement another part of the test measuring a covariate of language proficiency, and I am working on it, but first I would like to implement these changes)

Thank you for your help!

HPI