After the survey is completed, users are redirected back to the main site and the answers are automatically synced.
But, for some of the synced content, the user name is blank and the system reports the author as "anonymous (not verified)."

Oddly, this does not happen with all of the content (most of it, though).

Any idea why this might happen and how I can fix it? It matters mostly b/c I have a rule set up to send emails after the import. But, without the user name, it can't find the relevant user info to send the emails.

Thanks.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

thedut’s picture

Hello jarman,

In order to save the author, you have to set specific options on your LimeSurvey Admin interface :

  • Enable token-based response persistence
  • and the Token table must have been created.

You can check those 2 parameters from your survey view page.

For a better support, provide some informations :

  • does token-based response persistence is enabled ?
  • does the Token table has been created ?
  • Which LimeSurvey version are you using :LimeSurvey v1 or v2 ?
  • Do you use a One Page survey ?
  • Are anonymous users allowed to create answers ?
jarman’s picture

Thanks for the feedback. I'm sorry I didn't provide more information. Here is my set up:

I am using Limesurvey v2.
It is a multi-page survey.
My Drupal site only allows registered users the ability to see the link (to the survey) and create the content.

Token-based response persistence is not enabled.
The token table has not been created.

The weird thing is that it occasionally works. I cannot replicate the error, but it happens quite often. I have completed the survey nearly a dozen times without a problem. But, most every other user, upon redirection from the survey back to the drupal site, receives an error code (because the site automatically imported their content as anonymous and couldn't find their email address). I attached a screen shot to help show that. And, a screen shot of most imports showing as anonymous, but not the one I just completed.

Any help is greatly appreciated.

thedut’s picture

Token-based response persistence is not enabled.
The token table has not been created.

Try to change thoses 2 parameters according to #1 from your limesurvey admin interface and test again.

You will probable need to desactivate the survey first, then change parameters, and at last activate your survey again.

jarman’s picture

I made the changes to the parameters, but that did not fix the problem. Here is what happens: when the user creates a new answer, the system now reports the user name and the survey in the log (ie, survey #32). Then, when they are done with the the survey, and redirected back to the drupal site, the log shows an entry from ls_answ from "anonymous" with the message "the answer has just been edited." It continues to show the mail error (b/c the user is now anonymous. And, there is a new error from PHP: "Strict warning: only variables should be passed by reference in lime survey_sync_answ_set_invit()" from line 397 of lime survey_sync_api_answ.inc. This started to appear after I checked the box to "fill the token table of the LimeSurvey database with corresponding usernames and emails" (at least, I think that's when it started).

My goal is to have Rules automatically email the user when they are redirected back to the site. But, as long as the ls_answ shows the action by anonymous, it can't find the user's email.

Thanks so much for continuing to help with this.

jarman’s picture

Just an update. I have a solution that I wanted to share. Instead of relying on the sync to correctly identify the author of the post, I just included the user profile information on the response content type. Then, in Rules, I accessed that info with [node:field-profile-last] instead of [site:current-user:field-profile-first].

Thanks so much for this great module.

thedut’s picture

Status: Active » Closed (works as designed)

Great !
As a conclusion, you have to target the node author instead of the current user for Rules.

And, there is a new error from PHP: "Strict warning: only variables should be passed by reference in lime survey_sync_answ_set_invit()" from line 397 of lime survey_sync_api_answ.inc. This started to appear after I checked the box to "fill the token table of the LimeSurvey database with corresponding usernames and emails" (at least, I think that's when it started).

I will dig on the error message you provide. Maybe it is just a notice error.