Multiple selection of images


Author
Message
natash
natash
Associate Member (201 reputation)Associate Member (201 reputation)Associate Member (201 reputation)Associate Member (201 reputation)Associate Member (201 reputation)Associate Member (201 reputation)Associate Member (201 reputation)Associate Member (201 reputation)Associate Member (201 reputation)
Group: Forum Members
Posts: 14, Visits: 38
Hi there again, 

I've got now the practice trials programmed and what I would like to do is create a branch, so that if the person doesn't select the three targets he/she is thrown back to the instruction page and has to do it all over again until she completes the practice trials without an error. I tried doing that below, I couldn't get it to start with the instruction again, all I got is that it is thrown to the "notgoodtrial" and then it doesn't start all over but continues with the trial where the error occured. Does somebody have an idea how to solve this? 

best, Natash

<defaults>
/ fontstyle = ("Arial", 2%)
</defaults>


<values>
/ target_1_x = 0%
/ target_1_y = 0%
/ target_2_x = 0%
/ target_2_y = 0%
/ target_3_x = 0%
/ target_3_y = 0%
/ dist_1_x = 0%
/ dist_1_y = 0%
/ dist_2_x = 0%
/ dist_2_y = 0%
/ dist_3_x = 0%
/ dist_3_y = 0%
/ dist_4_x = 0%
/ dist_4_y = 0%
/ dist_5_x = 0%
/ dist_5_y = 0%
/ dist_6_x = 0%
/ dist_6_y = 0%
/ target_1 = 0
/ target_2 = 0
/ target_3 = 0
/ dist_1 = 0
/ dist_2 = 0
/ dist_3 = 0
/ dist_4 = 0
/ dist_5 = 0
/ dist_6 = 0


/ set = 1
</values>

<expressions>
/ n_selected = (values.target_1 + values.target_2 + values.target_3 + values.dist_1 + values.dist_2 +
values.dist_3 + values.dist_4 + values.dist_5 +
values.dist_6)
</expressions>

<expressions>
/richtig = (values.target_1 + values.target_2 + values.target_3)
</expressions>

<expressions>
/falsch= (values.target_1 + values.target_2 + values.target_3!=3 && expressions.n_selected==3)
</expressions>





// sets of 9 items each (three targets, nine dist)
<list setlist>
/ items = (1,2,3)
/ selectionmode = sequence
</list>

<item target_1_items>
/ 1 = "1_rund_blau_leer.png"
/ 2 = "1_kreuz_lila_leer.png"
/ 3 = "1_rund_orange_voll.png"


</item>

<item target_2_items>
/ 1 = "1_rund_orange_leer.png"
/ 2 = "1_rund_blau_leer.png"
/ 3 = "1_kreuz_lila_leer.png"

</item>

<item target_3_items>
/ 1 = "1_rund_lila_leer.png"
/ 2 = "1_eckig_orange_leer.png"
/ 3 = "1_eckig_blau_streifen.png"

</item>

<item dist_1_items>
/ 1 = "1_eckig_blau_leer.png"
/ 2 = "1_rund_lila_leer.png"
/ 3 = "1_rund_blau_leer.png"


</item>

<item dist_2_items>
/ 1 = "1_rund_lila_voll.png"
/ 2 = "1_rund_lila_voll.png"
/ 3 = "1_eckig_lila_voll.png"


</item>

<item dist_3_items>
/ 1 = "1_eckig_blau_voll.png"
/ 2 = "1_eckig_lila_voll.png"
/ 3 = "1_eckig_blau_voll.png"

</item>

<item dist_4_items>
/ 1 = "1_eckig_lila_voll.png"
/ 2 = "1_eckig_blau_voll.png"
/ 3 = "1_kreuz_blau_leer.png"


</item>

<item dist_5_items>
/ 1 = "1_rund_orange_voll.png"
/ 2 = "1_rund_orange_voll.png"
/ 3 = "1_rund_lila_leer.png"

</item>

<item dist_6_items>
/ 1 = "1_eckig_orange_leer.png"
/ 2 = "1_eckig_blau_leer.png"
/ 3 = "1_rund_lila_voll.png"


</item>



<picture target_1>
/ items = target_1_items
/ select = values.set
/ hposition = values.target_1_x
/ vposition = values.target_1_y
/ size = (16%, 26%)
/ erase = false
/ vjustify = center
</picture>

<text target_1_bg>
/ items = ("")
/ hposition = values.target_1_x
/ vposition = values.target_1_y
/ size = (18%, 28%)
/ erase = false
</text>

<picture target_2>
/ items = target_2_items
/ select = values.set
/ hposition = values.target_2_x
/ vposition = values.target_2_y
/ size = (16%, 26%)
/ erase = false
/ vjustify = center
</picture>

<text target_2_bg>
/ items = (" ")
/ hposition = values.target_2_x
/ vposition = values.target_2_y
/ size = (18%, 28%)
/ erase = false
</text>

<picture target_3>
/ items = target_3_items
/ select = values.set
/ hposition = values.target_3_x
/ vposition = values.target_3_y
/ size = (16%, 26%)
/ erase = false
/ vjustify = center
</picture>


<text target_3_bg>
/ items = (" ")
/ hposition = values.target_3_x
/ vposition = values.target_3_y
/ size = (18%, 28%)
/ erase = false
</text>

<picture dist_1>
/ items = dist_1_items
/ select = values.set
/ hposition = values.dist_1_x
/ vposition = values.dist_1_y
/ size = (16%, 26%)
/ erase = false
/ vjustify = center
</picture>

<text dist_1_bg>
/ items = (" ")
/ hposition = values.dist_1_x
/ vposition = values.dist_1_y
/ size = (18%, 28%)
/ erase = false
</text>

<picture dist_2>
/ items = dist_2_items
/ select = values.set
/ hposition = values.dist_2_x
/ vposition = values.dist_2_y
/ size = (16%, 26%)
/ erase = false
/ vjustify = center
</picture>

<text dist_2_bg>
/ items = ("")
/ hposition = values.dist_2_x
/ vposition = values.dist_2_y
/ size = (18%, 28%)
/ erase = false
</text>

<picture dist_3>
/ items = dist_3_items
/ select = values.set
/ hposition = values.dist_3_x
/ vposition = values.dist_3_y
/ size = (16%, 26%)
/ erase = false
/ vjustify = center
</picture>

<text dist_3_bg>
/ items = (" ")
/ hposition = values.dist_3_x
/ vposition = values.dist_3_y
/ size = (18%, 28%)
/ erase = false
</text>

<picture dist_4>
/ items = dist_4_items
/ select = values.set
/ hposition = values.dist_4_x
/ vposition = values.dist_4_y
/ size = (16%, 26%)
/ erase = false
/ vjustify = center
</picture>

<text dist_4_bg>
/ items = (" ")
/ hposition = values.dist_4_x
/ vposition = values.dist_4_y
/ size = (18%, 28%)
/ erase = false
</text>

<picture dist_5>
/ items = dist_5_items
/ select = values.set
/ hposition = values.dist_5_x
/ vposition = values.dist_5_y
/ size = (16%, 26%)
/ erase = false
/ vjustify = center
</picture>

<text dist_5_bg>
/ items = (" ")
/ hposition = values.dist_5_x
/ vposition = values.dist_5_y
/ size = (18%, 28%)
/ erase = false
</text>

<picture dist_6>
/ items = dist_6_items
/ select = values.set
/ hposition = values.dist_6_x
/ vposition = values.dist_6_y
/ size = (16%, 26%)
/ erase = false
/ vjustify = center
</picture>

<text dist_6_bg>
/ items = (" ")
/ hposition = values.dist_6_x
/ vposition = values.dist_6_y
/ size = (18%, 28%)
/ erase = false
</text>


<list xpos>
/ items = (10, 30, 50, 10, 30, 50, 10, 30, 50)
/ selectionmode = random
/ selectionrate = always
</list>

<list ypos>
/ items = (15, 15, 15, 45, 45, 45, 75, 75, 75)
/ selectionmode = list.xpos.currentindex
/ selectionrate = always
</list>


<trial start>
/ ontrialbegin = [
  values.set = list.setlist.nextvalue;
  text.target_1_bg.textbgcolor = white;
  text.target_2_bg.textbgcolor = white;
  text.target_3_bg.textbgcolor = white;
  text.dist_1_bg.textbgcolor = white;
    text.dist_2_bg.textbgcolor = white;
    text.dist_3_bg.textbgcolor = white;
    text.dist_4_bg.textbgcolor = white;
    text.dist_5_bg.textbgcolor = white;
    text.dist_6_bg.textbgcolor = white;
    
  values.target_1 = 0;
  values.target_2 = 0;
  values.target_3 = 0;
  values.dist_1 = 0;
    values.dist_2 = 0;
    values.dist_3 = 0;
    values.dist_4 = 0;
    values.dist_5 = 0;
    values.dist_6 = 0;

  values.target_1_x = list.xpos.nextvalue;
  values.target_1_y = list.ypos.nextvalue;
  values.target_2_x = list.xpos.nextvalue;
  values.target_2_y = list.ypos.nextvalue;
  values.target_3_x = list.xpos.nextvalue;
  values.target_3_y = list.ypos.nextvalue;
  values.dist_1_x = list.xpos.nextvalue;
  values.dist_1_y = list.ypos.nextvalue;
    values.dist_2_x = list.xpos.nextvalue;
  values.dist_2_y = list.ypos.nextvalue;
    values.dist_3_x = list.xpos.nextvalue;
  values.dist_3_y = list.ypos.nextvalue;
    values.dist_4_x = list.xpos.nextvalue;
  values.dist_4_y = list.ypos.nextvalue;
    values.dist_5_x = list.xpos.nextvalue;
  values.dist_5_y = list.ypos.nextvalue;
    values.dist_6_x = list.xpos.nextvalue;
  values.dist_6_y = list.ypos.nextvalue;

]
/ stimulusframes = [1=clearscreen]
/ trialduration = 0
/ validresponse = (0)
/ branch = [
  trial.clicktrial;
]
</trial>

<trial clicktrial>
/ ontrialend = [
  if (trial.clicktrial.response == "target_1") {
   if (values.target_1 == 0) {
    values.target_1 = 1;
    text.target_1_bg.textbgcolor = grey;
   } else if (values.target_1 == 1) {
    values.target_1 = 0;
    text.target_1_bg.textbgcolor = white;
   }
  };
  if (trial.clicktrial.response == "target_2") {
   if (values.target_2 == 0) {
    values.target_2 = 1;
    text.target_2_bg.textbgcolor = grey;
   } else if (values.target_2 == 1) {
    values.target_2 = 0;
    text.target_2_bg.textbgcolor = white;
   }
  };
  if (trial.clicktrial.response == "target_3") {
   if (values.target_3 == 0) {
    values.target_3 = 1;
    text.target_3_bg.textbgcolor = grey;
   } else if (values.target_3 == 1) {
    values.target_3 = 0;
    text.target_3_bg.textbgcolor = white;
   }
  };
  if (trial.clicktrial.response == "dist_1") {
   if (values.dist_1 == 0) {
    values.dist_1 = 1;
    text.dist_1_bg.textbgcolor = grey;
   } else if (values.dist_1 == 1) {
    values.dist_1 = 0;
    text.dist_1_bg.textbgcolor = white;
   }
  };
      if (trial.clicktrial.response == "dist_2") {
   if (values.dist_2 == 0) {
    values.dist_2 = 1;
    text.dist_2_bg.textbgcolor = grey;
   } else if (values.dist_2 == 1) {
    values.dist_2 = 0;
    text.dist_2_bg.textbgcolor = white;
   }
  };
      if (trial.clicktrial.response == "dist_3") {
   if (values.dist_3 == 0) {
    values.dist_3 = 1;
    text.dist_3_bg.textbgcolor = grey;
   } else if (values.dist_3 == 1) {
    values.dist_3 = 0;
    text.dist_3_bg.textbgcolor = white;
   }
  };
      if (trial.clicktrial.response == "dist_4") {
   if (values.dist_4 == 0) {
    values.dist_4 = 1;
    text.dist_4_bg.textbgcolor = grey;
   } else if (values.dist_4 == 1) {
    values.dist_4 = 0;
    text.dist_4_bg.textbgcolor = white;
   }
  };
      if (trial.clicktrial.response == "dist_5") {
   if (values.dist_5 == 0) {
    values.dist_5 = 1;
    text.dist_5_bg.textbgcolor = grey;
   } else if (values.dist_5 == 1) {
    values.dist_5 = 0;
    text.dist_5_bg.textbgcolor = white;
   }
  };
      if (trial.clicktrial.response == "dist_6") {
   if (values.dist_6 == 0) {
    values.dist_6 = 1;
    text.dist_6_bg.textbgcolor = grey;
   } else if (values.dist_6 == 1) {
    values.dist_6 = 0;
    text.dist_6_bg.textbgcolor = white;
   }
  };
     
]

/ stimulusframes = [1=clearscreen, target_1_bg, target_2_bg,target_3_bg, dist_1_bg, dist_2_bg, dist_3_bg, dist_4_bg, dist_5_bg, dist_6_bg, target_1, target_2, target_3, dist_1, dist_2, dist_3, dist_4, dist_5, dist_6, done, n_selected, spielregeln]
/ inputdevice = mouse
/ validresponse = (target_1, target_2, target_3, dist_1, dist_2, dist_3, dist_4, dist_5, dist_6, done)
/ branch = [
  if (trial.clicktrial.response != "done") {
   return trial.clicktrial;
  };
]
/ branch = [
  if (trial.clicktrial.response == "done" && expressions.n_selected != 3) {
   return trial.errortrial;
  };
    
    if (trial.clicktrial.response == "done" && expressions.n_selected == 3 && expressions.richtig != 3) {
        return trial.notgoodtrial;
    };
    
    else {
   return trial.successtrial;
  }
]
/ recorddata = true

</trial>

<trial errortrial>
/ stimulusframes = [1=clearscreen, target_1_bg, target_2_bg,target_3_bg, dist_1_bg, dist_2_bg, dist_3_bg, dist_4_bg, dist_5_bg, dist_6_bg, target_1, target_2, target_3, dist_1, dist_2, dist_3, dist_4, dist_5, dist_6, done, n_selected, errormsg, spielregeln]
/ trialduration = 1000
/ validresponse = (0)
/ recorddata = false
/ branch = [
  return trial.clicktrial;
]
</trial>

<trial successtrial>
/ stimulusframes = [1=clearscreen, successmsg]
/ trialduration = 1000
/ validresponse = (0)
/ recorddata = false

</trial>


<trial notgoodtrial>
/ stimulusframes = [1=clearscreen, notgoodmsg]
/ trialduration = 1000
/ validresponse = (0)
/ recorddata = false
/ branch = [
  return trial.start;
]
</trial>

<text notgoodmsg>
/ items = ("blablablabla")
/ erase = false
</text>


<text spielregeln>
/ items = ("Spielregeln ~n~nMarkiere die drei setbildenden Karten. Jede Eigenschaft für sich betrachtet muss auf den drei Karten entweder dreimal genau gleich oder dreimal vollkommen unterschiedlich sein. ")
/ position = (70%, 20%)
/ size = (20%, 20%)
/ hjustify = left
/ erase = false
</text>


<text n_selected>
/ items = ("Gewählte Karten: <%expressions.n_selected%>")
/ position = (70%, 70%)
/ erase = false
</text>

<button done>
/ caption = "Abgabe"
/ position = (70%, 90%)
/ size = (15%, 10%)
/ erase = false
</button>

<text errormsg>
/ items = ("Bitte wähle genau drei Karten aus.")
/ txcolor = red
/ erase = false
</text>

<text successmsg>
// items = ("You identified <%values.target_1 + values.target_2 + values.target_3%> of the SET.")
/ items = ("Runde <%values.set+1%>")
/ txcolor = green
/ erase = false
</text>


<instruct>
/ nextlabel = "Weiter"
/ prevlabel = "Zurück "
/ lastlabel = "Weiter"
/ inputdevice = mouse
/ font = ("Arial", -24, 400, 0, 34)
/ windowsize = (95%,95%)
</instruct>

<htmlpage Instruktion>
/ file = "test.htm"
</htmlpage>

<text targets>
/items = ("You identified <%values.target_1 + values.target_2 + values.target_3%> of the SET.")
</text>


<block uebungsaufgaben>
/ preinstructions = (Instruktion)
/ trials = [1-3=start]
</block>



<data>
/ columns = (date time subject group session blocknum blockcode
trialnum trialcode latency expressions.falsch expressions.richtig
values.set values.target_1 values.target_2
values.target_3 values.dist_1
values.dist_2 values.dist_3
values.dist_4 values.dist_5
values.dist_6 )
/ separatefiles = true
</data>


Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 105K

Please do not paste entire scripts into a post's body. Attach the respective script instead. In addition, if the script requires external files (images, etc.) to run, please provide those files as well.

natash
natash
Associate Member (201 reputation)Associate Member (201 reputation)Associate Member (201 reputation)Associate Member (201 reputation)Associate Member (201 reputation)Associate Member (201 reputation)Associate Member (201 reputation)Associate Member (201 reputation)Associate Member (201 reputation)
Group: Forum Members
Posts: 14, Visits: 38
Dave - 5/18/2020

Please do not paste entire scripts into a post's body. Attach the respective script instead. In addition, if the script requires external files (images, etc.) to run, please provide those files as well.

Sorry, will not happen again!
Attachments
set 20200517.zip (207 views, 295.00 KB)
Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 105K
natash - 5/18/2020
Dave - 5/18/2020

Please do not paste entire scripts into a post's body. Attach the respective script instead. In addition, if the script requires external files (images, etc.) to run, please provide those files as well.

Sorry, will not happen again!

Thanks for providing the files. See the attached revision for details.
Attachments
instruktion.iqx (190 views, 13.00 KB)
natash
natash
Associate Member (201 reputation)Associate Member (201 reputation)Associate Member (201 reputation)Associate Member (201 reputation)Associate Member (201 reputation)Associate Member (201 reputation)Associate Member (201 reputation)Associate Member (201 reputation)Associate Member (201 reputation)
Group: Forum Members
Posts: 14, Visits: 38
Dave - 5/18/2020
natash - 5/18/2020
Dave - 5/18/2020

Please do not paste entire scripts into a post's body. Attach the respective script instead. In addition, if the script requires external files (images, etc.) to run, please provide those files as well.

Sorry, will not happen again!

Thanks for providing the files. See the attached revision for details.

thank you!!
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search