- Posts: 111
- Thank you received: 20
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
event "beforeQuestionRender"
- orvil
- Topic Author
- Offline
- Premium Member
Less
More
6 years 2 months ago #164310
by orvil
Best regards/Beste Grüße,
O. Villani
event "beforeQuestionRender" was created by orvil
Hi,
I found this example for a plugin
<?php
class HelloWorld extends \ls\pluginmanager\PluginBase{
static protected $description = 'Hello World Plugin';
static protected $name = 'Hello World';
public function init() {
$this->subscribe('beforeQuestionRender');
}
public function beforeQuestionRender(){
$this->getEvent()->set('questionhelp', 'Hello World');
}
}
?>
Plugin can be seen and activated in plugin manager, but the render part does not work in 3.3.1- although the call seems to fit the description in the manual. Any suggestions? Are there different event names /calls now?
Thanks
I found this example for a plugin
<?php
class HelloWorld extends \ls\pluginmanager\PluginBase{
static protected $description = 'Hello World Plugin';
static protected $name = 'Hello World';
public function init() {
$this->subscribe('beforeQuestionRender');
}
public function beforeQuestionRender(){
$this->getEvent()->set('questionhelp', 'Hello World');
}
}
?>
Plugin can be seen and activated in plugin manager, but the render part does not work in 3.3.1- although the call seems to fit the description in the manual. Any suggestions? Are there different event names /calls now?
Thanks
Best regards/Beste Grüße,
O. Villani
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13597
- Thank you received: 2487
6 years 1 month ago #164316
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.
Replied by DenisChenu on topic event "beforeQuestionRender"
I think it must work , but surely a bug to be reported
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.
The topic has been locked.
- orvil
- Topic Author
- Offline
- Premium Member
Less
More
- Posts: 111
- Thank you received: 20
6 years 1 month ago #164320
by orvil
Best regards/Beste Grüße,
O. Villani
Replied by orvil on topic event "beforeQuestionRender"
Unfortunately it does not. Tried different approaches, but in vain.
Background: I'm trying to reproduce the addScript to question plugin for 3.3.1 because the current version, avaliable at the plugin section does not work anymore. Everything is fine except the js-code 'injection'. Thanks in advance for any suggestions on this case.
Thanks
Background: I'm trying to reproduce the addScript to question plugin for 3.3.1 because the current version, avaliable at the plugin section does not work anymore. Everything is fine except the js-code 'injection'. Thanks in advance for any suggestions on this case.
Thanks
Best regards/Beste Grüße,
O. Villani
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13597
- Thank you received: 2487
6 years 1 month ago #164324
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.
Replied by DenisChenu on topic event "beforeQuestionRender"
This one :
www.limesurvey.org/index.php?option=com_...oquestion&Itemid=729
?
It use Yii registerScript system, then it's something else.
I didn't start working on fix it for 3.X version on any plugin … i think i start by sendMailCron
It use Yii registerScript system, then it's something else.
I didn't start working on fix it for 3.X version on any plugin … i think i start by sendMailCron
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.
The topic has been locked.
- orvil
- Topic Author
- Offline
- Premium Member
Less
More
- Posts: 111
- Thank you received: 20
6 years 1 month ago #164332
by orvil
Best regards/Beste Grüße,
O. Villani
Replied by orvil on topic event "beforeQuestionRender"
Yes, this one
Think this is a good training for me to learn. I do have some ideas for plugins that may be of interest for all users, but it's a long road from an idea to a working plugin :ohmy:
Especially the inserting / replacement / prepending / appaneding to the html and/or js-source of questions and the admin interface is of essence. So I still hope there is someone with some suggestions...
Think this is a good training for me to learn. I do have some ideas for plugins that may be of interest for all users, but it's a long road from an idea to a working plugin :ohmy:
Especially the inserting / replacement / prepending / appaneding to the html and/or js-source of questions and the admin interface is of essence. So I still hope there is someone with some suggestions...
Best regards/Beste Grüße,
O. Villani
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13597
- Thank you received: 2487
6 years 1 month ago - 6 years 1 month ago #164335
by DenisChenu
If questionhelp are not updated : Report the bug
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.
Replied by DenisChenu on topic event "beforeQuestionRender"
My suggestion : your HelloWorld plugin must work if you fix the extendorvil wrote: So I still hope there is someone with some suggestions...
Code:
class HelloWorld extends PluginBase{ … }
If questionhelp are not updated : Report the bug
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.
Last edit: 6 years 1 month ago by DenisChenu.
The topic has been locked.
- orvil
- Topic Author
- Offline
- Premium Member
Less
More
- Posts: 111
- Thank you received: 20
6 years 1 month ago #164343
by orvil
Best regards/Beste Grüße,
O. Villani
Replied by orvil on topic event "beforeQuestionRender"
Unfortunately this is NOT the crucial point, I'm using this meanwhile.
The Plugin is shown in the Configuration > Plugin Manager section of the admin interface correctly. So it is registered and active. The part of my reproduction of the addScriptToQuestion where some properties are shown in the questions option are working too - see the attached image.
Only the call(s) for rendering as given in the first example does not work. That's a pitty
The Plugin is shown in the Configuration > Plugin Manager section of the admin interface correctly. So it is registered and active. The part of my reproduction of the addScriptToQuestion where some properties are shown in the questions option are working too - see the attached image.
Only the call(s) for rendering as given in the first example does not work. That's a pitty
Best regards/Beste Grüße,
O. Villani
Attachments:
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13597
- Thank you received: 2487
6 years 1 month ago #164471
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.
Replied by DenisChenu on topic event "beforeQuestionRender"
Did you report the bug ?orvil wrote: …
Only the call(s) for rendering as given in the first example does not work. That's a pitty
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.
The topic has been locked.
- orvil
- Topic Author
- Offline
- Premium Member
Less
More
- Posts: 111
- Thank you received: 20
6 years 1 month ago #164513
by orvil
Best regards/Beste Grüße,
O. Villani
Replied by orvil on topic event "beforeQuestionRender"
Not yet. Do you think it's not my fault? Maybe I forgot something. If not I'll report it.
P.S.: there is no example in the manual manual.limesurvey.org/BeforeQuestionRender
Could make things more easy
P.S.: there is no example in the manual manual.limesurvey.org/BeforeQuestionRender
Could make things more easy
Best regards/Beste Grüße,
O. Villani
The topic has been locked.
- orvil
- Topic Author
- Offline
- Premium Member
Less
More
- Posts: 111
- Thank you received: 20
6 years 1 month ago #164517
by orvil
Best regards/Beste Grüße,
O. Villani
Replied by orvil on topic event "beforeQuestionRender"
meanwhile I found via $this->log() that
- function beforeQuestionRender() is never called when displaying a question
but
- function init() is called for each question. I'm surprised about that, thought init() is only called once
- function beforeQuestionRender() is never called when displaying a question
but
- function init() is called for each question. I'm surprised about that, thought init() is only called once
Best regards/Beste Grüße,
O. Villani
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13597
- Thank you received: 2487
6 years 1 month ago #164528
by DenisChenu
PS : if you want to know if it's ytour fault : test you plugin in a 2.7X version
PS2: you'r right : init must happen only one time, like afterLoad plugin
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.
Replied by DenisChenu on topic event "beforeQuestionRender"
DenisChenu wrote: I think it must work , but surely a bug to be reported
PS : if you want to know if it's ytour fault : test you plugin in a 2.7X version
PS2: you'r right : init must happen only one time, like afterLoad plugin
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.
The following user(s) said Thank You: orvil
The topic has been locked.
- orvil
- Topic Author
- Offline
- Premium Member
Less
More
- Posts: 111
- Thank you received: 20
6 years 1 month ago #164530
by orvil
Best regards/Beste Grüße,
O. Villani
Replied by orvil on topic event "beforeQuestionRender"
Thanks, I will do so.
Best regards/Beste Grüße,
O. Villani
The topic has been locked.