Welcome to the LimeSurvey Community Forum

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

Create survey questions that are viewable but not fillable

  • captainwalker
  • captainwalker's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 weeks 4 hours ago - 2 weeks 4 hours ago #269727 by captainwalker
Your LimeSurvey version:  LimeSurvey Community Edition   Version 6.12.0+250310 
Own server or LimeSurvey hosting: own server
==================
I have array survey questions that are Grouped. 

My Group 1 question is to Yes/No - to ensure that 'professionals' can see AND fill the questions in Groups 2 and 3. 

But what I want to do is allow 'non-professionals' to see the questions in Group 2 and Group 3 but not be able to fill them out. 

It's easy to create a Condition for non-professionals to bypass entirely Group 2 and Group 3 questions. But that's not what I want. 

This condition in the Group 1: 
Code:
((G1Q00001 == "Y")) || ((G1Q00001 == "N"))
- allows professionals to see and fill Groups 2 and 3 questions, so that's fine. But it's also allowing non-professionals to both see and fill as well - I want to allow the non-professionals to see but not be able to fill anything. All they must be able to do is click 'Next'.

Purpose: non-professionals should see the questions for educational purposes but it wouldn't be appropriate for them to fill the questions. 

I am grateful for any guidance on how to achieve my objective.
Last edit: 2 weeks 4 hours ago by captainwalker. Reason: correcting typos

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 weeks 3 hours ago #269729 by Joffm
Hi,
easy solution:
Show these two groups to the professionals
Create the display for the others in two groups in "text display" questions.where you

javascript - more sophisticated:
This depends on the type of question - really only questions of type "array"?
Use javascript to set all radio buttons to "disabled".

Better you provide a lss export.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

  • captainwalker
  • captainwalker's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 weeks 2 hours ago #269731 by captainwalker
It's not possible to change from Arrays to Radio (or some other format) because of the particular nature and complexity of the 'professional questions' in Likert formation (arrays). 

Javascript is note everybody's cup o' tea. But even with AI assistance there is a problem figuring out where to place the code. AI would offer :
Code:
<script type="text/javascript">
$(document).ready(function() {
  if ((G1Q00001 == "N")) { // Check if the respondent is not a professional
    $('input, select, textarea').prop('disabled', true); // Disable all input fields
  }
});
</script>
Then AI gets stuck by telling me to insert that a Logic Tab which I cannot find at the group level. I don't know where to place the code at a 'question' level.
I have attached a cut down version for greater understanding. 
Many thanks. 

Please Log in to join the conversation.

  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 week 6 days ago #269740 by holch
Forget AI, ChatGPT and Co have no idea about Limesurvey. In 99% of the cases they are "haluzinating" and invent some stuff. Sometimes this might actually be quite close to reality, because the logics in Limesurvey are not that different to other logics, but in most cases the best thing that comes out of it is a good laugh.

Why a Zip archive and not an LSS file? Not gonna download a Zip file.

Help us to help you!
  • Provide your LS version and where it is installed (own server, uni/employer, SaaS hosting, etc.).
  • Always provide a LSS file (not LSQ or LSG).
Note: I answer at this forum in my spare time, I'm not a LimeSurvey GmbH employee.

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 week 6 days ago - 1 week 6 days ago #269745 by Joffm
Hi,
ChatGPT doesn't know that you have to retrieve the code of the first question in the script
Code:
<script type="text/javascript" charset="utf-8">
  $(document).on('ready pjax:scriptcomplete',function(){
 
    // Retrieve the answer code from the "professional" question
    var aC = '{G1Q00001}';
 
    if (aC == "N") { 
      $('input, select, textarea').prop('disabled', true);
    }
  });
</script>

Put it into the group description!

BTW: Better you use the IF-function to display the additional phrase in the group header (instead of the "alert")
 


As @holch: Why did you send a lsa export, not a lss export? Please, ease our work.

Joffm
 

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 1 week 6 days ago by Joffm.

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose