Dynamic numbers of trials / Conditional trialnumber


Author
Message
Jeff
Jeff
Guru (8.9K reputation)Guru (8.9K reputation)Guru (8.9K reputation)Guru (8.9K reputation)Guru (8.9K reputation)Guru (8.9K reputation)Guru (8.9K reputation)Guru (8.9K reputation)Guru (8.9K reputation)
Group: Forum Members
Posts: 49, Visits: 123

Hi all.  Is it possible to conditionally specify the number of trials in a block element?  I've tried a couple of different approaches (below), but I keep getting an 'invalid syntax' error.  More details attached.




<block K_Prac_block>



/ trials = [1 - values.LETTER_item_num = noreplace(LETTER_Prac_trials)]


   </block>



I've also tried this (both with and without quotes):



<block K_Prac_block>


/ trials = [1 - "<%values.LETTER_item_num%>" = noreplace(LETTER_Prac_trials)]


</block>




Thanks,


Jeff


Attachments
Conditional_trialnumber.exp (754 views, 988 bytes)
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: 103K

Syntax like the one above is not permitted. You need to implement this differently, e.g. using a /stop attribute.


<values>
/ ntrials = 40
</values>

<block myblock>
/ stop = [block.myblock.trialcount>values.ntrials]
/ trials = [1-10000=mytrial]
</block>


Regards,


~Dave


Jeff
Jeff
Guru (8.9K reputation)Guru (8.9K reputation)Guru (8.9K reputation)Guru (8.9K reputation)Guru (8.9K reputation)Guru (8.9K reputation)Guru (8.9K reputation)Guru (8.9K reputation)Guru (8.9K reputation)
Group: Forum Members
Posts: 49, Visits: 123

Thanks, Dave.  That did the trick.  To clarify for those who find this later, the stop attribute executes after the block has run so if the ntrials variable equals the maximum, then the stop function should be 


/ stop = [block.myblock.trialcount >values.ntrials]


Jeff


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search