Welcome to the LimeSurvey Community Forum

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

Help materials for Version 6

More
1 year 7 months ago #254707 by AideenW
To answer your question: I still have no permissions for JavaScript. I think i could get them but I'm waiting for a response from the tech people.
I figured out how to import the survey (so its' not just lines of code), so I'm going to check that out now. Sorry, I thought I needed some kind of software or something to look at it!

Please Log in to join the conversation.

More
1 year 7 months ago #254728 by holch
Replied by holch on topic Help materials for Version 6

Sorry, I thought I needed some kind of software or something to look at it!


Yes, the software called Limesurvey. :-)

LSS is a file format based on XML that allows to interchange Limesurvey surveys from one installation to another. So for you, this is certainly important to save the LSS file of your final Limesurvey questionnaire structure, together with your other documents of your thesis or study.

There is also a LSA file, which is made for archiving Limesurvey studies, which also includes other things besides the survey structure, like responses, etc.

Help us to help you!
  • Provide your LS version and where it is installed (own server, uni/employer, SaaS hosting, etc.).
  • Always provide a LSS file (not LSQ or LSG).
Note: I answer at this forum in my spare time, I'm not a LimeSurvey GmbH employee.

Please Log in to join the conversation.

More
1 year 7 months ago #254730 by Joffm
Replied by Joffm on topic Help materials for Version 6

but I don't think the approach you outlined above in your last comment would give me what I'm trying to achieve.

And how many times have I to write that it does.
This afternoon I started the survey several times and got the following outcomes
G - N - B2
B3 - G - N
B3 - G - N
B2 - N- -G
N - B3 - G
G - N - B3
N - G - B1
B2 - N - G
G - B1 - N
G - B2 - N
B1 - N - G
G - N - B3
B2 - N - G
G - N - B1
G - B1 - N
G - N - B2
You see B1, B2, B3 randomly, also B,N und G randomly.

Without javascript my sample is rather useless, but I also wrote before that there is a solution that only uses ExpressionScript.
Javascript is short and handy, the other is a bit lengthy.
If you can read German you will find an example in my "Tutorial 4. Gleichungen,..." in the Germen part.

But nevertheless I'll change my sample survey to the ExpressionScript sokution,.
It's a bit lengthy and a lot to write. Therefore javascript is the preferred solution.

And obviously you did not read th manual.
Here you would have found how to import a lss export.
[url] www.limesurvey.org/manual/Surveys_-_intr...tion#Import_a_survey [/url]
:
Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

More
1 year 7 months ago #254738 by AideenW
Thank you! I'm so not a computer person so I appreciate you explaining these details!

Please Log in to join the conversation.

More
1 year 7 months ago #254740 by AideenW
Perhaps I wasn't clear in what I meant before. The randomization of parts is good, and indeed works, apart from the fact that the names do not appear (at least for me) in the 10 times I've tested the survey.
Moreover, the randomization aspect I have figured out (thanks for your help with that, and @holch), and successfully applied. The main issue I am having now is how to make only 11 out of 33 names appear. I'm assuming I can't take the same approach as you did with the behaviors, since the names themselves appear in different groups.

Please Log in to join the conversation.

More
1 year 7 months ago - 1 year 7 months ago #254750 by Joffm
Replied by Joffm on topic Help materials for Version 6
Hi,
are you now able to use javascript?
If not, of course the names are not showing.

Now here's my sample without using javascript
 

File Attachment:

File Name: limesurvey...5781.lss
File Size:432.59 KB


Because I only show 4 out of 10 names you have to 
extend the survey to your 33 names
change these two lines in "eqNames"
{selNames_11='123456789A'}  - 10 Elements
to
{selNames_11='123456789ABCDEFGHIJKLMNOPQRSTUVWX'}  - 33 Elements

and
{selNames_999=join('#',selNames_13,selNames_23,selNames_33,selNames_43)}  - 4 Elements
to
{selNames_999=join('#',selNames_13,selNames_23,selNames_33,selNames_43,selNames_53,selNames_63,selNames_73,selNames_83,selNames_93,selNames_103,selNames_113)}  - 11 elements

In my opinion this calculation is rather straightforward and easy to understand.
Question "selNames" is a question of type "multiple short text" and is used as a container.
To select one element we need three equations; therefore the subquestions are coded 11, 12, 13, 21, 22, 23, 31, 32, ...
Code:
{selNames_11='123456789ABCDEFGHIJKLMNOPQRSTUVWX'}
{selNames_12=if(is_empty(selNames_12),rand(1,strlen(selNames_11)),selNames_12)}
{selNames_13=substr(selNames_11,selNames_12-1,1)}
{selNames_21=str_replace(selNames_13,'',selNames_11)}
{selNames_22=if(is_empty(selNames_22),rand(1,strlen(selNames_21)),selNames_22)}
{selNames_23=substr(selNames_21,selNames_22-1,1)}
{selNames_31=str_replace(selNames_23,'',selNames_21)}
{selNames_32=if(is_empty(selNames_32),rand(1,strlen(selNames_31)),selNames_32)}
{selNames_33=substr(selNames_31,selNames_32-1,1)}
{selNames_41=str_replace(selNames_33,'',selNames_31)}
{selNames_42=if(is_empty(selNames_42),rand(1,strlen(selNames_41)),selNames_42)}
{selNames_43=substr(selNames_41,selNames_42-1,1)}
{selNames_51=str_replace(selNames_43,'',selNames_41)}
{selNames_52=if(is_empty(selNames_52),rand(1,strlen(selNames_51)),selNames_52)}
{selNames_53=substr(selNames_51,selNames_52-1,1)}
{selNames_61=str_replace(selNames_53,'',selNames_51)}
{selNames_62=if(is_empty(selNames_62),rand(1,strlen(selNames_61)),selNames_62)}
{selNames_63=substr(selNames_61,selNames_62-1,1)}
{selNames_71=str_replace(selNames_63,'',selNames_61)}
{selNames_72=if(is_empty(selNames_72),rand(1,strlen(selNames_71)),selNames_72)}
{selNames_73=substr(selNames_71,selNames_72-1,1)}
{selNames_81=str_replace(selNames_73,'',selNames_71)}
{selNames_82=if(is_empty(selNames_82),rand(1,strlen(selNames_81)),selNames_82)}
{selNames_83=substr(selNames_81,selNames_82-1,1)}
{selNames_91=str_replace(selNames_83,'',selNames_81)}
{selNames_92=if(is_empty(selNames_92),rand(1,strlen(selNames_91)),selNames_92)}
{selNames_93=substr(selNames_91,selNames_92-1,1)}
{selNames_101=str_replace(selNames_93,'',selNames_91)}
{selNames_102=if(is_empty(selNames_102),rand(1,strlen(selNames_101)),selNames_102)}
{selNames_103=substr(selNames_101,selNames_102-1,1)}
{selNames_111=str_replace(selNames_103,'',selNames_101)}
{selNames_112=if(is_empty(selNames_112),rand(1,strlen(selNames_111)),selNames_112)}
{selNames_113=substr(selNames_111,selNames_112-1,1)}
{selNames_999=join('#',selNames_13,selNames_23,selNames_33,selNames_43,selNames_53,selNames_63,selNames_73,selNames_83,selNames_93,selNames_103,selNames_113)}

11. we fill the first base with 33 elements
12. We create a random number from 1 to the length of the string in 11
13. We put the element with index of this random number into 13
21. We remove (str_replace) this element from 11 and put the rest into 21
22. We create a random number from 1 to the length of the string in 21
23. We put the element with index of this random number into 23
31. We remove (str_replace) this element from 21 and put the rest into 31
32. We create a random number from 1 to the length of the string in 31
and so on.

In the last equation we join all these elements to a final string
This is used to display the name questions. function "strpos(haystack,needle)"
The condition is "strpos(selNames_999,"1")>0"
Meaning: If the index of "1" in selNames is greater than 0, it is existing.
Because the result "0" means "not found", but the functions returns 0 for the first element, there is the '#' at first place. Now the first valid element starts at position 1.

If the string contains "1", the 1. name is displayed.
If the string contains "2", the 2. name is displayed.
If the string contains "P", the 25. name is displayed.
and so on.

If you want to display the items in each behaviour group as well, you have to add a randomization group name to each question.
In the last behaviour group I used an array - just for demonstration.

And at last:
All questions are "not mandatory" - easier to test. 

Set it as you want to.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 1 year 7 months ago by Joffm.

Please Log in to join the conversation.

More
1 year 7 months ago #254753 by Joffm
Replied by Joffm on topic Help materials for Version 6
Addition:
Also for easier testing I set the survey to "group by group".
You have to set back to "question by question".

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: AideenW

Please Log in to join the conversation.

More
1 year 7 months ago #254757 by AideenW
Great, I think I can understand what you did there from the explanation you provided, thank you!
One question though- can I apply this to the rest of the names if I don't have coding permissions? Like can I take a selection of the code above and paste into the Expression Script for each question?

Please Log in to join the conversation.

More
1 year 7 months ago #254765 by AideenW
I'm a little confused- do I have to make any other edits to what you have presented in the example you sent back today, other than input the names as groups and adjust the two lines of code?
I've done so with the code, and added extra names but for some reason I still only see four names at any given time. The new ones I have input are appearing though, so that randomization is working well, but the expansion is not.
Is there something I need to be doing with [selNames]?

Please Log in to join the conversation.

More
1 year 7 months ago #254844 by Joffm
Replied by Joffm on topic Help materials for Version 6
As I wrote:
In "eqNames" you have to change these two lines from "red" to "blue".
And do NOT copy them from this forum thread. They will include HTML garbage.

I displayed the entire code to show that it is 11 times the same procedure.
Have look at the manual to understand, what the functions ("rand", "strlen", "substr", "str_replace") do to better understand the logic..

Addition:
And if you switch back to "question by question" you have to move
"selNames" before "eqNames"; and of course hide these question after you tested.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

More
1 year 7 months ago #254848 by AideenW
I got the names working perfectly earlier. I had 11 names appearing at random as desired, as well as randomiziation of task type. I recreated the same kind of code for the behavior task (note, this is split into three groups, with labels N, P, or B plus the corresponding number). I checked if the system was working early into inputting the N behaviors, and it was working perfectly, doing exactly as I wanted (the same as the names, selecting a predefined number n at random from a larger number of possible choices N). Once I finished inputting all the N behaviors, I went to check again how the survey itself was working, when I discovered that the behaviors went from being selected as desired, to having selBehaviors_999 being selected, to having nothing at all selected. Further, the names are also now messed up; before, the list at the beginning indicated which names had been randomly selected, and these mapped nicely onto the labels I had applied to each name (numbers 1-9 or letters a-x). Now, the 'selected names' list is just random strings of letters/numbers/symbols that don't map on, and the number of names that appears within the survey itself varies from none to 5. 
I wonder if you could take a look and see where I went wrong on the coding? I'm trying to use ChatGPT for suggestions but its hard to understand what it's telling me to do 
 

Please Log in to join the conversation.

More
1 year 7 months ago #254851 by Joffm
Replied by Joffm on topic Help materials for Version 6
Oh, something quite different.

At first: syntax errors.
And you copied the equation, didn't you.
Look what you got
 

And the second?
How many elements do you want to show of your bejhaviour questions?
5? There are 15 subquestions (5 x 3)
6? You join 6 numbers
7? You calculate up to 7 numbers
 

Now: Logic.
Remember, the idea of the logic was
B1, B2, B3 and Graph are shuffled around the Names  groups.

Fortunately there are 4 groups.
Because all are in the same randomization group and only one of the behaviour groups is displayed, there can be
2 groups before the names groups
2 groups after the names groups
1 before and 1 after the names groups

Here one outcome of the shuffle.
May be like this
 
If the random number is equal 1, the order is "Graph - Names - B1"
If the random number is equal 2, the order is "Graph - B2 - Names"
...

But in this your new survey design you again have three questions in each Behaviour group.
As in your very first approach this doesn't work.
Again you try to do a "group in group" approach

You can't display the "Names" groups and the "Behaviour" groups in random order.
What you can do is:
1. Use only one question per behaviour; use an question of type array.
Here a real nice solution, though with javascript
 
You insert some subheaders for your questions.
And to extend the first questions to seven points shouldn't be an issue.
I already complained about the silly 5-point-choice

As you can't use javascript, you may style the left side of this array with some css,
roughly like (without better styling)
 

2. You use micro-tayloring.
This means, you do not shuffle questions but only the question text according to your randomization.
This will shorten your survey immensely, but - especially in your case - is a huge amount of work to restructure your data before you are able to analyse.

Only a quick answer.

And I do not know, why you don't create a small prototype the test your ideas, especially when you implement something different.

Joffm

BTW:
What's the reason to randomize "Behaviour" and "Names".
Is it in your hypotesis that there is an influence if the respondents see the names first vs last?
But then you should control this. At the moment you do not know in which order the questions and groups were displayed.

I'm trying to use ChatGPT for suggestions but its hard to understand what it's telling me to do 

Oh, yes, do it.
This is usually a source of endless laughter from our side when ChatGPT talks about LimeSurvey.
It always sounds pretty logical, but it's usually just outrageous nonsense.




 

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

More
1 year 7 months ago #254872 by Joffm
Replied by Joffm on topic Help materials for Version 6
You see, all your "Behaviour" groups and "Graph" are in the same randomization group (RG2)
So "Graph" may appear somewhere in the middle of your "Behaviours".
Is this what you try to achieve?

And here a slightly better styled array


Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

More
1 year 7 months ago #254879 by AideenW
Hi Joffm,

I'll try to answer everything from your last two messages.

Indeed, I copied the syntax, but I since have managed to fix the issue and all is working as I want it to.
I hear your concerns about the randomization and I understand that if the individual questions are to be randomized, the overall tasks cannot be. I think it's more important to randomize the questions themselves (though this needs to be passed by my supervisor so could change). Doing it on a question-by-question basis also seems to have the benefit of keeping each trio of questions together (which is perhaps the most important thing), as well as making it more straightforward to present the instructions before each relevant task.
Unfortunately, the question design is fairly rigid, e.g., when there's a five point scale it needs to be 5 points, not 7. This is to do with how people interpret the question differently. I agree with you in terms of presentation but its important to keep the scales as they are. 
And the randomization issue I think I've explained above, but essentially all tasks have a set up where there is a group of questions that must be presented together but only a selection (e.g., 11/33) of the questions will be shown to participants. And so this leads me to my question :

I followed the example you provided for the Names to apply the same logic to the Behaviors task with great success, and now I am trying to do the same kind of thing to the Graphs task (this task follows a similar set up except that there are 6x graph types, each with a positive and negative version. I want participants to be shown one version of each 6 graphs. I have it set up currently so that there are different question groups for each graph version (12x total), and am trying to apply the randomization so that for example, graph1positive gets the randomization group label RG5, and then recieves the strpos(selG1pos_999,'X')>0 that was used in the other tasks. I also altered the code in the equation question accordingly and set up a selGraphs question block too. The issue is that while one graph is being selected, as I want, it is not being displayed in the actual survey itself. This is inspite of the fact that I can see which graph has been randomly selected on that very first screen labeled Only for your information that you put in the last time.

I know you said ChatGPT is useless, and it can be quite unhelpful sometimes, but it helps when your knowledge of coding is negligible. So I had asked, and gotten some useful tips with the behaviors set up, and decided to try asking it about the graphs also. Unfortunately again its' proving quite useless, though it did say something about it being unnecessary to provide the same kind of coding as for the other tasks, since they selected a larger number of question groups, and with the Graphs task im selecting only 1 out of 2 for presentation. Do you have any insights on that? Or is that just random gibberish? 

Please Log in to join the conversation.

More
1 year 7 months ago #254920 by holch
Replied by holch on topic Help materials for Version 6
I think you can safely ignore anything that ChatGPT tells you in terms of Limesurvey. If something was correct, it was out of sheer luck on ChatGPTs side.

Don't get me wrong. I use ChatGPT too. But as it has the tendency to invent things when it has no information about (instead of just saying: "Sorry, I have no idea"), it proves to be more dangerous than helpful in many scenarios. Especially when you have no clue about coding, it can tell you anything and it sounds so convincing and confident, that you will just believe it.

When you have decent knowledge about something, then ChatGPT can be helpful to accelerate processes, but if you have no idea of the topic, it is just too dangerous.

I don't think that ChatGPT was ever trained on anything that has to do with Limesurvey. So it probably just takes its knowledge from other areas and tries to apply it to Limesurvey, without sounding like a human that would let you usually know that he/she doesn't exactly know if it is correct. ChatGPT just assumes and states these assumptions as facts.

So, please, be very, very careful with anything ChatGPT and Limesurvey, at least for now.

Help us to help you!
  • Provide your LS version and where it is installed (own server, uni/employer, SaaS hosting, etc.).
  • Always provide a LSS file (not LSQ or LSG).
Note: I answer at this forum in my spare time, I'm not a LimeSurvey GmbH employee.

Please Log in to join the conversation.

Moderators: holchtpartner

Lime-years ahead

Online-surveys for every purse and purpose