- Posts: 8
- Thank you received: 0
Ask the community, share ideas, and connect with other LimeSurvey users!
<script type="text/javascript" charset="utf-8"> $(document).ready(function() { // this is your variables, random here var A = Math.floor((Math.random() * 10) + 1); var B = Math.floor((Math.random() * 10) + 1); var C = Math.floor((Math.random() * 10) + 1); //insert into your multiple numerical question $('#answer753561X33X3261').val(A); $('#answer753561X33X3262').val(B); $('#answer753561X33X3263').val(C); }); </script>
<script type="text/javascript" charset="utf-8"> $(document).ready(function() { // this is your variables, random here var A = Math.floor((Math.random() * 10) + 1); var B = Math.floor((Math.random() * 10) + 1); var C = Math.floor((Math.random() * 10) + 1); //insert into your multiple numerical question $('#question{QID} input[type="text"]:eq(0)').val(A); $('#question{QID} input[type="text"]:eq(1)').val(B); $('#question{QID} input[type="text"]:eq(2)').val(C); }); </script>
<script type="text/javascript" charset="utf-8"> $(document).ready(function() { // this is your variables, random here var A = Math.floor((Math.random() * 10) + 1); var B = Math.floor((Math.random() * 10) + 1); var C = Math.floor((Math.random() * 10) + 1); //insert into your multiple numerical question $('#question1234 input[type="text"]:eq(0)').val(A); $('#question1234 input[type="text"]:eq(1)').val(B); $('#question1234 input[type="text"]:eq(2)').val(C); }); </script>