<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>General</title><link>https://www.infopathdev.com:443/forums/41.aspx</link><description>If you're not sure where to ask your question, ask it here. If necessary, our moderators will make sure it gets classified in the correct board.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Randomizing questions</title><link>https://www.infopathdev.com:443/forums/thread/57409.aspx</link><pubDate>Wed, 28 Jul 2010 12:47:46 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:57409</guid><dc:creator>mgarant</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/57409.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=57409</wfw:commentRss><description>&lt;p&gt;Ok, like I said before, you will need one hidden field in each of the question&amp;#39;s section with default value &amp;quot;0&amp;quot;. The name of these fields must be something like hiddenfield1, hiddenfield2, hiddenfield3, ..., hiddenfield40. In the code I gave you, replace [YourXpath] by the xPath of one of the fields, without the number (ex : hiddenfield). That way, the code will be able to put &amp;quot;1&amp;quot; inside the choosen fields in the code, and then your question will be visible. Of course, for each section you need to put conditional formatting. To do so, right click on the section --&amp;gt; conditional formatting. Click add and set the condition to be &amp;quot;hiddenfield1 equals 0&amp;quot;&amp;nbsp;and check&amp;nbsp;hide this control.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;If you need more info, don&amp;#39;t hesitate to ask.&lt;/p&gt;</description></item><item><title>Re: Randomizing questions</title><link>https://www.infopathdev.com:443/forums/thread/57393.aspx</link><pubDate>Wed, 28 Jul 2010 07:11:18 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:57393</guid><dc:creator>miggers</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/57393.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=57393</wfw:commentRss><description>&lt;p&gt;Hey mgarant!&lt;/p&gt;
&lt;p&gt;&amp;nbsp;I&amp;#39;ve been a bit busy with other work, but I&amp;#39;ve finally got a working code for my form.. It&amp;#39;s set as a loading event.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;The question remains, how do I use the numbers on my form? Like I said, I&amp;#39;m completely null with coding, so even this confuses me.. Could you please point me at the right way or something? If it&amp;#39;s too hard to refer on the randomly generated numbers, I was thinking that maybe I could just paste the results on a table inside a hidden view, and then make rules and conditions based on the numbers, but I don&amp;#39;t even know how to do that.. :)&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I already know how to use different rules and conditional formatting, but using code or data connection is a harder task.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Thanks!&lt;/p&gt;
&lt;p&gt;&amp;nbsp;-Mikko&lt;/p&gt;</description></item><item><title>Re: Randomizing questions</title><link>https://www.infopathdev.com:443/forums/thread/57152.aspx</link><pubDate>Wed, 21 Jul 2010 13:03:17 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:57152</guid><dc:creator>mgarant</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/57152.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=57152</wfw:commentRss><description>&lt;p&gt;Here is some code... I&amp;#39;m not sure if it will work but it will give you a good start.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;XPathNavigator root = MainDataSource.CreateNavigator(); &lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;for (int i=0; i&amp;lt;10; i++)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;Random random = new Random();&lt;br /&gt;&amp;nbsp;int question = random.Next(1, 40);&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp;string value = root.selectsinglenode(&amp;quot;[YourXPath]/my:HideQuestion&amp;quot; + question, NamespaceManager).Value;&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp;if(value == &amp;quot;0&amp;quot;) //or value == &amp;quot;false&amp;quot;&lt;br /&gt;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;root.selectsinglenode(&amp;quot;[YourXpath]/my:HideQuestion&amp;quot; + question, NamespaceManager).setValue(&amp;quot;1&amp;quot;);//or &amp;quot;true&amp;quot;&lt;br /&gt;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;else&lt;br /&gt;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;i--;&lt;br /&gt;&amp;nbsp;}&lt;br /&gt;}&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Where you see [YourXpath], it is the xpath of the control you want to access to. To have it, you need to select your control (in infopath), and go to the &amp;quot;Data Source&amp;quot; Panel. The data related to the control will be highlighted. Right click on it and select &amp;quot;Copy XPath&amp;quot;. Then you just have to paste it in the code.&lt;/p&gt;
&lt;p&gt;If you have any other question, don&amp;#39;t hesitate to ask!&lt;/p&gt;
&lt;p&gt;Hope that helps!&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Edit : This code is C# by the way&lt;/p&gt;</description></item><item><title>Re: Randomizing questions</title><link>https://www.infopathdev.com:443/forums/thread/57150.aspx</link><pubDate>Wed, 21 Jul 2010 12:44:11 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:57150</guid><dc:creator>mgarant</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/57150.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=57150</wfw:commentRss><description>&lt;p&gt;Hello miggers,&lt;/p&gt;
&lt;p&gt;To use code in your infopath form, usually you right click on the control you want the code related with, and select &amp;quot;programming&amp;quot; and &amp;quot;Changed event&amp;quot;. That will create an event handler on that control. But for now, what you want is an OnLoad event. To do so, you go to Tools -&amp;gt; Programming -&amp;gt; Loading Event.&amp;nbsp; I&amp;#39;ll try to make some code sample for you and post it here.&lt;/p&gt;</description></item><item><title>Re: Randomizing questions</title><link>https://www.infopathdev.com:443/forums/thread/57142.aspx</link><pubDate>Wed, 21 Jul 2010 07:53:08 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:57142</guid><dc:creator>miggers</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/57142.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=57142</wfw:commentRss><description>&lt;p&gt;Ok, usually it takes a couple of days to install anything on these company computers, but now I have Visual Studio..&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Now the problem is that since I am no coder, I haven&amp;#39;t been able to produce any working code with Visual Studio. In addition, I have no idea how to use code in my Infopath form..&lt;/p&gt;
&lt;p&gt;In the mean time, I&amp;#39;m googling for a way for help, but could you please help me get started with this?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Thank you!&lt;/p&gt;
&lt;p&gt;-Mikko&lt;/p&gt;</description></item><item><title>Re: Randomizing questions</title><link>https://www.infopathdev.com:443/forums/thread/57139.aspx</link><pubDate>Wed, 21 Jul 2010 05:55:22 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:57139</guid><dc:creator>miggers</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/57139.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=57139</wfw:commentRss><description>&lt;p&gt;Thanks for the answer!&lt;/p&gt;
&lt;p&gt;I&amp;#39;ll look into that, but now I&amp;#39;m having problems with the code.. So if I understand correctly, I need MS Visual Studio Tools for Applications to write some code? Or is it possible to write code in just Infopath?&lt;/p&gt;
&lt;p&gt;I&amp;#39;m asking because Visual Studio is not installed in this computer, although now I have requested for it.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;-Mikko&lt;/p&gt;</description></item><item><title>Re: Randomizing questions</title><link>https://www.infopathdev.com:443/forums/thread/57114.aspx</link><pubDate>Tue, 20 Jul 2010 12:54:41 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:57114</guid><dc:creator>mgarant</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/57114.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=57114</wfw:commentRss><description>&lt;p&gt;Hello miggers,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;You probably could do this using conditionnal formating and a little bit of code for your random function. Put each questions in a separate section. Insert a hidden text box for each questions with names like &amp;quot;HideQuestion1&amp;quot;, &amp;quot;HideQuestion2&amp;quot; (it is important that only the number changes from a text box to another). Set default value for each of them to something like 0 or &amp;quot;false&amp;quot;. On form load event, find a random function that you will use to pick 10 numbers from 1 to 40 and then set the related hidden fields to 1 or &amp;quot;true&amp;quot;.&amp;nbsp; Then, for each questions, set conditionnal formatting to hide the question if the related hidden fields is equal to 0 or &amp;quot;false&amp;quot;.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Hope that helps&lt;/p&gt;</description></item><item><title>Randomizing questions</title><link>https://www.infopathdev.com:443/forums/thread/57103.aspx</link><pubDate>Tue, 20 Jul 2010 09:59:36 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:57103</guid><dc:creator>miggers</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/57103.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=57103</wfw:commentRss><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;I am new to Infopath and I have been working on a questionnaire, which basically works, but I&amp;#39;d like to know if it&amp;#39;s possible to randomize the questions? Say, I have for example 40 questions, but I&amp;#39;d like the form to randomize&amp;nbsp;10 questions of out of the 40 every time the questionnaire is being taken.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;If I can&amp;#39;t get that working, it seems that I may have been working with Infopath for nothing.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;-Mikko&lt;/p&gt;</description></item></channel></rss>