Welcome to the LimeSurvey Community Forum

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

use end url and attributes to redirect - problem when resuming later

  • asilbering
  • asilbering's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
4 years 6 months ago #188619 by asilbering
Hi,

I would very much appreciate the help of this expert community to design a survey.

I am new to LimeSurvey and using Version 2.05+ (for now).

Let me briefly explain the context:

I need to ask 10 questions to more than 300 teachers about the content of each hour they teach (each hour has a different "topic", the number of hours given by each teacher is variable, and there are more 700 hours in total).

In principle I could create one single survey and send the teachers as many links/emails as hours they have, but I am afraid that they might get confused with so many emails and end up filling out only some of them.
Also, rather than asking the teachers to fill out the topic of the hour they are responding about, I would like this information to appear as heading for the survey/group of questions (and to be saved in the answer).

My original idea was to create personalized surveys with as many groups of questions as hours a teacher gives and name the groups with the topic of the teaching hour. But I am now wondering if there is an alternative way using end url and attributes, so I can avoid uploading 300 surveys and retrieving 300 responses.

I would like to know if it is possible to do the following in LimeSurvey:

- Send an invitation with the link to one survey with 10 questions. The link would already contain information about the topic and this information would be passed to a hidden question so that the answers can be assigned to the right teaching hour. The topic should also be displayed somewhere in the survey so the teacher knows which hour he/she is responding about.

- the information about the number of hours given by a teacher and the topics would be "attached" to the identity of the teacher somehow (user token?), so that if the teacher gives more than one hour he/she will be redirected to a new survey tagged with a new topic as many times as necessary.

Is this feasible? Any ideas are more than welcome. Please let me know if the question is not clear...

Thanks a lot in advance,
Ana
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 6 months ago #188625 by holch
I don't think that it is possible, at least not the way you are trying to do it.

You can store the information about the teacher in the token table. However, this would only work for using it in one big survey, because there is no way in LS (at least that I am aware of) and the token table to store back which part/lesson has already been answered and then could be passed on to the next "survey".

So in my opinion you have 2 options:

1. One big survey including all lessons of each teacher (via the token table).
2. Different surveys for each lesson per teacher (will receive different links for each lesson).

I don't see how you could create a system within Limesurvey that would pass on the details of the lesson to be evaluated in the next questionnaire, at least not if there are more than 2 lessons per teacher.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
  • asilbering
  • asilbering's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
4 years 6 months ago #188651 by asilbering
Thanks for your feedback!
Then I will focus on a way to automate the creation of a big survey per teacher, and then try to find out how to upload them and export the data in batch.
If you have any leads on how to do this, I would be very thankful (I found the page about the APIs, but I am not an expert in this kind of things).
I saw there is a package to export answers from LimeSurvey to R, for example, but do you know if there is anything similar to upload surveys and token tables?

Let's say that I make one survey per teacher. If I understand correctly I should be able to use the token table to pass the information about the lesson to each question group, right?

Thanks again for your help!
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 6 months ago #188654 by holch
You do not need to create one questionnaire per teacher. You can put the lessons the teachers teach into the token table as custom attributes and then show and hide the respective questions whether the teacher is teaching this class or not. Of course, this depends very much on the total number of different classes that might be available how to structure it.

You have two options:
1. If you have only a limited amount of different classes, let's say it is three, Maths, Geography, Phsysics.

Then you could create a custom attribute for each of these classes in the token table and only show the questions for Maths, if there is a "Y" in the token table for the currently responding teacher. This works if you have only a relatively small amount of different classes. Maybe 10, but depends on the number of questions you have for each class, in order to not run into the limits of your database.

The other option is to just write the classes of each teacher in the columns and then pipe the name into the question groups. But this would also mean that some teacher might evaluate maths in the first column, while others do so in the second or third. This can be confusing for analysis.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
  • asilbering
  • asilbering's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
4 years 6 months ago #188656 by asilbering
Thanks for the ideas.
Actually each teacher has its own group of lessons (I am trying to map the curriculum of a medical school).
It looks like this:

Teacher1 Lesson1
Teacher1 Lesson2
Teacher1 Lesson3
Teacher2 Lesson4
Teacher3 Lesson5
Teacher3 Lesson6
etc...

And all of them have to answer the same 10 questions in relation to each lesson they teach.
So I could make one single survey and create one token for each teacher*lesson combination, but then some teachers would receive more than one url and I am afraid this would reduce the quality of the data.
Or I could have one survey per teacher, with as many groups as lessons that teacher has (teacher 1 would have 3 groups, while teacher 2 would have only one), but then I would have to "label" each group with the lesson name, and I am not sure how to do that.

I hope I managed to present the problem in a clearer way this time.
Thanks again for your help, I really appreciate the time you take!
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 6 months ago #188660 by holch

I hope I managed to present the problem in a clearer way this time.

Not really... ;-)

yes, you could send a link to the teachers per session, so Teacher 1 would receive 3 links. But I agree, some teachers might respond the first one and then nothing. Probably better to have everything in one survey.

So from what I understood, the set of questions is always the same, no matter what lesson the teacher teaches. But each teacher will teach a different lesson. So then the question is, what is the maximum amount of different lessons ONE teacher might teach?

From the information I have on this (I don't know how many teachers you have, I don't know how many different lessons exist and I don't know what the maximum amount of lessons is, that one teacher might teach, I don't know how you want to analyse this, etc.), but based on this information provided here I would probably do the following:

1. Create the group of 10 questions that will be asked per lesson.
2. Copy this group X times (x being the maximum amount of lessons that one teacher might teach)
3. Create a token table with X custom attributes (Lesson1, Lesson2, ..., LessonX) and in the custom attribute I would put the name of the lessons for each teacher/professor.
4. I would then pipe this name of the lesson in the respective groups via Expression-Manager and show hide the groups depending on how many lessons one teacher teaches.

I think this would be my approach, based on the current information provided.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 6 months ago - 4 years 6 months ago #188686 by Joffm
Hi, as far as I understood, there are 300 teacher with 1 to x classes, average 2.3.
So the maximum will be about 5, or?

I have an idea to:
create as many token attributes as there are classes of this teacher, that may contain the topic,
create as many token attributes as there are classes of this teacher, that contain a flag (1/0) to decide if this topic is asked and filled already,
in the first question do an ajax call to see which is the first "not answered" flag. (set this flag to "answered")

With "micro-tayloring" you may pipe the respective texts into the question.
This way you only need your ten questions only once.

More comfortable: You offer the "not answered" topics, so the teacher can decide which one to answer,

This is a first quick idea, which I have to create and test.
And I don't know about your version 2.05. I will try in 2.06.

Joffm

Of course, this is only possible if you have
  • access to the LimeSurvey database on your server
  • a little bit of knowledge of php and MySQL

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 4 years 6 months ago by Joffm.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 6 months ago #188690 by tpartner
Per Joffm's suggestion, you may be able to use the API (which some find easier than direct SQL queries) to check and update the token attributes.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • asilbering
  • asilbering's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
4 years 6 months ago #188691 by asilbering
Thanks to all for the feedback!

To your questions:
- There are around 300 teachers
- There are around 700 lessons (each lesson has a different lesson title)
- One teacher can have up to 15 lessons.
- I would like to export the data to R for analysis

I like holch's approach since it seems like something that does not require very deep technical knowledge (for now I don't have access to the LimeSurvey database, and I have zero experience with PHP and MySQL).

The points that remain unclear to me are:
- How many attributes can I create ? (i.e. could I create 15 attributes? Is there a maximum?)
- Are there any restrictions as to the content of the attributes? Ideally I would like to fill the attributes with the lesson title, so I could also use the attribute to display the title at the top of each question group. But lesson titles are long sentences that can contain symbols (to give you an example: "Causes, facteurs de risque et bilan de l'AVC & AIT "). Is this allowed?
- Would it be possible to fill all "unused" attributes with NA and then add a condition so that a group is only shown if the corresponding attribute (for example att2 corresponds to group 2) is not NA?

If this works then my life would be much easier than expected!

Thanks again and a nice evening to you all.
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 6 months ago #188692 by Joffm

- How many attributes can I create ? (i.e. could I create 15 attributes? Is there a maximum?)

Please, these are things you should just try.
There is a maximum because of the limitation by MySQL (read the manual about it), but this will not affect your tiny amount of attributes.

- Are there any restrictions as to the content of the attributes? Ideally I would like to fill the attributes with the lesson title, so I could also use the attribute to display the title at the top of each question group. But lesson titles are long sentences that can contain symbols (to give you an example: "Causes, facteurs de risque et bilan de l'AVC & AIT "). Is this allowed?

The same. Just try it.
But to tell you: In the database these fields are implemented as VARCHAR(255); so you have 255 characters. And it's utf-8.

- Would it be possible to fill all "unused" attributes with NA and then add a condition so that a group is only shown if the corresponding attribute (for example att2 corresponds to group 2) is not NA?

Of course; this is essential. Teachers have a different number of lessons.

Best regards
Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
  • asilbering
  • asilbering's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
4 years 6 months ago #188696 by asilbering
Thanks a lot for the info Joffm, it is very useful. I had read the manual about the limitations, but as I am not familiar with MySQL it is hard for me to understand what are the implications.
I will try it out!

Best regards,
Ana
The topic has been locked.
  • asilbering
  • asilbering's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
4 years 5 months ago #190325 by asilbering
Hi,

I just migrated from LimeSurvey 2.05 to 3.19 and I am having a problem to redirect to a new survey using a combination of end url and an equation question. This was working fine in the previous version.

My endurl is set to {myURL} which an equation question where I wrote (in the question text):

{ if({TOKEN:ATTRIBUTE_2}!="NA"," web-test.XXX.ch/index.php?r=survey/index...TRIBUTE_2}&newtest=Y ", COMPLETED) }

This should direct to a new survey if the token attribute is not NA, and end the survey otherwise.

But when I run the activated survey I get the error in the attached image, so the way in which I am writing the equation is not working.

I guess this is related to a change in the way things work in LS3.19, but I cannot figure it out.

Thanks in advance.
Best regards,

Ana
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose