Check out the LimeSurvey source code on GitHub!

javascript to prev question

5 years 6 months ago #64439 by Dean
we have a survey comprised of 3 groups:
1) introduction: to confirm study participant information
2) withdrawal: if during introduction a participant decides to withdraw
3) end: one non-response question that marks the end of the intro

The conditional logic works such that in 4 questions in group 1) the reader
of the survey (an operator in a calling center speaking to a study participant) is directed to the withdrawal question group 2). The first question is whether or not the participant really wants to withdraw (y/n): if yes, the remainder of
the group 2) questions are processed. If no, I would like to have the survey revert back to the question in group 1) that originated transition to group 2). I have seen javascript (js) code that allows for movement one page back:
document.limesurvey.move.value = 'moveprev';

is there a way to track where a question is entered from and then transition back to that location?

Please Log in to join the conversation.

5 years 6 months ago #64450 by tpartner
I don't think this is possible without tons of coding.

Additionally, I think your "go back" script may be flawed. {INSERTANS} only works with questions on previous pages. I think you need a listener on the question(s) in group 2. (search the forum for "javascript listener")

Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

5 years 6 months ago #64612 by TMSWhite

Can you say more about what you'd want to do in Group 1 once you get back to it? Change the value of the responses? Change the down-stream behavior in Group 2 or later?

If the goal is to given the subject the opportunity to withdrawal, but then continue on if they decide not to withdraw, there may be other ways to encode the conditional logic (at least in forthcoming version 1.92).

LimeSurvey 1.92 will support more complex conditional logic. You can find details in the Expression Manager discussions.

I actually have several surveys myself where I ask some initial questions, compute whether the subject is a good fit for the survey, and conditionally give the subject the option to continue the survey even if the results are not normed for their population (as long as they understand the caveat that any recommendations might not be correct given their circumstances).

In the same survey, I ask 19 questions that are part of a scale score, then compute the standard deviation of their answers. If it exceeds a threshold, I let them know that their answers are too inconsistent, and give them the option to go back and change some of their answers, or affirmatively state that their answers are correct even though the survey may think they are inconsistent.

The new conditional logic system makes such navigation paths easy.

Please Log in to join the conversation.

5 years 6 months ago #64928 by Dean
sorry for the delayed response (on vacation for 2 wks). I know nothing about js yet, so couldnt attest to the validity of the posted snippet. We have decided to enable the prev button functionality for the callers to revert back to the transition. thanks for responding to my 1st post!

Please Log in to join the conversation.

Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form