View Issue Details

IDProjectCategoryView StatusLast Update
15873Bug reports[All Projects] Pluginspublic2020-02-21 19:27
ReporterDenisChenu Assigned Toollehar  
Status assignedResolutionopen 
Product Version3.22.4 
Target VersionFixed in Version 
Summary15873: setVariableExpressionEnd have lack of system to udate question part

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


  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.
Complete LimeSurvey version number (& build)4.1.4 github
I will donate to the project if issue is resolvedNo
Browsernot relevant
Database & DB-Versionnot relevant
Server OS (if known)not relevant
Webserver software & version (if known)not relevant
PHP Versionnot relevant




2020-02-13 19:11


limesurvey_survey_checkKnowVarsUpdate.lss (35,950 bytes) (67,383 bytes)


2020-02-13 19:14

developer   ~55985

In the pluguin : knowVars is set here :

@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.



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



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.



2020-02-21 19:22

developer   ~56143

Add questionSeq2relevance to the event set and get :

  • 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


2020-02-21 19:27

developer   ~56144

Please tell me your preference. 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.

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:
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