- Posts: 3
- Thank you received: 0
Ask the community, share ideas, and connect with other LimeSurvey users!
<?php class PythonActivator extends PluginBase { protected $storage = 'DbStorage'; static protected $description = 'PythonActivator for Limesurvey'; static protected $name = 'PythonActivator'; public function init() { $this->subscribe('afterSurveyComplete', 'activatePythonScript'); } /** * Send the webhook on completion of a survey * @return array | response */ public function activatePythonScript() { $event = $this->getEvent(); $surveyId = $event->get('surveyId'); $responseId = $event->get('responseId'); $response = $this->pluginManager->getAPI()->getResponse($surveyId, $responseId); $command_exec = escapeshellcmd('/AbsoluterPfad/plugins/PythonActivator/mysql.py'); $str_output = shell_exec($command_exec); echo $str_output; } } ?>
Da dürfte das LimeSurvey-Forum wenig Hilfe bieten. Die Frage lautet ja eher "Wie kann Python in deiner Hostingumgebung ausgeführt werden"? Wenn Du nicht volle Kontrolle hast, dann wird der Provider ja am ehesten wissen, ob und wie Python unterstützt wird.
Code:Das Plugin wird auch soweit erfolgreich installiert, allerdings weiß ich nicht genau wie ich das Skript starten kann, da exec ja Sicherheitstechnisch unterbunden wird.