Why doesn't this script loop?


Author
Message
Nick Riches
Nick Riches
Esteemed Member (2K reputation)Esteemed Member (2K reputation)Esteemed Member (2K reputation)Esteemed Member (2K reputation)Esteemed Member (2K reputation)Esteemed Member (2K reputation)Esteemed Member (2K reputation)Esteemed Member (2K reputation)Esteemed Member (2K reputation)
Group: Forum Members
Posts: 19, Visits: 69
Hi

I have a very basic query. My script doesn't loop through items. Below is a very simple Minimal Worked Example. It should loop through the sentences, but only displays 1. Thanks

Nick


<item sentences>
/ 1 = "A dog is a canine"
/ 2 = "A cat is a feline"
/ 3 = "A bear is ursine"
</item>

<item questions>
/ 1 = ""
/ 2 = "Did this sentence mention a cat?"
/ 3 = ""
</item>

<text sentence>
/ items = sentences
/ select = text.question.currentindex
</text>

<text question>
/ items = questions
</text>

<trial trial>
/ stimulusframes = [1-3 = noreplace(sentence)]
/ validresponse = ("Y", "N")
</trial>

<block block>
/ trials = [1 = trial]
</block>

<expt expt>
/ blocks = [1 = block]
</expt>


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
Nick Riches - Monday, November 20, 2017
Hi

I have a very basic query. My script doesn't loop through items. Below is a very simple Minimal Worked Example. It should loop through the sentences, but only displays 1. Thanks

Nick


<item sentences>
/ 1 = "A dog is a canine"
/ 2 = "A cat is a feline"
/ 3 = "A bear is ursine"
</item>

<item questions>
/ 1 = ""
/ 2 = "Did this sentence mention a cat?"
/ 3 = ""
</item>

<text sentence>
/ items = sentences
/ select = text.question.currentindex
</text>

<text question>
/ items = questions
</text>

<trial trial>
/ stimulusframes = [1-3 = noreplace(sentence)]
/ validresponse = ("Y", "N")
</trial>

<block block>
/ trials = [1 = trial]
</block>

<expt expt>
/ blocks = [1 = block]
</expt>


<trial trial>
/ stimulusframes = [1-3 = noreplace(sentence)]
/ validresponse = ("Y", "N")
</trial>

is not supposed to "loop" through sentences. A given stimulus object like <text sentence> will select one and only one item per trial, displaying the element repeatedly during the trial will not lead to a new selection. If you wish to display three different items during a trial, you need three different stimulus objects -- e.g. <text sentence_a> to <text sentence_c> -- and have your trial display all three.

Nick Riches
Nick Riches
Esteemed Member (2K reputation)Esteemed Member (2K reputation)Esteemed Member (2K reputation)Esteemed Member (2K reputation)Esteemed Member (2K reputation)Esteemed Member (2K reputation)Esteemed Member (2K reputation)Esteemed Member (2K reputation)Esteemed Member (2K reputation)
Group: Forum Members
Posts: 19, Visits: 69
Dave - Monday, November 20, 2017
Nick Riches - Monday, November 20, 2017
Hi

I have a very basic query. My script doesn't loop through items. Below is a very simple Minimal Worked Example. It should loop through the sentences, but only displays 1. Thanks

Nick


<item sentences>
/ 1 = "A dog is a canine"
/ 2 = "A cat is a feline"
/ 3 = "A bear is ursine"
</item>

<item questions>
/ 1 = ""
/ 2 = "Did this sentence mention a cat?"
/ 3 = ""
</item>

<text sentence>
/ items = sentences
/ select = text.question.currentindex
</text>

<text question>
/ items = questions
</text>

<trial trial>
/ stimulusframes = [1-3 = noreplace(sentence)]
/ validresponse = ("Y", "N")
</trial>

<block block>
/ trials = [1 = trial]
</block>

<expt expt>
/ blocks = [1 = block]
</expt>


<trial trial>
/ stimulusframes = [1-3 = noreplace(sentence)]
/ validresponse = ("Y", "N")
</trial>

is not supposed to "loop" through sentences. A given stimulus object like <text sentence> will select one and only one item per trial, displaying the element repeatedly during the trial will not lead to a new selection. If you wish to display three different items during a trial, you need three different stimulus objects -- e.g. <text sentence_a> to <text sentence_c> -- and have your trial display all three.

Thanks. I'm afraid I don't understand. This is identical to one of the walk-through examples: the IAT script (snippets shown below). A series of items are defined and these are plugged into the text object. Then a trial object is created, in which the property 'items' references the text object. This successfully loops through the items. As far as I can see, my example has exactly the same structure as this, but it doesn't loop. There must be something wrong which causes it not to loop.
<text pleasant>
/ items = pleasant
</text>

<item pleasant>
/ 1 = "   HONOR   "
/ 2 = "   LUCKY   "
/ 3 = "   DIAMOND   "
/ 4 = "   LOYAL   "
/ 5 = "   FREEDOM   "
/ 6 = "   RAINBOW   "
/ 7 = "   LOVE   "
/ 8 = "   HONEST   "
/ 9 = "   PEACE   "
/10 = "   HEAVEN   "
</item>

(see http://www.millisecond.com/support/docs/v5/html/tutorials/simpleiat/iatcreatingstimuli.htm)
 
<trial pleasant> 
/ stimulusframes = [1=pleasant]
/ validresponse = ("a", "5")
/ correctresponse = ("5")
</trial>

(see http://www.millisecond.com/support/docs/v5/html/tutorials/simpleiat/iatcreatingtrials.htm)




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
Nick Riches - Monday, November 20, 2017
Dave - Monday, November 20, 2017
Nick Riches - Monday, November 20, 2017
Hi

I have a very basic query. My script doesn't loop through items. Below is a very simple Minimal Worked Example. It should loop through the sentences, but only displays 1. Thanks

Nick


<item sentences>
/ 1 = "A dog is a canine"
/ 2 = "A cat is a feline"
/ 3 = "A bear is ursine"
</item>

<item questions>
/ 1 = ""
/ 2 = "Did this sentence mention a cat?"
/ 3 = ""
</item>

<text sentence>
/ items = sentences
/ select = text.question.currentindex
</text>

<text question>
/ items = questions
</text>

<trial trial>
/ stimulusframes = [1-3 = noreplace(sentence)]
/ validresponse = ("Y", "N")
</trial>

<block block>
/ trials = [1 = trial]
</block>

<expt expt>
/ blocks = [1 = block]
</expt>


<trial trial>
/ stimulusframes = [1-3 = noreplace(sentence)]
/ validresponse = ("Y", "N")
</trial>

is not supposed to "loop" through sentences. A given stimulus object like <text sentence> will select one and only one item per trial, displaying the element repeatedly during the trial will not lead to a new selection. If you wish to display three different items during a trial, you need three different stimulus objects -- e.g. <text sentence_a> to <text sentence_c> -- and have your trial display all three.

Thanks. I'm afraid I don't understand. This is identical to one of the walk-through examples: the IAT script (snippets shown below). A series of items are defined and these are plugged into the text object. Then a trial object is created, in which the property 'items' references the text object. This successfully loops through the items. As far as I can see, my example has exactly the same structure as this, but it doesn't loop. There must be something wrong which causes it not to loop.
<text pleasant>
/ items = pleasant
</text>

<item pleasant>
/ 1 = "   HONOR   "
/ 2 = "   LUCKY   "
/ 3 = "   DIAMOND   "
/ 4 = "   LOYAL   "
/ 5 = "   FREEDOM   "
/ 6 = "   RAINBOW   "
/ 7 = "   LOVE   "
/ 8 = "   HONEST   "
/ 9 = "   PEACE   "
/10 = "   HEAVEN   "
</item>

(see http://www.millisecond.com/support/docs/v5/html/tutorials/simpleiat/iatcreatingstimuli.htm)
 
<trial pleasant> 
/ stimulusframes = [1=pleasant]
/ validresponse = ("a", "5")
/ correctresponse = ("5")
</trial>

(see http://www.millisecond.com/support/docs/v5/html/tutorials/simpleiat/iatcreatingtrials.htm)




No,

<trial pleasant> 
/ stimulusframes = [1=pleasant]
...
</trial>

is supposed to display the stimulus "pleasant" -- a single item will be shown per trial.


<trial trial>
/ stimulusframes = [1-3 = noreplace(sentence)]
...
</trial>

But you seem to expect the above to display "sentence" three times, each time showing a different item.
That is not the case, as I explained above.

If you were to run <trial trial> three times in a row, you would get three different items -- one per instance of the trial.

Nick Riches
Nick Riches
Esteemed Member (2K reputation)Esteemed Member (2K reputation)Esteemed Member (2K reputation)Esteemed Member (2K reputation)Esteemed Member (2K reputation)Esteemed Member (2K reputation)Esteemed Member (2K reputation)Esteemed Member (2K reputation)Esteemed Member (2K reputation)
Group: Forum Members
Posts: 19, Visits: 69
Dave - Monday, November 20, 2017
Nick Riches - Monday, November 20, 2017
Dave - Monday, November 20, 2017
Nick Riches - Monday, November 20, 2017
Hi

I have a very basic query. My script doesn't loop through items. Below is a very simple Minimal Worked Example. It should loop through the sentences, but only displays 1. Thanks

Nick


<item sentences>
/ 1 = "A dog is a canine"
/ 2 = "A cat is a feline"
/ 3 = "A bear is ursine"
</item>

<item questions>
/ 1 = ""
/ 2 = "Did this sentence mention a cat?"
/ 3 = ""
</item>

<text sentence>
/ items = sentences
/ select = text.question.currentindex
</text>

<text question>
/ items = questions
</text>

<trial trial>
/ stimulusframes = [1-3 = noreplace(sentence)]
/ validresponse = ("Y", "N")
</trial>

<block block>
/ trials = [1 = trial]
</block>

<expt expt>
/ blocks = [1 = block]
</expt>


<trial trial>
/ stimulusframes = [1-3 = noreplace(sentence)]
/ validresponse = ("Y", "N")
</trial>

is not supposed to "loop" through sentences. A given stimulus object like <text sentence> will select one and only one item per trial, displaying the element repeatedly during the trial will not lead to a new selection. If you wish to display three different items during a trial, you need three different stimulus objects -- e.g. <text sentence_a> to <text sentence_c> -- and have your trial display all three.

Thanks. I'm afraid I don't understand. This is identical to one of the walk-through examples: the IAT script (snippets shown below). A series of items are defined and these are plugged into the text object. Then a trial object is created, in which the property 'items' references the text object. This successfully loops through the items. As far as I can see, my example has exactly the same structure as this, but it doesn't loop. There must be something wrong which causes it not to loop.
<text pleasant>
/ items = pleasant
</text>

<item pleasant>
/ 1 = "   HONOR   "
/ 2 = "   LUCKY   "
/ 3 = "   DIAMOND   "
/ 4 = "   LOYAL   "
/ 5 = "   FREEDOM   "
/ 6 = "   RAINBOW   "
/ 7 = "   LOVE   "
/ 8 = "   HONEST   "
/ 9 = "   PEACE   "
/10 = "   HEAVEN   "
</item>

(see http://www.millisecond.com/support/docs/v5/html/tutorials/simpleiat/iatcreatingstimuli.htm)
 
<trial pleasant> 
/ stimulusframes = [1=pleasant]
/ validresponse = ("a", "5")
/ correctresponse = ("5")
</trial>

(see http://www.millisecond.com/support/docs/v5/html/tutorials/simpleiat/iatcreatingtrials.htm)




No,

<trial pleasant> 
/ stimulusframes = [1=pleasant]
...
</trial>

is supposed to display the stimulus "pleasant" -- a single item will be shown per trial.


<trial trial>
/ stimulusframes = [1-3 = noreplace(sentence)]
...
</trial>

But you seem to expect the above to display "sentence" three times, each time showing a different item.
That is not the case, as I explained above.

If you were to run <trial trial> three times in a row, you would get three different items -- one per instance of the trial.

Okay. I see now. The series needs to be specified for the block object, not the trial object. The following code works...


<item sentences>
/ 1 = "A dog is a canine"
/ 2 = "A cat is a feline"
/ 3 = "A bear is ursine"
</item>

<item questions>
/ 1 = ""
/ 2 = "Did this sentence mention a cat?"
/ 3 = ""
</item>

<text sentence>
/ items = sentences
</text>

<text question>
/ items = questions
</text>

<trial trial>
/ stimulusframes = [1 = sentence]
/ validresponse = ("Y", "N")
</trial>

<block block>
/ trials = [1-3 = trial]
</block>


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search