x

Main chapters

  1. LimeSurvey Cloud vs LimeSurvey CE
  2. LimeSurvey Cloud - Quick start guide
  3. LimeSurvey CE - Installation
  4. How to design a good survey (Guide)
  5. Getting started
  6. LimeSurvey configuration
  7. Introduction - Surveys
  8. View survey settings
  9. View survey menu
  10. View survey structure
  11. Introduction - Questions
  12. Introduction - Question Groups
  13. Introduction - Surveys - Management
  14. Survey toolbar options
  15. Multilingual survey
  16. Quick start guide - ExpressionScript
  17. Advanced features
  18. General FAQ
  19. Troubleshooting
  20. Workarounds
  21. License
  22. Version change log
  23. Plugins - Advanced
 Actions

Question signature

From LimeSurvey Manual

Revision as of 14:21, 6 June 2013 by C schmitz (talk | contribs) (Text replace - "Limesurvey" to "LimeSurvey")

Question signature

Since question types can no longer be uniquely identified their object names, we have created a signature scheme.

While in a single limesurvey instance question objects must be uniquely named, there might be different plugins defining the question objects with the same name.

To make sure we can identify what the type of a question is, we derive a unique identifier (GUID) from a signature.

Each question object MUST therefore define a protected static $signature field. This field is used to derive the signature using a hashing approach.

It is the developers task to make this signature as unique as possible, yet, it MUST never change. If the signature of a question object changes it is recognized as a new question type, while this is not necessarily a problem, the fact that the old question type is no longer available is. Since LimeSurvey cannot find the old question type it will not be able to execute, import, or maybe even edit, surveys containing this now unknown question type.

An example of a signature is shown below:

protected static $signature = array(

   'orignalAuthor' => 'Sam Mousa',

   'originalName' => 'Yes / No',

   'startDev' => '2013-30-1'

);

Note that you are free to use any format / data type you want. The GUID is derived using the following code:

/**
* This function derives a unique identifier for identifying a question type.
*/

public static function getGUID()

{

   // We use json_encode because it is faster than serialize.

   return md5(json_encode(static::$signature));

}