Welcome to the LimeSurvey Community Forum

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

Bank of images, randomly select some of them

  • JamesMWatson
  • JamesMWatson's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 6 months ago #205921 by JamesMWatson
Bank of images, randomly select some of them was created by JamesMWatson
I want to have a bank of 40 images, where the participant answers 10 questions involving 30 of the images chosen randomly. They will only see one question at a time.

Each question is essentially the same, with the multiple choices being: "highest", "middle" "lowest" and "cannot determine".

I need to keep a score of the number of times image(n) has been used in total (across all completed participants), and the number of times that it is selected as the "highest" and "lowest".


Is this possible using LimeSurvey, and which method is the easiest? I cannot manually make all the combinations of questions since this is 40! (40x39x38...)
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 6 months ago #205943 by Joffm
Hi,
this means

each of the ten questions shows three images and the respondent ranks them "highest", "middle", "lowest"?

Or what exactly, if I misunderstood?

And this

I need to keep a score of the number of times image(n) has been used in total (across all completed participants), and the number of times that it is selected as the "highest" and "lowest".

is not directly LimeSurvey related. This is up to you in your analysing software.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 6 months ago #205975 by Joffm
Hi,
if I am right, you can do this by:
1. Insert a question of type "short text" with the following javascript snippet.
Code:
<script type="text/javascript" charset="utf-8">
 
function shuffle(array) {
  var currentIndex = array.length, temporaryValue, randomIndex;
 
  // While there remain elements to shuffle...
  while (0 !== currentIndex) {
 
    // Pick a remaining element...
    randomIndex = Math.floor(Math.random() * currentIndex);
    currentIndex -= 1;
 
    // And swap it with the current element.
    temporaryValue = array[currentIndex];
    array[currentIndex] = array[randomIndex];
    array[randomIndex] = temporaryValue;
  }
 
  return array;
}
 
 
  $(document).on('ready pjax:scriptcomplete',function(){
// Fill the array
      var arr = ["01","02","03","04","05","06","07","08","09",10,11,12,13,14,15,16,17,18,19,20, 21,22,23,24,25,26,27,28,29,30, 31,32,33,34,35,35,36,38,39,40];
 
      arr = shuffle(arr);
      anumbers = arr.slice(0,30).join('');
      $('#question{QID} input[type="text"]').val(anumbers);
//    $('#question{QID}').hide();
   });
</script>

In your real survey this question has to be hidden; so uncomment this line
// $('#question{QID}').hide();

2.a. To rank you may use a question of type array with the three answer options ("Highest", "Middle", "Lowest")
Don't forget to include a question validation equation unique(self) and a validation tip.
As subquestions insert your images like
1. question
<img src="/limesurvey/upload/surveys/123456/images/Boat{substr(Q0,0,2)}.jpg" />
<img src="/limesurvey/upload/surveys/123456/images/Boat{substr(Q0,2,2)}.jpg" />
<img src="/limesurvey/upload/surveys/123456/images/Boat{substr(Q0,4,2)}.jpg" />

2. question
<img src="/limesurvey/upload/surveys/123456/images/Boat{substr(Q0,6,2)}.jpg" />
<img src="/limesurvey/upload/surveys/123456/images/Boat{substr(Q0,8,2)}.jpg" />
<img src="/limesurvey/upload/surveys/123456/images/Boat{substr(Q0,10,2)}.jpg" />

You see you capture the first, second, third,... two-character substring out of your first question.
And as you see, my images are called "Boat01.jpg", "Boat02.jpg",...,"Boat40.jpg".

2.b. Of course you may use a question of type ranking.
In my opinion this is not the best solution if the survey is taken on smartphones.

Here an example with both options.






File Attachment:

File Name: limesurvey...4817.lss
File Size:30 KB


Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
  • JamesMWatson
  • JamesMWatson's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 6 months ago #205976 by JamesMWatson
Replied by JamesMWatson on topic Bank of images, randomly select some of them
Wow! Thanks this is precisely what I intend to do, probably using the matrix style ranking.

Many thanks again,
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose