﻿<?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 3  » video.foo.currentitem does not return correct value</title><generator>InstantForum 2017-1 Final</generator><description>Millisecond Forums</description><link>https://forums.millisecond.com/</link><webMaster>Millisecond Forums</webMaster><lastBuildDate>Fri, 18 Sep 2026 17:02:04 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: video.foo.currentitem does not return correct value</title><link>https://forums.millisecond.com/Topic8846.aspx</link><description>&lt;p&gt;[quote]So my conclusion is that using this method, the currentitem is not updated until the element is called in the stimulustimes attribute[/quote]&lt;/p&gt;
&lt;p&gt;Yes. Sampling for elements occurs in the order specified in /stimulusframes or /stimulustimes.&lt;/p&gt;</description><pubDate>Mon, 08 Oct 2012 13:52:29 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>RE: video.foo.currentitem does not return correct value</title><link>https://forums.millisecond.com/Topic8845.aspx</link><description>&lt;p&gt;So I have a partial answer, with a followup question. &amp;nbsp;The two references (in the text element and Item_number assignment statement) were wrong because they occurred before the video.prompt_snd item was updated with the current item index. &amp;nbsp;When I moved the text element after the prompt_snd element in the stimulustimes line, the problem was fixed. &amp;nbsp;Similarly, when I moved the item_number assignment to ontrialend instead of ontrialbegin, that problem was fixed. &amp;nbsp;So my conclusion is that using this method, the currentitem is not updated until the element is called in the stimulustimes attribute. &amp;nbsp;Is that correct? &amp;nbsp;&lt;/p&gt;

&lt;p&gt;Jeff&lt;/p&gt;</description><pubDate>Mon, 08 Oct 2012 13:18:55 GMT</pubDate><dc:creator>jmwotw</dc:creator></item><item><title>RE: video.foo.currentitem does not return correct value</title><link>https://forums.millisecond.com/Topic8837.aspx</link><description>&lt;p&gt;Since the simplified, yet analogous &lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;&lt;span style="font-family: courier new,courier;"&gt;&amp;lt;values&amp;gt;&lt;br /&gt;/ Item_index = 0&lt;br /&gt;&amp;lt;/values&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;text mytext&amp;gt;&lt;br /&gt;/ items = myitems&lt;br /&gt;/ select = values.Item_index&lt;br /&gt;/ position = (50%, 40%)&lt;br /&gt;&amp;lt;/text&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;text item_name&amp;gt;&lt;br /&gt;/ items = (" Item name = &amp;lt;% text.mytext.currentitem %&amp;gt;")&lt;br /&gt;/ position = (50%, 60%)&lt;br /&gt;&amp;lt;/text&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;item myitems&amp;gt;&lt;br /&gt;/ 1 = "A"&lt;br /&gt;/ 2 = "B"&lt;br /&gt;/ 3 = "C"&lt;br /&gt;/ 4 = "D"&lt;br /&gt;&amp;lt;/item&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;trial mytrial&amp;gt;&lt;br /&gt;/ ontrialbegin = [values.Item_index=noreplace(1,2,3,4)]&lt;br /&gt;/ stimulusframes = [1=mytext, item_name]&lt;br /&gt;/ validresponse = (anyresponse)&lt;br /&gt;&amp;lt;/trial&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;block myblock&amp;gt;&lt;br /&gt;/ trials = [1-4=mytrial]&lt;br /&gt;&amp;lt;/block&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;works perfectly fine as far as I can tell (also with &amp;lt;video&amp;gt; elements instead of &amp;lt;text&amp;gt;, I would suspect there is a mistake somewhere in your script's logic. Since the script you attached cannot be run due to the missing dependencies (picture, video and sound files), I can't tell you where that mistake may be. I would recommend you first make a simple test case script along the lines of the above, verify that it works as intended and then go back to the full script to track down the error(s).&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;~Dave&lt;/p&gt;
</description><pubDate>Mon, 08 Oct 2012 07:22:27 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>video.foo.currentitem does not return correct value</title><link>https://forums.millisecond.com/Topic8836.aspx</link><description>&lt;p&gt;I am trying to use the currentitem reference to a video element, but even though the correct video plays during the trial, the references to it returns the value of the previous item. &amp;nbsp;For example, if the first two items are "Item001" and "Item002", then during the first trial, "Item001" plays, during the second trial, "Item002" plays, but the references to video.prompt_snd.currentitem return "Item001" during both trials. &amp;nbsp;&lt;/p&gt;

&lt;p&gt;
&lt;p class="MsoNormal"&gt;&lt;span&gt;&amp;lt;video Prompt_snd&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span&gt;/ items = Prompt&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span&gt;/ select = values.Item_index&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;lt;/video&amp;gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&amp;lt;text item_name&amp;gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;	&lt;/span&gt;/ items = (" &amp;lt;% &lt;b&gt;video.prompt_snd.currentitem&lt;/b&gt; %&amp;gt;")&lt;/p&gt;
&lt;p&gt;&amp;lt;/text&amp;gt;&lt;/p&gt;

&lt;p&gt;&amp;lt;trial test1_trials&amp;gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&amp;nbsp; / ontrialbegin = [expressions.Update_item_index]&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;span&gt;	&lt;/span&gt;/ ontrialbegin = [values.item_number = substring(&lt;b&gt;video.prompt_snd.currentitem&lt;/b&gt;, 0, 8)]&lt;/p&gt;
&lt;div&gt;...&lt;/div&gt;
&lt;div&gt;&amp;lt;/trial&amp;gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;p&gt;&amp;lt;expressions&amp;gt;&lt;/p&gt;
&lt;p&gt;/ Update_item_index =&lt;/p&gt;
&lt;p&gt;&amp;nbsp;if (values.block == 11) values.Item_index = counter.PK1_1_EBLMC_items.selectedvalue;&lt;/p&gt;
&lt;p&gt;&amp;lt;/expressions&amp;gt;&lt;/p&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;/p&gt;</description><pubDate>Mon, 08 Oct 2012 07:00:02 GMT</pubDate><dc:creator>jmwotw</dc:creator></item></channel></rss>