Actions

EM Enhancements: Difference between revisions

From LimeSurvey Manual

 
(12 intermediate revisions by 2 users not shown)
Line 7: Line 7:
== Write to token attributes from survey ==
== Write to token attributes from survey ==


Point of view : i really think it can be in plugin, in workaround. But are a specific issue. [[User:DenisChenu|DenisChenu]] ([[User talk:DenisChenu|talk]]) 18:09, 6 June 2017 (CEST)
See  [[Talk:EM_Enhancements]]


''Marcel'': This is an often requested, missing feature. Very often user data gets loaded into the token table and there is a question like "Is this address/email/phone number up to date: 'XYZ'?". If the user corrects data there should be an option to directly update the token data from within the survey. This also allows exporting the updated token data and re-use it at upcoming surveys.
See [[EM_Enhancements#Existing_plugins_way]]
 
=== Use-cases ===
 
* Update or correct address saved in token attribute (see Write-at-submission)
* When using more than one survey, write e.g. disease in token attribute, then use it in following surveys. "How do you feel now about <disease>?"
 
=== Usage ===
 
<code>{TOKEN.ATTRIBUTE_1 = Q123.shown}</code>
 
Another version, using <code>:=</code> for assignment:
 
<code>{TOKEN.ATTRIBUTE_1 := Q123.shown}</code>
 
Yet another version, using a function:
 
<code>{writeTokenAttribute(<token attribute name>, <value>)}</code>
 
Would also work with <code>readTokenAttribute</code>.
 
(Or maybe "write_token_attr" and "read_token_attr".)
 
=== Implementation ===
 
TODO


== Make EM access earlier runs of same survey (waves) ==
== Make EM access earlier runs of same survey (waves) ==
Line 19: Line 44:
See : [https://github.com/LimeSurvey/LimeSurvey/blob/master/application/views/admin/survey/Question/editdefaultvalues_view.php#L172 yesNo_defaultvalue_widget]
See : [https://github.com/LimeSurvey/LimeSurvey/blob/master/application/views/admin/survey/Question/editdefaultvalues_view.php#L172 yesNo_defaultvalue_widget]


== Write-at-submission (Denis plugin) ==
== Write-at-submission ==


* Simple usage of afterSurveySubmitted [https://framagit.org/SondagePro-LimeSurvey-plugin/updateTokenByResponse updateTokenByResponse]
* Existing plugin : Simple usage of afterSurveySubmitted [https://framagit.org/SondagePro-LimeSurvey-plugin/updateTokenByResponse updateTokenByResponse]


== Expand EM using plugin ==
== Expand EM using plugin ==
Line 29: Line 54:
*** QCODE.help
*** QCODE.help
*** QCODE.statMedium , QCODE.statCount ... see [https://framagit.org/SondagePro-LimeSurvey-plugin/getStatInSurvey/blob/master/README.md getStatInSurvey]
*** QCODE.statMedium , QCODE.statCount ... see [https://framagit.org/SondagePro-LimeSurvey-plugin/getStatInSurvey/blob/master/README.md getStatInSurvey]
*** Plugin:Something ?
*** Maybe better with QCODE.pluginname.varfromplugin (by default) . Decison must be done about : allowing update existing part.
*** PluginName:Something (like we have TOKEN:SOMETHING)
** At whole page ? Allowing to update with a specific params in beforeSurveyPage ? Or create a new updateKnowVar static function ?
** At whole page ? Allowing to update with a specific params in beforeSurveyPage ? Or create a new updateKnowVar static function ?
*** Allow to update TOKEN:SOMETHING too
*** Allow to update TOKEN:SOMETHING too
*** Allow same than before
*** Allow same than before
=== Existing plugins way ===
* [https://framagit.org/SondagePro-LimeSurvey-plugin/updateTokenAttribute updateTokenAttribute]
** Update {TOKEN:ATTRIBUTE_X} during survey
** Show the only known current solution to udpate existing knowVars (found by this dev)
** Recnstruct WHOLE session just to update some var : server broker ;)


== Read quota from expression ==
== Read quota from expression ==

Latest revision as of 15:41, 8 June 2017

Notes about adding additional enhancements to the expression manager.

  • Will changes break compatibility and thus bump major version?
  • What's the priority?
  • Who has time to implement it?

Write to token attributes from survey

See Talk:EM_Enhancements

See EM_Enhancements#Existing_plugins_way

Use-cases

  • Update or correct address saved in token attribute (see Write-at-submission)
  • When using more than one survey, write e.g. disease in token attribute, then use it in following surveys. "How do you feel now about <disease>?"

Usage

{TOKEN.ATTRIBUTE_1 = Q123.shown}

Another version, using := for assignment:

{TOKEN.ATTRIBUTE_1 := Q123.shown}

Yet another version, using a function:

{writeTokenAttribute(<token attribute name>, <value>)}

Would also work with readTokenAttribute.

(Or maybe "write_token_attr" and "read_token_attr".)

Implementation

TODO

Make EM access earlier runs of same survey (waves)

TODO

Make default value better (expressions)

See : yesNo_defaultvalue_widget

Write-at-submission

Expand EM using plugin

  • Add a way for pugin to update/extend Expression manager knowVars (currenlty private)
    • Only at start ? Allow to add new var for each question, example
      • QCODE.help
      • QCODE.statMedium , QCODE.statCount ... see getStatInSurvey
      • Maybe better with QCODE.pluginname.varfromplugin (by default) . Decison must be done about : allowing update existing part.
      • PluginName:Something (like we have TOKEN:SOMETHING)
    • At whole page ? Allowing to update with a specific params in beforeSurveyPage ? Or create a new updateKnowVar static function ?
      • Allow to update TOKEN:SOMETHING too
      • Allow same than before

Existing plugins way

  • updateTokenAttribute
    • Update {TOKEN:ATTRIBUTE_X} during survey
    • Show the only known current solution to udpate existing knowVars (found by this dev)
    • Recnstruct WHOLE session just to update some var : server broker ;)

Read quota from expression

  • If have a GUI for equation question type : we have an nothing to update more. And we have a way.
    • This can be tested with hacking database ;) (already done)