working with a hidden index

More
3 years 7 months ago - 3 years 7 months ago #115842 by cshaw
cshaw created the topic: working with a hidden index
I am using the "Show question index / allow jumping" = Incremental, setting for a survey. However, I am suppressing the display of the index until the respondent reaches the end of the survey.
    <script type="text/javascript">
        $(document).ready(function() {
            $('#index').hide();        
            $("#index").remove();
            $('.withindex').removeClass('withindex');	
    });
    </script>

At which point I am providing a button by which the respondent can go back to the beginning of a group of questions and edit. That all works fine.

However: NOW I want to pass the page number $('thisstep').value() of the summary back when the user clicks my custom button to edit a previously answered question group, so that after that question group has been completed I will be able to give the option to jump back to the summary rather than clicking next until the summary is reached.

The tricky part is knowing how to get the summary page number from the summary page back to the group. My thought was to pass the information in a URL link rather than using a button. Not seeing how to trigger a URL to utilize the index control instead of a button control. And if I did get a URL to work, how to pass anything in the URL.

Crazy idea?
Last Edit: 3 years 7 months ago by cshaw.

Please Log in or Create an account to join the conversation.

More
3 years 7 months ago #115847 by DenisChenu
DenisChenu replied the topic: working with a hidden index
I think we allow only $_POST parameters for step, we must do own $_POST/submit . It can be done, but really tricky.

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .
The following user(s) said Thank You: cshaw

Please Log in or Create an account to join the conversation.

More
3 years 7 months ago #115862 by cshaw
cshaw replied the topic: working with a hidden index
It would be nice to be able to refer to a question later in the survey when your are allowing jumping.

In my particular case, respondents enter family member health history information, each relative in a separate group.

I provide a summary page after all the relatives have been entered. The summary includes buttons to jump back to edit the group for each relative's history.

When the respondent utilizes the buttons to return to a relative and edit, I have no way to know if they have already seen the overall summary or not, and whether or not I should provide a button (utilizing the index) to jump back to the overall summary after the edits.

Currently I can provide a button regardless, and if the summary hasn't been seen, clicking the button does nothing. However if the summary has been seen, clicking the button returns the respondent to the summary.

SO if I had any way to know that a later question had been visited (the overall summary) then I would know whether to hide the button that allows jumping. It seems wrong to have a button to show a summary when clicking on it has no action.

The problem is that when you attempt to refer to a question later in a survey, lime balks. This makes sense if the question has never been visited, or if you have used "Previous" to move back, which is like erasing answers.

However when utilizing the index and jumping to a previous question, you should be able to refer to the values previously entered. They do exist, when you jump back it is as if you had never left and you can view the values. SO it seems like we ought to be able to access them programmatically.

Maybe we can refer to a later question from earlier in the survey and I just don't know how, or maybe we can't and we should work on making it an option to allow references to later questions.

Please Log in or Create an account to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!