Hi,
Extend EM is on projet, but we need to simplify, then rewrite it before.
All is done in helper/expression/em_core_helper.php ... a really big file with really big function.
Actually : we don't have included solution ...
BUT : you can do a plugin to search in the database with beforeSurveyPage and fill a "hidden" question with the answer.
Something like that (very quick)
Code:
public function beforeSurveyPage()
{
$questionId="123X45X67"; // SGQA style
$oEvent=$this->getEvent();
$iSurveyId=$oEvent->get('surveyId');
$sessionSurvey=Yii::app()->session["survey_{$iSurveyId}"];
if($sessionSurvey && empty($sessionSurvey[$questionId]) && !empty($sessionSurvey['token'])))
{
$sessionSurvey[$questionId]=$this->callFuction($sessionSurvey['token']);
Yii::app()->session["survey_{$iSurveyId}"]=$sessionSurvey;
}
}
private function callFuction($sToken)
{
// Here the best is to create a new connexion DB with Yii and use Yii to find the information
// But i think Yii can accept another method
// See https://gitlab.com/Shnoulle-LimeSurvey-plugin/authWPbyDB/blob/master/AuthWPbyDB.php#L193 for an example
}