Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

do stuff on SurveyComplete Event

  • kitsunekyo
  • kitsunekyo's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
8 years 9 months ago #130071 by kitsunekyo
do stuff on SurveyComplete Event was created by kitsunekyo
Hi,

I'm pretty new to limesurvey and my client wants to lock videos behind a survey and trigger another survey when the video has finished playing.
I will do that with a custom shortcode / plugin in wordpress but I dont know yet how to communicate between LimeSurvey and WordPress.

My plan is to either use PostMessage (cross domain communication for iframes) or localstorage / cookies and ask for a "surveyComplete" property in either cookies or somewhere else.

What I dont know yet is how to fire an event once the survey has been submitted by the user. Is there something already in place I can build upon?
a surveyComplete() event seems so basic that I cant imagine to be the first to ask this. :)

Thanks a lot for your help in advance.
The topic has been locked.
  • kitsunekyo
  • kitsunekyo's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
8 years 9 months ago #130095 by kitsunekyo
Replied by kitsunekyo on topic do stuff on SurveyComplete Event
I could solve this problem by using PostMessage in a javascript section of the conclusion section of the survey. since the user could only get to this section when the survey was submitted.

my plugin then set up an event listener for post message and fired an event once the desired message was received.

using post message solves the CORS issue as well.

can be closed.
The topic has been locked.
Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose