Millisecond Forums

clicks count

https://forums.millisecond.com/Topic18339.aspx

By wsly - 2/15/2016

Hi!

I need to create in my data file a column to register how many clicks a participant does in each block, I have tried several different solutions but no one seems to work.
Any suggestions please????
By Dave - 2/15/2016

This entirely depends on how you programmed your script. Usually you'll want to create and increase <values> entries to count the clicks and log those to the data file. Suppose you have a <trial> that displays two "boxes" a and b. Then you could do something along the lines of:

<values>
/ a_clickcount = 0
/ b_clickcount = 0
</values>

<expt>
/ blocks = [1-2 = myblock]
</expt>

<block myblock>
/ onblockbegin = [values.a_clickcount = 0; values.b_clickcount = 0; ]
/ trials = [1-10 = mytrial]
</block>

<trial mytrial>
/ ontrialend = [if (trial.mytrial.response == "a") values.a_clickcount += 1; ]
/ ontrialend = [if (trial.mytrial.response == "b") values.b_clickcount += 1; ]
/ stimulusframes = [1=a,b]
/ inputdevice = mouse
/ validresponse = (a, b)
</trial>

<text a>
/ items = ("A")
/ size = (20%, 20%)
/ position = (35%, 50%)
/ txbgcolor = grey
</text>

<text b>
/ items = ("B")
/ size = (20%, 20%)
/ position = (65%, 50%)
/ txbgcolor = grey
</text>

<data>
/ columns = [date time subject group blocknum blockcode trialnum trialcode response latency correct values.a_clickcount values.b_clickcount]
/ separatefiles = true
</data>

By wsly - 2/15/2016

Thank you for the suggestion!!

Additionally, I have a slight issue I cannot figure out how to solve. Here's the point: I've got a simple shape embedded in a more complex figure and participants have to find the single shape within the complex one by clicking on its corners. Problem is that there is more than one solution (the same simple shape can be traced four times in the complex figure. Some corners are in common between two or more solutions, but it seems that it does not recognize as correct all the three solutions the overlapping corner belongs to.
Here's the code - in the highlighted lines, for example, if I click on the corner it does only recognize solution 4 as correct, not 1 or 2.

<trial complexII_4>
/ inputdevice = mouse
/ stimulusframes = [1 = selectedCorner]
/ validresponse = (solutionII_4_1_1, solutionII_4_1_2, solutionII_4_1_3, solutionII_4_1_4, solutionII_4_1_5, solutionII_4_1_6, solutionII_4_1_7,
solutionII_4_2_1, solutionII_4_2_2, solutionII_4_2_3, solutionII_4_2_4, solutionII_4_2_5, solutionII_4_2_6, solutionII_4_2_7,
solutionII_4_3_1, solutionII_4_3_2, solutionII_4_3_3, solutionII_4_3_4, solutionII_4_3_5, solutionII_4_3_6, solutionII_4_3_7,
solutionII_4_4_1, solutionII_4_4_2, solutionII_4_4_3, solutionII_4_4_4, solutionII_4_4_5, solutionII_4_4_6, solutionII_4_4_7,
back, done, background)

/ ontrialend = [
if (trial.complexII_4.response == "solutionII_4_1_1" && values.solutionII_4_1_1set == 0 && (values.currentsolutionII_4 == 0 || values.currentsolutionII_4 == 1)){
values.solutionII_4_1_1set = 1;
values.solutionII_4_1_feedback_x1 = values.solutionII_4_1_x1;
values.solutionII_4_1_feedback_y1 = values.solutionII_4_1_y1;
values.selectedcornersii_4 += 1;
   values.ii_4_clickcount += 1;

shape.selectedCorner.hposition = values.solutionII_4_1_x1;
shape.selectedCorner.vposition = values.solutionII_4_1_y1;

if (values.currentsolutionII_4 == 0){
values.currentsolutionII_4 = 1;
} else {};

}
else if ((trial.complexII_4.response == "solutionII_4_1_2" || trial.complexII_4.response == "solutionII_4_3_1") && values.solutionII_4_1_2set == 0 && (values.currentsolutionII_4 == 0 || values.currentsolutionII_4 == 1 || values.currentsolutionII_4 == 3 )){
values.solutionII_4_1_2set = 1;
   values.solutionII_4_3_1set = 1;
values.solutionII_4_1_feedback_x2 = values.solutionII_4_1_x2;
values.solutionII_4_1_feedback_y2 = values.solutionII_4_1_y2;
values.selectedcornersii_4 += 1;
   values.ii_4_clickcount += 1;

shape.selectedCorner.hposition = values.solutionII_4_1_x2;
shape.selectedCorner.vposition = values.solutionII_4_1_y2;

if (values.currentsolutionII_4 == 0){
values.currentsolutionII_4 = 1; values.currentsolutionII_4 = 3;
} else {};
}
else if ((trial.complexII_4.response == "solutionII_4_1_3" || trial.complexII_4.response == "solutionII_4_2_7" || trial.complexII_4.response == "solutionII_4_4_6") && values.solutionII_4_1_3set == 0 && (values.currentsolutionII_4 == 0 || values.currentsolutionII_4 == 1 || values.currentsolutionII_4 == 2 || values.currentsolutionII_4 == 4 )){
values.solutionII_4_1_3set = 1;
   values.solutionII_4_2_7set = 1;
   values.solutionII_4_4_6set = 1;
values.solutionII_4_1_feedback_x3 = values.solutionII_4_1_x3;
values.solutionII_4_1_feedback_y3 = values.solutionII_4_1_y3;
values.selectedcornersii_4 += 1;
   values.ii_4_clickcount += 1;

shape.selectedCorner.hposition = values.solutionII_4_1_x3;
shape.selectedCorner.vposition = values.solutionII_4_1_y3;

if (values.currentsolutionII_4 == 0 ){
values.currentsolutionII_4 = 1; values.currentsolutionII_4 = 2; values.currentsolutionII_4 = 4;
  }else {};
}

else if ((trial.complexII_4.response == "solutionII_4_1_4" || trial.complexII_4.response == "solutionII_4_3_5") && values.solutionII_4_1_4set == 0 && (values.currentsolutionII_4 == 0 || values.currentsolutionII_4 == 1 || values.currentsolutionII_4 == 3 )){
values.solutionII_4_1_4set = 1;
   values.solutionII_4_3_5set = 1;
values.solutionII_4_1_feedback_x4 = values.solutionII_4_1_x4;
values.solutionII_4_1_feedback_y4 = values.solutionII_4_1_y4;
values.selectedcornersii_4 += 1;
   values.ii_4_clickcount += 1;

shape.selectedCorner.hposition = values.solutionII_4_1_x4;
shape.selectedCorner.vposition = values.solutionII_4_1_y4;

if (values.currentsolutionII_4 == 0){
values.currentsolutionII_4 = 1; values.currentsolutionII_4 = 3;
} else {};

}
else if (trial.complexII_4.response == "solutionII_4_1_5" && values.solutionII_4_1_5set == 0 && (values.currentsolutionII_4 == 1 || values.currentsolutionII_4 == 0)){
values.solutionII_4_1_5set = 1;
values.solutionII_4_1_feedback_x5 = values.solutionII_4_1_x5;
values.solutionII_4_1_feedback_y5 = values.solutionII_4_1_y5;
values.selectedcornersii_4 += 1;
   values.ii_4_clickcount += 1;

shape.selectedCorner.hposition = values.solutionII_4_1_x5;
shape.selectedCorner.vposition = values.solutionII_4_1_y5;

if (values.currentsolutionII_4 == 0){
values.currentsolutionII_4 = 1;
} else {};
}
else if (trial.complexII_4.response == "solutionII_4_1_6" && values.solutionII_4_1_6set == 0 && (values.currentsolutionII_4 == 1 || values.currentsolutionII_4 == 0)){
values.solutionII_4_1_6set = 1;
values.solutionII_4_1_feedback_x6 = values.solutionII_4_1_x6;
values.solutionII_4_1_feedback_y6 = values.solutionII_4_1_y6;
values.selectedcornersii_4 += 1;
   values.ii_4_clickcount += 1;

shape.selectedCorner.hposition = values.solutionII_4_1_x6;
shape.selectedCorner.vposition = values.solutionII_4_1_y6;

if (values.currentsolutionII_4 == 0){
values.currentsolutionII_4 = 1;
} else {};

}
else if ((trial.complexII_4.response == "solutionII_4_1_7" || trial.complexII_4.response == "solutionII_4_3_6") && values.solutionII_4_1_7set == 0 && (values.currentsolutionII_4 == 0 || values.currentsolutionII_4 == 1 || values.currentsolutionII_4 == 3 )){
values.solutionII_4_1_7set = 1;
values.solutionII_4_3_6set = 1;
values.solutionII_4_1_feedback_x7 = values.solutionII_4_1_x7;
values.solutionII_4_1_feedback_y7 = values.solutionII_4_1_y7;
values.selectedcornersii_4 += 1;
   values.ii_4_clickcount += 1;

shape.selectedCorner.hposition = values.solutionII_4_1_x7;
shape.selectedCorner.vposition = values.solutionII_4_1_y7;

if (values.currentsolutionII_4 == 0){
values.currentsolutionII_4 = 1; values.currentsolutionII_4 = 3;
} else {};
}
else if (trial.complexII_4.response == "solutionII_4_2_1" && values.solutionII_4_2_1set == 0 && (values.currentsolutionII_4 == 0 || values.currentsolutionII_4 == 2)){
values.solutionII_4_2_1set = 1;
values.solutionII_4_2_feedback_x1 = values.solutionII_4_2_x1;
values.solutionII_4_2_feedback_y1 = values.solutionII_4_2_y1;
values.selectedcornersii_4 += 1;
   values.ii_4_clickcount += 1;

shape.selectedCorner.hposition = values.solutionII_4_2_x1;
shape.selectedCorner.vposition = values.solutionII_4_2_y1;

if (values.currentsolutionII_4 == 0){
values.currentsolutionII_4 = 2;
} else {};
}
else if ((trial.complexII_4.response == "solutionII_4_2_2" || trial.complexII_4.response == "solutionII_4_4_1") && values.solutionII_4_2_2set == 0 && (values.currentsolutionII_4 == 0 || values.currentsolutionII_4 == 2 || values.currentsolutionII_4 == 4 )){
values.solutionII_4_2_2set = 1;
   values.solutionII_4_4_1set = 1;
values.solutionII_4_2_feedback_x2 = values.solutionII_4_2_x2;
values.solutionII_4_2_feedback_y2 = values.solutionII_4_2_y2;
values.selectedcornersii_4 += 1;
   values.ii_4_clickcount += 1;

shape.selectedCorner.hposition = values.solutionII_4_2_x2;
shape.selectedCorner.vposition = values.solutionII_4_2_y2;

if (values.currentsolutionII_4 == 0){
values.currentsolutionII_4 = 2; values.currentsolutionII_4 = 4;
} else {};
}
else if ((trial.complexII_4.response == "solutionII_4_2_3" || trial.complexII_4.response == "solutionII_4_3_7") && values.solutionII_4_2_3set == 0 && (values.currentsolutionII_4 == 0 || values.currentsolutionII_4 == 2 || values.currentsolutionII_4 == 3 )){
values.solutionII_4_2_3set = 1;
   values.solutionII_4_3_7set = 1;
values.solutionII_4_2_feedback_x3 = values.solutionII_4_2_x3;
values.solutionII_4_2_feedback_y3 = values.solutionII_4_2_y3;
values.selectedcornersii_4 += 1;
   values.ii_4_clickcount += 1;

shape.selectedCorner.hposition = values.solutionII_4_2_x3;
shape.selectedCorner.vposition = values.solutionII_4_2_y3;

if (values.currentsolutionII_4 == 0){
values.currentsolutionII_4 = 2; values.currentsolutionII_4 = 3;
} else {};
}
else if ((trial.complexII_4.response == "solutionII_4_2_4" || trial.complexII_4.response == "solutionII_4_4_5") && values.solutionII_4_2_4set == 0 && (values.currentsolutionII_4 == 0 || values.currentsolutionII_4 == 2 || values.currentsolutionII_4 == 4 )){
values.solutionII_4_2_4set = 1;
   values.solutionII_4_4_5set = 1;
values.solutionII_4_2_feedback_x4 = values.solutionII_4_2_x4;
values.solutionII_4_2_feedback_y4 = values.solutionII_4_2_y4;
values.selectedcornersii_4 += 1;
   values.ii_4_clickcount += 1;

shape.selectedCorner.hposition = values.solutionII_4_2_x4;
shape.selectedCorner.vposition = values.solutionII_4_2_y4;

if (values.currentsolutionII_4 == 0){
values.currentsolutionII_4 = 2; values.currentsolutionII_4 = 4;
} else {};
}
else if (trial.complexII_4.response == "solutionII_4_2_5" && values.solutionII_4_2_5set == 0 && (values.currentsolutionII_4 == 0 || values.currentsolutionII_4 == 2)){
values.solutionII_4_2_5set = 1;
values.solutionII_4_2_feedback_x5 = values.solutionII_4_2_x5;
values.solutionII_4_2_feedback_y5 = values.solutionII_4_2_y5;
values.selectedcornersii_4 += 1;
   values.ii_4_clickcount += 1;

shape.selectedCorner.hposition = values.solutionII_4_2_x5;
shape.selectedCorner.vposition = values.solutionII_4_2_y5;

if (values.currentsolutionII_4 == 0){
values.currentsolutionII_4 = 2;
} else {};
}
else if (trial.complexII_4.response == "solutionII_4_2_6" && values.solutionII_4_2_6set == 0 && (values.currentsolutionII_4 == 0 || values.currentsolutionII_4 == 2)){
values.solutionII_4_2_6set = 1;
values.solutionII_4_2_feedback_x6 = values.solutionII_4_2_x6;
values.solutionII_4_2_feedback_y6 = values.solutionII_4_2_y6;
values.selectedcornersii_4 += 1;
   values.ii_4_clickcount += 1;

shape.selectedCorner.hposition = values.solutionII_4_2_x6;
shape.selectedCorner.vposition = values.solutionII_4_2_y6;

if (values.currentsolutionII_4 == 0){
values.currentsolutionII_4 = 2;
} else {};
  }
else if (trial.complexII_4.response == "solutionII_4_3_2" && values.solutionII_4_3_2set == 0 && (values.currentsolutionII_4 == 3 || values.currentsolutionII_4 == 0)){
values.solutionII_4_3_2set = 1;
values.solutionII_4_3_feedback_x2 = values.solutionII_4_3_x2;
values.solutionII_4_3_feedback_y2 = values.solutionII_4_3_y2;
values.selectedcornersii_4 += 1;
   values.ii_4_clickcount += 1;

shape.selectedCorner.hposition = values.solutionII_4_3_x2;
shape.selectedCorner.vposition = values.solutionII_4_3_y2;

if (values.currentsolutionII_4 == 0){
values.currentsolutionII_4 = 3;
} else {};
  }
else if ((trial.complexII_4.response == "solutionII_4_3_3" || trial.complexII_4.response == "solutionII_4_4_7") && values.solutionII_4_3_3set == 0 && (values.currentsolutionII_4 == 0 || values.currentsolutionII_4 == 3 || values.currentsolutionII_4 == 4 )){
values.solutionII_4_3_3set = 1;
   values.solutionII_4_4_7set = 1;
values.solutionII_4_3_feedback_x3 = values.solutionII_4_3_x3;
values.solutionII_4_3_feedback_y3 = values.solutionII_4_3_y3;
values.selectedcornersii_4 += 1;
   values.ii_4_clickcount += 1;

shape.selectedCorner.hposition = values.solutionII_4_3_x3;
shape.selectedCorner.vposition = values.solutionII_4_3_y3;

if (values.currentsolutionII_4 == 0){
values.currentsolutionII_4 = 3; values.currentsolutionII_4 = 4;
} else {};
  }
else if (trial.complexII_4.response == "solutionII_4_3_4" && values.solutionII_4_3_4set == 0 && (values.currentsolutionII_4 == 3 || values.currentsolutionII_4 == 0)){
values.solutionII_4_3_4set = 1;
values.solutionII_4_3_feedback_x4 = values.solutionII_4_3_x4;
values.solutionII_4_3_feedback_y4 = values.solutionII_4_3_y4;
values.selectedcornersii_4 += 1;
   values.ii_4_clickcount += 1;

shape.selectedCorner.hposition = values.solutionII_4_3_x4;
shape.selectedCorner.vposition = values.solutionII_4_3_y4;

if (values.currentsolutionII_4 == 0){
values.currentsolutionII_4 = 3;
} else {};
}
else if (trial.complexII_4.response == "solutionII_4_4_2" && values.solutionII_4_4_2set == 0 && (values.currentsolutionII_4 == 0 || values.currentsolutionII_4 == 4)){
values.solutionII_4_4_2set = 1;
values.solutionII_4_4_feedback_x2 = values.solutionII_4_4_x2;
values.solutionII_4_4_feedback_y2 = values.solutionII_4_4_y2;
values.selectedcornersii_4 += 1;
   values.ii_4_clickcount += 1;

shape.selectedCorner.hposition = values.solutionII_4_4_x2;
shape.selectedCorner.vposition = values.solutionII_4_4_y2;

if (values.currentsolutionII_4 == 0){
values.currentsolutionII_4 = 4;
} else {};
}
else if (trial.complexII_4.response == "solutionII_4_4_3" && values.solutionII_4_4_3set == 0 && (values.currentsolutionII_4 == 4 || values.currentsolutionII_4 == 0)){
values.solutionII_4_4_3set = 1;
values.solutionII_4_4_feedback_x3 = values.solutionII_4_4_x3;
values.solutionII_4_4_feedback_y3 = values.solutionII_4_4_y3;
values.selectedcornersii_4 += 1;
   values.ii_4_clickcount += 1;

shape.selectedCorner.hposition = values.solutionII_4_4_x3;
shape.selectedCorner.vposition = values.solutionII_4_4_y3;

if (values.currentsolutionII_4 == 0){
values.currentsolutionII_4 = 4;
} else {};
  }
else if (trial.complexII_4.response == "solutionII_4_4_4" && values.solutionII_4_4_4set == 0 && (values.currentsolutionII_4 == 4 || values.currentsolutionII_4 == 0)){
values.solutionII_4_4_4set = 1;
values.solutionII_4_4_feedback_x4 = values.solutionII_4_4_x4;
values.solutionII_4_4_feedback_y4 = values.solutionII_4_4_y4;
values.selectedcornersii_4 += 1;
   values.ii_4_clickcount += 1;

shape.selectedCorner.hposition = values.solutionII_4_4_x4;
shape.selectedCorner.vposition = values.solutionII_4_4_y4;

if (values.currentsolutionII_4 == 0){
values.currentsolutionII_4 = 4;
} else {};
}
else if (trial.complexII_4.response == "done") {
values.stopcondition = 1;

}
else if (trial.complexII_4.response == "back") {
values.selectedcornersii_4 = 0;
values.correctii_4 = 0;

values.solutionII_4_1_set = 0;
values.solutionII_4_1_1set = 0;
values.solutionII_4_1_2set = 0;
values.solutionII_4_1_3set = 0;
values.solutionII_4_1_4set = 0;
values.solutionII_4_1_5set = 0;
values.solutionII_4_1_6set = 0;
values.solutionII_4_1_7set = 0;

values.solutionII_4_2_set = 0;
values.solutionII_4_2_1set = 0;
values.solutionII_4_2_2set = 0;
values.solutionII_4_2_3set = 0;
values.solutionII_4_2_4set = 0;
values.solutionII_4_2_5set = 0;
values.solutionII_4_2_6set = 0;
values.solutionII_4_2_7set = 0;

  values.solutionII_4_3_set = 0;
values.solutionII_4_3_1set = 0;
values.solutionII_4_3_2set = 0;
values.solutionII_4_3_3set = 0;
values.solutionII_4_3_4set = 0;
values.solutionII_4_3_5set = 0;
values.solutionII_4_3_6set = 0;
values.solutionII_4_3_7set = 0;

  values.solutionII_4_4_set = 0;
values.solutionII_4_4_1set = 0;
values.solutionII_4_4_2set = 0;
values.solutionII_4_4_3set = 0;
values.solutionII_4_4_4set = 0;
values.solutionII_4_4_5set = 0;
values.solutionII_4_4_6set = 0;
values.solutionII_4_4_7set = 0;


values.solutionII_4_1_feedback_x1 = -100;
  values.solutionII_4_1_feedback_y1 = -100;
  values.solutionII_4_1_feedback_x2 = -100;
  values.solutionII_4_1_feedback_y2 = -100;
  values.solutionII_4_1_feedback_x3 = -100;
  values.solutionII_4_1_feedback_y3 = -100;
  values.solutionII_4_1_feedback_x4 = -100;
  values.solutionII_4_1_feedback_y4 = -100;
  values.solutionII_4_1_feedback_x5 = -100;
  values.solutionII_4_1_feedback_y5 = -100;
  values.solutionII_4_1_feedback_x6 = -100;
  values.solutionII_4_1_feedback_y6 = -100;
  values.solutionII_4_1_feedback_x7 = -100;
  values.solutionII_4_1_feedback_y7 = -100;


  values.solutionII_4_2_feedback_x1 = -100;
  values.solutionII_4_2_feedback_y1 = -100;
  values.solutionII_4_2_feedback_x2 = -100;
  values.solutionII_4_2_feedback_y2 = -100;
  values.solutionII_4_2_feedback_x3 = -100;
  values.solutionII_4_2_feedback_y3 = -100;
  values.solutionII_4_2_feedback_x4 = -100;
  values.solutionII_4_2_feedback_y4 = -100;
  values.solutionII_4_2_feedback_x5 = -100;
  values.solutionII_4_2_feedback_y5 = -100;
  values.solutionII_4_2_feedback_x6 = -100;
  values.solutionII_4_2_feedback_y6 = -100;
  values.solutionII_4_2_feedback_x7 = -100;
  values.solutionII_4_2_feedback_y7 = -100;
 
  values.solutionII_4_3_feedback_x1 = -100;
  values.solutionII_4_3_feedback_y1 = -100;
  values.solutionII_4_3_feedback_x2 = -100;
  values.solutionII_4_3_feedback_y2 = -100;
  values.solutionII_4_3_feedback_x3 = -100;
  values.solutionII_4_3_feedback_y3 = -100;
  values.solutionII_4_3_feedback_x4 = -100;
  values.solutionII_4_3_feedback_y4 = -100;
  values.solutionII_4_3_feedback_x5 = -100;
  values.solutionII_4_3_feedback_y5 = -100;
  values.solutionII_4_3_feedback_x6 = -100;
  values.solutionII_4_3_feedback_y6 = -100;
  values.solutionII_4_3_feedback_x7 = -100;
  values.solutionII_4_3_feedback_y7 = -100;
 
  values.solutionII_4_4_feedback_x1 = -100;
  values.solutionII_4_4_feedback_y1 = -100;
  values.solutionII_4_4_feedback_x2 = -100;
  values.solutionII_4_4_feedback_y2 = -100;
  values.solutionII_4_4_feedback_x3 = -100;
  values.solutionII_4_4_feedback_y3 = -100;
  values.solutionII_4_4_feedback_x4 = -100;
  values.solutionII_4_4_feedback_y4 = -100;
  values.solutionII_4_4_feedback_x5 = -100;
  values.solutionII_4_4_feedback_y5 = -100;
  values.solutionII_4_4_feedback_x6 = -100;
  values.solutionII_4_4_feedback_y6 = -100;
  values.solutionII_4_4_feedback_x7 = -100;
  values.solutionII_4_4_feedback_y7 = -100;
 

values.response_x = -100;
values.response_y = -100;

}
else {
values.wrongselection = 1;
};

if (trial.complexII_4.response == "background" || values.wrongselection == 1)

{
values.response_x = trial.complexII_4.responsex;
values.response_y = trial.complexII_4.responsey;
};
if (values.solutionII_4_1_1set == 1 && values.solutionII_4_1_2set == 1 && values.solutionII_4_1_3set == 1 && values.solutionII_4_1_4set == 1 && values.solutionII_4_1_5set == 1 && values.solutionII_4_1_6set == 1 && values.solutionII_4_1_7set == 1 &&
values.selectedcornersii_4 == values.numberofcornersII_4) {
values.correctii_4 = 1;
}
else if (values.solutionII_4_2_1set == 1 && values.solutionII_4_2_2set == 1 && values.solutionII_4_2_3set == 1 && values.solutionII_4_2_4set == 1 && values.solutionII_4_2_5set == 1 && values.solutionII_4_2_6set == 1 && values.solutionII_4_2_7set == 1 &&
values.selectedcornersii_4 == values.numberofcornersII_4) {
values.correctii_4 = 1;
  }
else if (values.solutionII_4_3_1set == 1 && values.solutionII_4_3_2set == 1 && values.solutionII_4_3_3set == 1 && values.solutionII_4_3_4set == 1 && values.solutionII_4_3_5set == 1 && values.solutionII_4_3_6set == 1 && values.solutionII_4_3_7set == 1 &&
values.selectedcornersii_4 == values.numberofcornersII_4) {
values.correctii_4 = 1;
}
else if (values.solutionII_4_4_1set == 1 && values.solutionII_4_4_2set == 1 && values.solutionII_4_4_3set == 1 && values.solutionII_4_4_4set == 1 && values.solutionII_4_4_5set == 1 && values.solutionII_4_4_6set == 1 && values.solutionII_4_4_7set == 1 &&
values.selectedcornersii_4 == values.numberofcornersII_4) {
values.correctii_4 = 1;
}
else {values.correctii_4 = 0}
]


By Dave - 2/15/2016

Sorry, but the code does not make much sense in isolation. I can tell you this, though: The response options you list in /validresponse are evaluated *in the order given*. I.e., suppose you have two stimuli that overlap on-screen, <shape red> in the background and <shape green> in the foreground as per the /stimulusframes attribute:
----
<shape red>
/ shape = rectangle
/ color = red
/ size = (25%, 25%)
/ position = (50%, 40%)
</shape>

<shape green>
/ shape = rectangle
/ color = green
/ size = (25%, 25%)
/ position = (55%, 45%)
</shape>

<trial mytrial>
/ stimulusframes = [1=red, green]
/ inputdevice = mouse
/ validresponse = (red, green)
</trial>

<block myblock>
/ trials = [1=mytrial]
</block>
----

With

/ validresponse = (red, green)

defined in the <trial>, clicking anywhere on the green shape *within the area it overlaps with the red shape* will record the response as "red".

Conversely, defining

/ validresponse = (green, red)

will record a response in the overlapping area as "green".
By wsly - 2/15/2016

And is there any way to randomize the order? I have added the script so you can check for yourself what i am doing wrong. 
I thought it was a matter of adding a sort of logical to my conditionals. 

if (values.currentsolutionII_4 == 0){
values.currentsolutionII_4 = 1; values.currentsolutionII_4 = 3;
} else {};

What I need is to code: "if the values of current solution is set to 0 (no corners belonging to that solution already clicked), then the current solution can be 4 AND 3. Is there such a thing? 
By Dave - 2/16/2016

Since I cannot run that script and actually see what it's supposed to do (I don't have all the image files it requires, obviously), it is of limited use to me, I'm afraid. Can you strip that thing down to a single example and post just that along with the few stimuli needed to actually execute it?

> And is there any way to randomize the order?

No.

> What I need is to code: "if the values of current solution is set to 0 (no corners belonging to that solution already clicked), then the
> current solution can be 4 AND 3. Is there such a thing?

Not like that:

        if (values.currentsolutionII_4 == 0){
            values.currentsolutionII_4 = 1; values.currentsolutionII_4 = 3;
        } else {};

A variable (<values> entry) can take on a single value at any given time. It cannot be equal to both 1 AND 3 at the same time. You'd need two separate variables instead. In the above code, values.currentsolutionII_4 would always end up being set to 3.
By wsly - 2/16/2016

here it is, just the code for problem II_4 with the stimuli.

Different solutions have different corners' colors.

I'm in despair,
please helpppppppppppp!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! :( :( :(
By Dave - 2/16/2016

Thanks for the stripped-down script. FYI: I am working on / through this, but this isn't exactly trivial.
By Dave - 2/16/2016

Thanks for the stripped-down example. That makes it somewhat easier to assess. The bottom line, in my opinion, is this: In order to make this work, the whole thing needs to be re-framed to a substantial degree. What you'll want to avoid at any cost is overlapping response objects. Instead, have one -- and only one -- object per corner. In case of the example problem, that means you'd have a total of 19 clickable circles on-screen. A given circle can "belong to" several possible solutions, in some cases as many 3 in the example. In each instance of the <trial>, you'll want to (a) store a the set of solutions the clicked object is part of and then (b) check whether there is overlap in the solutions associated with the selected object and those associated with the *previously* selected objects. As long as that holds true, the response is valid / correct.

To illustrate what I mean, consider a simple example. Suppose you have a rectangle comprised of eight circles on-screen -- named c1 to c8, left to right, top to bottom -- and your objective is to select four of them to highlight a square. There are three solutions: (1) Select c1, c2, c3 and c4 -- the four circles on the top, or (2) select c3, c4, c5 and c6 -- the four middle circles, or (3) the four bottom circles -- c5 to c8. Obviously, the c3 and c4 are part of  solutions #1 and# 2, c5 and c6 are part of solutions #2 and 3. In other words: While selecting c1 automatically commits you to a particular solution (#1), selecting e.g. c3 first does not commit you to a single solution yet -- you could still go for #1 or #2. Selecting c4 as the 2nd response also doesn't commit you -- both #1 and #2 are still in the cards at this point, etc.

What is needed is a way to encode which possible solutions each circle applies to. E.g.

<values>
...
/ c3_applies_to_solution_1 = true
/ c3_applies_to_solution_2 = true
/ c3_applies_to_solution_3 = false
...
</values>

means that response c3 applies to solution #1 (true), solution #2 (true), but not solution #3 (false). You can then evaluate those properties against the still applicable solutions as you proceed through the trial.

Here's how you would code that:

<values>
/ c1_applies_to_solution_1 = true
/ c1_applies_to_solution_2 = false
/ c1_applies_to_solution_3 = false

/ c2_applies_to_solution_1 = true
/ c2_applies_to_solution_2 = false
/ c2_applies_to_solution_3 = false

/ c3_applies_to_solution_1 = true
/ c3_applies_to_solution_2 = true
/ c3_applies_to_solution_3 = false

/ c4_applies_to_solution_1 = true
/ c4_applies_to_solution_2 = true
/ c4_applies_to_solution_3 = false

/ c5_applies_to_solution_1 = false
/ c5_applies_to_solution_2 = true
/ c5_applies_to_solution_3 = true

/ c6_applies_to_solution_1 = false
/ c6_applies_to_solution_2 = true
/ c6_applies_to_solution_3 = true

/ c7_applies_to_solution_1 = false
/ c7_applies_to_solution_2 = false
/ c7_applies_to_solution_3 = true

/ c8_applies_to_solution_1 = false
/ c8_applies_to_solution_2 = false
/ c8_applies_to_solution_3 = true

/ c1_x = 40%
/ c1_y = 20%
/ c2_x = 60%
/ c2_y = 20%
/ c3_x = 40%
/ c3_y = 40%
/ c4_x = 60%
/ c4_y = 40%
/ c5_x = 40%
/ c5_y = 60%
/ c6_x = 60%
/ c6_y = 60%
/ c7_x = 40%
/ c7_y = 80%
/ c8_x = 60%
/ c8_y = 80%

/ solution_1_applicable = true
/ solution_2_applicable = true
/ solution_3_applicable = true

/ response_applies_to_solution_1 = true
/ response_applies_to_solution_2 = true
/ response_applies_to_solution_3 = true

/ correctcorner_size = 3%

/ possible_solutions = ""
/ responsestorage = ""
/ current_response_solutions = ""
/ response_correct = 0
/ committed = "No"
/ committedsolutionnumber = ""
</values>

<block myblock>
/ trials = [1=starttrial]
</block>

<trial starttrial>
/ ontrialbegin = [values.solution_1_applicable = true; values.solution_2_applicable = true; values.solution_3_applicable = true;
    values.response_applies_to_solution_1 = true; values.response_applies_to_solution_2 = true; values.response_applies_to_solution_3 = true;
    shape.selectedcorner.hposition = -10%; shape.selectedcorner.vposition = -10%; ]
/ stimulusframes = [1=c1,c2,c3,c4,c5,c6,c7,c8,done,debug]
/ trialduration = 1000
/ branch = [trial.clicktrial]
</trial>

<text debug>
/ items = ("Solution #1 applicable: <%values.solution_1_applicable%> | Solution #2 applicable: <%values.solution_2_applicable%> | Solution #3 applicable: <%values.solution_3_applicable%>
Response <%trial.clicktrial.response%> applies to #1: <%values.response_applies_to_solution_1%> #2: <%values.response_applies_to_solution_2%> #3: <%values.response_applies_to_solution_3%>
Responses: <%values.responsestorage%>")
/ position = (50%, 10%)
/ size = (90%, 10%)
/ erase = false
</text>

<text done>
/ items = ("DONE")
/ position = (50%, 90%)
/ erase = false
</text>


<trial clicktrial>
/ stimulusframes = [1=selectedcorner, debug]
/ validresponse = (c1,c2,c3,c4,c5,c6,c7,c8,done)
/ isvalidresponse = [!contains(values.responsestorage, trial.clicktrial.response)]
/ inputdevice = mouse
/ ontrialend = [values.responsestorage = concat(values.responsestorage, trial.clicktrial.response)]
/ ontrialend = [
    if (trial.clicktrial.response == "c1") {
    values.response_applies_to_solution_1 = values.c1_applies_to_solution_1;
    values.response_applies_to_solution_2 = values.c1_applies_to_solution_2;
    values.response_applies_to_solution_3 = values.c1_applies_to_solution_3;
    shape.selectedcorner.hposition = values.c1_x;
    shape.selectedcorner.vposition = values.c1_y; }
    else if (trial.clicktrial.response == "c2") {
    values.response_applies_to_solution_1 = values.c2_applies_to_solution_1;
    values.response_applies_to_solution_2 = values.c2_applies_to_solution_2;
    values.response_applies_to_solution_3 = values.c2_applies_to_solution_3;
    shape.selectedcorner.hposition = values.c2_x;
    shape.selectedcorner.vposition = values.c2_y; }

    else if (trial.clicktrial.response == "c3") {
    values.response_applies_to_solution_1 = values.c3_applies_to_solution_1;
    values.response_applies_to_solution_2 = values.c3_applies_to_solution_2;
    values.response_applies_to_solution_3 = values.c3_applies_to_solution_3;
    shape.selectedcorner.hposition = values.c3_x;
    shape.selectedcorner.vposition = values.c3_y; }

    else if (trial.clicktrial.response == "c4") {
    values.response_applies_to_solution_1 = values.c4_applies_to_solution_1;
    values.response_applies_to_solution_2 = values.c4_applies_to_solution_2;
    values.response_applies_to_solution_3 = values.c4_applies_to_solution_3;
    shape.selectedcorner.hposition = values.c4_x;
    shape.selectedcorner.vposition = values.c4_y; }

    else if (trial.clicktrial.response == "c5") {
    values.response_applies_to_solution_1 = values.c5_applies_to_solution_1;
    values.response_applies_to_solution_2 = values.c5_applies_to_solution_2;
    values.response_applies_to_solution_3 = values.c5_applies_to_solution_3;
    shape.selectedcorner.hposition = values.c5_x;
    shape.selectedcorner.vposition = values.c5_y; }

    else if (trial.clicktrial.response == "c6") {
    values.response_applies_to_solution_1 = values.c6_applies_to_solution_1;
    values.response_applies_to_solution_2 = values.c6_applies_to_solution_2;
    values.response_applies_to_solution_3 = values.c6_applies_to_solution_3;
    shape.selectedcorner.hposition = values.c6_x;
    shape.selectedcorner.vposition = values.c6_y; }

    else if (trial.clicktrial.response == "c7") {
    values.response_applies_to_solution_1 = values.c7_applies_to_solution_1;
    values.response_applies_to_solution_2 = values.c7_applies_to_solution_2;
    values.response_applies_to_solution_3 = values.c7_applies_to_solution_3;
    shape.selectedcorner.hposition = values.c7_x;
    shape.selectedcorner.vposition = values.c7_y; }

    else if (trial.clicktrial.response == "c8") {
    values.response_applies_to_solution_1 = values.c8_applies_to_solution_1;
    values.response_applies_to_solution_2 = values.c8_applies_to_solution_2;
    values.response_applies_to_solution_3 = values.c8_applies_to_solution_3;
    shape.selectedcorner.hposition = values.c8_x;
    shape.selectedcorner.vposition = values.c8_y; };
    ]

/ ontrialend = [values.solution_1_applicable = values.solution_1_applicable * values.response_applies_to_solution_1;
    values.solution_2_applicable = values.solution_2_applicable * values.response_applies_to_solution_2;
    values.solution_3_applicable = values.solution_3_applicable * values.response_applies_to_solution_3; ]

/ ontrialend = [if (values.solution_1_applicable || values.solution_2_applicable || values.solution_3_applicable)
    values.response_correct = 1 else values.response_correct = 0; ]

/ branch = [if (values.response_correct == 1) trial.clicktrial else trial.errortrial]
</trial>

<trial errortrial>
/ ontrialbegin = [text.redx.hposition = shape.selectedcorner.hposition; text.redx.vposition = shape.selectedcorner.vposition; ]
/ stimulusframes = [1=redx]
/ trialduration = 500
/ branch = [trial.starttrial]
</trial>

<text redx>
/ items = ("X")
/ fontstyle = ("Arial", 5%, true)
/ txcolor = red
/ txbgcolor = transparent
/ erase = true(white)
</text>

<shape c1>
/ shape = circle
/ color = blue
/ hposition = values.c1_x
/ vposition = values.c1_y
/ size = (values.correctcorner_size * 0.75, values.correctcorner_size)
/ erase = false
</shape>

<shape c2>
/ shape = circle
/ color = blue
/ hposition = values.c2_x
/ vposition = values.c2_y
/ size = (values.correctcorner_size * 0.75, values.correctcorner_size)
/ erase = false
</shape>

<shape c3>
/ shape = circle
/ color = blue
/ hposition = values.c3_x
/ vposition = values.c3_y
/ size = (values.correctcorner_size * 0.75, values.correctcorner_size)
/ erase = false
</shape>

<shape c4>
/ shape = circle
/ color = blue
/ hposition = values.c4_x
/ vposition = values.c4_y
/ size = (values.correctcorner_size * 0.75, values.correctcorner_size)
/ erase = false
</shape>

<shape c5>
/ shape = circle
/ color = blue
/ hposition = values.c5_x
/ vposition = values.c5_y
/ size = (values.correctcorner_size * 0.75, values.correctcorner_size)
/ erase = false
</shape>

<shape c6>
/ shape = circle
/ color = blue
/ hposition = values.c6_x
/ vposition = values.c6_y
/ size = (values.correctcorner_size * 0.75, values.correctcorner_size)
/ erase = false
</shape>

<shape c7>
/ shape = circle
/ color = blue
/ hposition = values.c7_x
/ vposition = values.c7_y
/ size = (values.correctcorner_size * 0.75, values.correctcorner_size)
/ erase = false
</shape>

<shape c8>
/ shape = circle
/ color = blue
/ hposition = values.c8_x
/ vposition = values.c8_y
/ size = (values.correctcorner_size * 0.75, values.correctcorner_size)
/ erase = false
</shape>

<shape selectedCorner>
/ shape = circle
/ color = yellow
/ size = (values.correctcorner_size * 0.75, values.correctcorner_size)
/ erase = false
/ hposition = -10%
/ vposition = -10%
</shape>

Hope this helps.
By wsly - 2/16/2016

Thank you for your reply and your efforts. In fact, the code had been commissioned to Katja B. who wrote it for my research team. I am not sure I can fully understand how to customize the code according to your example, so I might need to pass it on her to be sure that everything run properly and correctly as it is a huge research and everything should be incontestable once we will have our data collected. 
Thank you very much indeed!!!!!!!
By Dave - 2/16/2016

Despite thinking about it for a long time, I, however, don't see a way to pull this off reliably other than the one I outlined above. But perhaps Katja can seen another (less "invasive") way to get rid of the overlap problem in the existing codebase -- she is certainly vastly more familiar with the script as-is than I am. Hope this helps.
By wsly - 2/16/2016

Forget the previous one, I managed to modify the script myself.

thank you very much indeed, I have modified the script and now we are close to what we aimed to achieve. Slight issue: if I click on a corner that DOES discriminate a specific solution, i.e.:
- 1st click = corner C3 in common with solutions 1,2,3 --> all are still clickable solutions
-2nd click = corner C5 belonging to just solution 2 --> solutions 1 and 3 are now incorrect 
how can I mark the other solutions as wrong?

smth like 
/ ontrialend = [if (trial.complexII_4.response = "a corner which is committed to only one solution") the only clickable corners are those belonging to that solution, all the other corners being marked as wrong..

In few words, if I click on a corner that identify solution 2, then solutions 3,4 and 1 are all wrong. 
Hope this makes sense....


By Dave - 2/16/2016

I don't know where the specific mistake is in your modified code (which I don't have). In the example where I outlined the solution, the part relevant to your question is this:

<trial clicktrial>
...
/ ontrialend = [values.solution_1_applicable = values.solution_1_applicable * values.response_applies_to_solution_1;
    values.solution_2_applicable = values.solution_2_applicable * values.response_applies_to_solution_2;
    values.solution_3_applicable = values.solution_3_applicable * values.response_applies_to_solution_3; ]
...
</trial>

You multiple the "applicable solutions* by the solutions tied to the response. This will always give you the *most restricted* version. Suppose you start with all three solutions available and select a response that applies to solutions #1 and #3:

Trial #1
Start:             1 - 1 - 1
Response:  1 - 0 - 1
Result:          1 - 0 - 1

Now, in the next trial, only solutions #1 and #3 are still in the cards:

Trial #2:
Start:             1 - 0 - 1
Response:  0 - 1 - 0
Result:          0 - 0 - 0

and if you select any response option that does not apply to either solution, the response will be judged as wrong (as it should be). This approach should extend straightforwardly to as many solutions as you need. For the case you mention

> In few words, if I click on a corner that identify solution 2, then solutions 3,4 and 1 are all wrong.

Trial #1
Start:             1 - 1 - 1 - 1
Response:  0 - 1 - 0 - 0
Result:         0 - 1 - 0 - 0

And in the next trial, any response that *does not* apply to solution #2 would be marked as wrong:

Trial #2:
Start:             0 - 1 - 0 - 0
Response:  1 - 0 - 1 - 1
Result:          0 - 0 - 0 - 0
By wsly - 2/16/2016

#1: as soon as I click on just one corner , the "well done" message appears (while it should appear once all corners of just 1 solutions have been clicked)

#2: anyway, as you can see from the photo, all the corners are clickable, without any discrimination. If I click on a corner that belongs just to solution1, I can as well click on corners that belongs to solution 4 or 3, which should be marked incorrect because once I choose solution 1, then the other solutions are wrong and I shouldn't be able to click on them. Attached there's the code modified according to your reply
https://www.millisecond.com/forums/uploads/images/05c43689-d20e-4391-8688-6269.jpg
By Dave - 2/16/2016

#1: The two below /ontrialend statements are in the wrong order:
...
/ ontrialend = [if (values.solution_1_applicable || values.solution_2_applicable
 || values.solution_3_applicable || values.solution_4_applicable)
   values.correctii_4 = 1 else values.correctii_4 = 0; ]

/ ontrialend = [values.solution_1_applicable = values.solution_1_applicable * values.response_applies_to_solution_1;
    values.solution_2_applicable = values.solution_2_applicable * values.response_applies_to_solution_2;
    values.solution_3_applicable = values.solution_3_applicable * values.response_applies_to_solution_3;
    values.solution_4_applicable = values.solution_4_applicable * values.response_applies_to_solution_4;
]

The multiplication step (2nd /ontrialend above) ought to happen *before* the correctness evaluation (1st /ontrialend above), i.e.

/ ontrialend = [values.solution_1_applicable = values.solution_1_applicable * values.response_applies_to_solution_1;
    values.solution_2_applicable = values.solution_2_applicable * values.response_applies_to_solution_2;
    values.solution_3_applicable = values.solution_3_applicable * values.response_applies_to_solution_3;
    values.solution_4_applicable = values.solution_4_applicable * values.response_applies_to_solution_4; ]

/ ontrialend = [if (values.solution_1_applicable || values.solution_2_applicable
 || values.solution_3_applicable || values.solution_4_applicable)
   values.correctii_4 = 1 else values.correctii_4 = 0;
]

#2: The below /branch is wrong:

/ branch = [
    if (values.correctii_4 == 1) {
        trial.positiveFeedback;
...

values.correctii_4 only indicates whether the *current* response (single object clicked) is correct. It does *not* indicate that the entire *problem* composed of *multiple* clicks on multiple objects was solved correctly. Thus you do not want to branch to trial.positiveFeedback when values.correctii_4 == 1, but invoke trial.negativefeedbackii_4 if the current response was wrong.

 branch = [
    if (values.correctii_4 == 0) {
        trial.negativefeedbackii_4;
...

As for logic that determines if / when the *entire* problem has been solved, you still need to implement that, I think.
By Dave - 2/16/2016

Perhaps a slight extension of the previous example will help with the rest (such as implementing the "full solution completed" logic):

<values>
/ c1_applies_to_solution_1 = true
/ c1_applies_to_solution_2 = false
/ c1_applies_to_solution_3 = false

/ c2_applies_to_solution_1 = true
/ c2_applies_to_solution_2 = false
/ c2_applies_to_solution_3 = false

/ c3_applies_to_solution_1 = true
/ c3_applies_to_solution_2 = true
/ c3_applies_to_solution_3 = false

/ c4_applies_to_solution_1 = true
/ c4_applies_to_solution_2 = true
/ c4_applies_to_solution_3 = false

/ c5_applies_to_solution_1 = false
/ c5_applies_to_solution_2 = true
/ c5_applies_to_solution_3 = true

/ c6_applies_to_solution_1 = false
/ c6_applies_to_solution_2 = true
/ c6_applies_to_solution_3 = true

/ c7_applies_to_solution_1 = false
/ c7_applies_to_solution_2 = false
/ c7_applies_to_solution_3 = true

/ c8_applies_to_solution_1 = false
/ c8_applies_to_solution_2 = false
/ c8_applies_to_solution_3 = true

/ c1_set = 0
/ c2_set = 0
/ c3_set = 0
/ c4_set = 0
/ c5_set = 0
/ c6_set = 0
/ c7_set = 0
/ c8_set = 0

/ c1_x = 40%
/ c1_y = 20%
/ c2_x = 60%
/ c2_y = 20%
/ c3_x = 40%
/ c3_y = 40%
/ c4_x = 60%
/ c4_y = 40%
/ c5_x = 40%
/ c5_y = 60%
/ c6_x = 60%
/ c6_y = 60%
/ c7_x = 40%
/ c7_y = 80%
/ c8_x = 60%
/ c8_y = 80%

/ solution_1_applicable = true
/ solution_2_applicable = true
/ solution_3_applicable = true

/ response_applies_to_solution_1 = true
/ response_applies_to_solution_2 = true
/ response_applies_to_solution_3 = true

/ correctcorner_size = 3%

/ number_of_possible_solutions = 0
/ responsestorage = ""
/ response_correct = 0
/ committed = false
/ committedsolutionnumber = 0
</values>

<expressions>
/ solution_1 = (values.c1_set * values.c2_set * values.c3_set * values.c4_set)
/ solution_2 = (values.c3_set * values.c4_set * values.c5_set * values.c6_set)
/ solution_3 = (values.c5_set * values.c6_set * values.c7_set * values.c8_set)
</expressions>


<block myblock>
/ trials = [1=starttrial]
</block>

<trial starttrial>
/ ontrialbegin = [values.solution_1_applicable = true; values.solution_2_applicable = true; values.solution_3_applicable = true;
    values.response_applies_to_solution_1 = true; values.response_applies_to_solution_2 = true; values.response_applies_to_solution_3 = true;
    values.committed = false; values.committedsolutionnumber = 0;
    values.c1_set = 0; values.c2_set = 0; values.c3_set = 0; values.c4_set = 0;
    values.c5_set = 0; values.c6_set = 0; values.c7_set = 0; values.c8_set = 0;
    values.responsestorage = "";
    values.number_of_possible_solutions = values.solution_1_applicable + values.solution_2_applicable + values.solution_3_applicable;
    shape.selectedcorner.hposition = -10%; shape.selectedcorner.vposition = -10%; ]
/ stimulusframes = [1=c1,c2,c3,c4,c5,c6,c7,c8,done,debug]
/ trialduration = 1000
/ branch = [trial.clicktrial]
</trial>

<text debug>
/ items = ("Solution #1 applicable: <%values.solution_1_applicable%> | Solution #2 applicable: <%values.solution_2_applicable%> | Solution #3 applicable: <%values.solution_3_applicable%>
Number of possible solutions: <%values.number_of_possible_solutions%>
Committed to solution: <%values.committed%> | Committed to solution # <%values.committedsolutionnumber%>
Response <%trial.clicktrial.response%> applies to #1: <%values.response_applies_to_solution_1%> #2: <%values.response_applies_to_solution_2%> #3: <%values.response_applies_to_solution_3%>
Responses: <%values.responsestorage%>")
/ fontstyle = ("Arial", 2%)
/ position = (50%, 10%)
/ size = (90%, 10%)
/ erase = false
</text>

<text done>
/ items = ("DONE")
/ position = (50%, 90%)
/ erase = false
</text>


<trial clicktrial>
/ stimulusframes = [1=selectedcorner, debug]
/ validresponse = (c1,c2,c3,c4,c5,c6,c7,c8,done)
/ isvalidresponse = [!contains(values.responsestorage, trial.clicktrial.response)]
/ inputdevice = mouse
/ ontrialend = [values.responsestorage = concat(values.responsestorage, trial.clicktrial.response)]
/ ontrialend = [
    if (trial.clicktrial.response == "c1") {
    values.c1_set = 1;
    values.response_applies_to_solution_1 = values.c1_applies_to_solution_1;
    values.response_applies_to_solution_2 = values.c1_applies_to_solution_2;
    values.response_applies_to_solution_3 = values.c1_applies_to_solution_3;
    shape.selectedcorner.hposition = values.c1_x;
    shape.selectedcorner.vposition = values.c1_y; }

    else if (trial.clicktrial.response == "c2") {
    values.c2_set = 1;
    values.response_applies_to_solution_1 = values.c2_applies_to_solution_1;
    values.response_applies_to_solution_2 = values.c2_applies_to_solution_2;
    values.response_applies_to_solution_3 = values.c2_applies_to_solution_3;
    shape.selectedcorner.hposition = values.c2_x;
    shape.selectedcorner.vposition = values.c2_y; }

    else if (trial.clicktrial.response == "c3") {
    values.c3_set = 1;
    values.response_applies_to_solution_1 = values.c3_applies_to_solution_1;
    values.response_applies_to_solution_2 = values.c3_applies_to_solution_2;
    values.response_applies_to_solution_3 = values.c3_applies_to_solution_3;
    shape.selectedcorner.hposition = values.c3_x;
    shape.selectedcorner.vposition = values.c3_y; }

    else if (trial.clicktrial.response == "c4") {
    values.c4_set = 1;
    values.response_applies_to_solution_1 = values.c4_applies_to_solution_1;
    values.response_applies_to_solution_2 = values.c4_applies_to_solution_2;
    values.response_applies_to_solution_3 = values.c4_applies_to_solution_3;
    shape.selectedcorner.hposition = values.c4_x;
    shape.selectedcorner.vposition = values.c4_y; }

    else if (trial.clicktrial.response == "c5") {
    values.c5_set = 1;
    values.response_applies_to_solution_1 = values.c5_applies_to_solution_1;
    values.response_applies_to_solution_2 = values.c5_applies_to_solution_2;
    values.response_applies_to_solution_3 = values.c5_applies_to_solution_3;
    shape.selectedcorner.hposition = values.c5_x;
    shape.selectedcorner.vposition = values.c5_y; }

    else if (trial.clicktrial.response == "c6") {
    values.c6_set = 1;
    values.response_applies_to_solution_1 = values.c6_applies_to_solution_1;
    values.response_applies_to_solution_2 = values.c6_applies_to_solution_2;
    values.response_applies_to_solution_3 = values.c6_applies_to_solution_3;
    shape.selectedcorner.hposition = values.c6_x;
    shape.selectedcorner.vposition = values.c6_y; }

    else if (trial.clicktrial.response == "c7") {
    values.c7_set = 1;
    values.response_applies_to_solution_1 = values.c7_applies_to_solution_1;
    values.response_applies_to_solution_2 = values.c7_applies_to_solution_2;
    values.response_applies_to_solution_3 = values.c7_applies_to_solution_3;
    shape.selectedcorner.hposition = values.c7_x;
    shape.selectedcorner.vposition = values.c7_y; }

    else if (trial.clicktrial.response == "c8") {
    values.c8_set = 1;
    values.response_applies_to_solution_1 = values.c8_applies_to_solution_1;
    values.response_applies_to_solution_2 = values.c8_applies_to_solution_2;
    values.response_applies_to_solution_3 = values.c8_applies_to_solution_3;
    shape.selectedcorner.hposition = values.c8_x;
    shape.selectedcorner.vposition = values.c8_y; };
    ]

/ ontrialend = [values.solution_1_applicable = values.solution_1_applicable * values.response_applies_to_solution_1;
    values.solution_2_applicable = values.solution_2_applicable * values.response_applies_to_solution_2;
    values.solution_3_applicable = values.solution_3_applicable * values.response_applies_to_solution_3; ]

/ ontrialend = [if (values.solution_1_applicable || values.solution_2_applicable || values.solution_3_applicable)
    values.response_correct = 1 else values.response_correct = 0; ]

/ ontrialend = [values.number_of_possible_solutions = values.solution_1_applicable + values.solution_2_applicable + values.solution_3_applicable; ]

/ ontrialend = [if (values.number_of_possible_solutions == 1) {values.committed = true;
    values.committedsolutionnumber = 1*values.solution_1_applicable + 2*values.solution_2_applicable + 3*values.solution_3_applicable; };
    ]

/ branch = [if (expressions.solution_1 || expressions.solution_2 || expressions.solution_3) trial.successtrial; ]
/ branch = [if (values.response_correct == 1) trial.clicktrial else trial.errortrial]
</trial>

<trial errortrial>
/ ontrialbegin = [text.redx.hposition = shape.selectedcorner.hposition; text.redx.vposition = shape.selectedcorner.vposition; ]
/ stimulusframes = [1=redx]
/ trialduration = 500
/ branch = [trial.starttrial]
</trial>

<trial successtrial>
/ stimulusframes = [1=successtext]
/ trialduration = 500
</trial>

<text successtext>
/ items = ("Solution # <%values.committedsolutionnumber%> completed successfully.")
</text>


<text redx>
/ items = ("X")
/ fontstyle = ("Arial", 5%, true)
/ txcolor = red
/ txbgcolor = transparent
/ erase = true(white)
</text>

<shape c1>
/ shape = circle
/ color = blue
/ hposition = values.c1_x
/ vposition = values.c1_y
/ size = (values.correctcorner_size * 0.75, values.correctcorner_size)
/ erase = false
</shape>

<shape c2>
/ shape = circle
/ color = blue
/ hposition = values.c2_x
/ vposition = values.c2_y
/ size = (values.correctcorner_size * 0.75, values.correctcorner_size)
/ erase = false
</shape>

<shape c3>
/ shape = circle
/ color = blue
/ hposition = values.c3_x
/ vposition = values.c3_y
/ size = (values.correctcorner_size * 0.75, values.correctcorner_size)
/ erase = false
</shape>

<shape c4>
/ shape = circle
/ color = blue
/ hposition = values.c4_x
/ vposition = values.c4_y
/ size = (values.correctcorner_size * 0.75, values.correctcorner_size)
/ erase = false
</shape>

<shape c5>
/ shape = circle
/ color = blue
/ hposition = values.c5_x
/ vposition = values.c5_y
/ size = (values.correctcorner_size * 0.75, values.correctcorner_size)
/ erase = false
</shape>

<shape c6>
/ shape = circle
/ color = blue
/ hposition = values.c6_x
/ vposition = values.c6_y
/ size = (values.correctcorner_size * 0.75, values.correctcorner_size)
/ erase = false
</shape>

<shape c7>
/ shape = circle
/ color = blue
/ hposition = values.c7_x
/ vposition = values.c7_y
/ size = (values.correctcorner_size * 0.75, values.correctcorner_size)
/ erase = false
</shape>

<shape c8>
/ shape = circle
/ color = blue
/ hposition = values.c8_x
/ vposition = values.c8_y
/ size = (values.correctcorner_size * 0.75, values.correctcorner_size)
/ erase = false
</shape>

<shape selectedCorner>
/ shape = circle
/ color = yellow
/ size = (values.correctcorner_size * 0.75, values.correctcorner_size)
/ erase = false
/ hposition = -10%
/ vposition = -10%
</shape>
By wsly - 2/17/2016

You're amazing!!! It works now!! Still...

#1 it seems to keep memory of all the corner clicked from the beginning of trial and so, I can't click on corners I have already clicked
I mean smth like 
if (trial.mytrial.response == "background" || trial.mytrial.response == "back" || values.correct_response = 0 <<<that are all conditions that lead to the simple figure again>> reset all the corners clicked so far.
I tried smth like /ontrialend = [trial.test.resetstimulusframes()] but of course :/ it does not work. [[  I'm hopeless I know ]]
 
#why can't I click on the background even though it is listed in the /stimulusframes and /validresponse???
By Dave - 2/17/2016

Re. #1: I'm guessing, but if at any point you need to make all responses available again, you ought to reset values.responsestorage (see my example code in the previous reply).

Re. #2: Possibly related to #1 above.
By Inquisit1234 - 5/14/2018

Hello,

I am trying to record the amount of times a participant clicks each dropdown box (and possibly each latency) when solving a math equation. Currently I have the script set up for a <surveypage>, but I imagine that may not be the best approach when compared to a <block> structure.

Here's what I have:

<caption caption>
/ caption = "Please answer the question below"
/ fontstyle = ("Verdana", 3%, false, false, false, false, 5, 1)
/ position = (37%, 20%)
</caption>

<caption caption1>
/ caption = "6 is"
/ fontstyle = ("Verdana", 3%, false, false, false, false, 5, 1)
/ position = (40%, 40%)
</caption>

<dropdown option1>
/ options = (">", "<", "=")
/ optionvalues = ("1","2","3")
/ fontstyle = ("Verdana", 3%, false, false, false, false, 5, 1)
/ position = (45%, 40%)
/ required = true
</dropdown>

<caption caption2>
/ caption = "7 is "
/ fontstyle = ("Verdana", 3%, false, false, false, false, 5, 1)
/ position = (50%, 40%)
</caption>

<dropdown option2>
/ options = (">", "<", "=")
/ optionvalues = ("1","2","3")
/ fontstyle = ("Verdana", 3%, false, false, false, false, 5, 1)
/ position = (55%, 40%)
/ required = true
</dropdown>

<caption caption3>
/ caption = "8"
/ fontstyle = ("Verdana", 3%, false, false, false, false, 5, 1)
/ position = (60%, 40%)
</caption>

<surveypage math>
/ fontstyle = ("Verdana", 3%, true, false, false, false, 5, 1)
/ questions = [1=caption; 2=caption1; 3=option1; 4=caption2; 5=option2; 6=caption3]
/ nextbuttonposition = (60%, 60%)
</surveypage>


<survey math>
/ pages = [1=math]
/ responsefontstyle = ("Verdana", -12, false, false, false, false, 5, 0)
/ itemfontstyle = ("Verdana", -13, false, false, false, false, 5, 0)
/ itemspacing = 1%
/ showpagenumbers = false
</survey>

Any help would be appreciated.
By Dave - 5/14/2018

Inquisit1234 - Monday, May 14, 2018
Hello,

I am trying to record the amount of times a participant clicks each dropdown box (and possibly each latency) when solving a math equation. Currently I have the script set up for a <surveypage>, but I imagine that may not be the best approach when compared to a <block> structure.

Here's what I have:

<caption caption>
/ caption = "Please answer the question below"
/ fontstyle = ("Verdana", 3%, false, false, false, false, 5, 1)
/ position = (37%, 20%)
</caption>

<caption caption1>
/ caption = "6 is"
/ fontstyle = ("Verdana", 3%, false, false, false, false, 5, 1)
/ position = (40%, 40%)
</caption>

<dropdown option1>
/ options = (">", "<", "=")
/ optionvalues = ("1","2","3")
/ fontstyle = ("Verdana", 3%, false, false, false, false, 5, 1)
/ position = (45%, 40%)
/ required = true
</dropdown>

<caption caption2>
/ caption = "7 is "
/ fontstyle = ("Verdana", 3%, false, false, false, false, 5, 1)
/ position = (50%, 40%)
</caption>

<dropdown option2>
/ options = (">", "<", "=")
/ optionvalues = ("1","2","3")
/ fontstyle = ("Verdana", 3%, false, false, false, false, 5, 1)
/ position = (55%, 40%)
/ required = true
</dropdown>

<caption caption3>
/ caption = "8"
/ fontstyle = ("Verdana", 3%, false, false, false, false, 5, 1)
/ position = (60%, 40%)
</caption>

<surveypage math>
/ fontstyle = ("Verdana", 3%, true, false, false, false, 5, 1)
/ questions = [1=caption; 2=caption1; 3=option1; 4=caption2; 5=option2; 6=caption3]
/ nextbuttonposition = (60%, 60%)
</surveypage>


<survey math>
/ pages = [1=math]
/ responsefontstyle = ("Verdana", -12, false, false, false, false, 5, 0)
/ itemfontstyle = ("Verdana", -13, false, false, false, false, 5, 0)
/ itemspacing = 1%
/ showpagenumbers = false
</survey>

Any help would be appreciated.

It's not possible to collect that kind of data (times a certain survey-type question was clicked) with surveypages -- whether you use a <block> or a <survey> doesn't matter in this case, it wouldn't work in either case.
By Inquisit1234 - 5/14/2018

Dave - Monday, May 14, 2018
Inquisit1234 - Monday, May 14, 2018
Hello,

I am trying to record the amount of times a participant clicks each dropdown box (and possibly each latency) when solving a math equation. Currently I have the script set up for a <surveypage>, but I imagine that may not be the best approach when compared to a <block> structure.

Here's what I have:

<caption caption>
/ caption = "Please answer the question below"
/ fontstyle = ("Verdana", 3%, false, false, false, false, 5, 1)
/ position = (37%, 20%)
</caption>

<caption caption1>
/ caption = "6 is"
/ fontstyle = ("Verdana", 3%, false, false, false, false, 5, 1)
/ position = (40%, 40%)
</caption>

<dropdown option1>
/ options = (">", "<", "=")
/ optionvalues = ("1","2","3")
/ fontstyle = ("Verdana", 3%, false, false, false, false, 5, 1)
/ position = (45%, 40%)
/ required = true
</dropdown>

<caption caption2>
/ caption = "7 is "
/ fontstyle = ("Verdana", 3%, false, false, false, false, 5, 1)
/ position = (50%, 40%)
</caption>

<dropdown option2>
/ options = (">", "<", "=")
/ optionvalues = ("1","2","3")
/ fontstyle = ("Verdana", 3%, false, false, false, false, 5, 1)
/ position = (55%, 40%)
/ required = true
</dropdown>

<caption caption3>
/ caption = "8"
/ fontstyle = ("Verdana", 3%, false, false, false, false, 5, 1)
/ position = (60%, 40%)
</caption>

<surveypage math>
/ fontstyle = ("Verdana", 3%, true, false, false, false, 5, 1)
/ questions = [1=caption; 2=caption1; 3=option1; 4=caption2; 5=option2; 6=caption3]
/ nextbuttonposition = (60%, 60%)
</surveypage>


<survey math>
/ pages = [1=math]
/ responsefontstyle = ("Verdana", -12, false, false, false, false, 5, 0)
/ itemfontstyle = ("Verdana", -13, false, false, false, false, 5, 0)
/ itemspacing = 1%
/ showpagenumbers = false
</survey>

Any help would be appreciated.

It's not possible to collect that kind of data (times a certain survey-type question was clicked) with surveypages -- whether you use a <block> or a <survey> doesn't matter in this case, it wouldn't work in either case.

Thanks for the reply.  Do you have any suggestion as to how I can implement a selection of three options twice, while recording the amount of clicks and latency of each? Thank you.
By seandr - 5/14/2018

If you're willing to present one problem at a time, you could set this up as a trial and show the various equality operators as <text> elements that the participant can click on. Something like the following:

<text firstnumber>
/ items = ("6 is")
/ position = (50%, 25%)
</text>

<text secondnumber>
/ items = ("8")
/ position = (50%, 75%)
</text> 

<text gt>
/ items = (">")
/ position = (25%, 50%)
</text>

<text eq>
/ items = ("=")
/ position = (50%, 50%)
</text>

<text lt>
/ items = ("<")
/ position = (75%, 50%)
</text>

<trial problem>
/ stimulustimes = [1=firstnumber, secondnumber, gt, eq, lt]
/ inputdevice = mouse
/ validresponse = (gt, eq, lt)
</trial>

You'll need to play around with font size and layout. You can also specify lists of number items for the firstnumber and secondnumber text elements so that all of your problems are presented with those two elements

Hope this helps,
Sean

By Dave - 5/14/2018

seandr - Monday, May 14, 2018
If you're willing to present one problem at a time, you could set this up as a trial and show the various equality operators as <text> elements that the participant can click on. Something like the following:

<text firstnumber>
/ items = ("6 is")
/ position = (50%, 25%)
</text>

<text secondnumber>
/ items = ("8")
/ position = (50%, 75%)
</text> 

<text gt>
/ items = (">")
/ position = (25%, 50%)
</text>

<text eq>
/ items = ("=")
/ position = (50%, 50%)
</text>

<text lt>
/ items = ("<")
/ position = (75%, 50%)
</text>

<trial problem>
/ stimulustimes = [1=firstnumber, secondnumber, gt, eq, lt]
/ inputdevice = mouse
/ validresponse = (gt, eq, lt)
</trial>

You'll need to play around with font size and layout. You can also specify lists of number items for the firstnumber and secondnumber text elements so that all of your problems are presented with those two elements

Hope this helps,
Sean


I was going to suggest something similar to what Sean outlined, only a little more involved:

<values>
/ digit1 = 6
/ digit2 = 7
/ digit3 = 8
/ op1 = ""
/ op2 = ""
</values>

<defaults>
/ fontstyle = ("Verdana", 3%)
</defaults>


<block myblock>
/ trials = [1=main]
</block>

<trial main>
/ stimulusframes = [1=question, digit1, operator1, digit2, operator2, digit3, submit]
/ inputdevice = mouse
/ validresponse = (operator1, operator2, submit)
/ isvalidresponse = [(trial.main.response == "submit" && values.op1 !="" && values.op2 !="")
    || trial.main.response == "operator1" || trial.main.response == "operator2"]
/ branch = [if (trial.main.response == "operator1") trial.select_operator1]
/ branch = [if (trial.main.response == "operator2") trial.select_operator2]
</trial>

<trial select_operator1>
/ ontrialend = [if (trial.select_operator1.response == "gt1") values.op1 = ">"]
/ ontrialend = [if (trial.select_operator1.response == "lt1") values.op1 = "<"]
/ ontrialend = [if (trial.select_operator1.response == "eq1") values.op1 = "="]
/ stimulusframes = [1=gt1,lt1,eq1]
/ inputdevice = mouse
/ validresponse = (gt1,lt1,eq1)
/ branch = [trial.main]
</trial>

<trial select_operator2>
/ ontrialend = [if (trial.select_operator2.response == "gt2") values.op2 = ">"]
/ ontrialend = [if (trial.select_operator2.response == "lt2") values.op2 = "<"]
/ ontrialend = [if (trial.select_operator2.response == "eq2") values.op2 = "="]
/ stimulusframes = [1=gt2,lt2,eq2]
/ inputdevice = mouse
/ validresponse = (gt2,lt2,eq2)
/ branch = [trial.main]
</trial>

<text question>
/ items = ("Please answer the question below")
/ erase = false
/ position = (50%, 25%)
</text>

<text digit1>
/ items = ("<%values.digit1%> is")
/ position = (30%, 50%)
/ erase = false
/ size = (10%, 10%)
/ hjustify = center
/ vjustify = center
</text>

<text digit2>
/ items = ("<%values.digit2%> is")
/ position = (50%, 50%)
/ size = (10%, 10%)
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text digit3>
/ items = ("<%values.digit3%>")
/ position = (70%, 50%)
/ size = (10%, 10%)
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text operator1>
/ items = ("<%values.op1%>")
/ position = (40%, 50%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text operator2>
/ items = ("<%values.op2%>")
/ position = (60%, 50%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text submit>
/ items = ("SUBMIT")
/ position = (50%, 92%)
/ size = (20%, 10%)
/ txbgcolor = grey
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text gt1>
/ items = (">")
/ position = (40%, 60%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ hjustify = center
/ vjustify = center
</text>

<text eq1>
/ items = ("=")
/ position = (40%, 70%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ hjustify = center
/ vjustify = center
</text>

<text lt1>
/ items = ("<")
/ position = (40%, 80%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ hjustify = center
/ vjustify = center
</text>

<text gt2>
/ items = (">")
/ position = (60%, 60%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ hjustify = center
/ vjustify = center
</text>

<text eq2>
/ items = ("=")
/ position = (60%, 70%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ hjustify = center
/ vjustify = center
</text>

<text lt2>
/ items = ("<")
/ position = (60%, 80%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ hjustify = center
/ vjustify = center
</text>
By Inquisit1234 - 5/16/2018

Thanks so much for the script, Sean.  Unfortunately, both parts of the equation need to be presented at the same time, and I do not want it to automatically submit after an option is select . Dave's script seems to work great for the design I am attempting to implement. Now, I just have a question about the output. Each of the rows appear to be a change in the digit, and it appears the "response" column corresponds to each selected response (first digit = gt1,eq1,lt1, second digit = gt2,eg2,lt2). Is that correct? What I don't know if I understand is the operator 1 and 2 response. I believe the operators contain the response options (gt,eg,lt), but why are they recorded (and the latency) as well as the response selected? Also, I am not sure I understand column stimulusonset1 onward. Thanks again.
By Dave - 5/16/2018

Inquisit1234 - Wednesday, May 16, 2018
Thanks so much for the script, Sean.  Unfortunately, both parts of the equation need to be presented at the same time, and I do not want it to automatically submit after an option is select . Dave's script seems to work great for the design I am attempting to implement. Now, I just have a question about the output. Each of the rows appear to be a change in the digit, and it appears the "response" column corresponds to each selected response (first digit = gt1,eq1,lt1, second digit = gt2,eg2,lt2). Is that correct? What I don't know if I understand is the operator 1 and 2 response. I believe the operators contain the response options (gt,eg,lt), but why are they recorded (and the latency) as well as the response selected? Also, I am not sure I understand column stimulusonset1 onward. Thanks again.

There are three <trial> elements in the script. <trial main> just sits there and waits for your response, i.e. a click on one of the two grey boxes that function as the placeholder for the operators (operator1 and operator2). In the response column for each instance of <trial main> you're going to see which of the two operator box was clicked, and the latency reflects when that occurred relative to when that instance of <trial main> started.

Once that selection is made, either <trial select_operator1> or <trial select_operator2> is run: If you indicated you wanted to set or change operator1 by clicking on the operator1 box in <trial main>, you get <trial select_operator1> which presents the three options gt1, eq1 and lt1. If you selected the operator2 box, you get <trial select_operator2> which offers the options gt2, eq2 and lt2. You will find that logged in the response column in the respective row(s). The latency reflects when an option (greater than, equal, or less than) was chosen relative to when the respective instance of <trial select_operator1> or <trial select_operator2> started.

After that, both <trial select_operator1> and <trial select_operator1> invoke <trial main> again, which sits there until you decide what you want to do next: Set the other operator, change the operator you already set again. This will repeat for as long as you decide to change things around, i.e. the script will bounce back and forth between <trial main> and the two operator selection trials.

Finally, once you've set both and settled on a solution, the whole thing can be ended by submitting your solution (click on the submit box) presented by <trial main>.
By Inquisit1234 - 5/16/2018

Dave - Wednesday, May 16, 2018
Inquisit1234 - Wednesday, May 16, 2018
Thanks so much for the script, Sean.  Unfortunately, both parts of the equation need to be presented at the same time, and I do not want it to automatically submit after an option is select . Dave's script seems to work great for the design I am attempting to implement. Now, I just have a question about the output. Each of the rows appear to be a change in the digit, and it appears the "response" column corresponds to each selected response (first digit = gt1,eq1,lt1, second digit = gt2,eg2,lt2). Is that correct? What I don't know if I understand is the operator 1 and 2 response. I believe the operators contain the response options (gt,eg,lt), but why are they recorded (and the latency) as well as the response selected? Also, I am not sure I understand column stimulusonset1 onward. Thanks again.

There are three <trial> elements in the script. <trial main> just sits there and waits for your response, i.e. a click on one of the two grey boxes that function as the placeholder for the operators (operator1 and operator2). In the response column for each instance of <trial main> you're going to see which of the two operator box was clicked, and the latency reflects when that occurred relative to when that instance of <trial main> started.

Once that selection is made, either <trial select_operator1> or <trial select_operator2> is run: If you indicated you wanted to set or change operator1 by clicking on the operator1 box in <trial main>, you get <trial select_operator1> which presents the three options gt1, eq1 and lt1. If you selected the operator2 box, you get <trial select_operator2> which offers the options gt2, eq2 and lt2. You will find that logged in the response column in the respective row(s). The latency reflects when an option (greater than, equal, or less than) was chosen relative to when the respective instance of <trial select_operator1> or <trial select_operator2> started.

After that, both <trial select_operator1> and <trial select_operator1> invoke <trial main> again, which sits there until you decide what you want to do next: Set the other operator, change the operator you already set again. This will repeat for as long as you decide to change things around, i.e. the script will bounce back and forth between <trial main> and the two operator selection trials.

Finally, once you've set both and settled on a solution, the whole thing can be ended by submitting your solution (click on the submit box) presented by <trial main>.
Thanks very much, Dave.  This explanation is extremely helpful.

By Inquisit1234 - 5/17/2018

Inquisit1234 - Thursday, May 17, 2018
Dave - Wednesday, May 16, 2018
Inquisit1234 - Wednesday, May 16, 2018
Thanks so much for the script, Sean.  Unfortunately, both parts of the equation need to be presented at the same time, and I do not want it to automatically submit after an option is select . Dave's script seems to work great for the design I am attempting to implement. Now, I just have a question about the output. Each of the rows appear to be a change in the digit, and it appears the "response" column corresponds to each selected response (first digit = gt1,eq1,lt1, second digit = gt2,eg2,lt2). Is that correct? What I don't know if I understand is the operator 1 and 2 response. I believe the operators contain the response options (gt,eg,lt), but why are they recorded (and the latency) as well as the response selected? Also, I am not sure I understand column stimulusonset1 onward. Thanks again.

There are three <trial> elements in the script. <trial main> just sits there and waits for your response, i.e. a click on one of the two grey boxes that function as the placeholder for the operators (operator1 and operator2). In the response column for each instance of <trial main> you're going to see which of the two operator box was clicked, and the latency reflects when that occurred relative to when that instance of <trial main> started.

Once that selection is made, either <trial select_operator1> or <trial select_operator2> is run: If you indicated you wanted to set or change operator1 by clicking on the operator1 box in <trial main>, you get <trial select_operator1> which presents the three options gt1, eq1 and lt1. If you selected the operator2 box, you get <trial select_operator2> which offers the options gt2, eq2 and lt2. You will find that logged in the response column in the respective row(s). The latency reflects when an option (greater than, equal, or less than) was chosen relative to when the respective instance of <trial select_operator1> or <trial select_operator2> started.

After that, both <trial select_operator1> and <trial select_operator1> invoke <trial main> again, which sits there until you decide what you want to do next: Set the other operator, change the operator you already set again. This will repeat for as long as you decide to change things around, i.e. the script will bounce back and forth between <trial main> and the two operator selection trials.

Finally, once you've set both and settled on a solution, the whole thing can be ended by submitting your solution (click on the submit box) presented by <trial main>.
Thanks very much, Dave.  This explanation is extremely helpful.


I would like to create additional trials using other digits. So, is it possible to simply add additional digits in the <value>, and add another <trial> (e.g., <trial main 2> ) with the new digits listed in the stimulusframes? I attempted this, but it seems is it unable to locate the new digits, and even if I can get beyond that, I am not sure the operators with reset to blank for trial 2.   
By Dave - 5/17/2018

Inquisit1234 - Thursday, May 17, 2018
Inquisit1234 - Thursday, May 17, 2018
Dave - Wednesday, May 16, 2018
Inquisit1234 - Wednesday, May 16, 2018
Thanks so much for the script, Sean.  Unfortunately, both parts of the equation need to be presented at the same time, and I do not want it to automatically submit after an option is select . Dave's script seems to work great for the design I am attempting to implement. Now, I just have a question about the output. Each of the rows appear to be a change in the digit, and it appears the "response" column corresponds to each selected response (first digit = gt1,eq1,lt1, second digit = gt2,eg2,lt2). Is that correct? What I don't know if I understand is the operator 1 and 2 response. I believe the operators contain the response options (gt,eg,lt), but why are they recorded (and the latency) as well as the response selected? Also, I am not sure I understand column stimulusonset1 onward. Thanks again.

There are three <trial> elements in the script. <trial main> just sits there and waits for your response, i.e. a click on one of the two grey boxes that function as the placeholder for the operators (operator1 and operator2). In the response column for each instance of <trial main> you're going to see which of the two operator box was clicked, and the latency reflects when that occurred relative to when that instance of <trial main> started.

Once that selection is made, either <trial select_operator1> or <trial select_operator2> is run: If you indicated you wanted to set or change operator1 by clicking on the operator1 box in <trial main>, you get <trial select_operator1> which presents the three options gt1, eq1 and lt1. If you selected the operator2 box, you get <trial select_operator2> which offers the options gt2, eq2 and lt2. You will find that logged in the response column in the respective row(s). The latency reflects when an option (greater than, equal, or less than) was chosen relative to when the respective instance of <trial select_operator1> or <trial select_operator2> started.

After that, both <trial select_operator1> and <trial select_operator1> invoke <trial main> again, which sits there until you decide what you want to do next: Set the other operator, change the operator you already set again. This will repeat for as long as you decide to change things around, i.e. the script will bounce back and forth between <trial main> and the two operator selection trials.

Finally, once you've set both and settled on a solution, the whole thing can be ended by submitting your solution (click on the submit box) presented by <trial main>.
Thanks very much, Dave.  This explanation is extremely helpful.


I would like to create additional trials using other digits. So, is it possible to simply add additional digits in the <value>, and add another <trial> (e.g., <trial main 2> ) with the new digits listed in the stimulusframes? I attempted this, but it seems is it unable to locate the new digits, and even if I can get beyond that, I am not sure the operators with reset to blank for trial 2.   

Yes, it's possible. Store your digits in paired <list>s and then sample from those lists at the start of each round and store the digits sampled in the respective values.
By Inquisit1234 - 5/17/2018

Dave - Thursday, May 17, 2018
Inquisit1234 - Thursday, May 17, 2018
Inquisit1234 - Thursday, May 17, 2018
Dave - Wednesday, May 16, 2018
Inquisit1234 - Wednesday, May 16, 2018
Thanks so much for the script, Sean.  Unfortunately, both parts of the equation need to be presented at the same time, and I do not want it to automatically submit after an option is select . Dave's script seems to work great for the design I am attempting to implement. Now, I just have a question about the output. Each of the rows appear to be a change in the digit, and it appears the "response" column corresponds to each selected response (first digit = gt1,eq1,lt1, second digit = gt2,eg2,lt2). Is that correct? What I don't know if I understand is the operator 1 and 2 response. I believe the operators contain the response options (gt,eg,lt), but why are they recorded (and the latency) as well as the response selected? Also, I am not sure I understand column stimulusonset1 onward. Thanks again.

There are three <trial> elements in the script. <trial main> just sits there and waits for your response, i.e. a click on one of the two grey boxes that function as the placeholder for the operators (operator1 and operator2). In the response column for each instance of <trial main> you're going to see which of the two operator box was clicked, and the latency reflects when that occurred relative to when that instance of <trial main> started.

Once that selection is made, either <trial select_operator1> or <trial select_operator2> is run: If you indicated you wanted to set or change operator1 by clicking on the operator1 box in <trial main>, you get <trial select_operator1> which presents the three options gt1, eq1 and lt1. If you selected the operator2 box, you get <trial select_operator2> which offers the options gt2, eq2 and lt2. You will find that logged in the response column in the respective row(s). The latency reflects when an option (greater than, equal, or less than) was chosen relative to when the respective instance of <trial select_operator1> or <trial select_operator2> started.

After that, both <trial select_operator1> and <trial select_operator1> invoke <trial main> again, which sits there until you decide what you want to do next: Set the other operator, change the operator you already set again. This will repeat for as long as you decide to change things around, i.e. the script will bounce back and forth between <trial main> and the two operator selection trials.

Finally, once you've set both and settled on a solution, the whole thing can be ended by submitting your solution (click on the submit box) presented by <trial main>.
Thanks very much, Dave.  This explanation is extremely helpful.


I would like to create additional trials using other digits. So, is it possible to simply add additional digits in the <value>, and add another <trial> (e.g., <trial main 2> ) with the new digits listed in the stimulusframes? I attempted this, but it seems is it unable to locate the new digits, and even if I can get beyond that, I am not sure the operators with reset to blank for trial 2.   

Yes, it's possible. Store your digits in paired <list>s and then sample from those lists at the start of each round and store the digits sampled in the respective values.

Okay, so I have created these lists:

<list firstnumbers>
/ items = (1,2,3,4,5,6)
/ selectionmode = sequence
</list>

<list secondnumbers>
/ items = (1,2,3,4,5,6)
/ selectionmode = sequence
</list>

<list thirdnumbers>
/ items = (1,2,3,4,5,6)
/ selectionmode = sequence
</list>
 
And, have edited the <text>:

<text digit1>
/ items = ("<%list.firstnumbers.selectionmode%> is")
/ position = (30%, 50%)
/ erase = false
/ size = (10%, 10%)
/ hjustify = center
/ vjustify = center
</text>

<text digit2>
/ items = ("<%list.secondnumbers.selectionmode%> is")
/ position = (50%, 50%)
/ size = (10%, 10%)
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text digit3>
/ items = ("<%list.thirdnumbers.selectionmode%>")
/ position = (70%, 50%)
/ size = (10%, 10%)
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

But, I am a little confused as to how to make the trials continue until the sequence of numbers have concluded. Any suggestions? Thank you.
By Dave - 5/17/2018

Inquisit1234 - Thursday, May 17, 2018
Dave - Thursday, May 17, 2018
Inquisit1234 - Thursday, May 17, 2018
Inquisit1234 - Thursday, May 17, 2018
Dave - Wednesday, May 16, 2018
Inquisit1234 - Wednesday, May 16, 2018
Thanks so much for the script, Sean.  Unfortunately, both parts of the equation need to be presented at the same time, and I do not want it to automatically submit after an option is select . Dave's script seems to work great for the design I am attempting to implement. Now, I just have a question about the output. Each of the rows appear to be a change in the digit, and it appears the "response" column corresponds to each selected response (first digit = gt1,eq1,lt1, second digit = gt2,eg2,lt2). Is that correct? What I don't know if I understand is the operator 1 and 2 response. I believe the operators contain the response options (gt,eg,lt), but why are they recorded (and the latency) as well as the response selected? Also, I am not sure I understand column stimulusonset1 onward. Thanks again.

There are three <trial> elements in the script. <trial main> just sits there and waits for your response, i.e. a click on one of the two grey boxes that function as the placeholder for the operators (operator1 and operator2). In the response column for each instance of <trial main> you're going to see which of the two operator box was clicked, and the latency reflects when that occurred relative to when that instance of <trial main> started.

Once that selection is made, either <trial select_operator1> or <trial select_operator2> is run: If you indicated you wanted to set or change operator1 by clicking on the operator1 box in <trial main>, you get <trial select_operator1> which presents the three options gt1, eq1 and lt1. If you selected the operator2 box, you get <trial select_operator2> which offers the options gt2, eq2 and lt2. You will find that logged in the response column in the respective row(s). The latency reflects when an option (greater than, equal, or less than) was chosen relative to when the respective instance of <trial select_operator1> or <trial select_operator2> started.

After that, both <trial select_operator1> and <trial select_operator1> invoke <trial main> again, which sits there until you decide what you want to do next: Set the other operator, change the operator you already set again. This will repeat for as long as you decide to change things around, i.e. the script will bounce back and forth between <trial main> and the two operator selection trials.

Finally, once you've set both and settled on a solution, the whole thing can be ended by submitting your solution (click on the submit box) presented by <trial main>.
Thanks very much, Dave.  This explanation is extremely helpful.


I would like to create additional trials using other digits. So, is it possible to simply add additional digits in the <value>, and add another <trial> (e.g., <trial main 2> ) with the new digits listed in the stimulusframes? I attempted this, but it seems is it unable to locate the new digits, and even if I can get beyond that, I am not sure the operators with reset to blank for trial 2.   

Yes, it's possible. Store your digits in paired <list>s and then sample from those lists at the start of each round and store the digits sampled in the respective values.

Okay, so I have created these lists:

<list firstnumbers>
/ items = (1,2,3,4,5,6)
/ selectionmode = sequence
</list>

<list secondnumbers>
/ items = (1,2,3,4,5,6)
/ selectionmode = sequence
</list>

<list thirdnumbers>
/ items = (1,2,3,4,5,6)
/ selectionmode = sequence
</list>
 
And, have edited the <text>:

<text digit1>
/ items = ("<%list.firstnumbers.selectionmode%> is")
/ position = (30%, 50%)
/ erase = false
/ size = (10%, 10%)
/ hjustify = center
/ vjustify = center
</text>

<text digit2>
/ items = ("<%list.secondnumbers.selectionmode%> is")
/ position = (50%, 50%)
/ size = (10%, 10%)
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text digit3>
/ items = ("<%list.thirdnumbers.selectionmode%>")
/ position = (70%, 50%)
/ size = (10%, 10%)
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

But, I am a little confused as to how to make the trials continue until the sequence of numbers have concluded. Any suggestions? Thank you.

You need to do something like this:

<values>
/ digit1 = 0
/ digit2 = 0
/ digit3 = 0
/ op1 = ""
/ op2 = ""
/ roundnumber = 0
</values>

<defaults>
/ fontstyle = ("Verdana", 3%)
</defaults>


<block myblock>
/ trials = [1-6=startround;]
</block>

<trial startround>
/ ontrialbegin = [values.op1 = "";
    values.op2 = "";
    values.digit1 = list.firstnumbers.nextvalue;
    values.digit2 = list.secondnumbers.nextvalue;
    values.digit3 = list.thirdnumbers.nextvalue;
    values.roundnumber += 1;
    ]
/ stimulusframes = [1=clearscreen, roundtext]
/ trialduration = 1000
/ validresponse = (0)
/ branch = [trial.main]
</trial>

<shape clearscreen>
/ color = white
/ shape = rectangle
/ size = (100%, 100%)
</shape>

<text roundtext>
/ items = ("This is round #<%values.roundnumber%>.")
</text>

<list firstnumbers>
/ items = (1,2,3,4,5,6)
/ selectionmode = sequence
</list>

<list secondnumbers>
/ items = (1,2,3,4,5,6)
/ selectionmode = list.firstnumbers.currentindex
</list>

<list thirdnumbers>
/ items = (1,2,3,4,5,6)
/ selectionmode = list.firstnumbers.currentindex
</list>

<trial main>
/ stimulusframes = [1=question, digit1, operator1, digit2, operator2, digit3, submit]
/ inputdevice = mouse
/ validresponse = (operator1, operator2, submit)
/ isvalidresponse = [(trial.main.response == "submit" && values.op1 !="" && values.op2 !="")
    || trial.main.response == "operator1" || trial.main.response == "operator2"]
/ branch = [if (trial.main.response == "operator1") trial.select_operator1]
/ branch = [if (trial.main.response == "operator2") trial.select_operator2]
</trial>

<trial select_operator1>
/ ontrialend = [if (trial.select_operator1.response == "gt1") values.op1 = ">"]
/ ontrialend = [if (trial.select_operator1.response == "lt1") values.op1 = "<"]
/ ontrialend = [if (trial.select_operator1.response == "eq1") values.op1 = "="]
/ stimulusframes = [1=gt1,lt1,eq1]
/ inputdevice = mouse
/ validresponse = (gt1,lt1,eq1)
/ branch = [trial.main]
</trial>

<trial select_operator2>
/ ontrialend = [if (trial.select_operator2.response == "gt2") values.op2 = ">"]
/ ontrialend = [if (trial.select_operator2.response == "lt2") values.op2 = "<"]
/ ontrialend = [if (trial.select_operator2.response == "eq2") values.op2 = "="]
/ stimulusframes = [1=gt2,lt2,eq2]
/ inputdevice = mouse
/ validresponse = (gt2,lt2,eq2)
/ branch = [trial.main]
</trial>

<text question>
/ items = ("Please answer the question below")
/ erase = false
/ position = (50%, 25%)
</text>

<text digit1>
/ items = ("<%values.digit1%> is")
/ position = (30%, 50%)
/ erase = false
/ size = (10%, 10%)
/ hjustify = center
/ vjustify = center
</text>

<text digit2>
/ items = ("<%values.digit2%> is")
/ position = (50%, 50%)
/ size = (10%, 10%)
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text digit3>
/ items = ("<%values.digit3%>")
/ position = (70%, 50%)
/ size = (10%, 10%)
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text operator1>
/ items = ("<%values.op1%>")
/ position = (40%, 50%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text operator2>
/ items = ("<%values.op2%>")
/ position = (60%, 50%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text submit>
/ items = ("SUBMIT")
/ position = (50%, 92%)
/ size = (20%, 10%)
/ txbgcolor = grey
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text gt1>
/ items = (">")
/ position = (40%, 60%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ hjustify = center
/ vjustify = center
</text>

<text eq1>
/ items = ("=")
/ position = (40%, 70%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ hjustify = center
/ vjustify = center
</text>

<text lt1>
/ items = ("<")
/ position = (40%, 80%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ hjustify = center
/ vjustify = center
</text>

<text gt2>
/ items = (">")
/ position = (60%, 60%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ hjustify = center
/ vjustify = center
</text>

<text eq2>
/ items = ("=")
/ position = (60%, 70%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ hjustify = center
/ vjustify = center
</text>

<text lt2>
/ items = ("<")
/ position = (60%, 80%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ hjustify = center
/ vjustify = center
</text>

By Inquisit1234 - 5/17/2018

Dave - Thursday, May 17, 2018
Inquisit1234 - Thursday, May 17, 2018
Dave - Thursday, May 17, 2018
Inquisit1234 - Thursday, May 17, 2018
Inquisit1234 - Thursday, May 17, 2018
Dave - Wednesday, May 16, 2018
Inquisit1234 - Wednesday, May 16, 2018
Thanks so much for the script, Sean.  Unfortunately, both parts of the equation need to be presented at the same time, and I do not want it to automatically submit after an option is select . Dave's script seems to work great for the design I am attempting to implement. Now, I just have a question about the output. Each of the rows appear to be a change in the digit, and it appears the "response" column corresponds to each selected response (first digit = gt1,eq1,lt1, second digit = gt2,eg2,lt2). Is that correct? What I don't know if I understand is the operator 1 and 2 response. I believe the operators contain the response options (gt,eg,lt), but why are they recorded (and the latency) as well as the response selected? Also, I am not sure I understand column stimulusonset1 onward. Thanks again.

There are three <trial> elements in the script. <trial main> just sits there and waits for your response, i.e. a click on one of the two grey boxes that function as the placeholder for the operators (operator1 and operator2). In the response column for each instance of <trial main> you're going to see which of the two operator box was clicked, and the latency reflects when that occurred relative to when that instance of <trial main> started.

Once that selection is made, either <trial select_operator1> or <trial select_operator2> is run: If you indicated you wanted to set or change operator1 by clicking on the operator1 box in <trial main>, you get <trial select_operator1> which presents the three options gt1, eq1 and lt1. If you selected the operator2 box, you get <trial select_operator2> which offers the options gt2, eq2 and lt2. You will find that logged in the response column in the respective row(s). The latency reflects when an option (greater than, equal, or less than) was chosen relative to when the respective instance of <trial select_operator1> or <trial select_operator2> started.

After that, both <trial select_operator1> and <trial select_operator1> invoke <trial main> again, which sits there until you decide what you want to do next: Set the other operator, change the operator you already set again. This will repeat for as long as you decide to change things around, i.e. the script will bounce back and forth between <trial main> and the two operator selection trials.

Finally, once you've set both and settled on a solution, the whole thing can be ended by submitting your solution (click on the submit box) presented by <trial main>.
Thanks very much, Dave.  This explanation is extremely helpful.


I would like to create additional trials using other digits. So, is it possible to simply add additional digits in the <value>, and add another <trial> (e.g., <trial main 2> ) with the new digits listed in the stimulusframes? I attempted this, but it seems is it unable to locate the new digits, and even if I can get beyond that, I am not sure the operators with reset to blank for trial 2.   

Yes, it's possible. Store your digits in paired <list>s and then sample from those lists at the start of each round and store the digits sampled in the respective values.

Okay, so I have created these lists:

<list firstnumbers>
/ items = (1,2,3,4,5,6)
/ selectionmode = sequence
</list>

<list secondnumbers>
/ items = (1,2,3,4,5,6)
/ selectionmode = sequence
</list>

<list thirdnumbers>
/ items = (1,2,3,4,5,6)
/ selectionmode = sequence
</list>
 
And, have edited the <text>:

<text digit1>
/ items = ("<%list.firstnumbers.selectionmode%> is")
/ position = (30%, 50%)
/ erase = false
/ size = (10%, 10%)
/ hjustify = center
/ vjustify = center
</text>

<text digit2>
/ items = ("<%list.secondnumbers.selectionmode%> is")
/ position = (50%, 50%)
/ size = (10%, 10%)
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text digit3>
/ items = ("<%list.thirdnumbers.selectionmode%>")
/ position = (70%, 50%)
/ size = (10%, 10%)
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

But, I am a little confused as to how to make the trials continue until the sequence of numbers have concluded. Any suggestions? Thank you.

You need to do something like this:

<values>
/ digit1 = 0
/ digit2 = 0
/ digit3 = 0
/ op1 = ""
/ op2 = ""
/ roundnumber = 0
</values>

<defaults>
/ fontstyle = ("Verdana", 3%)
</defaults>


<block myblock>
/ trials = [1-6=startround;]
</block>

<trial startround>
/ ontrialbegin = [values.op1 = "";
    values.op2 = "";
    values.digit1 = list.firstnumbers.nextvalue;
    values.digit2 = list.secondnumbers.nextvalue;
    values.digit3 = list.thirdnumbers.nextvalue;
    values.roundnumber += 1;
    ]
/ stimulusframes = [1=clearscreen, roundtext]
/ trialduration = 1000
/ validresponse = (0)
/ branch = [trial.main]
</trial>

<shape clearscreen>
/ color = white
/ shape = rectangle
/ size = (100%, 100%)
</shape>

<text roundtext>
/ items = ("This is round #<%values.roundnumber%>.")
</text>

<list firstnumbers>
/ items = (1,2,3,4,5,6)
/ selectionmode = sequence
</list>

<list secondnumbers>
/ items = (1,2,3,4,5,6)
/ selectionmode = list.firstnumbers.currentindex
</list>

<list thirdnumbers>
/ items = (1,2,3,4,5,6)
/ selectionmode = list.firstnumbers.currentindex
</list>

<trial main>
/ stimulusframes = [1=question, digit1, operator1, digit2, operator2, digit3, submit]
/ inputdevice = mouse
/ validresponse = (operator1, operator2, submit)
/ isvalidresponse = [(trial.main.response == "submit" && values.op1 !="" && values.op2 !="")
    || trial.main.response == "operator1" || trial.main.response == "operator2"]
/ branch = [if (trial.main.response == "operator1") trial.select_operator1]
/ branch = [if (trial.main.response == "operator2") trial.select_operator2]
</trial>

<trial select_operator1>
/ ontrialend = [if (trial.select_operator1.response == "gt1") values.op1 = ">"]
/ ontrialend = [if (trial.select_operator1.response == "lt1") values.op1 = "<"]
/ ontrialend = [if (trial.select_operator1.response == "eq1") values.op1 = "="]
/ stimulusframes = [1=gt1,lt1,eq1]
/ inputdevice = mouse
/ validresponse = (gt1,lt1,eq1)
/ branch = [trial.main]
</trial>

<trial select_operator2>
/ ontrialend = [if (trial.select_operator2.response == "gt2") values.op2 = ">"]
/ ontrialend = [if (trial.select_operator2.response == "lt2") values.op2 = "<"]
/ ontrialend = [if (trial.select_operator2.response == "eq2") values.op2 = "="]
/ stimulusframes = [1=gt2,lt2,eq2]
/ inputdevice = mouse
/ validresponse = (gt2,lt2,eq2)
/ branch = [trial.main]
</trial>

<text question>
/ items = ("Please answer the question below")
/ erase = false
/ position = (50%, 25%)
</text>

<text digit1>
/ items = ("<%values.digit1%> is")
/ position = (30%, 50%)
/ erase = false
/ size = (10%, 10%)
/ hjustify = center
/ vjustify = center
</text>

<text digit2>
/ items = ("<%values.digit2%> is")
/ position = (50%, 50%)
/ size = (10%, 10%)
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text digit3>
/ items = ("<%values.digit3%>")
/ position = (70%, 50%)
/ size = (10%, 10%)
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text operator1>
/ items = ("<%values.op1%>")
/ position = (40%, 50%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text operator2>
/ items = ("<%values.op2%>")
/ position = (60%, 50%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text submit>
/ items = ("SUBMIT")
/ position = (50%, 92%)
/ size = (20%, 10%)
/ txbgcolor = grey
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text gt1>
/ items = (">")
/ position = (40%, 60%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ hjustify = center
/ vjustify = center
</text>

<text eq1>
/ items = ("=")
/ position = (40%, 70%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ hjustify = center
/ vjustify = center
</text>

<text lt1>
/ items = ("<")
/ position = (40%, 80%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ hjustify = center
/ vjustify = center
</text>

<text gt2>
/ items = (">")
/ position = (60%, 60%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ hjustify = center
/ vjustify = center
</text>

<text eq2>
/ items = ("=")
/ position = (60%, 70%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ hjustify = center
/ vjustify = center
</text>

<text lt2>
/ items = ("<")
/ position = (60%, 80%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ hjustify = center
/ vjustify = center
</text>


This code appears to work great. Thanks so much, Dave.
By Inquisit1234 - 7/11/2018

Hello again. So, I have a related question.  Any suggestions as to how to collect the same log data from these "drop down" menus, but change both the text and responses in the operators for each item.

For example, lets use the phrase "This is a large item, and this is a small item." The words "large" and "small" would be in the operators, the reset would be text. The next item would be "This is 10 times larger, and this is 3 times smaller." In this item, "10 and "3" would be in the operators, the rest would be text.

Overall, I am trying to figure out what would be the most efficient way to administer several different items (both text and operators), but still collect all of the log data capture by the script previously provided here.

Thank you.
By Dave - 7/11/2018

Inquisit1234 - Wednesday, July 11, 2018
Hello again. So, I have a related question.  Any suggestions as to how to collect the same log data from these "drop down" menus, but change both the text and responses in the operators for each item.

For example, lets use the phrase "This is a large item, and this is a small item." The words "large" and "small" would be in the operators, the reset would be text. The next item would be "This is 10 times larger, and this is 3 times smaller." In this item, "10 and "3" would be in the operators, the rest would be text.

Overall, I am trying to figure out what would be the most efficient way to administer several different items (both text and operators), but still collect all of the log data capture by the script previously provided here.

Thank you.

It would work exactly the same way as the existing script. There is nothing that prevents to from storing text strings in <list> elements and using those in the various <values> instead of using digits only. And there is nothing that prevents you from having the operators -- <text lt> etc. in the original script -- be variable as well, in the same way as the digits are variable in the original. E.g.:

<values>
/ digit1 = 0
/ digit2 = 0
/ digit3 = 0
/ opa = ""
/ opb = ""
/ op1 = ""
/ op2 = ""
/ roundnumber = 0
</values>

<defaults>
/ fontstyle = ("Verdana", 3%)
</defaults>


<block myblock>
/ trials = [1-2=startround;]
</block>

<trial startround>
/ ontrialbegin = [values.op1 = "";
    values.op2 = "";
    values.digit1 = list.firstnumbers.nextvalue;
    values.digit2 = list.secondnumbers.nextvalue;
    values.digit3 = list.thirdnumbers.nextvalue;
    values.opa = list.opa.nextvalue;
    values.opb = list.opb.nextvalue;
    values.roundnumber += 1;
    ]
/ stimulusframes = [1=clearscreen, roundtext]
/ trialduration = 1000
/ validresponse = (0)
/ branch = [trial.main]
</trial>

<shape clearscreen>
/ color = white
/ shape = rectangle
/ size = (100%, 100%)
</shape>

<text roundtext>
/ items = ("This is round #<%values.roundnumber%>.")
</text>

<list firstnumbers>
/ items = ("This is a", "This is")
/ selectionmode = sequence
</list>

<list secondnumbers>
/ items = ("item. This is a","times larger. And this is")
/ selectionmode = list.firstnumbers.currentindex
</list>

<list thirdnumbers>
/ items = ("item.","times smaller")
/ selectionmode = list.firstnumbers.currentindex
</list>

<list opa>
/ items = ("large","10")
/ selectionmode = list.firstnumbers.currentindex
</list>

<list opb>
/ items = ("small","3")
/ selectionmode = list.firstnumbers.currentindex
</list>

<trial main>
/ stimulusframes = [1=question, digit1, operator1, digit2, operator2, digit3, submit]
/ inputdevice = mouse
/ validresponse = (operator1, operator2, submit)
/ isvalidresponse = [(trial.main.response == "submit" && values.op1 !="" && values.op2 !="")
    || trial.main.response == "operator1" || trial.main.response == "operator2"]
/ branch = [if (trial.main.response == "operator1") trial.select_operator1]
/ branch = [if (trial.main.response == "operator2") trial.select_operator2]
</trial>

<trial select_operator1>
/ ontrialend = [if (trial.select_operator1.response == "gt1") values.op1 = values.opa]
/ ontrialend = [if (trial.select_operator1.response == "lt1") values.op1 = values.opb]
/ stimulusframes = [1=gt1,lt1]
/ inputdevice = mouse
/ validresponse = (gt1,lt1)
/ branch = [trial.main]
</trial>

<trial select_operator2>
/ ontrialend = [if (trial.select_operator2.response == "gt2") values.op2 = values.opa]
/ ontrialend = [if (trial.select_operator2.response == "lt2") values.op2 = values.opb]
/ stimulusframes = [1=gt2,lt2]
/ inputdevice = mouse
/ validresponse = (gt2,lt2)
/ branch = [trial.main]
</trial>

<text question>
/ items = ("Please answer the question below")
/ erase = false
/ position = (50%, 25%)
</text>

<text digit1>
/ items = ("<%values.digit1%>")
/ position = (20%, 50%)
/ erase = false
/ size = (20%, 10%)
/ hjustify = center
/ vjustify = center
</text>

<text digit2>
/ items = ("<%values.digit2%>")
/ position = (50%, 50%)
/ size = (20%, 10%)
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text digit3>
/ items = ("<%values.digit3%>")
/ position = (80%, 50%)
/ size = (20%, 10%)
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text operator1>
/ items = ("<%values.op1%>")
/ position = (30%, 50%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text operator2>
/ items = ("<%values.op2%>")
/ position = (60%, 50%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text submit>
/ items = ("SUBMIT")
/ position = (50%, 92%)
/ size = (20%, 10%)
/ txbgcolor = grey
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text gt1>
/ items = ("<%values.opa%>")
/ position = (30%, 60%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ hjustify = center
/ vjustify = center
</text>

<text lt1>
/ items = ("<%values.opb%>")
/ position = (30%, 70%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ hjustify = center
/ vjustify = center
</text>

<text gt2>
/ items = ("<%values.opa%>")
/ position = (60%, 60%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ hjustify = center
/ vjustify = center
</text>

<text lt2>
/ items = ("<%values.opb%>")
/ position = (60%, 70%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ hjustify = center
/ vjustify = center
</text>

You'll have to fiddle around with the on-screen positions a bit to make things look good because your example items at least vary in length, but the general approach is no different from the digits-only version.
By Inquisit1234 - 7/11/2018

Dave - Wednesday, July 11, 2018
Inquisit1234 - Wednesday, July 11, 2018
Hello again. So, I have a related question.  Any suggestions as to how to collect the same log data from these "drop down" menus, but change both the text and responses in the operators for each item.

For example, lets use the phrase "This is a large item, and this is a small item." The words "large" and "small" would be in the operators, the reset would be text. The next item would be "This is 10 times larger, and this is 3 times smaller." In this item, "10 and "3" would be in the operators, the rest would be text.

Overall, I am trying to figure out what would be the most efficient way to administer several different items (both text and operators), but still collect all of the log data capture by the script previously provided here.

Thank you.

It would work exactly the same way as the existing script. There is nothing that prevents to from storing text strings in <list> elements and using those in the various <values> instead of using digits only. And there is nothing that prevents you from having the operators -- <text lt> etc. in the original script -- be variable as well, in the same way as the digits are variable in the original. E.g.:

<values>
/ digit1 = 0
/ digit2 = 0
/ digit3 = 0
/ opa = ""
/ opb = ""
/ op1 = ""
/ op2 = ""
/ roundnumber = 0
</values>

<defaults>
/ fontstyle = ("Verdana", 3%)
</defaults>


<block myblock>
/ trials = [1-2=startround;]
</block>

<trial startround>
/ ontrialbegin = [values.op1 = "";
    values.op2 = "";
    values.digit1 = list.firstnumbers.nextvalue;
    values.digit2 = list.secondnumbers.nextvalue;
    values.digit3 = list.thirdnumbers.nextvalue;
    values.opa = list.opa.nextvalue;
    values.opb = list.opb.nextvalue;
    values.roundnumber += 1;
    ]
/ stimulusframes = [1=clearscreen, roundtext]
/ trialduration = 1000
/ validresponse = (0)
/ branch = [trial.main]
</trial>

<shape clearscreen>
/ color = white
/ shape = rectangle
/ size = (100%, 100%)
</shape>

<text roundtext>
/ items = ("This is round #<%values.roundnumber%>.")
</text>

<list firstnumbers>
/ items = ("This is a", "This is")
/ selectionmode = sequence
</list>

<list secondnumbers>
/ items = ("item. This is a","times larger. And this is")
/ selectionmode = list.firstnumbers.currentindex
</list>

<list thirdnumbers>
/ items = ("item.","times smaller")
/ selectionmode = list.firstnumbers.currentindex
</list>

<list opa>
/ items = ("large","10")
/ selectionmode = list.firstnumbers.currentindex
</list>

<list opb>
/ items = ("small","3")
/ selectionmode = list.firstnumbers.currentindex
</list>

<trial main>
/ stimulusframes = [1=question, digit1, operator1, digit2, operator2, digit3, submit]
/ inputdevice = mouse
/ validresponse = (operator1, operator2, submit)
/ isvalidresponse = [(trial.main.response == "submit" && values.op1 !="" && values.op2 !="")
    || trial.main.response == "operator1" || trial.main.response == "operator2"]
/ branch = [if (trial.main.response == "operator1") trial.select_operator1]
/ branch = [if (trial.main.response == "operator2") trial.select_operator2]
</trial>

<trial select_operator1>
/ ontrialend = [if (trial.select_operator1.response == "gt1") values.op1 = values.opa]
/ ontrialend = [if (trial.select_operator1.response == "lt1") values.op1 = values.opb]
/ stimulusframes = [1=gt1,lt1]
/ inputdevice = mouse
/ validresponse = (gt1,lt1)
/ branch = [trial.main]
</trial>

<trial select_operator2>
/ ontrialend = [if (trial.select_operator2.response == "gt2") values.op2 = values.opa]
/ ontrialend = [if (trial.select_operator2.response == "lt2") values.op2 = values.opb]
/ stimulusframes = [1=gt2,lt2]
/ inputdevice = mouse
/ validresponse = (gt2,lt2)
/ branch = [trial.main]
</trial>

<text question>
/ items = ("Please answer the question below")
/ erase = false
/ position = (50%, 25%)
</text>

<text digit1>
/ items = ("<%values.digit1%>")
/ position = (20%, 50%)
/ erase = false
/ size = (20%, 10%)
/ hjustify = center
/ vjustify = center
</text>

<text digit2>
/ items = ("<%values.digit2%>")
/ position = (50%, 50%)
/ size = (20%, 10%)
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text digit3>
/ items = ("<%values.digit3%>")
/ position = (80%, 50%)
/ size = (20%, 10%)
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text operator1>
/ items = ("<%values.op1%>")
/ position = (30%, 50%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text operator2>
/ items = ("<%values.op2%>")
/ position = (60%, 50%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text submit>
/ items = ("SUBMIT")
/ position = (50%, 92%)
/ size = (20%, 10%)
/ txbgcolor = grey
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text gt1>
/ items = ("<%values.opa%>")
/ position = (30%, 60%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ hjustify = center
/ vjustify = center
</text>

<text lt1>
/ items = ("<%values.opb%>")
/ position = (30%, 70%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ hjustify = center
/ vjustify = center
</text>

<text gt2>
/ items = ("<%values.opa%>")
/ position = (60%, 60%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ hjustify = center
/ vjustify = center
</text>

<text lt2>
/ items = ("<%values.opb%>")
/ position = (60%, 70%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ hjustify = center
/ vjustify = center
</text>

You'll have to fiddle around with the on-screen positions a bit to make things look good because your example items at least vary in length, but the general approach is no different from the digits-only version.
Hello, Dave.  Great. This makes a lot of sense. Thank you.
Now, what if I wanted to include items that use a single selection Likert type scale as the response option (e.g., a text prompt and four radio button response options) instead of the dropdowns, but I want to capture all of the clicking as well. Is that possible?

By Dave - 7/11/2018

Inquisit1234 - Wednesday, July 11, 2018
Dave - Wednesday, July 11, 2018
Inquisit1234 - Wednesday, July 11, 2018
Hello again. So, I have a related question.  Any suggestions as to how to collect the same log data from these "drop down" menus, but change both the text and responses in the operators for each item.

For example, lets use the phrase "This is a large item, and this is a small item." The words "large" and "small" would be in the operators, the reset would be text. The next item would be "This is 10 times larger, and this is 3 times smaller." In this item, "10 and "3" would be in the operators, the rest would be text.

Overall, I am trying to figure out what would be the most efficient way to administer several different items (both text and operators), but still collect all of the log data capture by the script previously provided here.

Thank you.

It would work exactly the same way as the existing script. There is nothing that prevents to from storing text strings in <list> elements and using those in the various <values> instead of using digits only. And there is nothing that prevents you from having the operators -- <text lt> etc. in the original script -- be variable as well, in the same way as the digits are variable in the original. E.g.:

<values>
/ digit1 = 0
/ digit2 = 0
/ digit3 = 0
/ opa = ""
/ opb = ""
/ op1 = ""
/ op2 = ""
/ roundnumber = 0
</values>

<defaults>
/ fontstyle = ("Verdana", 3%)
</defaults>


<block myblock>
/ trials = [1-2=startround;]
</block>

<trial startround>
/ ontrialbegin = [values.op1 = "";
    values.op2 = "";
    values.digit1 = list.firstnumbers.nextvalue;
    values.digit2 = list.secondnumbers.nextvalue;
    values.digit3 = list.thirdnumbers.nextvalue;
    values.opa = list.opa.nextvalue;
    values.opb = list.opb.nextvalue;
    values.roundnumber += 1;
    ]
/ stimulusframes = [1=clearscreen, roundtext]
/ trialduration = 1000
/ validresponse = (0)
/ branch = [trial.main]
</trial>

<shape clearscreen>
/ color = white
/ shape = rectangle
/ size = (100%, 100%)
</shape>

<text roundtext>
/ items = ("This is round #<%values.roundnumber%>.")
</text>

<list firstnumbers>
/ items = ("This is a", "This is")
/ selectionmode = sequence
</list>

<list secondnumbers>
/ items = ("item. This is a","times larger. And this is")
/ selectionmode = list.firstnumbers.currentindex
</list>

<list thirdnumbers>
/ items = ("item.","times smaller")
/ selectionmode = list.firstnumbers.currentindex
</list>

<list opa>
/ items = ("large","10")
/ selectionmode = list.firstnumbers.currentindex
</list>

<list opb>
/ items = ("small","3")
/ selectionmode = list.firstnumbers.currentindex
</list>

<trial main>
/ stimulusframes = [1=question, digit1, operator1, digit2, operator2, digit3, submit]
/ inputdevice = mouse
/ validresponse = (operator1, operator2, submit)
/ isvalidresponse = [(trial.main.response == "submit" && values.op1 !="" && values.op2 !="")
    || trial.main.response == "operator1" || trial.main.response == "operator2"]
/ branch = [if (trial.main.response == "operator1") trial.select_operator1]
/ branch = [if (trial.main.response == "operator2") trial.select_operator2]
</trial>

<trial select_operator1>
/ ontrialend = [if (trial.select_operator1.response == "gt1") values.op1 = values.opa]
/ ontrialend = [if (trial.select_operator1.response == "lt1") values.op1 = values.opb]
/ stimulusframes = [1=gt1,lt1]
/ inputdevice = mouse
/ validresponse = (gt1,lt1)
/ branch = [trial.main]
</trial>

<trial select_operator2>
/ ontrialend = [if (trial.select_operator2.response == "gt2") values.op2 = values.opa]
/ ontrialend = [if (trial.select_operator2.response == "lt2") values.op2 = values.opb]
/ stimulusframes = [1=gt2,lt2]
/ inputdevice = mouse
/ validresponse = (gt2,lt2)
/ branch = [trial.main]
</trial>

<text question>
/ items = ("Please answer the question below")
/ erase = false
/ position = (50%, 25%)
</text>

<text digit1>
/ items = ("<%values.digit1%>")
/ position = (20%, 50%)
/ erase = false
/ size = (20%, 10%)
/ hjustify = center
/ vjustify = center
</text>

<text digit2>
/ items = ("<%values.digit2%>")
/ position = (50%, 50%)
/ size = (20%, 10%)
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text digit3>
/ items = ("<%values.digit3%>")
/ position = (80%, 50%)
/ size = (20%, 10%)
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text operator1>
/ items = ("<%values.op1%>")
/ position = (30%, 50%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text operator2>
/ items = ("<%values.op2%>")
/ position = (60%, 50%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text submit>
/ items = ("SUBMIT")
/ position = (50%, 92%)
/ size = (20%, 10%)
/ txbgcolor = grey
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text gt1>
/ items = ("<%values.opa%>")
/ position = (30%, 60%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ hjustify = center
/ vjustify = center
</text>

<text lt1>
/ items = ("<%values.opb%>")
/ position = (30%, 70%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ hjustify = center
/ vjustify = center
</text>

<text gt2>
/ items = ("<%values.opa%>")
/ position = (60%, 60%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ hjustify = center
/ vjustify = center
</text>

<text lt2>
/ items = ("<%values.opb%>")
/ position = (60%, 70%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ hjustify = center
/ vjustify = center
</text>

You'll have to fiddle around with the on-screen positions a bit to make things look good because your example items at least vary in length, but the general approach is no different from the digits-only version.
Hello, Dave.  Great. This makes a lot of sense. Thank you.
Now, what if I wanted to include items that use a single selection Likert type scale as the response option (e.g., a text prompt and four radio button response options) instead of the dropdowns, but I want to capture all of the clicking as well. Is that possible?


Yes, you can again do that in the exact same way.
By Inquisit1234 - 7/18/2018

Dave - Wednesday, July 11, 2018
Inquisit1234 - Wednesday, July 11, 2018
Dave - Wednesday, July 11, 2018
Inquisit1234 - Wednesday, July 11, 2018
Hello again. So, I have a related question.  Any suggestions as to how to collect the same log data from these "drop down" menus, but change both the text and responses in the operators for each item.

For example, lets use the phrase "This is a large item, and this is a small item." The words "large" and "small" would be in the operators, the reset would be text. The next item would be "This is 10 times larger, and this is 3 times smaller." In this item, "10 and "3" would be in the operators, the rest would be text.

Overall, I am trying to figure out what would be the most efficient way to administer several different items (both text and operators), but still collect all of the log data capture by the script previously provided here.

Thank you.

It would work exactly the same way as the existing script. There is nothing that prevents to from storing text strings in <list> elements and using those in the various <values> instead of using digits only. And there is nothing that prevents you from having the operators -- <text lt> etc. in the original script -- be variable as well, in the same way as the digits are variable in the original. E.g.:

<values>
/ digit1 = 0
/ digit2 = 0
/ digit3 = 0
/ opa = ""
/ opb = ""
/ op1 = ""
/ op2 = ""
/ roundnumber = 0
</values>

<defaults>
/ fontstyle = ("Verdana", 3%)
</defaults>


<block myblock>
/ trials = [1-2=startround;]
</block>

<trial startround>
/ ontrialbegin = [values.op1 = "";
    values.op2 = "";
    values.digit1 = list.firstnumbers.nextvalue;
    values.digit2 = list.secondnumbers.nextvalue;
    values.digit3 = list.thirdnumbers.nextvalue;
    values.opa = list.opa.nextvalue;
    values.opb = list.opb.nextvalue;
    values.roundnumber += 1;
    ]
/ stimulusframes = [1=clearscreen, roundtext]
/ trialduration = 1000
/ validresponse = (0)
/ branch = [trial.main]
</trial>

<shape clearscreen>
/ color = white
/ shape = rectangle
/ size = (100%, 100%)
</shape>

<text roundtext>
/ items = ("This is round #<%values.roundnumber%>.")
</text>

<list firstnumbers>
/ items = ("This is a", "This is")
/ selectionmode = sequence
</list>

<list secondnumbers>
/ items = ("item. This is a","times larger. And this is")
/ selectionmode = list.firstnumbers.currentindex
</list>

<list thirdnumbers>
/ items = ("item.","times smaller")
/ selectionmode = list.firstnumbers.currentindex
</list>

<list opa>
/ items = ("large","10")
/ selectionmode = list.firstnumbers.currentindex
</list>

<list opb>
/ items = ("small","3")
/ selectionmode = list.firstnumbers.currentindex
</list>

<trial main>
/ stimulusframes = [1=question, digit1, operator1, digit2, operator2, digit3, submit]
/ inputdevice = mouse
/ validresponse = (operator1, operator2, submit)
/ isvalidresponse = [(trial.main.response == "submit" && values.op1 !="" && values.op2 !="")
    || trial.main.response == "operator1" || trial.main.response == "operator2"]
/ branch = [if (trial.main.response == "operator1") trial.select_operator1]
/ branch = [if (trial.main.response == "operator2") trial.select_operator2]
</trial>

<trial select_operator1>
/ ontrialend = [if (trial.select_operator1.response == "gt1") values.op1 = values.opa]
/ ontrialend = [if (trial.select_operator1.response == "lt1") values.op1 = values.opb]
/ stimulusframes = [1=gt1,lt1]
/ inputdevice = mouse
/ validresponse = (gt1,lt1)
/ branch = [trial.main]
</trial>

<trial select_operator2>
/ ontrialend = [if (trial.select_operator2.response == "gt2") values.op2 = values.opa]
/ ontrialend = [if (trial.select_operator2.response == "lt2") values.op2 = values.opb]
/ stimulusframes = [1=gt2,lt2]
/ inputdevice = mouse
/ validresponse = (gt2,lt2)
/ branch = [trial.main]
</trial>

<text question>
/ items = ("Please answer the question below")
/ erase = false
/ position = (50%, 25%)
</text>

<text digit1>
/ items = ("<%values.digit1%>")
/ position = (20%, 50%)
/ erase = false
/ size = (20%, 10%)
/ hjustify = center
/ vjustify = center
</text>

<text digit2>
/ items = ("<%values.digit2%>")
/ position = (50%, 50%)
/ size = (20%, 10%)
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text digit3>
/ items = ("<%values.digit3%>")
/ position = (80%, 50%)
/ size = (20%, 10%)
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text operator1>
/ items = ("<%values.op1%>")
/ position = (30%, 50%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text operator2>
/ items = ("<%values.op2%>")
/ position = (60%, 50%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text submit>
/ items = ("SUBMIT")
/ position = (50%, 92%)
/ size = (20%, 10%)
/ txbgcolor = grey
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text gt1>
/ items = ("<%values.opa%>")
/ position = (30%, 60%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ hjustify = center
/ vjustify = center
</text>

<text lt1>
/ items = ("<%values.opb%>")
/ position = (30%, 70%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ hjustify = center
/ vjustify = center
</text>

<text gt2>
/ items = ("<%values.opa%>")
/ position = (60%, 60%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ hjustify = center
/ vjustify = center
</text>

<text lt2>
/ items = ("<%values.opb%>")
/ position = (60%, 70%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ hjustify = center
/ vjustify = center
</text>

You'll have to fiddle around with the on-screen positions a bit to make things look good because your example items at least vary in length, but the general approach is no different from the digits-only version.
Hello, Dave.  Great. This makes a lot of sense. Thank you.
Now, what if I wanted to include items that use a single selection Likert type scale as the response option (e.g., a text prompt and four radio button response options) instead of the dropdowns, but I want to capture all of the clicking as well. Is that possible?


Yes, you can again do that in the exact same way.

I am still struggling with this. I have items that have prompts (e.g., "Which of these must be true?", "Which of these must be false?") and 6 vertical radio button response options (A-F). I am not certain how to adapt the above script to cycle through the prompts and response options. Would I use the <radiobuttons> element in place of the <text operator1>?As always, thanks for the help.
By Dave - 7/18/2018

Inquisit1234 - Wednesday, July 18, 2018
Dave - Wednesday, July 11, 2018
Inquisit1234 - Wednesday, July 11, 2018
Dave - Wednesday, July 11, 2018
Inquisit1234 - Wednesday, July 11, 2018
Hello again. So, I have a related question.  Any suggestions as to how to collect the same log data from these "drop down" menus, but change both the text and responses in the operators for each item.

For example, lets use the phrase "This is a large item, and this is a small item." The words "large" and "small" would be in the operators, the reset would be text. The next item would be "This is 10 times larger, and this is 3 times smaller." In this item, "10 and "3" would be in the operators, the rest would be text.

Overall, I am trying to figure out what would be the most efficient way to administer several different items (both text and operators), but still collect all of the log data capture by the script previously provided here.

Thank you.

It would work exactly the same way as the existing script. There is nothing that prevents to from storing text strings in <list> elements and using those in the various <values> instead of using digits only. And there is nothing that prevents you from having the operators -- <text lt> etc. in the original script -- be variable as well, in the same way as the digits are variable in the original. E.g.:

<values>
/ digit1 = 0
/ digit2 = 0
/ digit3 = 0
/ opa = ""
/ opb = ""
/ op1 = ""
/ op2 = ""
/ roundnumber = 0
</values>

<defaults>
/ fontstyle = ("Verdana", 3%)
</defaults>


<block myblock>
/ trials = [1-2=startround;]
</block>

<trial startround>
/ ontrialbegin = [values.op1 = "";
    values.op2 = "";
    values.digit1 = list.firstnumbers.nextvalue;
    values.digit2 = list.secondnumbers.nextvalue;
    values.digit3 = list.thirdnumbers.nextvalue;
    values.opa = list.opa.nextvalue;
    values.opb = list.opb.nextvalue;
    values.roundnumber += 1;
    ]
/ stimulusframes = [1=clearscreen, roundtext]
/ trialduration = 1000
/ validresponse = (0)
/ branch = [trial.main]
</trial>

<shape clearscreen>
/ color = white
/ shape = rectangle
/ size = (100%, 100%)
</shape>

<text roundtext>
/ items = ("This is round #<%values.roundnumber%>.")
</text>

<list firstnumbers>
/ items = ("This is a", "This is")
/ selectionmode = sequence
</list>

<list secondnumbers>
/ items = ("item. This is a","times larger. And this is")
/ selectionmode = list.firstnumbers.currentindex
</list>

<list thirdnumbers>
/ items = ("item.","times smaller")
/ selectionmode = list.firstnumbers.currentindex
</list>

<list opa>
/ items = ("large","10")
/ selectionmode = list.firstnumbers.currentindex
</list>

<list opb>
/ items = ("small","3")
/ selectionmode = list.firstnumbers.currentindex
</list>

<trial main>
/ stimulusframes = [1=question, digit1, operator1, digit2, operator2, digit3, submit]
/ inputdevice = mouse
/ validresponse = (operator1, operator2, submit)
/ isvalidresponse = [(trial.main.response == "submit" && values.op1 !="" && values.op2 !="")
    || trial.main.response == "operator1" || trial.main.response == "operator2"]
/ branch = [if (trial.main.response == "operator1") trial.select_operator1]
/ branch = [if (trial.main.response == "operator2") trial.select_operator2]
</trial>

<trial select_operator1>
/ ontrialend = [if (trial.select_operator1.response == "gt1") values.op1 = values.opa]
/ ontrialend = [if (trial.select_operator1.response == "lt1") values.op1 = values.opb]
/ stimulusframes = [1=gt1,lt1]
/ inputdevice = mouse
/ validresponse = (gt1,lt1)
/ branch = [trial.main]
</trial>

<trial select_operator2>
/ ontrialend = [if (trial.select_operator2.response == "gt2") values.op2 = values.opa]
/ ontrialend = [if (trial.select_operator2.response == "lt2") values.op2 = values.opb]
/ stimulusframes = [1=gt2,lt2]
/ inputdevice = mouse
/ validresponse = (gt2,lt2)
/ branch = [trial.main]
</trial>

<text question>
/ items = ("Please answer the question below")
/ erase = false
/ position = (50%, 25%)
</text>

<text digit1>
/ items = ("<%values.digit1%>")
/ position = (20%, 50%)
/ erase = false
/ size = (20%, 10%)
/ hjustify = center
/ vjustify = center
</text>

<text digit2>
/ items = ("<%values.digit2%>")
/ position = (50%, 50%)
/ size = (20%, 10%)
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text digit3>
/ items = ("<%values.digit3%>")
/ position = (80%, 50%)
/ size = (20%, 10%)
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text operator1>
/ items = ("<%values.op1%>")
/ position = (30%, 50%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text operator2>
/ items = ("<%values.op2%>")
/ position = (60%, 50%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text submit>
/ items = ("SUBMIT")
/ position = (50%, 92%)
/ size = (20%, 10%)
/ txbgcolor = grey
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text gt1>
/ items = ("<%values.opa%>")
/ position = (30%, 60%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ hjustify = center
/ vjustify = center
</text>

<text lt1>
/ items = ("<%values.opb%>")
/ position = (30%, 70%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ hjustify = center
/ vjustify = center
</text>

<text gt2>
/ items = ("<%values.opa%>")
/ position = (60%, 60%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ hjustify = center
/ vjustify = center
</text>

<text lt2>
/ items = ("<%values.opb%>")
/ position = (60%, 70%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ hjustify = center
/ vjustify = center
</text>

You'll have to fiddle around with the on-screen positions a bit to make things look good because your example items at least vary in length, but the general approach is no different from the digits-only version.
Hello, Dave.  Great. This makes a lot of sense. Thank you.
Now, what if I wanted to include items that use a single selection Likert type scale as the response option (e.g., a text prompt and four radio button response options) instead of the dropdowns, but I want to capture all of the clicking as well. Is that possible?


Yes, you can again do that in the exact same way.

I am still struggling with this. I have items that have prompts (e.g., "Which of these must be true?", "Which of these must be false?") and 6 vertical radio button response options (A-F). I am not certain how to adapt the above script to cycle through the prompts and response options. Would I use the <radiobuttons> element in place of the <text operator1>?As always, thanks for the help.

No, you would not use <radiobuttons>. If you want something that works *exactly* like the previous script you use regular <text> and / or <shape> elements. If you want something like a simple likert-type scale, then simply use the <likert> trial element.
By Inquisit1234 - 7/18/2018

Dave - Wednesday, July 18, 2018
Inquisit1234 - Wednesday, July 18, 2018
Dave - Wednesday, July 11, 2018
Inquisit1234 - Wednesday, July 11, 2018
Dave - Wednesday, July 11, 2018
Inquisit1234 - Wednesday, July 11, 2018
Hello again. So, I have a related question.  Any suggestions as to how to collect the same log data from these "drop down" menus, but change both the text and responses in the operators for each item.

For example, lets use the phrase "This is a large item, and this is a small item." The words "large" and "small" would be in the operators, the reset would be text. The next item would be "This is 10 times larger, and this is 3 times smaller." In this item, "10 and "3" would be in the operators, the rest would be text.

Overall, I am trying to figure out what would be the most efficient way to administer several different items (both text and operators), but still collect all of the log data capture by the script previously provided here.

Thank you.

It would work exactly the same way as the existing script. There is nothing that prevents to from storing text strings in <list> elements and using those in the various <values> instead of using digits only. And there is nothing that prevents you from having the operators -- <text lt> etc. in the original script -- be variable as well, in the same way as the digits are variable in the original. E.g.:

<values>
/ digit1 = 0
/ digit2 = 0
/ digit3 = 0
/ opa = ""
/ opb = ""
/ op1 = ""
/ op2 = ""
/ roundnumber = 0
</values>

<defaults>
/ fontstyle = ("Verdana", 3%)
</defaults>


<block myblock>
/ trials = [1-2=startround;]
</block>

<trial startround>
/ ontrialbegin = [values.op1 = "";
    values.op2 = "";
    values.digit1 = list.firstnumbers.nextvalue;
    values.digit2 = list.secondnumbers.nextvalue;
    values.digit3 = list.thirdnumbers.nextvalue;
    values.opa = list.opa.nextvalue;
    values.opb = list.opb.nextvalue;
    values.roundnumber += 1;
    ]
/ stimulusframes = [1=clearscreen, roundtext]
/ trialduration = 1000
/ validresponse = (0)
/ branch = [trial.main]
</trial>

<shape clearscreen>
/ color = white
/ shape = rectangle
/ size = (100%, 100%)
</shape>

<text roundtext>
/ items = ("This is round #<%values.roundnumber%>.")
</text>

<list firstnumbers>
/ items = ("This is a", "This is")
/ selectionmode = sequence
</list>

<list secondnumbers>
/ items = ("item. This is a","times larger. And this is")
/ selectionmode = list.firstnumbers.currentindex
</list>

<list thirdnumbers>
/ items = ("item.","times smaller")
/ selectionmode = list.firstnumbers.currentindex
</list>

<list opa>
/ items = ("large","10")
/ selectionmode = list.firstnumbers.currentindex
</list>

<list opb>
/ items = ("small","3")
/ selectionmode = list.firstnumbers.currentindex
</list>

<trial main>
/ stimulusframes = [1=question, digit1, operator1, digit2, operator2, digit3, submit]
/ inputdevice = mouse
/ validresponse = (operator1, operator2, submit)
/ isvalidresponse = [(trial.main.response == "submit" && values.op1 !="" && values.op2 !="")
    || trial.main.response == "operator1" || trial.main.response == "operator2"]
/ branch = [if (trial.main.response == "operator1") trial.select_operator1]
/ branch = [if (trial.main.response == "operator2") trial.select_operator2]
</trial>

<trial select_operator1>
/ ontrialend = [if (trial.select_operator1.response == "gt1") values.op1 = values.opa]
/ ontrialend = [if (trial.select_operator1.response == "lt1") values.op1 = values.opb]
/ stimulusframes = [1=gt1,lt1]
/ inputdevice = mouse
/ validresponse = (gt1,lt1)
/ branch = [trial.main]
</trial>

<trial select_operator2>
/ ontrialend = [if (trial.select_operator2.response == "gt2") values.op2 = values.opa]
/ ontrialend = [if (trial.select_operator2.response == "lt2") values.op2 = values.opb]
/ stimulusframes = [1=gt2,lt2]
/ inputdevice = mouse
/ validresponse = (gt2,lt2)
/ branch = [trial.main]
</trial>

<text question>
/ items = ("Please answer the question below")
/ erase = false
/ position = (50%, 25%)
</text>

<text digit1>
/ items = ("<%values.digit1%>")
/ position = (20%, 50%)
/ erase = false
/ size = (20%, 10%)
/ hjustify = center
/ vjustify = center
</text>

<text digit2>
/ items = ("<%values.digit2%>")
/ position = (50%, 50%)
/ size = (20%, 10%)
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text digit3>
/ items = ("<%values.digit3%>")
/ position = (80%, 50%)
/ size = (20%, 10%)
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text operator1>
/ items = ("<%values.op1%>")
/ position = (30%, 50%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text operator2>
/ items = ("<%values.op2%>")
/ position = (60%, 50%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text submit>
/ items = ("SUBMIT")
/ position = (50%, 92%)
/ size = (20%, 10%)
/ txbgcolor = grey
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text gt1>
/ items = ("<%values.opa%>")
/ position = (30%, 60%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ hjustify = center
/ vjustify = center
</text>

<text lt1>
/ items = ("<%values.opb%>")
/ position = (30%, 70%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ hjustify = center
/ vjustify = center
</text>

<text gt2>
/ items = ("<%values.opa%>")
/ position = (60%, 60%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ hjustify = center
/ vjustify = center
</text>

<text lt2>
/ items = ("<%values.opb%>")
/ position = (60%, 70%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ hjustify = center
/ vjustify = center
</text>

You'll have to fiddle around with the on-screen positions a bit to make things look good because your example items at least vary in length, but the general approach is no different from the digits-only version.
Hello, Dave.  Great. This makes a lot of sense. Thank you.
Now, what if I wanted to include items that use a single selection Likert type scale as the response option (e.g., a text prompt and four radio button response options) instead of the dropdowns, but I want to capture all of the clicking as well. Is that possible?


Yes, you can again do that in the exact same way.

I am still struggling with this. I have items that have prompts (e.g., "Which of these must be true?", "Which of these must be false?") and 6 vertical radio button response options (A-F). I am not certain how to adapt the above script to cycle through the prompts and response options. Would I use the <radiobuttons> element in place of the <text operator1>?As always, thanks for the help.

No, you would not use <radiobuttons>. If you want something that works *exactly* like the previous script you use regular <text> and / or <shape> elements. If you want something like a simple likert-type scale, then simply use the <likert> trial element.

Hello Dave.  Will the log data be captured with the <likert> trial element (e.g., which options the participant selected before submitting, timing, etc.)? And, is there a way to make the Likert options be presented vertically instead of horizontally? 
By Dave - 7/18/2018

Inquisit1234 - Wednesday, July 18, 2018
Dave - Wednesday, July 18, 2018
Inquisit1234 - Wednesday, July 18, 2018
Dave - Wednesday, July 11, 2018
Inquisit1234 - Wednesday, July 11, 2018
Dave - Wednesday, July 11, 2018
Inquisit1234 - Wednesday, July 11, 2018
Hello again. So, I have a related question.  Any suggestions as to how to collect the same log data from these "drop down" menus, but change both the text and responses in the operators for each item.

For example, lets use the phrase "This is a large item, and this is a small item." The words "large" and "small" would be in the operators, the reset would be text. The next item would be "This is 10 times larger, and this is 3 times smaller." In this item, "10 and "3" would be in the operators, the rest would be text.

Overall, I am trying to figure out what would be the most efficient way to administer several different items (both text and operators), but still collect all of the log data capture by the script previously provided here.

Thank you.

It would work exactly the same way as the existing script. There is nothing that prevents to from storing text strings in <list> elements and using those in the various <values> instead of using digits only. And there is nothing that prevents you from having the operators -- <text lt> etc. in the original script -- be variable as well, in the same way as the digits are variable in the original. E.g.:

<values>
/ digit1 = 0
/ digit2 = 0
/ digit3 = 0
/ opa = ""
/ opb = ""
/ op1 = ""
/ op2 = ""
/ roundnumber = 0
</values>

<defaults>
/ fontstyle = ("Verdana", 3%)
</defaults>


<block myblock>
/ trials = [1-2=startround;]
</block>

<trial startround>
/ ontrialbegin = [values.op1 = "";
    values.op2 = "";
    values.digit1 = list.firstnumbers.nextvalue;
    values.digit2 = list.secondnumbers.nextvalue;
    values.digit3 = list.thirdnumbers.nextvalue;
    values.opa = list.opa.nextvalue;
    values.opb = list.opb.nextvalue;
    values.roundnumber += 1;
    ]
/ stimulusframes = [1=clearscreen, roundtext]
/ trialduration = 1000
/ validresponse = (0)
/ branch = [trial.main]
</trial>

<shape clearscreen>
/ color = white
/ shape = rectangle
/ size = (100%, 100%)
</shape>

<text roundtext>
/ items = ("This is round #<%values.roundnumber%>.")
</text>

<list firstnumbers>
/ items = ("This is a", "This is")
/ selectionmode = sequence
</list>

<list secondnumbers>
/ items = ("item. This is a","times larger. And this is")
/ selectionmode = list.firstnumbers.currentindex
</list>

<list thirdnumbers>
/ items = ("item.","times smaller")
/ selectionmode = list.firstnumbers.currentindex
</list>

<list opa>
/ items = ("large","10")
/ selectionmode = list.firstnumbers.currentindex
</list>

<list opb>
/ items = ("small","3")
/ selectionmode = list.firstnumbers.currentindex
</list>

<trial main>
/ stimulusframes = [1=question, digit1, operator1, digit2, operator2, digit3, submit]
/ inputdevice = mouse
/ validresponse = (operator1, operator2, submit)
/ isvalidresponse = [(trial.main.response == "submit" && values.op1 !="" && values.op2 !="")
    || trial.main.response == "operator1" || trial.main.response == "operator2"]
/ branch = [if (trial.main.response == "operator1") trial.select_operator1]
/ branch = [if (trial.main.response == "operator2") trial.select_operator2]
</trial>

<trial select_operator1>
/ ontrialend = [if (trial.select_operator1.response == "gt1") values.op1 = values.opa]
/ ontrialend = [if (trial.select_operator1.response == "lt1") values.op1 = values.opb]
/ stimulusframes = [1=gt1,lt1]
/ inputdevice = mouse
/ validresponse = (gt1,lt1)
/ branch = [trial.main]
</trial>

<trial select_operator2>
/ ontrialend = [if (trial.select_operator2.response == "gt2") values.op2 = values.opa]
/ ontrialend = [if (trial.select_operator2.response == "lt2") values.op2 = values.opb]
/ stimulusframes = [1=gt2,lt2]
/ inputdevice = mouse
/ validresponse = (gt2,lt2)
/ branch = [trial.main]
</trial>

<text question>
/ items = ("Please answer the question below")
/ erase = false
/ position = (50%, 25%)
</text>

<text digit1>
/ items = ("<%values.digit1%>")
/ position = (20%, 50%)
/ erase = false
/ size = (20%, 10%)
/ hjustify = center
/ vjustify = center
</text>

<text digit2>
/ items = ("<%values.digit2%>")
/ position = (50%, 50%)
/ size = (20%, 10%)
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text digit3>
/ items = ("<%values.digit3%>")
/ position = (80%, 50%)
/ size = (20%, 10%)
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text operator1>
/ items = ("<%values.op1%>")
/ position = (30%, 50%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text operator2>
/ items = ("<%values.op2%>")
/ position = (60%, 50%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text submit>
/ items = ("SUBMIT")
/ position = (50%, 92%)
/ size = (20%, 10%)
/ txbgcolor = grey
/ erase = false
/ hjustify = center
/ vjustify = center
</text>

<text gt1>
/ items = ("<%values.opa%>")
/ position = (30%, 60%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ hjustify = center
/ vjustify = center
</text>

<text lt1>
/ items = ("<%values.opb%>")
/ position = (30%, 70%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ hjustify = center
/ vjustify = center
</text>

<text gt2>
/ items = ("<%values.opa%>")
/ position = (60%, 60%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ hjustify = center
/ vjustify = center
</text>

<text lt2>
/ items = ("<%values.opb%>")
/ position = (60%, 70%)
/ size = (10%, 10%)
/ txbgcolor = grey
/ hjustify = center
/ vjustify = center
</text>

You'll have to fiddle around with the on-screen positions a bit to make things look good because your example items at least vary in length, but the general approach is no different from the digits-only version.
Hello, Dave.  Great. This makes a lot of sense. Thank you.
Now, what if I wanted to include items that use a single selection Likert type scale as the response option (e.g., a text prompt and four radio button response options) instead of the dropdowns, but I want to capture all of the clicking as well. Is that possible?


Yes, you can again do that in the exact same way.

I am still struggling with this. I have items that have prompts (e.g., "Which of these must be true?", "Which of these must be false?") and 6 vertical radio button response options (A-F). I am not certain how to adapt the above script to cycle through the prompts and response options. Would I use the <radiobuttons> element in place of the <text operator1>?As always, thanks for the help.

No, you would not use <radiobuttons>. If you want something that works *exactly* like the previous script you use regular <text> and / or <shape> elements. If you want something like a simple likert-type scale, then simply use the <likert> trial element.

Hello Dave.  Will the log data be captured with the <likert> trial element (e.g., which options the participant selected before submitting, timing, etc.)? And, is there a way to make the Likert options be presented vertically instead of horizontally? 

> Will the log data be captured with the <likert> trial element (e.g., which options the participant selected before submitting, timing, etc.)?

No. If you want that you need to build something like the script discussed throughout this thread. I.e. use standard <text> and <trial> elements.

>  And, is there a way to make the Likert options be presented vertically instead of horizontally?

No.