Thanks to all.
Thanks to all.
<script type="text/javascript" charset="utf-8">
$(document).on('ready pjax:scriptcomplete',function(){
// Identify this question
var thisQuestion = $('#question{QID}');
var input1 = $('input:text:eq(0)', thisQuestion);
var input2 = $('input:text:eq(1)', thisQuestion);
// Define the minimum and maximum numbers
var minNumber = 1;
var maxNumber = 10;
// Only load random numbers once
if($.trim($(input1).val()) == '' && $.trim($(input2).val()) == '') {
// Create an array of possible numbers
var numbers = [];
var i;
for (i = minNumber; i <= maxNumber; i++) {
numbers.push(i);
}
// Shuffle the numbers array
shuffleArray(numbers)
// Load the first sub-question with the first number
$(input1).val(numbers[0]).trigger('keyup');
// Load the second sub-question with the second number
$(input2).val(numbers[1]).trigger('keyup');
}
});
// A function to shuffle arrays
function shuffleArray(array) {
for (var i = array.length - 1; i > 0; i--) {
var j = Math.floor(Math.random() * (i + 1));
var temp = array[i];
array[i] = array[j];
array[j] = temp;
}
return array;
}
</script>
This also does work as far as I can see. If I change the equation question in the second group to "counter = 1", both questions are shown in that group.larissabruebach said: In this case shouldn't it work when I set the relevance equation to counter == 1 and then set the counter within the group to 1? As far as I can see it doesn't.
Did you read about "Survey participants and attributes"? Your question implies that you haven't. If you like to code a workaround to decipher the token into choiceoptions, fine. But you can just place the numbers/codes into a attribute field and access the attribute field inside LimeSurvey.Jmantysalo wrote: Hmm... Can the token be handled like a string or number? If so, the token could be just of the form XXXYYYY where X-part would define possible choises and YYYY would be string to differentiate students.
There is no exact known limit. That can depend on the database used or the post limits in php.TomUlivieri wrote: Do you know if there is a maximum set of answer accepted or if there is a way to manage such a large set of labels?
What question type do you see for the advanced course(s)? I ask because you can't arbitrarily generate answers for LimeSurvey. If using list-radio or multiple-choice questions, the answers/sub-questions must be defined in the LimeSurvey GUI.[/quote]tpartner wrote: You can use Evan Plaice's jquery-csv platform to convert CSV contents into JavaScript objects.
Thanks. Seems usefull, I'll look at that.
I don't understand the need to access the first CSV file - couldn't the basic course be placed in a token attribute?
True, it can.
I think it could be easier that way.