Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: Copy Survey Not Working - Question Codes

Copy Survey Not Working - Question Codes 8 months 1 week ago #111980

  • Mike1985_2
  • Mike1985_2's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 15
  • Karma: 0
Hi,

I'm having a problem understanding the way LimeSurvey handles copying of surveys/groups/questions.

I have tried to copy an entire survey (having the same issue with importing as well). Although the copy is technically successful, all my subquestions from array type questions have not copied over.

So, as a different approach, I tried to import just a question (an array type with subquestions) on it's own from one survey to another and I get the following error message;
LimeSurvey
Error
 
The question could not be imported for the following reasons:
 
Question codes must be unique.

Why can't the codes be made unique for me? Do I have to do something differently to get it to work?

Can I turn debugging on and see the SQL query that is being submitted for this?
Attachments:
Last Edit: 8 months 1 week ago by Mike1985_2. Reason: Added another question
The administrator has disabled public write access.

Copy Survey Not Working - Question Codes 8 months 1 week ago #111990

  • holch
  • holch's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 3407
  • Thank you received: 462
  • Karma: 151
Never had a problem like this.

What version do you work with?

Do you have the same question code for more than one question?
Have a look at the manual! It is a really valuable source for information. Here some helpful links:
Manual (EN) | Question Types | Question Attributes | Workarounds

If you found this answer helpful and it saved you some time please consider a donation to the project to keep Limesurvey going!
The administrator has disabled public write access.

Copy Survey Not Working - Question Codes 8 months 6 days ago #111994

  • Mike1985_2
  • Mike1985_2's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 15
  • Karma: 0
Version 2.05+ Build 140811

The question codes are unique - but obviously once I try to import, it is importing an exact duplicate and therefore there will be duplicate codes.

Am I supposed to go through the .lss files first and change all the codes?
The administrator has disabled public write access.

Copy Survey Not Working - Question Codes 8 months 6 days ago #111996

  • fransmarcelissen
  • fransmarcelissen's Avatar
  • OFFLINE
  • Gold Lime
  • Posts: 200
  • Thank you received: 40
  • Karma: 12
I do not know whether this is intended behaviour, but indeed, if you import the same question twice, the codes are the same.
What I would do: do not import the question the second time, but copy the (first) question. Then you can/must change the code. Or before import change the code of the first question.
Frans
The administrator has disabled public write access.

Copy Survey Not Working - Question Codes 8 months 6 days ago #112009

  • holch
  • holch's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 3407
  • Thank you received: 462
  • Karma: 151
Let us be clear here what you are trying: You try to export a whole survey and import it as a whole new survey, correct? In this case, as long as within the same survey you don't have the same question code twice this should be not a problem. The new survey should receive a new survey code and you should be fine.

I will make a test later.

However, when exporting and importing questions (like fransmacelissen is saying), you need to make sure to give the imported question a different question code to any other question within the survey you are importing to.
Have a look at the manual! It is a really valuable source for information. Here some helpful links:
Manual (EN) | Question Types | Question Attributes | Workarounds

If you found this answer helpful and it saved you some time please consider a donation to the project to keep Limesurvey going!
The administrator has disabled public write access.

Copy Survey Not Working - Question Codes 8 months 6 days ago #112010

  • holch
  • holch's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 3407
  • Thank you received: 462
  • Karma: 151
Just exported and then imported a survey with the same LS version as you and there are no error messages.

I would assume that there is something wrong with the survey you are trying to import and export.

Can you provide the survey as a download here or is it confidential?

Ahhh, I just had another look at your orginal post, and your export is a question file.

Of course there can't be two questions with the same name. So when you import the question to a survey where there is already a question with this code, you will need to change the code for one of them.

Just tested it and the question is imported without asking for a new question code. This wasn't a problem, because 'q4' did not exist in my test survey. I tried to import it again, which is when I got your error message.

So you have two quick solutions: If you want to have the same question twice in the same survey, don't export/import it, but copy it. Or you need to change the question code for the one that already exists after exporting, so you can import it. Ideally there would be a dialog when importing, so that you can change the question code of the imported question. I think a bug report would be good. But for now you can solve it with the above aproaches.

For importing Surveys this doesn't happen. Might be also a problem for importing groups.
Have a look at the manual! It is a really valuable source for information. Here some helpful links:
Manual (EN) | Question Types | Question Attributes | Workarounds

If you found this answer helpful and it saved you some time please consider a donation to the project to keep Limesurvey going!
Last Edit: 8 months 6 days ago by holch.
The administrator has disabled public write access.

Copy Survey Not Working - Question Codes 4 months 3 weeks ago #115381

  • ohvelma
  • ohvelma's Avatar
  • OFFLINE
  • Senior Lime
  • Posts: 59
  • Thank you received: 3
  • Karma: 3
Yep, this is an issue for importing groups.

I have the situation where I am asking respondents to enter family health information for my group's research study, so we are asking the same questions over and over again with each family member.

I created a group with health info questions for a family member, thinking I could export and import the group again for the second family member. I can export/import to .lss files, BUT all the references get broken since we are referencing ONLY the question name. It would be really great if LimeSurvey namespaced the questions. That is what we used to do when with had SGQA names. We lost some flexibility going to a user defined name.

It is very tedious to go through and rename EVERY question, so I thought I'd export the whole survey to Excel make the modifications and then upload again. BUT no that doesn't work anymore either. I can't get a survey saved as txt to upload again. Maybe someone else knows a trick I don't.

IT's a little frustrating because I know we used to have that functionality.

I am playing around with different approaches ... but if anyone else has crossed this bridge and KNOWS how to get to the other side I'd appreciate a head's up.

What I am thinking I will try:
- Playing around with different types of export/import
- Try using SGQA names for questions and doing export/import of the group

Carole
The administrator has disabled public write access.

Copy Survey Not Working - Question Codes 4 months 3 weeks ago #115397

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 7075
  • Thank you received: 957
  • Karma: 282
Hi,

I update directly the lsg file for this, for example adding G1 at start of each question. Open with gedit and replace all G1 by G2.

It work, but it's not cool, then you can pit a feature request.
The administrator has disabled public write access.

Copy Survey Not Working - Question Codes 4 months 3 weeks ago #115400

  • fransmarcelissen
  • fransmarcelissen's Avatar
  • OFFLINE
  • Gold Lime
  • Posts: 200
  • Thank you received: 40
  • Karma: 12
Extra advice: always make a backup of the db first, before doing this kind of things.
Even more naughty: you can also change the names of the questions and the references also directly in the mysql database. Again: never do this without making a backup first!
Succes!
frans
The administrator has disabled public write access.
The following user(s) said Thank You: ohvelma

Copy Survey Not Working - Question Codes 4 months 3 weeks ago #115433

  • ohvelma
  • ohvelma's Avatar
  • OFFLINE
  • Senior Lime
  • Posts: 59
  • Thank you received: 3
  • Karma: 3
Ah, great tip!
The administrator has disabled public write access.
  • Page:
  • 1
  • 2
Moderators: ITEd
Time to create page: 0.183 seconds
Donation Image