Is there any chance that you could add a rule event in 2.0 (once there are rules) that would fire when a participant completes a survey?

Ideally, I'd like to keep track of completed surveys in Drupal and to set a completed field to True.

By the way, is a "response" a set of answers for one participant? I wasn't sure about the difference between "responses" and "answers".

Thanks for a great module.

Comments

jsibley created an issue. See original summary.

thedut’s picture

Component: Code » Documentation

Hello jsibley,

Event as "When an answer has been completed" is not provided by the LimeSurvey Sync V2 module but could be easily built from the rules UI. You can "create" this event as simple a custom Rule :

  1. Event
    • When an entity has been saved and entity type is LimeSurvey Answer
  2. Condition
    • LimeSurvey Sync status (Token lss-status) has changed (compare datas, old value is not egal as new value)
    • and the new value is "completed"
  3. Action
    • DO something (as an example : setting your completed field to true).

If you do it, please share it on that thread.

By the way, is a "response" a set of answers for one participant? I wasn't sure about the difference between "responses" and "answers".

Yes it's right.
The Drupal Answer entity is the exact equivalent of the Answer entry into to the LimeSurvey site.
The Drupal Token entity is the exact equivalent of the Token entry into to the LimeSurvey site.
The Drupal "Response" entity is a set of an answer and its associated token (if it exists). The response entity is responsible for filling a LimeSurvey answer form from the Drupal Site, managing redirection to the LimeSurvey site and coming back to Drupal. When the Synchronization status of a response is set to "Synchronized", it means that its Drupal answer entity AND its Drupal token entity (if it exists) are synchronized regarding their equivalent into the LimeSurvey database.

jsibley’s picture

The rules idea sounds great, but I'm having a problem.

First, I don't see a rules even for when entity is saved.

I see rules events for specific entities that I have created but not for answers or responses.

Do you need to do something to expose these entities to rules? I see them in views, just not in rules.

Thanks for your help and a great module.

thedut’s picture

hum, I need to check this issue, I may check it within one week.

jsibley’s picture

Hi,

Any chance you could check on this? I'm not seeing any event I could use to tell when a survey response has been completed.

Ideally, I would like an event that would correspond to when the user is redirected back to Drupal, so that I could then do some of my own housekeeping on the Drupal end.

thedut’s picture

Assigned: Unassigned » thedut
Status: Active » Fixed

Hello,

you can apply the advice in #2 into the new dev version.

Status: Fixed » Closed (fixed)

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