I wrote a plugin where I added a drop down menu based on the value selected, I would like to change the values of other attributes not present in the Question object only in QuestionAttribute.
But I don't want to call befoeQuestionAttriibuteSave because if the value of the given attribute is empty then the event for that attribute doesn't exist.
I would like to change $ _POST values somehow (or otherwise change it?) Or raise a write event for the changed attribute. Unfortunately, I don't know how to do this.
If it's public : best is to use beforeQuestionRender
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.
I wrote a plugin. It adds a new attribute "newQuestionAttributes", that is "validation_type" of type "singleselect".
When editing the poll, edit the question. On the right side of the "Plugins" menu I have such a window with eg E-mail, Phone etc. I choose "Phone" and click save.
The plug-in catches the "beforeQuestionSave" event. In this case, I check this validation_type if it is "Phone". If so, he wants to set the appropriate validation rules in the 'em_validation_q' and 'em_validation_q_tip' fields.
The problem is that the "em_validation_q" fields are not present in the question attributes ($this->event->get('model')).
I don't know how to change the attribute for em_validation_q in such a way that it writes those attribute. Changing the value in $_POST doesn't change that.
How can I do it differently? How should it be correct. Is it possible in beforeQuestionSave 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.