﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>Millisecond Forums » Millisecond Forums » Inquisit 4  » Trouble randomly selecting items from more than one list</title><generator>InstantForum 2017-1 Final</generator><description>Millisecond Forums</description><link>https://forums.millisecond.com/</link><webMaster>Millisecond Forums</webMaster><lastBuildDate>Wed, 26 Aug 2026 03:56:34 GMT</lastBuildDate><ttl>20</ttl><item><title>Trouble randomly selecting items from more than one list</title><link>https://forums.millisecond.com/Topic17013.aspx</link><description>Hi, I'm new to Inquest so please forgive my ignorance. &lt;br/&gt;I'm trying to present stimuli in the following form 'a + b = ' and collect an open-ended response. I have specified two lists with the numbers 'a' and 'b' as follows:&lt;br/&gt;&lt;br/&gt;&amp;lt;list firstnumbers&amp;gt;&lt;br/&gt;/ items = (0,1,1, 1, 3, 3, etc.&lt;span style="font-size: 10pt;"&gt;)&lt;/span&gt;&lt;br/&gt;/ selectionmode = sequence&lt;br/&gt;&amp;lt;/list&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;list secondnumbers&amp;gt;&lt;br/&gt;/ items = (1,1,1, 2, 2, 2, etc.)&lt;br/&gt;/ selectionmode = sequence&lt;br/&gt;&amp;lt;/list&amp;gt;&lt;br/&gt;&lt;br/&gt;Through an expression 'generatemathproblems', I generate the strings 'a + b = ' and this works fine. However, what I would like to do is not to select the numbers 'a' and 'b' in sequence, but randomly &lt;span style="text-decoration: underline;"&gt;while preserving the correspondence between the numbers 'a' and 'b'.&lt;/span&gt;&amp;nbsp;In other words, if say, the fourth item is selected for 'a', then I want 'b' to be the fourth item too; the fourth however should be randomly chosen. I tried to make a list 'stimulustracker' with a randomly chosen index between 1 and the maxnumberstimuli but list doesn't seem to support 'select':&lt;br/&gt;&lt;br/&gt;&amp;lt;list stimulustracker&amp;gt;&lt;br/&gt;/ poolsize = values.maxnumberstimuli&lt;br/&gt;&amp;lt;/list&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;list firstnumbers&amp;gt;&lt;br/&gt;/ items = (0,1,1, 1, 3, 3, etc.)&lt;br/&gt;/ select = list.stimulustracker.nextindex&lt;br/&gt;&amp;lt;/lis&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;list secondnumbers&amp;gt;&lt;br/&gt;/ items = (1,1,1, 2, 2, 2, etc.)&lt;br/&gt;/ select = list.stimulustracker.currentindex&lt;br/&gt;&amp;lt;/list&amp;gt;&lt;br/&gt;&lt;br/&gt;Does anyone know how to solve this problem? Thanks a bunch!&lt;br/&gt;--Marieke</description><pubDate>Wed, 26 Aug 2015 08:00:19 GMT</pubDate><dc:creator>mvanrooij</dc:creator></item><item><title>RE: Trouble randomly selecting items from more than one list</title><link>https://forums.millisecond.com/Topic17015.aspx</link><description>It works! Thanks so much :)</description><pubDate>Wed, 26 Aug 2015 08:00:19 GMT</pubDate><dc:creator>mvanrooij</dc:creator></item><item><title>RE: Trouble randomly selecting items from more than one list</title><link>https://forums.millisecond.com/Topic17014.aspx</link><description>#1: Your &amp;lt;list&amp;gt; syntax is off. There is no /select attribute for &amp;lt;list&amp;gt; elements, the correct attribute is /selectionmode. That's why your syntax does not work, the &amp;lt;list&amp;gt;s are not paired.&lt;br/&gt;&lt;br/&gt;#2: You don't need a 3rd list to serve as index into the other two lists. You simply do:&lt;br/&gt;&lt;br/&gt;&amp;lt;block myblock&amp;gt;&lt;br/&gt;/ trials = [1-6=mytrial]&lt;br/&gt;&amp;lt;/block&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial mytrial&amp;gt;&lt;br/&gt;/ stimulusframes = [1=mytext]&lt;br/&gt;/ validresponse = (57)&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;list firstnumbers&amp;gt;&lt;br/&gt;/ items = (0,1,1,1,3,3)&lt;br/&gt;/ selectionmode = random&lt;br/&gt;&amp;lt;/list&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;list secondnumbers&amp;gt;&lt;br/&gt;/ items = (1,1,1,2,2,2)&lt;br/&gt;&lt;strong&gt;/ selectionmode = list.firstnumbers.currentindex&lt;/strong&gt;&lt;br/&gt;&amp;lt;/list&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;text mytext&amp;gt;&lt;br/&gt;/ items = ("&amp;lt;%list.firstnumbers.nextvalue%&amp;gt; + &amp;lt;%list.secondnumbers.nextvalue%&amp;gt; = ?")&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;</description><pubDate>Wed, 26 Aug 2015 07:39:36 GMT</pubDate><dc:creator>Dave</dc:creator></item></channel></rss>