Hi David,
Did you know if PHP have another way to 'knock' a python script ? PHP exec is always disable for security purpose but maybe another solution.
Else : you can call the same line directly in PHP using manual.limesurvey.org/AfterSurveyComplete and curl.
Some example of php script : framagit.org/SondagePro-LimeSurvey-plugi...enByResponse.php#L58
You just need the public function afterSurveyComplete()
and put a curl
Quickly done (not tested)
Did you know if PHP have another way to 'knock' a python script ? PHP exec is always disable for security purpose but maybe another solution.
Else : you can call the same line directly in PHP using manual.limesurvey.org/AfterSurveyComplete and curl.
Some example of php script : framagit.org/SondagePro-LimeSurvey-plugi...enByResponse.php#L58
You just need the public function afterSurveyComplete()
and put a curl
Quickly done (not tested)
public function afterSurveyComplete() {
$surveyId =$this->getEvent()->get('surveyId');
$token = isset($_SESSION['survey_'.$surveyId]['token'] ? $_SESSION['survey_'.$surveyId]['token'] : null;
if($token) {
// There are surely another way to call a py script ???
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://localhost:8080/cgi-bin/Psychiatric%20Diagnostic%20Interview%20Print.py?surveyid=".$surveyId."&urltoken=".$token);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$output = curl_exec($ch);
curl_close($ch);
}
}