Submit data to external system between each question group?

More
2 years 3 months ago #123052 by krypsin
krypsin created the topic: Submit data to external system between each question group?
Hi there all,

I am trying to go about hacking the core code to allow me to send the question & token data to an external database/system each time the user clicks "next" when on a survey, however after crawling through the source code for hours I can't seem to find the right file to edit to add in this behaviour...

Originally I was going to make a plugin to do this, but I don't think the plugin events can handle this kind of thing.
"afterSurveyComplete" is kinda what I'm after, but I need an event not for when the entire survey is completed but for when each group of questions is completed.

So it would go like this:

User starts a survey->fills out first group of questions->clicks "Next"->data goes into token database AND gets sent to remote system/database->fills out second group of questions->clicks "Next"->data goes into token database AND gets sent to remote system/database->and so on.

Is this too much of a complicated task that I am asking?

Any help is greatly appreciated.

Please Log in to join the conversation.

More
2 years 3 months ago #123072 by DenisChenu
DenisChenu replied the topic: Submit data to external system between each question group?
pwiki Plugin have some event to trace "move next/move previous", not sure it wrok (i don't use it), but can be an inspiration : git.framasoft.org/SondagePro-LimeSurvey-...PiwikPlugin.php#L235

The original event is beforeSurveyPage

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .

Please Log in to join the conversation.

More
2 years 3 months ago #123087 by krypsin
krypsin replied the topic: Submit data to external system between each question group?
Thanks for that, could be useful.

Only problem is though, I don't think that "beforeSurveyPage" will be able to access any of the users responses/answers they enter because the function is used before any of the user input happens?

Please Log in to join the conversation.

More
2 years 3 months ago #123093 by DenisChenu
DenisChenu replied the topic: Submit data to external system between each question group?
In BeforeSurveyPage : you can use Yii

Yii::app()->getRequest()->getPost('move'); give you the button clicked for example.

If i remind BeforeSurveyPage come after EM validation , then maybe you can try
LimeExpressionManager::GetLastMoveResult(); to have the last move result

Denis

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .

Please Log in to join the conversation.

More
2 years 3 months ago #123158 by krypsin
krypsin replied the topic: Submit data to external system between each question group?
Ah this is a good step forward! :)

But I cannot see how from here I am to find the users given answers from previous question group?

I'm looking in em_manager_helper.php but I can't find anything (This is a huge file!)

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!