Welcome to the LimeSurvey Community Forum

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

One survey for different classes

  • tammo
  • tammo's Avatar
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
8 years 4 months ago #128834 by tammo
Replied by tammo on topic One survey for different classes
I set up a survey (see attachment) with tokens and one extra attribute for the class (numerical, because text will not help you)

The first group of the survey has 1 hidden question, which records the class as it is given in the token. The other question is one you could have asked.

This survey does record both the class as well as the shown question in the database, but I cannot figure out why you cannot filter on the hidden question. Hopefully another LS power user can help you further along the line.


Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl
The topic has been locked.
More
8 years 4 months ago #128835 by AnnaBH
Replied by AnnaBH on topic One survey for different classes
I couldn´t open your file but I think I have found out how to do now except how I do with the hidden question. I have added an extra attribute. I call it Group and you can belong to group 1 or 2. Then I add a hidden question and choose the tokens from the Limesurvey replacement... The question looks like this: {TOKEN:ATTRIBUTE_1} Is that enough? I would have tried it´s easier to ask :) I hope for luck one more time!
The topic has been locked.
  • tammo
  • tammo's Avatar
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
8 years 4 months ago #128836 by tammo
Replied by tammo on topic One survey for different classes
Great minds think alike: what you did what was in the file that I sent you you.

A file that ends with .lss is a file that you can use for importing a survey. So: go to new survey and import this one using the .lss file. Not necessary now, because no new knowledge is in it...


Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl
The following user(s) said Thank You: AnnaBH
The topic has been locked.
  • tammo
  • tammo's Avatar
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
8 years 4 months ago #128837 by tammo
Replied by tammo on topic One survey for different classes
When you export the results of a survey to SPSS, token values are also exported, so this "hidden question trick" is not necessary then.

When you export to Excel, you can indicate which attributes from the token table need to be included. So then the "hidden question trick" is also superfluous.


Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl
The topic has been locked.
More
8 years 4 months ago #128839 by AnnaBH
Replied by AnnaBH on topic One survey for different classes
I have no idea what SPSS is so that will have to wait for a while :D
The topic has been locked.
More
8 years 4 months ago #128859 by AnnaBH
Replied by AnnaBH on topic One survey for different classes
Ok. There is something I miss if I want to use Limeservice own diagrams. How do I do to get the answer on the hidden question? The question is there but I didn´t get any answers (because it is hidden). I guess it´s supposed to shown in some kind of "auto-magic" way? But how?
The topic has been locked.
  • fransmarcelissen
  • fransmarcelissen's Avatar
  • Offline
  • Premium Member
  • Premium Member
More
8 years 4 months ago - 8 years 4 months ago #128864 by fransmarcelissen
Replied by fransmarcelissen on topic One survey for different classes
I agree with Tammo that the best approach is one survey with a hidden question. But if you know a tiny bit of R it is not necessary to export the date to a spss file: you can directly read the data from the limesurvey database into R (using rpc2) and analyse the data. This all takes less then 10 lines of code. An example is shown below. Her the following happens:
- Data are read by R from limesurvey
- Data are filtered (here: only males are selected)
- Analyse data (here as an example: create histogram of intelligence scores).
R is much more powerful (and if you know it: easier) then spss, especially the graphics.

library(limer)

options(lime_api = "" www.XXXXX.nl/index.php/admin/remotecontrol ")
options(lime_username = USERID)
options(lime_password = PASSWORD)

get_session_key( )
data = get_responses(iSurveyID = 123456, sLanguageCode = 'nl')
men = dplyr::filter(data,sex=='Male')
hist(men$intelligence)
Last edit: 8 years 4 months ago by fransmarcelissen.
The following user(s) said Thank You: AnnaBH
The topic has been locked.
More
8 years 4 months ago #128869 by AnnaBH
Replied by AnnaBH on topic One survey for different classes
Haha! Thank you guys but you think to much of my knowledge... I´m just an ordinary limesurveyuser ^^
I really think R looks lika a good idea. If I only knew it... I will see if I can get help from a friend.
But until I have that help it will have to do with limesurvey and maybe excel. So my biggest problem is still how I get the answer to the hidden question? I think I maybe have the answer for that in your LSS-file Tammo, but I can´t get it to work. I try to import it but it fails :/ So if you can describe in words what I must do or if you can help me how to import the file proparly?
The topic has been locked.
  • fransmarcelissen
  • fransmarcelissen's Avatar
  • Offline
  • Premium Member
  • Premium Member
More
8 years 4 months ago #128870 by fransmarcelissen
Replied by fransmarcelissen on topic One survey for different classes
Which limesurvey version are you using? If it is 2.00: see www.limesurvey.org/en/community-services...index-is-not-defined In that case I would suggest to upgrade to a newer version.
But as Tammo mentioned before: you do'nt need the hidden question, if you export the attributes together with the answers.
Frans
The topic has been locked.
More
8 years 4 months ago #128871 by AnnaBH
Replied by AnnaBH on topic One survey for different classes
Ah. Ok. It´s 2.0. And here is my next problem. I have my LImeSurvey on my virtual server. It seems that I can´t update it in any ordinary way. There is no botton or text for "uptate". If I have to update it and then put it manually on my virtuel server again I think I have to see myself defeeted :/ At least for now. I will come back! Promise ;-)
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 4 months ago #128872 by tpartner
Replied by tpartner on topic One survey for different classes

How do I do to get the answer on the hidden question? The question is there but I didn´t get any answers (because it is hidden). I guess it´s supposed to shown in some kind of "auto-magic" way? But how?


1) Set up your survey to use JavaScript .

2) Add a list-radio type question with answer codes that match the expected token ATTRIBUTE_1 values. Do not hide this question with the LimeSurvey setting - we'll do that with Javascript.

3) Insert this script in the source of the radio question:
Code:
<script type="text/javascript" charset="utf-8">    
  $(document).ready(function(){
 
    // Hide this question
    $('#question{QID}').hide();
 
    // Click the "ATTRIBUTE_1" radio
    $('#question{QID} input.radio[value="{TOKEN:ATTRIBUTE_1}"]').trigger('click');
  });
</script>

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: AnnaBH
The topic has been locked.
More
8 years 4 months ago #128875 by AnnaBH
Replied by AnnaBH on topic One survey for different classes
Thank´s but I have to wait and try this as well. Can´t even find Global settings. I think I have to go for making different diagrams using the identification number this time. But I will learn! And update! Or I will get someone to help me fix that :)
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose