View Issue Details

IDProjectCategoryView StatusLast Update
08633Development RemoteControlpublic2014-02-03 11:43
Reportermmirasol Assigned Totrougakoss  
Status assignedResolutionopen 
Summary08633: API functions for Export Survey, Import Survey, Activate Survey, Deactivate Survey
DescriptionWe are currently trying to develop a survey test tool which allows us to generate test links over surveys developed in lime. What we want to do primarily is point our test tool to the second instance so that all test data is separated from real data.

The challenge here is that we want the second instance to be completely controlled by the first instance so that whenever any changes are made to the first these are also replicated on the second so that we don't have to export, import and activate manually.

1. When a survey is activated on the first instance, the survey is exported and imported in the second instance and also activated.
2. If a survey is deactivated on the first instnace, it will also be deactivated on the second instance.
3. If any changes are made the survey on the first instance, these are also replicated on the second.

TagsNo tags attached.

Users monitoring this issue

User List There are no users monitoring this issue.




2014-01-30 18:08

reporter   ~28285

Hello guys. I'm currently working with a copy of limesurvey 2.00. And I'm trying to figure out where the helpers in the remote control API are being loaded from.

Example: in the activate_survey function, I see:

$aActivateResults = activateSurvey($iSurveyID);

I would like to ask what admin/activate is referring to.
Secondly, I would like to ask where the activateSurvey function is defined.

If you can point me in the right direction, I believe I should be able to figure out how the API works and come up with the missing functions that we need.


2014-01-30 22:28

partner   ~28288

trougakoss, since you have been working on the API a lot, maybe you can provide some help?


2014-01-30 22:59

reporter   ~28289

hi mmirasol,
Some of your questions can be answered rather simply.
1. activateSurvey is defined in application/protected/helpers/admin/activate_helper.php (you can easily find this by using ctrl+click where the function is used; in most IDEs that takes you to the declartion) (alternatively just use a find in files function, present in almost all IDEs and editors to find all occurences of "function activateSurvey".

2. Internally activating a survey should be done in the Survey model. Currently this code is located in the helper file mentioned in 1, ideally one would activate a survey with the following code:


3. From a plugin we provide the LimesurveyApi object; currently this object has functions like getToken and getResponses, a function getSurvey can easily be added.
Activating a survey would then look like this:

$this->api->getSurvey(12345)->activate(); // Obviously in reality you would want to check for a return value != null to prevent errors.

Good luck!


2014-01-30 22:59

reporter   ~28290

Also, use 2.05


2014-01-31 13:19

reporter   ~28308

Hello mmirasol, if there is something i can help you with (that is not already answered), please let me know


2014-01-31 15:45

reporter   ~28329

Thank you, trougakoss and sammousa. Currently, our web server is running on php 5.1 so we cannot use 2.05 yet. And we have other applications running on this server so we cannot upgrade without checking the impact yet.

So now, we can only work with lime 2.00.

sammousa, lime 2.00 does not have a protected folder, but I see application/helpers/admin/activate_helper.php is there. Is it correct to assume the any references to the protected folder is pointing directly to the application folder?

secondly, how does the Yii::app()->loadHelper('admin/activate');
function work? Where can I find a list of helpers that I can load?


2014-02-01 04:43

reporter   ~28364

I also have a question about json-rpc. Is it a php class that needs to be enabled? I cannot connect to my local instance of limesurvey running on wampserver but I can connect to another instance that's hosted online. Please advise what I should check so I can work locally.


2014-02-03 11:39

partner   ~28433

Which PHP versions are used on the two systems?


2014-02-03 11:41

partner   ~28434

Last edited: 2014-02-03 11:43

View 2 revisions

Have a look at for a PHP example and library.

According to you may need to include an additional file.

Issue History

Date Modified Username Field Change
2014-01-30 15:59 mmirasol New Issue
2014-01-30 18:08 mmirasol Note Added: 28285
2014-01-30 22:25 Mazi Project Bug reports => Development
2014-01-30 22:28 Mazi Assigned To => trougakoss
2014-01-30 22:28 Mazi Status new => assigned
2014-01-30 22:28 Mazi Note Added: 28288
2014-01-30 22:59 sammousa Note Added: 28289
2014-01-30 22:59 sammousa Note Added: 28290
2014-01-31 13:19 trougakoss Note Added: 28308
2014-01-31 15:45 mmirasol Note Added: 28329
2014-02-01 04:43 mmirasol Note Added: 28364
2014-02-03 11:39 Mazi Note Added: 28433
2014-02-03 11:41 Mazi Note Added: 28434
2014-02-03 11:43 Mazi Note Edited: 28434 View Revisions