Hi.

At the moment Limesurvey Sync creates a new token every time a user fills out a survey. It would be great if you could add a feature that first checks to see if there is a premade token in Lime Survey. I guess the best way would be to compare the email in drupal user database with the token table in lime. The main reason for this request is that without such a feature you can't use token specific attributes and fields. It would be even better if you could also add a feature that only allows a user to enter a survey if there is a premade token. I guess this feature should also check the token uses left field so that a user could only enter a new survey if there are uses left.

A different way to solve this would be if the limesurvey sync could add information to the token during creation. Like First Name, Last Name, Uses Left and token attributes. Even if you do it this way it would still require some way to restrict how many times a user could enter a survey.

Thanks for all your great work!

Comments

thedut’s picture

Status: Postponed » Active

Hi,

This is an interesting thread about requested feature on the LimeSurvey Sync module.
However, some features are already availables :

if the limesurvey sync could add information to the token during creation. Like First Name, Last Name, Uses Left and token attributes.

If you check on the survey tab options page "Fill the token table of the LimeSurvey database with corresponding usernames and emails", the created token will contain

  • the drupal username into the LimeSurvey field Last Name
  • and the Drupal user mail into the LimeSurvey field email.
  • The limeSurvey field "First Name" will be empty
  • and the Uses Left field will be set to 1.

a feature that only allows a user to enter a survey if there is a premade token

This is already available : on the LimeSurvey admin interface, set your survey to "switch to closed-access mode" and don't create tokens from the LimeSurvey admin interface : the survey will be available only from your drupal site, with the auto-generate token. Read below for restricting access depending on specific attribute values (not available yet).

In order to allow a user to edit a survey from the Drupal site, disctinct answers (from a same user and a same survey) should have distinct tokens (1 answer = 1 unique token). That why premade tokens is not the right way.

some way to restrict how many times a user could enter a survey

The right way should be to restrict how many new answer nodes a user may create. The Node Limit custom module can already do that (I have not tested it but it should work).

As a new feature, it could be interesting to create cck Fields for answer nodes : the drupal site would import thoses values into attribute colomns on the LimeSurvey token table.
Then it would be possible to create rules (using the Rules custom module) allowing to create a new answer only if the attribute value match an expected value.

thedut’s picture

Status: Active » Postponed
henrkmunch’s picture

Status: Active » Postponed

Sounds like a great idea. I'll have to try out the nodes module. It would however be great if you could "map" more fields in drupal that could be passed to lime. For instance custom fields for First name, Last name and token attributes.

On the other hand lime has a great system for passing out tokens and keeping track of reminders and it would be nice if you could use it by doing it the other way around. That is mapping drupal user email to the a premade token database.

Rules module would also be great but I guess that takes alot more work.

I really love your module and for god sake don't make it into SurveyPress but there are still a few simple features that you could "steal" from that plugin..... ;)

thedut’s picture

I'm glad you enjoy this module.
IHO, this is the best Drupal survey module ever ! ;)

It would however be great if you could "map" more fields in drupal that could be passed to lime. For instance custom fields for First name, Last name and token attributes.

Yes, it would.
I guess it is an advanced feature, that would only interest few users. I may implement it but it not my priory task.
I may work on that idea within monthes.

arellani’s picture

Version: 7.x-1.0 » 7.x-1.3
Assigned: Unassigned » arellani
Category: feature » support
Status: Postponed » Active

Hello

I select in survey tab options page "Fill the token table of the LimeSurvey database with corresponding usernames and emails", created token will contain:
the drupal username into the LimeSurvey field Last Name
and the Drupal user mail into the LimeSurvey field email.

Works Perfect! So...
I have in a User Profile some fields with "Token-value" already like Organization, Enterprice, telephone, Directions...
Is there some way to pre-fill this tokens in to the Lime survey field? Just like username or email..

Thanks for all your great work!

thedut’s picture

Version: 7.x-1.3 » 7.x-1.5
Assigned: arellani » Unassigned
Category: support » feature
Status: Active » Postponed

Hello arellani,

You are asking for a feature request.
I may implement it but it is not my priority task.
I am working right now on the LimeSurvey Sync 7.x-2.x version, then I will try to fix another issue, and then I may start to fix this one.
This request is postponed (within several monthes).

arellani’s picture

Title: Premade tokens » Field on View to access to answer the survey

Hello thedut

I already have Syncronized My Survey (On Limesurvey Site) with my Drupal Site.

I have a Content Type "Survey FCEX" and his Content Type for his answers "Answers Survey FCEX"".

So, I have one views with Content Type = "Survey FCEX"
I can not find the way or the field i have to add on the view, for my users sites (not admin) can add answers to this survey.

Field Title goes to the Survey edit (like an admin) What I have to do?

Thank you for your support.

thedut’s picture

Title: Field on View to access to answer the survey » Premade tokens

@arellani :

The issue system does not work that way.
Create a new issue going to https://drupal.org/node/add/project-issue/limesurvey_sync
Then I wil answer to your question.

[EDIT : answer HERE].

thedut’s picture

There is an interesting approch for premade tokens : the drupal sandbox project LimeSurvey Integeration (and its tutorial).
This module synchronize the Drupal users with the LimeSurvey central participant panel. You can then add token invitations from the central participant panel.
When synchronizing the Drupal users with the LimeSurvey central participant panel you can decide which fields to use as source for First name, Lastname, etc...
I may add such feature into the LimeSurvey Sync module in the future.

thedut’s picture

Assigned: Unassigned » thedut
Issue summary: View changes

The limesurvey SYnc module v7.x-2.0 is available as an alpha.
It will handle the LimeSurvey participant system. but it is not available yet. It is a future develppement on this branch.
The v2 comes with many improvements.
More informations here.

thedut’s picture

Version: 7.x-1.5 » 7.x-3.0-beta1
Status: Postponed » Fixed

Fixed Into the new v7.x-3.0-beta1 release : it is possible now to create tokens, and easily importing Dp user info (name, fields) into the LimeSurvey token table or Importing LimeSurvey token table infos into Drupal. A new interface is provided in order to create tokens for all users or only for specific roles users.

jsibley’s picture

Hi,

Could you please explain the new token capabilities or point me to any documentation? For example, where does one create / define tokens?

Also, can there be more than one token per user and will it be possible for users to have more than one participant entity associated with each user?

Also, when tokens are used, will it be a one-to-one relationship between token and participant, or an there be multiple tokens for each participant?

Many thanks!

thedut’s picture

Hi Johnathan !

Could you please explain the new token capabilities or point me to any documentation? For example, where does one create / define tokens?

I need to precise first the context : the LimeSurvey central participant datas is not handled by the LimeSurvey Sync v7.x-3.0-beta1 module : In order to associated Drupal Users with LimeSurvey participants, you will have to do it for each LimeSurvey survey, using the LimeSurvey Token table of each survey.

There are many ways to transfert informations between Drupal Users and LimeSurvey. In a nutshell :

  1. First use Rules to map fields relationships for token entity during the synchronization process.
  2. Then proceed to the synchronization.

Assuming your survey ID is 598191 and survey machine name is my_survey :

First case : Your LimeSurvey Token table is empty and you want to fill it with Drupal Users,

  1. Edit the rule : LimeSurvey Sync token import user infos from DP to LS (598191) (going to admin/config/workflow/rules/reaction/manage/rules_limesurvey_sync_token_598191_import_dp2ls.
    • Add the action 'set a data value',
    • set 'data' to entity:lss-uid:name (lss_uid is the Drupal user this token is for)
    • and 'value' to entity:ls-lastname :
    • On creating/updating a token enabling the Synchronization from DP to LS : the LimeSurvey token lastname will become the corresponding Drupal username.
    • You can repeat this operation for all user fields and LimeSurvey token attributes to. You can changes any token information, like setting usesleft to 5 instead of 1.
  2. Create tokens from Drupal :
    • Do it one by one from the create token page (going to ls-token-598191/add, selecting a user, checking "synchronize DP to LS" and save.
    • Or for many or all users, going to admin/structure/limesurvey/token/my-survey/users
    • clicking to "create tokens"

  3. EDIT : Hum, there is a bug : the ls-token-598191/add page returns a denied error, I'm going to fix this issue, I keep you in touch. Ok, Fixed !

other case : your LimeSurvey Token table is fulled and you want to import those informations to Drupal Users

  1. Create a new rules with event Synchronize LS to DP, and condition entity is of type : token 598191. and action : Fetch entity by ID, entity user, ID : entity:lss-uid:uid
  2. Now add many 'set data value' actions importing token (entity) values to the account (Fetched entity) variable.
  3. If there is no existing Drupal User corresponding to the Token email, is is possible to automatically create users using the rule : LimeSurvey Sync token import user infos from LS to SP (598191) (going to admin/config/workflow/rules/reaction/manage/rules_limesurvey_sync_token_598191_import_ls2dp set to disabled by default).
  4. Import Token from LS to DP from admin/structure/limesurvey/surveys/manage/my-survey/synchronize page

Also, can there be more than one token per user and will it be possible for users to have more than one participant entity associated with each user?

Yes and yes !

Also, when tokens are used, will it be a one-to-one relationship between token and participant, or an there be multiple tokens for each participant?

Assuming than a participant is a token invitation entry : multiple tokens for each participant.

jsibley’s picture

This all sounds great, so far. I'm noticing a few potential issues. I'm not sure whether some of these might be by design.

Token is not listed in the structure/limesurvey submenu
If one selects structure/limesurvey (not one of the submenu items) there is a listing for token but clicking on it gives a message of "you do not have any administrative items"
Perhaps because of these two items, there doesn't seem to be a clear way to synchronize tokens
In content/entities I see answer and survey but not item
The limesurvey fields seem to be named differently in rules and in views

Thanks!

thedut’s picture

Token is not listed in the structure/limesurvey submenu

2 possible explications for this :

  • You don't use the dev version
  • or you didn't create the Token table from the LimeSurvey Admin interface ("switch to close access").

Please report about those points.

The limesurvey fields seem to be named differently in rules and in views

Could you be more specific ?

jsibley’s picture

Hi,

I was using beta1, not dev. You were correct.

Switching to dev, I now see tokens in the submenu, but nothing seems to work.

There are "//" instead of "/" in the submenu URLS (e.g., admin/structure/limesurvey/token//fields), but changing it to one slash doesn't seem to go anywhere useful for any of the submenu options
I did create the token table in Limesurvey with closed access. Perhaps this is because there are tokens that were created in the previous version of limesurvey_sync?

If I create a rule to put the correct UID in each existing token, should that allow everything to work properly?

Thanks. This seems to be a huge step forward!

jsibley’s picture

Also, I was referring to (for example):

in rules, entity:lss-uid (User)
in views, User (User)

or

in rules, entity : lss-uid : mail (Email)
in views, LS Admin : email (LS Admin : email)

Am I correct that these are referring, in each case, to the same field?

Thanks.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.