Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Preview Question Group is utterly broken

  • supernovus
  • supernovus's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 months 3 weeks ago #266773 by supernovus
Preview Question Group is utterly broken was created by supernovus
Please help us help you and fill where relevant:
Your LimeSurvey version: 6.6.3+240909
Own server or LimeSurvey hosting: own servers (9 VMs in Australia, 1 in UK, 2 in Canada).
Survey theme/template: iar2023
  - extends `vanilla`
  - custom.css: our own colour scheme and font-face rules
  - custom.js: a few helper functions to try to work around weirdness
==================

The Preview Question and Preview Question Group features have never worked very well, and are entirely broken in most cases.

First of all, if you open a question group in the middle of a survey that has a condition set, it doesn't disable the condition checks, and the preview is usually of a mostly empty page as all the questions in the group are hidden by default. Not a particularly good design for a PREVIEW! See the first attachment for an example.

Well, up until recently I'd had a simple hack to work around that nonsense, in the form of a JS function:
Code:
IAR.fixPreview = function()
{
// Remove the 'hidden' and 'irrelevant' classes.
document.querySelectorAll('div,ul,li').forEach(el =>
el.classList.remove('ls-hidden', 'ls-irrelevant'));
}

Which worked alright (still annoying it was necessary). See the 2nd attachment for how it looks after I run that.

Well with the latest update, at least on certain question types ("Multiple numerical input" for example), as soon as I change a value in any input fields, it triggers the validation code, and bam, all the questions vanish again.

Not particularly useful for previewing a question design... which would be what a Preview function should be used for.

Any suggestions for how to correct this broken user experience?
 

Please Log in to join the conversation.

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team & Official Partner
  • LimeSurvey Community Team & Official Partner
More
2 months 2 weeks ago #266786 by DenisChenu
Replied by DenisChenu on topic Preview Question Group is utterly broken

 First of all, if you open a question group in the middle of a survey that has a condition set, it doesn't disable the condition checks, and the preview is usually of a mostly empty page as all the questions in the group are hidden by default. Not a particularly good design for a PREVIEW! See the first attachment for an example.

Yes : it's the desired behavior !
If you have condition on group : it was set to true always. Maybe you can move to Group condition ?
If you have conditions on question with value set on previous group : you can use prefill url in your preview : for example, if you have all question with condfition Q00 == "Y", just add on your url &Q00=Y

Why it's the desired behavior : because you need to have a way to test your condition in same group.

Any suggestions for how to correct this broken user experience? 

Start by community.limesurvey.org/feature-request/ or community.limesurvey.org/bug-tracker/

Maybe it can be interesting to have a preview where all conditions (on question and group) ,was set to true.

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. - Professional support - Plugins, theme and development .
I don't answer to private message.

Please Log in to join the conversation.

  • supernovus
  • supernovus's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 months 2 weeks ago #266800 by supernovus
Replied by supernovus on topic Preview Question Group is utterly broken
Thanks for that information, it's very helpful! Knowing that I can force the answers to previous questions via the URL is great. It won't help the actual staff using the app on a daily basis, as most of them are non-technical market researchers who wouldn't have the first clue on how to edit the URL.

I have the opposite problem, I'm an IT guy who doesn't use Limesurvey on a daily basis, and only tries to help the research team when they run into issues.

Now the biggest problem I've found is that due to the type of question (I've attached another screenshot) where it's using an array filter based on the answers to the previous question, the URL query string goes from:

?r=survey/index/action/previewgroup/sid/887291/gid/528

to:

?r=survey/index/action/previewgroup/sid/887291/gid/528/A7_1/Y/A7_2/Y/A7_3/Y/A7_4/Y/A7_5/Y/A7_6/Y/A7_7/Y/A7_8/Y/A7_9/Y/A7_10/Y/A7_11/Y/A7_12/Y/A7_13/Y/A7_14/Y/A7_15/Y/A7_16/Y/A7_99/N

Which isn't terrible, but I certainly wouldn't expect any of the non-technical users to type that in by hand!

I wonder how difficult it would be to write a floating element specific to the Preview page that shows any linked questions (in this case the array filter and an additional condition that skips the question entirely if set) and allows non-technical users to change the value. When I'm done my regular tasks today, I might look at writing something myself. If I knew the Limesurvey codebase better, I'd write it as a proper plugin, but for the time being it'll likely end up being a snippet of JS that we can add to our custom.js and have run when it detects the preview page is in use. Which shouldn't be too difficult thanks to the em_javascript.js being available on the preview pages.

Thanks again, cheers!

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose