Welcome, Guest
Username: Password: Remember me

TOPIC: javascript to prev question

javascript to prev question 2 years 11 months ago #64439

  • Dean
  • Dean's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 2
  • Karma: 0
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:
<script>
if ("{INSERTANS:SIDXGIDXQID}" == "No"){
document.limesurvey.move.value = 'moveprev';
document.limesurvey.submit();
}
</script>

is there a way to track where a question is entered from and then transition back to that location?
The administrator has disabled public write access.

Re: javascript to prev question 2 years 11 months ago #64450

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4049
  • Thank you received: 739
  • Karma: 341
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")
Cheers,
Tony Partner

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

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.

Re: javascript to prev question 2 years 11 months ago #64612

  • TMSWhite
  • TMSWhite's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 759
  • Thank you received: 82
  • Karma: 36
Dean-

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.
The administrator has disabled public write access.

Re: javascript to prev question 2 years 10 months ago #64928

  • Dean
  • Dean's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 2
  • Karma: 0
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!
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.144 seconds
Donation Image