Does the limesurvey have beforeSurvey event?

More
11 months 1 week 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?

Please Log in to join the conversation.

More
11 months 1 week ago #209796 by DenisChenu

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development . I don't answer to private message.

Please Log in to join the conversation.

More
11 months 1 week ago #209797 by DenisChenu

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development . I don't answer to private message.

Please Log in to join the conversation.

More
11 months 1 week ago #209798 by liumingjun
I hope it will only be triggered once before the welcome, and will not be triggered later

Please Log in to join the conversation.

More
11 months 1 week ago #209799 by liumingjun
beforeSurveyPage && beforeSurveyDynamicSave Unable to meet demand...

Please Log in to join the conversation.

More
11 months 1 week ago #209819 by DenisChenu

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 service on demand , plugin development . I don't answer to private message.

Please Log in to join the conversation.

More
11 months 1 week ago #209830 by liumingjun
I understand what you mean, I will try, thank you,
The following user(s) said Thank You: DenisChenu

Please Log in to join the conversation.

More
10 months 1 week ago #211206 by wpfan2099
g day

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

this would be nice

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now