View Issue Details

This bug affects 1 person(s).
 6
IDProjectCategoryView StatusLast Update
15873Bug reportsPluginspublic2020-12-30 19:27
ReporterDenisChenu Assigned Toollehar  
PrioritynoneSeverityminor 
Status closedResolutionfixed 
Product Version3.22.4 
Fixed in Version4.x.0-dev 
Summary15873: setVariableExpressionEnd have lack of system to udate question part
Description

With setVariableExpressionEnd : you can udpate knowVars and add some fixed Var (see plugins)
You can access too some information from question and update it.
But : uodating knowVars didn't update question part

Steps To Reproduce

:D

  1. Unzip included plugins in your plugins directory
  2. Actuvate plugins
  3. Import included survey
  4. Look at organizer : must show only 1 question according to code
  5. But it don't work
Additional Information

knowVars is updated : hidden is set to 1 for the good questions]
But _validateQuestion use questionSeq2relevance
And this array is set before the event

TagsNo tags attached.
Attached Files
organizeSurvey.zip (67,383 bytes)
Bug heat6
Complete LimeSurvey version number (& build)4.1.4 github
I will donate to the project if issue is resolvedNo
Browsernot relevant
Database type & versionnot relevant
Server OS (if known)not relevant
Webserver software & version (if known)not relevant
PHP Versionnot relevant

Relationships

child of 15923 closedDenisChenu Feature requests Allow to update some Expression Dynamic variable : hidden or relevance, or set order of question (by plugins) 

Users monitoring this issue

There are no users monitoring this issue.

Activities

DenisChenu

DenisChenu

2020-02-13 19:14

developer   ~55985

In the pluguin : knowVars is set here : https://gitlab.com/SondagesPro/coreAndTools/organizeSurvey/-/blob/master/organizeSurvey.php#L93-96

@ollehar :
3 solutions :

  1. Add questionSeq2relevance to the event set and get
  2. Set questionSeq2relevance as public (but it's in session)
  3. Move questionSeq2relevance setting after the event : reread knowVars

Tell me what solution can be accepted in master , if not in develop.

DenisChenu

DenisChenu

2020-02-20 08:52

developer   ~56104

@ollehar : i think of a 4th solution.

  1. Create some public function in EM
    1. setQuestionHidden($qid,$hidden = true);
    2. setQuestionrelevance($qid,$relevance);
    3. getQuestionHidden($qid);
    4. getQuestionrelevance($qid);
  2. Add related function in API
    1. ExpressionProcessStepString (have one currently but broken)
    2. ExpressionSetValueToKnowVar : used by expressionFixedDbVar
    3. ExpressionUpdateReplacementFields
    4. ExpressionSetQuestionHidden
    5. ExpressionSetQuestionrelevance
    6. ExpressionGetQuestionHidden
    7. ExpressionGetQuestionrelevance

Are you OK with such pull request principle ?

For my current project : i need a way to update relevance or hidden dynamically.

But i think a "Hidden by expression" can be really great
https://bugs.limesurvey.org/view.php?id=13835

DenisChenu

DenisChenu

2020-02-20 16:12

developer   ~56107

With API n: no way to "Set order od question by ººº"

We have random, but i have a system where they use "Order by token attribute" (and hide some by token attribute".
LimeSurvey 1.80 hacked version + 1.92 + .... never find a way to get it in a clean way.

DenisChenu

DenisChenu

2020-02-21 19:22

developer   ~56143

Add questionSeq2relevance to the event set and get : https://github.com/LimeSurvey/LimeSurvey/pull/1392

  • Advantage : the most par updatable by plugin, no need other. I'm sure we can set order etc ...
  • Con : plugin s can broke totally Expression Script system easily

Add related function in API

  • Advantage : ? Unsure
  • Con : Create new function in EM just for API. API just call just created function
DenisChenu

DenisChenu

2020-02-21 19:27

developer   ~56144

Please tell me your preference.

https://github.com/LimeSurvey/LimeSurvey/pull/1392 is the easiest, already checked for hidden. But ... allow a lot by plugin.

Extend API seems more a false bad idea.

I try «Move questionSeq2relevance setting after the event : reread knowVars » but this was too complex... Maybe update questionSeq2relevance partially with the new knowVars only ?
But we loose order of questions by plugins.

DenisChenu

DenisChenu

2020-02-27 10:05

developer   ~56220

Forum post where a plugin ca be interesting Grouping questions within a question group

DenisChenu

DenisChenu

2020-03-09 07:48

developer   ~56360

@ollehar : develop branch are 4.0.0dev ?

ollehar

ollehar

2020-03-09 10:53

administrator   ~56365

@ollehar : develop branch are 4.0.0dev ?

No, should be 4.x.0-dev, I guess.

DenisChenu

DenisChenu

2020-03-09 11:18

developer   ~56366

Then must create a 4.X-dev :)

ollehar

ollehar

2020-03-09 11:23

administrator   ~56367

Blubb. One sec.

ollehar

ollehar

2020-03-09 11:24

administrator   ~56368

Done.

DenisChenu

DenisChenu

2020-03-09 11:26

developer   ~56369

:+1:

cdorin

cdorin

2020-12-30 19:27

reporter   ~61372

fixed in 4.4.0 rc1

Issue History

Date Modified Username Field Change
2020-02-13 19:11 DenisChenu New Issue
2020-02-13 19:11 DenisChenu File Added: limesurvey_survey_checkKnowVarsUpdate.lss
2020-02-13 19:11 DenisChenu File Added: organizeSurvey.zip
2020-02-13 19:14 DenisChenu Note Added: 55985
2020-02-19 15:57 DenisChenu Assigned To => DenisChenu
2020-02-19 15:57 DenisChenu Status new => assigned
2020-02-20 08:52 DenisChenu Note Added: 56104
2020-02-20 16:12 DenisChenu Note Added: 56107
2020-02-21 19:22 DenisChenu Note Added: 56143
2020-02-21 19:25 DenisChenu Assigned To DenisChenu => ollehar
2020-02-21 19:27 DenisChenu Note Added: 56144
2020-02-27 10:04 DenisChenu Issue Monitored: DenisChenu
2020-02-27 10:05 DenisChenu Note Added: 56220
2020-02-27 10:56 DenisChenu Relationship added child of 15923
2020-03-09 07:48 DenisChenu Status assigned => resolved
2020-03-09 07:48 DenisChenu Resolution open => fixed
2020-03-09 07:48 DenisChenu Fixed in Version => 4.0.0dev
2020-03-09 07:48 DenisChenu Note Added: 56360
2020-03-09 10:53 ollehar Note Added: 56365
2020-03-09 11:18 DenisChenu Note Added: 56366
2020-03-09 11:23 ollehar Note Added: 56367
2020-03-09 11:24 ollehar Fixed in Version 4.0.0dev => 4.x.0-dev
2020-03-09 11:24 ollehar Note Added: 56368
2020-03-09 11:26 DenisChenu Note Added: 56369
2020-03-12 10:02 DenisChenu Issue End Monitor: DenisChenu
2020-12-30 19:27 cdorin Note Added: 61372
2020-12-30 19:27 cdorin Status resolved => closed