Random group of questions with style="display: none;"

More
3 months 1 week ago #156767 by teracomp
teracomp created the topic: Random group of questions with style="display: none;"
I have a long survey, 250 questions. The first 125 questions are 25 groups for ranking 5 each. That works fine.
The next five sections include 25 questions each with a Randomization Group Name set to 'practices'

If the user selects Resume Later the items are saved, but when they return, most of the questions are not visible. For some reason, most questions have a style set to "display: none;" (see attached)

The users CANNOT complete the survey because there are mandatory questions that are hidden from their view.

Have I missed a setting somewhere??

This survey is live and on a short-runtime since it's used for validation purposes. Greatly appreciate a prompt response.

Thanks!
dave

Dave Phillips
Attachments:

Please Log in to join the conversation.

More
3 months 1 week ago #156790 by teracomp
teracomp replied the topic: Random group of questions with style="display: none;"
Two of my subject matter experts have abandoned this survey because of this bug.

Please tell me I've made a mistake and point me in the right direction.

dp

Dave Phillips

Please Log in to join the conversation.

More
3 months 1 week ago - 3 months 1 week ago #156799 by olle
olle replied the topic: Random group of questions with style="display: none;"
Randomization with "Resume later" is basically useless, since the randomization will be renewed on each visit. This is fixed in LS 3.0 (not yet released), where the random seed is saved together with the participant response, this way preserving the random order between visits.
Last Edit: 3 months 1 week ago by olle.
The following user(s) said Thank You: teracomp

Please Log in to join the conversation.

More
3 months 1 week ago #156800 by teracomp
teracomp replied the topic: Random group of questions with style="display: none;"
So, I'm stuck.

My plan B is to stop the survey, randomize my 125 items externally, then import them in groups and eliminate the Randomization Group label.

Dave Phillips

Please Log in to join the conversation.

More
3 months 1 week ago #156802 by olle
olle replied the topic: Random group of questions with style="display: none;"
You can also use JavaScript to hide questions randomly.

Please Log in to join the conversation.

More
3 months 1 week ago #156804 by teracomp
teracomp replied the topic: Random group of questions with style="display: none;"
I really appreciate your thoughts on this. I have several LS surveys published and I'm really hoping to use it more extensively. This kind of issue makes those I'm supporting question the use of LS and puts me in a tight spot. And, of course, I didn't know Resume Later with randomized groups would cause such a problem.

I'm thinking that Resume Later will work by hiding those questions which are already answered, yes? As long as they're not randomly placed within the group, this should work.

I haven't implemented "Plan B" but intend to do that in the next hour or so.

Adding Javascript to each of the 125 questions doesn't seem like the best approach, though I'm guessing I could do this on the backend database in the question meta table somehow (seems risky). My goal is to make sure the items are not in sequential order as they are now (just to make admin easier).

Dave Phillips

Please Log in to join the conversation.

More
3 months 1 week ago #156805 by olle
olle replied the topic: Random group of questions with style="display: none;"
You would add JavaScript to the groups, not the questions (assuming your survey is organized by groups). Still, it might take some work to get it right.

Please Log in to join the conversation.

More
3 months 1 week ago #156806 by teracomp
teracomp replied the topic: Random group of questions with style="display: none;"
Ah yes, that makes more sense...I would need to find style="display: none;" and change that to block. This would reveal questions already answered, but since this is a validation survey, that might be ok.

I'll give that a try first. Thanks for the correction to my early morning thinking!

Dave Phillips

Please Log in to join the conversation.

More
3 months 1 week ago #156813 by teracomp
teracomp replied the topic: Random group of questions with style="display: none;"
Any feedback on the jQuery code would be appreciated.

What I want to do with the jQuery is grab all of the question divs and remove style="display: none;"

The div ids start with "question" so this should find all "question" divs and remove each style attribute

In each of the 5 group's source, I need to add:

<script type="text/javascript">
$( document ).ready(function() {
$("div[id^='question']").removeAttr("style");
});
</script>

With the style removed, the questions will then be displayed.

Please let me know if I'm thinking straight. This seems like the right idea.

Dave Phillips

Please Log in to join the conversation.

More
3 months 1 week ago #156815 by teracomp
teracomp replied the topic: Random group of questions with style="display: none;"
While this does show all of the divs, it is NOT the solution. Every time I select NEXT for a group, I get an error that all questions have not been answered (I assume this is because of RAND), the answers are lost and the page reloads with a bunch of unanswered questions.

I'm going to have to go back to the original idea of randomizing the questions and loading the groups with sets of randomized questions.

Looking forward to Version 3.0!

Dave Phillips

Please Log in to join the conversation.

More
3 months 6 days ago #156832 by DenisChenu
DenisChenu replied the topic: Random group of questions with style="display: none;"
To show one group in 5 : you can use a Equation question type with.
{if(is_empty(self.NAOK),alea(1,5),self.NAOK)}

Named 'groupChoose' and a condition on each group : groupChoose==1 etc …

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: LouisGac

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now