Problems getting random navigation working

3 years 6 days ago #106562 by mvdct
Hi Limesurvey community,

Can you help me? I've got stuck trying to apply random navigation paths through a questionnaire.

I'm adapting a survey I've used before. In the original version a random number was generated between 1 and 3.999 (inter-eq), and that number determined which question participants saw on the following question group (interventions). This worked great.

Now I'm trying to adapt the above format and I've got stuck. Attached are two cut down versions of where I am at.

Version 1 is very similar to the original. First a random number. Then a question based on that random number. The equations work fine. However, I'd put some javascript in the original survey to stop people advancing through the page too quickly. It worked fine in the original - where I didn't want anyone jumping through the questions. However, in this new version, despite the fact the javascript is only present in questions v1 and v2 it is also triggered for v3. So my question is this: is there any way the javascript can happen for v1 and v2 but not v3? (FYI: v3 is a control condition and doesn't need a delay)

In version 2, I was trying something slightly more complicated and create more navigation pathways through the questionnaire. So now, a random number is generated between 1 and 6.999. In the original version and version 1 it was straight forward, the relevance equation for the later questions was along the lines of: "audio == 1". In other words: "do this question only if the random number is this".

In version 2 I was wanting to trigger questions on the basis of: "audio == 1 or 2". In other words: "do this question if the random number is either 1 or 2". However when I entered that into the equation, the LS printing the question twice on the screen. I'm not sure what I'm doing wrong. My question is this: what should the relevance equation be?

As I say, both version 1 & 2 of the survey attached.


Tested in both IE and FF. LS: version 2.05+ Build 140116.

Please Log in to join the conversation.

3 years 5 days ago #106581 by tpartner
Regarding your first question - it's not possible that the JavaScript is acting on version 3 unless it is present there. It must be in the source of one of the questions or in template.js.

Your relevance equation for version 2 should be something like:
audio == 1 OR audio == 2


Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: mvdct

Please Log in to join the conversation.

3 years 3 days ago #106630 by mvdct

Thanks for correcting my error on the relevance equation. What you suggested works perfectly.

As for the JS. Apologies, let me clarify. I just checked again. There is no JS in the question v3, but there is in question v1 and v2 of the same question group. It should all be there in version1.lss in the first post.

Thanks again for your help.


Please Log in to join the conversation.