View Issue Details

This bug affects 1 person(s).
 6
IDProjectCategoryView StatusLast Update
14445Feature requestsExpression Managerpublic2021-03-07 21:55
ReporterMazi Assigned ToDenisChenu  
PrioritynoneSeverityfeature 
Status closedResolutionfixed 
Fixed in Version4.0.0dev 
Summary14445: Add placeholder for seed
Description

Sometimes you also need the seed value to be available as a placeholder e.g. within the end URL or the email templates so it would be great to add {SEED} as an available placeholder.

TagsNo tags attached.
Bug heat6
Story point estimate
Users affected %

Relationships

related to 11519 closedDenisChenu make fields Anonyous and ip address in Expression Manager available 

Users monitoring this issue

There are no users monitoring this issue.

Activities

DenisChenu

DenisChenu

2019-04-05 12:00

developer   ~51378

Think a plugin can use LimeExpressionManager::updateReplacementFields('seed'=>$seed) for this.
Need to have the good time to get it. Maybe a new event.

This one can not be used : https://github.com/LimeSurvey/LimeSurvey/pull/1256 since it's done opnly when survey is started (but no database update (? unsure)

DenisChenu

DenisChenu

2019-05-17 11:18

developer   ~51984

PS : i think all database data can be accesssible via Expression Manager.

ollehar

ollehar

2019-05-20 14:56

administrator   ~51988

What's the use-case?

Mazi

Mazi

2019-05-20 15:08

updater   ~51989

@ollehar, in our case we wanted to pass the user's seed value into a GET parameter when calling an external reporting script. Just to make sure users can call the report with another ID by simply changing from e.g. 11 (their ID) to 10 (the previous user). So we wanted to check ID and seed value.

DenisChenu

DenisChenu

2019-05-20 15:33

developer   ~51990

For

PS : i think all database data can be accesssible via Expression Manager.

Because plugin can hack DB columns and add anything ;) (no idea, but can be potentially great)

DenisChenu

DenisChenu

2019-05-28 18:34

developer   ~52136

One place holder really needed : SUBMITDATE : then can check if survey is submitted or not (with token <-> response table or in some plugins).

Mazi

Mazi

2019-05-28 21:16

updater   ~52137

+1 for submitdate placeholder

DenisChenu

DenisChenu

2019-05-28 23:47

developer   ~52138

STARTDATE and DATESTAMP can be interesting too : for example : condition on lastpage
date("Y-m-d H:i:s") > STARTDATE + 10 minutes with tip "You don't read enough on this survey"

Maybe with SURVEY:XXX for all non related to question survey DB column :)

DenisChenu

DenisChenu

2019-05-29 10:44

developer   ~52140

@Mazi : if it work with core plugin ( in core/plugins or .plugin unsure) : are you OK ?

Think of

  1. Activate plugin
  2. Check list with (global)
    1. Add all DB column Y/N (not related to question (ie: not starting with sid)
    2. If no if checked : Add SEED Y/N
    3. Add STARTDATE Y/N
    4. Add DATESTAMP (if exist)
  3. Check list by survey where all existing data column can be checked/unchecked/leave default (i really like the 3 options here : Y/N/«inherit»
  4. Maybe add a SurveyGroups settings (for plugin inheritance)

@ollehar : it's a next feature, right, even if adding SEED or STARTDATE or … is really easy : we can't get it in master, right ?
If we add it by plugins (deactuvated by default) it don't broke existing survey with Question code as SEED or STARTDATE or …

Mazi

Mazi

2019-05-29 10:59

updater   ~52141

@DenisChenu, while I like the idea of separating code by creating plugins, I consider supporting additional EM placeholders a core feature so it makes more sense adding this to the upcoming LS 4 version.
I think there is no need to add an additional list/feature for enabling certain placeholders. We can just support them out of the box as we do with {SID} or {SAVEDID}.

DenisChenu

DenisChenu

2019-05-29 11:04

developer   ~52142

If you support it out of the box : you broke some of my surveys where i add a STARTDATE question : then NO it can not be forced ! (and potential usage of SEED question code)
(and if you support it out of the box : i don't take it even for 4.0)

If it's i core : it must be in ExpressionManager reserved word

Mazi

Mazi

2019-05-29 11:09

updater   ~52143

@DenisChenu, I didn't know that the discussed placeholders are not a reserved EM word yet. Of course, it has to be added there first. Since e.g. underscores are not allowed at questions code, why don't we used such placeholders like {START_DATE}, {SEED_VALUE} and the like?
That should work fine and all we need is documenting everything properly.

DenisChenu

DenisChenu

2019-05-29 11:28

developer   ~52147

Last edited: 2019-05-29 11:29

START_DATA : question START, subquestion DATE …

But the important things : if it's in core : i don't take it even for 4.0 (but maybe make my own plugin before it come in ls core)

2nd important things : STARTDATE : easy (for dev), START_DATE (or anything else) need a function for correspondance

Mazi

Mazi

2019-05-29 12:23

updater   ~52148

" if it's in core : i don't take it even for 4.0 (but maybe make my own plugin"
Why?

DenisChenu

DenisChenu

2019-05-29 13:30

developer   ~52149

Last edited: 2019-05-29 14:04

Because i'm not OK to adding it in core if a plugin solution is available [*], and because adding it in core can broke some survey.

* : because in my situation : have a plugin is the only way to have stable solution when i need stable solution. No bug not resolved during month and month …

DenisChenu

DenisChenu

2019-06-08 11:38

developer   ~52335

@Mazi :

in our case we wanted to pass the user's seed value into a GET parameter when calling an external reporting script. Just to make sure users can call the report with another ID by simply changing from e.g. 11 (their ID) to 10 (the previous user). So we wanted to check ID and seed value.

I want to play (no client on this one) : https://gitlab.com/SondagesPro/QuestionSettingsType/generateUniqId

A plugin for LimeSurvey to generate an unique id for usage in survey.

Then you can have your solution :)

Mazi

Mazi

2019-06-10 16:32

updater   ~52338

Hi Denis, our workaround due to the missing placeholder is indeed to populate an equation question using rand() and then using that value as an additional parameter.
But since "seed" does something very similar, just supporting the placeholder will do the trick.

DenisChenu

DenisChenu

2019-06-10 17:39

developer   ~52340

Warning : with SAVEDID, when deactivate, reactivate : id of response are updated :)

DenisChenu

DenisChenu

2019-07-14 16:39

developer   ~52869

@Mazi : https://github.com/LimeSurvey/LimeSurvey/pull/1256/commits/ddd4a65fb13951d1033064fa91e024fc7e500586
Sample plugin for start

Mazi

Mazi

2019-07-15 09:04

updater   ~52873

Thanks, Denis!

DenisChenu

DenisChenu

2019-08-05 16:31

developer   ~53114

https://github.com/LimeSurvey/LimeSurvey/commit/011890d128084176074421cbe82cdd342706f729#diff-bccf0f511c5328f1ef2c78b92305646a

Issue History

Date Modified Username Field Change
2019-01-21 10:34 Mazi New Issue
2019-04-05 12:00 DenisChenu Note Added: 51378
2019-05-17 11:18 DenisChenu Note Added: 51984
2019-05-20 14:56 ollehar Note Added: 51988
2019-05-20 15:08 Mazi Note Added: 51989
2019-05-20 15:33 DenisChenu Note Added: 51990
2019-05-28 18:34 DenisChenu Note Added: 52136
2019-05-28 21:16 Mazi Note Added: 52137
2019-05-28 23:47 DenisChenu Note Added: 52138
2019-05-29 10:44 DenisChenu Note Added: 52140
2019-05-29 10:59 Mazi Note Added: 52141
2019-05-29 11:04 DenisChenu Note Added: 52142
2019-05-29 11:09 Mazi Note Added: 52143
2019-05-29 11:28 DenisChenu Note Added: 52147
2019-05-29 11:28 DenisChenu Note Edited: 52147
2019-05-29 11:29 DenisChenu Note Edited: 52147
2019-05-29 12:23 Mazi Note Added: 52148
2019-05-29 13:30 DenisChenu Note Added: 52149
2019-05-29 14:04 DenisChenu Note Edited: 52149
2019-06-08 11:38 DenisChenu Note Added: 52335
2019-06-10 16:32 Mazi Note Added: 52338
2019-06-10 17:39 DenisChenu Note Added: 52340
2019-07-14 16:39 DenisChenu Note Added: 52869
2019-07-15 09:04 Mazi Note Added: 52873
2019-08-05 16:31 DenisChenu Assigned To => DenisChenu
2019-08-05 16:31 DenisChenu Status new => resolved
2019-08-05 16:31 DenisChenu Resolution open => fixed
2019-08-05 16:31 DenisChenu Fixed in Version => 4.0.0dev
2019-08-05 16:31 DenisChenu Note Added: 53114
2019-09-07 11:01 DenisChenu Relationship added related to 11519
2021-03-07 21:55 c_schmitz Status resolved => closed