Hi,
Thanks both for your comments above. A few notes. I now understand much better the above answers, the token system and the type of branching it allows. The solution suggested above (to use tokens to decide for instance what should be shown and what should be editable) seems quite easy to implement, with a possibly needed precaution.
For a given country, the researcher, the reviewer and the supervisor will be working (one after the other) on one single instance of the set of answers. Hence, for 50 countries, there will be 50 set of answers, not 150. We can have a token which controls what a respondent will see (in a secure way, to avoid respondent trying to modify the URL parameters). However, the only potential problem I see with that is for the email notifications. We do want to send the first invitation to the researcher, and the second to the reviewer; while in the standard token table there is only one email address.
One way to solve this is to create custom token fields in the token table, with additional emails and names, hence having for each country only one record.
A record for a country would have the email field (standard in each limesurvey token table), plus 3 email fields, and a “step” field. The standard email field would the one to which the next email would be sent. A procedure will copy the relevant email from one of the 3 email fields to that standard email field.
This could be done simply by writing MySql triggers in the DB backend to monitor the content of the lime_tokens_xxxxx table. When the token is created, it is validated and (if OK) the email of the researcher is copied to the standard email field, and “1” is written in the “step” field. When the researchers has completed the survey, the MySql trigger writes the email of the reviewer to that standard email field, and “2” is written in the “step” field. This step field is used in the email templates to adjust the text which will be sent. Same thing for stage 3.
A quite different option is to have one record for each individual (so 150 records for 50 countries), with a token (eg country name or numerical code) to specify the country (ie the set of answers for that country), 3 people modifying in effect the same single survey at different times (so 3 people will have the same token). However, they would also have a code (as a field in the token table, sent to them by email) which would decide which questions to show and how to show them (previously answered questions being visible but not editable by the reviewer, the reviewer will say if they agree though).
In the simplistic form, the code would be the same for people have the same role (all researchers having the code “B27Ry”, all reviewers having “LD67Gz”). An improved code would be based on the respondent role and country, in a difficult to guess way, but easy to code with the expression manager. An encrypting function f(.,.) would transform f(country, role) into a code. Knowing the country, computing the code for both roles and comparing the results with the user provided code is enough to verify that a respondent is a researcher or a reviewer. To clarify thing: Fr-rv could be the code for France/reviewer and Fr-rs could be the code for researcher, but obviously some functions allow to hide such a simple process.
Also the code could be provided by URL to avoid having to ask the respondent to type it.
Last not least, one token field could be used by the supervisor to keep track of the step, and validate things for the next step.
Hope this might help someone else. Thanks for reading. Comments welcome!
Cheers,
Mayeul
The topic has been locked.