- Posts: 18
- Thank you received: 0
Ask the community, share ideas, and connect with other LimeSurvey users!
Please Log in to join the conversation.
Please Log in to join the conversation.
Please Log in to join the conversation.
Please Log in to join the conversation.
Please Log in to join the conversation.
false : it workUnfortunately, events for responses don’t work.
2022/03/12 15:30:45 [trace] [plugin.TestResponseEvent] beforeSurveyDynamicSave for on 713188 2022/03/12 15:30:45 [trace] [plugin.TestResponseEvent] afterSurveyDynamicSave for new on 713188 2022/03/12 15:30:45 [trace] [plugin.TestResponseEvent] beforeResponseSave for new on 713188 2022/03/12 15:30:45 [trace] [plugin.TestResponseEvent] afterResponseSave for new on 713188 2022/03/12 15:30:54 [trace] [plugin.TestResponseEvent] beforeResponseSave for new on 713188 2022/03/12 15:30:54 [trace] [plugin.TestResponseEvent] afterResponseSave for new on 713188
public function init() { $this->subscribe('beforeResponseSave', 'testResponseSave'); $this->subscribe('beforeSurveyDynamicSave', 'testResponseSave'); $this->subscribe('afterResponseSave', 'testResponseSave'); $this->subscribe('afterSurveyDynamicSave', 'testResponseSave'); } public function testResponseSave() { if (Yii::app() instanceof CConsoleApplication) { return; } $eventName = $this->getEvent()->getEventName(); $surveyId = $this->getEvent()->get('surveyId'); $oResponse = $this->getEvent()->get('model'); if(!empty($oResponse->id)) { $srid = "new"; } else { $srid = $oResponse->id; } $this->log("{$eventName} for {$srid} on {$surveyId}"); }
Please Log in to join the conversation.
Please Log in to join the conversation.