- Posts: 16
- Thank you received: 0
Ask the community, share ideas, and connect with other LimeSurvey users!
Understood.The method we will be using for data analysis allows us to compute the influence of those values without the need to display multiple participants exactly the same vignette / text - all we need is for each value to be displayed a sufficiently large number of times.
We will not use the participant database because recruitment will be handled by an external party that distributes the survey link.
Hide the question with a CSS class "hidden".So I tried Joffm's solution with the external PHP script, which worked just fine ... until I hid the short text question from participants. Since there is no question to display, the call to the PHP server is not executed. If I make the question visible again, everything works. Is there a way to execute this call and store the returned text somewhere such that participants don't get to see it?
Would you be calling different PHP scripts for each sub-question or the same PHP script, passing it a variable to indicate which sub-question is to be loaded?Also, I need multiple texts retrieved this way. First I tried to do this with a "multiple short texts" question, but if I try the code posted above, all of the text fields are filled with the same text, presumably because in this question type the text fields have a different structure. How would I have to execute the call to the external PHP file and fill in the text fields if I have multiple short texts in one question?
<p><strong>Question Group Heading</strong></p> <div id="text1_container"> </div> <p><script type="text/javascript" charset="utf-8"> $(document).on('ready pjax:scriptcomplete',function(){ $.post('https://www.remote-server.com/questionX.php?key={randomnumber}' , function(data) { $('#text1_container').html(data); }) .fail(function() { $('#text1_container').html("FALLBACK TEXT"); // All of the lines below don't work (printing {fallback} on the next page always shows the default value "nofallback"} //$("#answer{138631X276X2469}").val("fallback").trigger('keyup'); //$('#answer138631X276X2469').val('fallback'); //$('#fallback') = 'True'; }) ; }); </script>
$('#answer138631X276X2469').val('fallback').trigger('keyup');