Add column to "responses" table of survey with a plugin

More
5 months 1 week ago #231217 by Miratek
Please help us help you and fill where relevant:
Your LimeSurvey version: LimeSurvey Community Edition Version 5.3.14+220516
Own server or LimeSurvey hosting: Own Server
Survey theme/template: -
==================

Hey guys,

I'm developing a plugin. If an user participates on the survey, I can see all the responses on the page "responses" in a table (with columns like "completed" etc.).
But I want to write additional information to the database so the table shows another custom column, e.g. "successful" where PHP should define if a user gets a true or false (based on some variables). 
My approach is to use the afterSurveyComplete-Event. I can already show the responses via $this->pluginManager->getAPI()->getResponse($surveyId, $responseId);
But how can I set an additional variable there? How to write data to the database?

Greetings!

Please Log in to join the conversation.

More
5 months 1 week ago #231219 by tammo
To add a new column to your responses tabel, you can also add a hidden question (text) with the question code "succesful"


Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl

Please Log in to join the conversation.

More
5 months 1 week ago #231226 by Miratek
That would be possible, yes. But I want that a limesurvey survey creator only needs to install my plugin and do not alter its survey (by adding additional questions).
Is there another way?

Please Log in to join the conversation.

More
5 months 1 week ago #231229 by tammo
Well, yes, but then you would indeed need a plugin.

I am not good at that, possibly one of the other experts that hang around here may be able to help you.

Tammo


Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl

Please Log in to join the conversation.

More
5 months 1 week ago #231236 by Miratek
Thank you for your answers!
Yes indeed, my whole topic is about me developing a plugin :-)

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now