Randomise trial timings


Author
Message
jacklee-w
jacklee-w
Expert (1.3K reputation)Expert (1.3K reputation)Expert (1.3K reputation)Expert (1.3K reputation)Expert (1.3K reputation)Expert (1.3K reputation)Expert (1.3K reputation)Expert (1.3K reputation)Expert (1.3K reputation)
Group: Forum Members
Posts: 12, Visits: 84
Hi all,

Just a little thing - I have a reading task on the go with intermittent probes and want to randomise the time it takes for them to appear.

The part of the script concerned is:

<trial readingtrialHAT>
/ ontrialend = [if (trial.readingtrialHAT.response==205 && values.pagenumber < values.npages) values.pagenumber +=1;
  if (trial.readingtrialHAT.response==203 && values.pagenumber > 1) values.pagenumber -= 1;]
/ ontrialend = [values.timeuntilprobe -= trial.readingtrialHAT.latency]
/ stimulusframes = [1=pagetext]
/ validresponse = (203, 205, 57)
/ timeout = values.timeuntilprobe
/ branch = [if (trial.readingtrialHAT.response == 0) trial.HATtrial else trial.readingtrialHAT]
</trial>

<trial HATtrial>
/ ontrialend = [values.probenumber += 1;
  values.timeuntilprobe = values.probeinterval]
/ stimulusframes = [1=clearscreen, probepromptHAT; 2=picture.hat]
/ correctresponse = ("y", "n")
/ validresponse = ("y", "n")
/ branch = [trial.readingtrialHAT]
</trial>

<values>
/ npages = 20
/ pagenumber = 1
/ probeinterval = 10000
/ timeuntilprobe = values.probeinterval
/ nprobes = 8
/ probenumber = 0
/ completed = 0
</values>

I thought changing '10000' in /probeinterval to replace(30000,40000,50000,60000) would do the trick- which is the effect I want- but it seems to just select the last value and use it consistently.

Any ideas as to what I'm missing?

Thanks!
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
jacklee-w - Monday, July 31, 2017
Hi all,

Just a little thing - I have a reading task on the go with intermittent probes and want to randomise the time it takes for them to appear.

The part of the script concerned is:

<trial readingtrialHAT>
/ ontrialend = [if (trial.readingtrialHAT.response==205 && values.pagenumber < values.npages) values.pagenumber +=1;
  if (trial.readingtrialHAT.response==203 && values.pagenumber > 1) values.pagenumber -= 1;]
/ ontrialend = [values.timeuntilprobe -= trial.readingtrialHAT.latency]
/ stimulusframes = [1=pagetext]
/ validresponse = (203, 205, 57)
/ timeout = values.timeuntilprobe
/ branch = [if (trial.readingtrialHAT.response == 0) trial.HATtrial else trial.readingtrialHAT]
</trial>

<trial HATtrial>
/ ontrialend = [values.probenumber += 1;
  values.timeuntilprobe = values.probeinterval]
/ stimulusframes = [1=clearscreen, probepromptHAT; 2=picture.hat]
/ correctresponse = ("y", "n")
/ validresponse = ("y", "n")
/ branch = [trial.readingtrialHAT]
</trial>

<values>
/ npages = 20
/ pagenumber = 1
/ probeinterval = 10000
/ timeuntilprobe = values.probeinterval
/ nprobes = 8
/ probenumber = 0
/ completed = 0
</values>

I thought changing '10000' in /probeinterval to replace(30000,40000,50000,60000) would do the trick- which is the effect I want- but it seems to just select the last value and use it consistently.

Any ideas as to what I'm missing?

Thanks!

The proper way to do this is to sample the intervals from a <list>:

<values>
/ npages = 20
/ pagenumber = 1
/ timeuntilprobe = 0
/ nprobes = 8
/ probenumber = 0
</values>

<list probeintervals>
/ items = (30000,40000,50000,60000)
/ replace = true
</list>


<block myblock>
/ onblockbegin = [
    values.timeuntilprobe = list.probeintervals.nextvalue
]

/ stop = [values.probenumber == values.nprobes]
/ trials = [1=readingtrial]
</block>

<trial readingtrial>
/ ontrialend = [if (trial.readingtrial.response==205 && values.pagenumber < values.npages) values.pagenumber +=1;
    if (trial.readingtrial.response==203 && values.pagenumber > 1) values.pagenumber -= 1;]
/ ontrialend = [values.timeuntilprobe -= trial.readingtrial.latency]
/ stimulusframes = [1=pagetext]
/ validresponse = (203, 205)
/ timeout = values.timeuntilprobe
/ branch = [if (trial.readingtrial.response == 0) openended.probetrial else trial.readingtrial]
</trial>

<openended probetrial>
/ ontrialend = [values.probenumber += 1;
    values.timeuntilprobe = list.probeintervals.nextvalue]
/ stimulusframes = [1=clearscreen, probeprompt]
/ branch = [trial.readingtrial]
</openended>

<text pagetext>
/ items = pageitems
/ erase = false
/ size = (90%, 90%)
/ select = values.pagenumber
</text>

<item pageitems>
/ 1 = "Page 01 Text..."
/ 2 = "Page 02 Text..."
/ 3 = "Page 03 Text..."
/ 4 = "Page 04 Text..."
/ 5 = "Page 05 Text..."
/ 6 = "Page 06 Text..."
/ 7 = "Page 07 Text..."
/ 8 = "Page 08 Text..."
/ 9 = "Page 09 Text..."
/ 10 = "Page 10 Text..."
/ 11 = "Page 11 Text..."
/ 12 = "Page 12 Text..."
/ 13 = "Page 13 Text..."
/ 14 = "Page 14 Text..."
/ 15 = "Page 15 Text..."
/ 16 = "Page 16 Text..."
/ 17 = "Page 17 Text..."
/ 18 = "Page 18 Text..."
/ 19 = "Page 19 Text..."
/ 20 = "Page 20 Text..."
</item>

<text probeprompt>
/ items = ("What are you thinking about right now?")
/ position = (50%, 10%)
</text>


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search