Documentation

, by Denis Chenu

This plugin allow (in some condition) any user to reload any response. User can be an administrator or not, survey can have token or not, survey can be anonymous or not … ,

Can be used alone or as an helper for other plugins.

Using the plugin alone

Using this plugin alone is only useful for administrators. By default : an administrator can reload any response using the response ID.

You can activate the creation of the unique access code by survey, then any user knowing this access code can edit existing response. For example : you can click on this link https://demo.sondages.pro/423356?sr... and edit response 206 on survey 423356.

Settings of reloadAnyRespone

All of this options exist globally (at plugin settings page) and by survey.

  • Allow admin user to edit response with responseid : if an admin user load a survey with parameter srid : the response of the survey with this id are loaded and admin user can edit it.
  • Allow participant with token to create or reload responses : With not anonymous survey ; allow user to load specific response. Particularly interesting with answer persistence to off.
  • Create unique code automatically : unique code allow any user knowing this code (and the response id) to reload this response.
  • Allow using unique code if exist : If unique code exist, allow any user knowing it to edit the answer. Parameter used for the access code is `code`. for example usage of link `1234?srid=1&code=accessode` try to load the response id 1 on survey 1234 with unique access code accessode.
  • Time for disable multiple access (in minutes) : since editing a response by 2 person at same time can replace current response done : a time for disabling mutiple access for all response done.

Only at global plugin settings

  • Replace edit response in browse response interface : when an admin user edit a response via admin gui default link : the plugin launch the survey like it was seen publicly. This replace the edit button to a link to launch the current survey with this response loaded.
  • Delete the link of response when a response is deleted. : Delete the link with the unique access code of each response when this one was deleted. default to no, because new response got an new number when survey is activated again. Remind : if you use import/export as VV, a new response can replace an old one.
  • Delete the link of all responses of a survey when it’s deactivated. : Delete the existing link when a survey is deactivated. Default to no : this allow to import form an old database.
  • Delete the link of all responses of a survey when it’s deleted : Delete whole response access code when a survey is deleted. Default to yes.

Usage as tool for other plugins

The plugin add 2 models for managing existing access code and the multiple access limitation. You can easily know if plugin exist and is activated with Yii::getPathOfAlias('reloadAnyResponse').

Using the responseLink model

- Create or find a reponse $responseLink = \reloadAnyResponse\models\responseLink::setResponseLink($iSurvey,$iResponse,$sToken).
- Get a response url with the parameters : $responseLink->getStartUrl($absolute = true);

Sample usage

Using the surveySession model

- save a session time : \reloadAnyResponse\models\surveySession::saveSessionTime($iSurvey,$iResponse=null)
- find a current response id is currently edited : \reloadAnyResponse\models\surveySession::getIsUsed($iSurvey,$iResponse=null)

If $iResponse is null : get the current response id from `$_SESSION`. The plugin use this model in beforeSurveyPage event if Time for disable multiple access (in minutes) is not empty.