Generating random sequences with constraints


Author
Message
SanneBos
SanneBos
Associate Member (112 reputation)Associate Member (112 reputation)Associate Member (112 reputation)Associate Member (112 reputation)Associate Member (112 reputation)Associate Member (112 reputation)Associate Member (112 reputation)Associate Member (112 reputation)Associate Member (112 reputation)
Group: Forum Members
Posts: 7, Visits: 19
Dave - 5/18/2021
SanneBos - 5/18/2021
Dave - 5/18/2021
SanneBos - 5/18/2021
SanneBos - 5/18/2021
Hi Dave,

Based on your comment on the difficulties with my constraints I hard coded the sequences. That fixed my issues, and the experiment works almost completely now.

Now, some other part of my script fails...

I use the code below to run one of five different hard-coded sequences (Further specified within block.ADHD1, and different per block)

<expt>
    / blocks = [
        1 =list.blockSelectorADHD; ]
</expt>

<list blockSelectorADHD>
    / items = (block.ADHD1, block.ADHD2, block.ADHD3, block.ADHD4, block.ADHD5)
    / selectionmode = random
</list>

This works for most of my code.
However, in the end of my experiment I also have a random sequence of 5 rounds of blocks that shoud be followed by a specific surveypage;
For example: surveypage 1, block1 - - surveypage 2, block2 - - surveypage 5, block5 - - surveypage 4, block4 - - surveypage 3, block3

In my old version of the experiment I used:     
<expt>
    / blocks = [
          1-5 = noreplace(survey1, survey2, survey3, survey4, survey5); ]
</expt>

With the survey's branching to that specific block.

However, the two techniques don't mix, as I am not allowed to branch in my survey to a list.blockSelector...

Do you know a way to work around this?
It would be ideal if I could branch to a list, but that doesn't work...




Small addition: what makes it difficult is that there is a preinstruction html page before each block... So the order is surveypage - preinstruction - other trials... That's where I'm stuck currently.

> However, the two techniques don't mix, as I am not allowed to branch in my survey to a list.blockSelector...

This is not true, why do you believe that to be the case?

When I run my script, I get the error:
The element 'blockSelectorRelaties' returned by branch expression 'blockSelectorRelaties' is the wrong type.

And the blocks don't run, only the surveys work.

To /branch to a block object contained in a list, you ought to do

<block StroopInstructionsDL_werk>
  / preinstructions = (expronde3A)
  / branch = [list.blockSelectorWerk.nextvalue]
</block>

<block StroopInstructionsDL_sociaal>
  / preinstructions = (expronde3A)
  / branch = [list.blockSelectorSociaal.nextvalue]
</block>

<block StroopInstructionsDL_relaties>
  / preinstructions = (expronde3A)
  / branch = [list.blockSelectorRelaties.nextvalue]
</block>

<block StroopInstructionsDL_hobby>
  / preinstructions = (expronde3A)
  / branch = [list.blockSelectorHobby.nextvalue]
</block>

<block StroopInstructionsDL_zelf>
  / preinstructions = (expronde3A)
  / branch = [list.blockSelectorZelf.nextvalue]
</block>

nextvalue is what actually causes an item from the list (here: a block object) to be sampled. list.blockselector in /branch returns nothing in and of itself in /branch, i.e. not a block object.

Thanks! Everything works now!
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search