Welcome, Guest
Username: Password: Remember me

TOPIC: Copy Survey Not Working - Question Codes

Copy Survey Not Working - Question Codes 3 weeks 4 days ago #111980

  • Mike1985_2
  • Mike1985_2's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 12
  • 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: 3 weeks 4 days ago by Mike1985_2. Reason: Added another question
The administrator has disabled public write access.

Copy Survey Not Working - Question Codes 3 weeks 3 days ago #111990

  • holch
  • holch's Avatar
  • NOW ONLINE
  • LimeSurvey Team
  • Posts: 2682
  • Thank you received: 324
  • Karma: 121
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 3 weeks 3 days ago #111994

  • Mike1985_2
  • Mike1985_2's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 12
  • 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 3 weeks 3 days ago #111996

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 3 weeks 3 days ago #112009

  • holch
  • holch's Avatar
  • NOW ONLINE
  • LimeSurvey Team
  • Posts: 2682
  • Thank you received: 324
  • Karma: 121
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 3 weeks 3 days ago #112010

  • holch
  • holch's Avatar
  • NOW ONLINE
  • LimeSurvey Team
  • Posts: 2682
  • Thank you received: 324
  • Karma: 121
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: 3 weeks 3 days ago by holch.
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.159 seconds
Donation Image