Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Tutorial how to create admin menu entry that is calling custom PHP script

More
2 years 2 months ago #210684 by nkamp01
Hello,

If I google on manual/Tutorial about limesurvey plugin (and/or development), I find 'old documentation of 5 years ago like that from Reportico (PHP 5.3).
So is there a new more recent documentation to build a plugin for limesurvey?
Also when I search on the official plugin page, there are old plugins for limesurvey version 2.05 but I'm using limesurvey 3.25.

My feeling is that the documentation is not up to date or do I not search good enough?

We have python scripts to anylyse the assessment data. But for now this is running from the commandline (Linux).
What I like todo is 
  • add a new main menu item at the admin site "Assessment Result" for example, with a submenu item "analyse assessment"
  • When I click on the menu item "analyse assessment", an page is openend with three fields to fill in by the user.  and a start button.
  • When I press the start button, submit to the server and from the PHP code the python scripts are executed.
  • The python scripts are now creating an html page, I hope that I can embed in page of limesurvey, so that you can see the result in LimeSurvey.
Is there documentation so that I can realize this? Or does somebody know if there is a plugin which is more or less doing this thing..?
I have PHP 7.4.14, LimeSurvey 3.25

I hope that someone can help me a bit further.

Nico
The topic has been locked.
More
2 years 2 months ago #210692 by DenisChenu
Did you look at core plugins ?

There are some in demo directory
Else : manual.limesurvey.org/Available_third_party_plugins is a better list for uptodate plugins

Else
  1. manual.limesurvey.org/BeforeToolsMenuRender or create a right menu : gitlab.com/SondagesPro/managament/respon...tAndManage.php#L1770
  2. Why not use survey settings ? manual.limesurvey.org/BeforeSurveySettings else : github.com/LimeSurvey/LimeSurvey/blob/03...PluginHelper.php#L21
  3. manual.limesurvey.org/NewSurveySettings or PluginHelper
  4. python is not PHP …
In my opinion: gitlab.com/SondagesPro/managament/respon...stAndManage.php#L368 PluginHelper is a good solution …

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.
More
2 years 2 months ago #210709 by nkamp01
Thanks DenisChenu.
I've been through the Available_third_party plugins, but these have been changed in 2014 if I go to github.
And the others, is going to github with an PHP file, but then? No explanation or what I can or should do.
There is in plugin directory an directory "Example". But can activate that plugin? How? Were can I find the documentation about this?
I know python is something different than PHP.

I have changed my mind a little. I want to add a button at the survey bar, see my screenshot. And when I press on that button than it should do what I have written were this thread is started with.

I have found in the files:
  • htdocs\limesurvey\application\views\admin\survey\surveybar_view.php 
    Code:
    <!-- Extra menus from plugins -->
            <?php App()->getController()->renderPartial(
                '/admin/survey/surveybar_plugins',
                [
                    'beforeSurveyBarRender' => $beforeSurveyBarRender
                ]
            ); ?>
  • htdocs\limesurvey\application\views\admin\survey\surveybar_plugins.php. I expect that the array $beforeSurveyBarRender will be filled with menu items of plugins. But were do I place these plugins? I mean in the limesurvey/plugin directory or htdocs\limesurvey\application\core\plugins\
I hope that someone can help me with some to documentation how to add a plugin and activate it.

If I'm not looking at right place than it's my fault, but for me now it's hard to find, sorry.
The topic has been locked.
More
2 years 2 months ago #210762 by DenisChenu
All my plugins are free like a speech  …

> I hope that someone can help me with some to documentation how to add a plugin and activate it.

extensions.sondages.pro/about/install-an...-for-limesurvey.html

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.
More
2 years 2 months ago #210773 by nkamp01
Hello DenisChenu,

I have seen these, I have tried three plugins, but till now, I can't find were I'm looking for.
I have just installed "export all answers", try to activate and than I get the error message "class 'exportCompleteAnswers' does not have a method 'beforeActivate'".

But is there an document or another plugin, that is adding a button at the top-menu bar of the survey, so that I can look at that one how that needs to be done?

There is an array named "$beforeSurveyBarRender", so this means in my opinion that there are specific plugins for the survey page.
Does anyone know a plugin for the survey page?
The topic has been locked.
More
2 years 2 months ago #210782 by DenisChenu
> I have just installed "export all answers", try to activate and than I get the error message "class 'exportCompleteAnswers' does not have a method 'beforeActivate'".

LimeSurvey version and buildnumber ?
How you can have this ? Way to reproduce ?
 

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.

Lime-years ahead

Online-surveys for every purse and purpose