Dear all,
First I have to tell you this is my first survey and I don't know anything about coding. Maybe that is the reason why I haven't found a solution that is suitable to my skills.
After looking for an answer in the forums for several hours, I am desperately to find a solution to my problem that is assigning a default value to an array.
I have a group of questions, inside I have a subquestion "hobbies" and the answers are a likert scale from 1 (strongly disagree) to 7 (Strongly agree)
I want to set answer "1" as checked, default value, to my SQ001 of q1
What can I do?
this javascript I have found doesn't work:
<script type="text/javascript">
$(document).ready(function () {
col = 1;
$('input[type=radio][id$=' + col + ']', $('#q1')).each(function () {
$(this).attr('checked', true);
});
});
</script>
Source:
uilots-labs.wp.hum.uu.nl/how-to/default-answers-in-limesurvey/
I tried adding it in the source code of the question, the subquestion and the answer but it doesnt work.
I have found this Assignment Operator:
{Q1_SQ1=(is_empty(Q1_SQ1.NAOK),"A99",Q1_SQ1.NAOK)}
and modified it to my survey:
{q1_SQ001=(is_empty(q1_SQ001.NAOK),"1",q1_SQ001.NAOK)}
but don't know where to put that, I tried here: Question validation equation but it doesn't work
Source:
www.limesurvey.org/manual/Expression_Man..._Assignment_Operator
I also found this script
<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
var defaultText = 'My default';
$('#question{QID} tr[id^="javatbd"]').each(function(i) {
if($('input[type="text"]:eq(0)', this).val() == '') {
$('input[type="text"]:eq(0)', this).val(defaultText)
}
});
});
</script>
but I don't know how to adapt it to my case and where to add it
Source:
www.limesurvey.org/forum/can-i-do-this-w...ion-type-array-texts
Finally, I know a solution would be to create a Question type - Equation but I don't find the documentation to create something like what I need in the link below :
www.limesurvey.org/manual/Question_type_-_Equation
Thank you very much for your help.