Actions

Alternatives to the LimeSurvey import function/zh-hant: Difference between revisions

From LimeSurvey Manual

m (Text replace - "<br/>" to "<br />")
(Updating to match new version of source page)
Line 29: Line 29:
php cmdline_importsurvey -h
php cmdline_importsurvey -h


If you have previously exported a survey structure, you can import it from the "New Survey" screen. Click on the browse button to choose the SQL/CSV file, and then click on the button. The import process reads the following formats:
If you have previously exported a survey structure, you can import it from the "Create, import, or copy survey" screen. Click on the import button. Click on the browse button to choose the file, and then click on the button. The import process reads the following formats:
*.LSA files, .TXT files
*v1.50 or later .CSV files created by LimeSurvey
*v1.50 or later .CSV files created by LimeSurvey
*v1.90 or later .LSS files created by LimeSurvey
*v1.90 or later .LSS files created by LimeSurvey
Line 43: Line 44:
To use it, in the shell go to the limesurvey/admin folder and execute:
To use it, in the shell go to the limesurvey/admin folder and execute:


php cmdline_importsurvey <File to import> <nowiki>[</nowiki><user> <password>]
php cmdline_importsurvey <File to import> <nowiki>[</nowiki><user> <password>]
 
*<File to import> has to be one of the described above
*<File to import> has to be one of the described above
*<user> has to be a user with the right to create surveys
*<user> has to be a user with the right to create surveys
Line 50: Line 52:
If you need to see the parameters you can execute:
If you need to see the parameters you can execute:


php cmdline_importsurvey -h
php cmdline_importsurvey -h


=Importing surveys from other applications=
=Importing surveys from other applications=


We are often getting requests to import a survey from other applications or survey providers. The problem is that providers like SurveyMonkey lock you in - it is not possible to export the survey structure from SurveyMonkey, only the response data. So you can see that using non-open propietary software or providers can be a bad idea in the first place.
We are often getting requests to import a survey from other applications or survey providers. The problem is that providers like SurveyMonkey lock you in - it is not possible to export the survey structure from SurveyMonkey, only the response data. So you can see that using non-open propietary software or providers can be a bad idea in the first place.

Revision as of 02:05, 13 June 2013

如果您在較早前曾導出問卷,您亦可以在 "新增問卷" 的頁面導入問卷。 您只需要 Click 選瀏覽按鈕選擇 sql/csv 檔案,然後 click  選有關按鈕。導入過程會讀取LimeSurvey建立的格式︰

'sql' 檔案,並 '乖巧地' (我故意使用這個字眼) 重新為問卷、組別、題目、答案及條件敘述編號,讓彼此可以互相配對。詳見 輸出問卷 的章節.

  • LimeSurvey (PHPSurveyor) v0.98 - v1.0 建立的 .SQL 檔案
  • LimeSurvey (PHPSurveyor) v1.45 or 以上版本建立的 .CSV 檔案

這樣你就可以從舊有版本導入舊問卷了

'有智慧地' 導入(我喜用這個術語) ,可以重排問卷,重排組別、題目、答案以至條件設定,令到彼此可以合作無間。 詳見 導出問卷.


自 1.50 版本起,可以透過系統的命令列(或 shell 層面) 執行導入問卷的工作。為此你先要使用 shell 層面,配合 PHP 組譯器的組態設定,讓源程序可以執行 shell 的核心指令。

這功能用處很大,特別是在大型的問卷導入工作時,常會出現 timeout 的問題。

使用方法是在shell 命令列進入 limesurvey/admin 資料夾執行:

php cmdline_importsurvey <導入的文件檔> [<持分者> <密碼>]

  • <導入的文件檔> 必須為上述格式的文件檔
  • <持分者> 必須為有權建立新問卷的持分者
  • <password> 持分者的密碼
    *<持分者> 及 <密碼> 只有在存取控制已啟用才用得著。

如果你需要找出參數,你可以執行:

php cmdline_importsurvey -h

If you have previously exported a survey structure, you can import it from the "Create, import, or copy survey" screen. Click on the import button. Click on the browse button to choose the file, and then click on the button. The import process reads the following formats:

  • .LSA files, .TXT files
  • v1.50 or later .CSV files created by LimeSurvey
  • v1.90 or later .LSS files created by LimeSurvey

That way you can import old surveys from previous version. The import 'intelligently' re-numbers the survey, group, question, answer and condition IDs so that they all match each other - no existing surveys will be overwritten. See section on Exporting a survey structure for more information.

Import using the commandline utility

Since version 1.50 it is possible to import surveys from the command line (or shell). To use this functionality you have to have access to the shell and the PHP interpreter has to be configured to allow shell execution of scripts.

This functionality is useful when you have timeout problems with the web version that could happen when you have very long surveys to import.

To use it, in the shell go to the limesurvey/admin folder and execute:

php cmdline_importsurvey <File to import> [<user> <password>]
  • <File to import> has to be one of the described above
  • <user> has to be a user with the right to create surveys
  • <password> the password for the user
    *<user> and <password> are only required if the control access is active

If you need to see the parameters you can execute:

php cmdline_importsurvey -h

Importing surveys from other applications

We are often getting requests to import a survey from other applications or survey providers. The problem is that providers like SurveyMonkey lock you in - it is not possible to export the survey structure from SurveyMonkey, only the response data. So you can see that using non-open propietary software or providers can be a bad idea in the first place.