Welcome to the LimeSurvey Community Forum

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

Provide read only answer for one subquestion

More
9 years 9 months ago #124053 by mikeg
In my survey I am asking students to explain the importance of 4 out of 5 topics using a 'multiple short text'. The 5th explanation will come from the instructor and serve as an exemplar for the students. I am wondering how the heck to do something like this

In the example below students would provide the text for <student response> and the instructor's exemplar response is provided ahead of time and is in double quotes.

Topic 1: Replication Initiation <student response>
Topic 2: Error Checking "Error checking is critical to DNA replication because errors...>
Topic 3: Lagging vs Leading <student response>
.
.
.
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
9 years 9 months ago #124055 by holch
Use the question type "text display" or include the explanation in the question text itself.

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.
The topic has been locked.
More
9 years 9 months ago #124065 by jelo
You can set input fields to readonly via JQuery. You might upload your question here to ensure the right workaround is applied.

To get an impression what I mean, here is an example to ensure that a checkbox answer is always checked.
Code:
<script type="text/javascript" charset="utf-8">
  $(document).ready(function() {
                var qID = {QID};
                var answer = $('input[id$="X'+qID+'A1"]');
                $(answer).attr('disabled', true);
                $(answer).prop('readonly', true);
         });
</script>

There are other examples here in the forum.

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
9 years 9 months ago #124083 by tpartner
Replied by tpartner on topic Provide read only answer for one subquestion
Just a little tip to add to jelo's post - be careful when rendering inputs "disabled". If the input remains disabled when the form is submitted, its value may not be recorded in the data.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
More
9 years 9 months ago #124085 by jelo

tpartner wrote: If the input remains disabled when the form is submitted, its value may not be recorded in the data.

Is that behavior depending on the browser? Or on Limesurvey and shipped JS libraries?

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
9 years 9 months ago - 9 years 9 months ago #124086 by tpartner
Replied by tpartner on topic Provide read only answer for one subquestion
That is browser behaviour. All browsers should adhere to that. More info - www.w3.org/TR/html401/interact/forms.html#successful-controls .

I always do something like:

Code:
<script type="text/javascript" charset="utf-8">
  $(document).ready(function() {
    var qID = {QID};
    var answer = $('input[id$="X'+qID+'A1"]');
 
    $(answer).prop('disabled', true);
    $(answer).prop('readonly', true);
 
        $('#movenextbtn, #movesubmitbtn').click(function() {
            $(answer).prop('disabled', false);
        });
  });
</script>

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 9 years 9 months ago by tpartner.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
9 years 9 months ago #124087 by tpartner
Replied by tpartner on topic Provide read only answer for one subquestion
...or just use the readonly property.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose