Welcome to the LimeSurvey Community Forum

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

Does the limesurvey have beforeSurvey event?

  • liumingjun
  • liumingjun's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 11 months ago #209791 by liumingjun
I hope that there will be a logic process before the questionnaire is loaded, and an event will be triggered before the welcome page. Does limesurvey have such an event?
I can only add code to application/controllers/survey/index.php 608 line now,
eg:
$event = new PluginEvent('beforeSurvey');
$event->set('surveyId', $surveyid);
App()->getPluginManager()->dispatchEvent($event);

Is there a better way? Or comes with the system? Or I submit to github?
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team & Official Partner
  • LimeSurvey Community Team & Official Partner
More
3 years 11 months ago #209796 by DenisChenu
Replied by DenisChenu on topic Does the limesurvey have beforeSurvey event?

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. - Professional support - Plugins, theme and development .
I don't answer to private message.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team & Official Partner
  • LimeSurvey Community Team & Official Partner
More
3 years 11 months ago #209797 by DenisChenu
Replied by DenisChenu on topic Does the limesurvey have beforeSurvey event?

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. - Professional support - Plugins, theme and development .
I don't answer to private message.
The topic has been locked.
  • liumingjun
  • liumingjun's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 11 months ago #209798 by liumingjun
Replied by liumingjun on topic Does the limesurvey have beforeSurvey event?
I hope it will only be triggered once before the welcome, and will not be triggered later
The topic has been locked.
  • liumingjun
  • liumingjun's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 11 months ago #209799 by liumingjun
Replied by liumingjun on topic Does the limesurvey have beforeSurvey event?
beforeSurveyPage && beforeSurveyDynamicSave Unable to meet demand...
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team & Official Partner
  • LimeSurvey Community Team & Official Partner
More
3 years 11 months ago #209819 by DenisChenu
Replied by DenisChenu on topic Does the limesurvey have beforeSurvey event?

liumingjun wrote: I hope it will only be triggered once before the welcome, and will not be triggered later

You can test if $_SESSION is set or not in beforeSurveyPage

If not set and survey is active (and don't have token) : it's the welcome page.
If have token : is_empty($_SESSION) && isset(App()-getRequest()->getParam('token'))



Again : purpose :)

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. - Professional support - Plugins, theme and development .
I don't answer to private message.
The topic has been locked.
  • liumingjun
  • liumingjun's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 11 months ago #209830 by liumingjun
Replied by liumingjun on topic Does the limesurvey have beforeSurvey event?
I understand what you mean, I will try, thank you,
The following user(s) said Thank You: DenisChenu
The topic has been locked.
More
3 years 10 months ago #211206 by wpfan2099
Replied by wpfan2099 on topic Does the limesurvey have beforeSurvey event?
g day

very interesting - can we have some more infos on that topic?

this would be nice
The topic has been locked.
Moderators: holchtpartner

Lime-years ahead

Online-surveys for every purse and purpose