|Anonymous | Login||2015-12-01 12:02 CET|
|My View | View Issues | Change Log | Roadmap | Repositories|
|View Issue Details|
|ID||Project||Category||View Status||Date Submitted||Last Update|
|08633||Development||[All Projects] RemoteControl||public||2014-01-30 15:59||2014-02-03 11:43|
|Target Version||Fixed in Version|
|Summary||08633: API functions for Export Survey, Import Survey, Activate Survey, Deactivate Survey|
|Description||We 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.
|Tags||No tags attached.|
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.
|trougakoss, since you have been working on the API a lot, maybe you can provide some help?|
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.
|Also, use 2.05|
|Hello mmirasol, if there is something i can help you with (that is not already answered), please let me know|
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?
|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.|
|Which PHP versions are used on the two systems?|
edited on: 2014-02-03 11:43
Have a look at http://manual.limesurvey.org/RemoteControl_2_API#PHP_Example [^] for a PHP example and library.
According to https://code.google.com/p/json-rpc-stomp-simple/source/browse/trunk/Php/test-json-rpc.php?r=5 [^] you may need to include an additional file.
|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|
|Copyright © 2000 - 2015 MantisBT Team|