View Issue Details

This bug affects 1 person(s).
IDProjectCategoryView StatusLast Update
08858Feature requestsExpression Managerpublic2021-03-07 21:55
ReporterMazi Assigned ToDenisChenu  
Status closedResolutionreopened 
Summary08858: Extend EM so we can get the question text of multiple choice and array questions via questioncode.question

For multiple choice questions or other questions using subquestions the syntax "questioncode.question" is currently treatd as invalid and one only seem to be able to get the subquestion text via questioncode_subquestioncode.question.

Currently there is no possibility to also retrieve the question text for these question types.

Additional Information

mfaber, I assign this to you since you now seem to know EM inside out and thus I am interested in your opinion if this is hard to implement.

TagsNo tags attached.
Bug heat12


related to 08859 closedc_schmitz Bug reports Using .question syntax auto-adds additional text 
related to 14200 acknowledged Bug reports EM missing data for multiple choice questions 

Users monitoring this issue

User List duvemyster, TMSWhite




2014-03-14 11:45

developer   ~29261

Last edited: 2014-03-14 11:46

This make a lot of change in EM : core and manager

Not in 2.05, but more for 2.06

And allow access to other information too (get from DB, and not from session :help is the first example).



2014-03-17 22:34

reporter   ~29306

For questions with subquestion this may actually qualify as a bug (missing implementation)....
Should not be that much work. Implementation probably in _GetVarAttribute() in em_manager_helper.
I can take it (the .question-thing) but will likely not get to it before april.



2014-03-25 22:28

reporter   ~29532

Carsten, please advise:

This is our status:

For questions without subquestions (eg. single answer)
QCODE.question [gives question text]

For questions with subquestions (eg. matrix)
QCODE_SQCODE.question [gives SUBquestion text]
No access to the main question text at the moment.
--> QCODE.question [gives error]

Problem is that only subquestions are in the fieldmap and other data structures, so for a matrix question, QCODE without a subquestion code is (for EM) not a valid variable. And i am reluctant to change that only because we would like to access "QCODE.question".

What can be very easily implemented is an additional question attribute (let's call it ".questiontext"?). So the main questiontext of a matrix question could be accessed with QCODE_ANYSQCODE.questiontext. Question is: Would that be ok/helpful? Or rather leave it as it is?



2014-03-26 09:41

updater   ~29533

Tom, do you have any advice for us how to best deal with this?



2014-03-26 09:57

developer   ~29534


Like mafaber say, 2 siolution:

  • Leave EM KnowVars system (in fieldmap) + Add a new function to call 'anything'
  • Add all Question part in knowvar

Very difficult to choose, because after choosing, it can be more easy or more difficult to add a new system (question-help is one example, but our user have surely a lot of idea).



2014-05-02 11:10

reporter   ~29925

Carsten: feel free to assign this back to me if you think a ".questiontext" attribute would be helpful (see



2017-02-14 04:52

reporter   ~43007

If I can add that this is a problem for me. When creating a "Review page" subquestion answers without the main question context can be meaningless. In the survey I am currently working on I need to display an image which is embedded within the question text to give the answer some relevance.

I can work around it but its a lot more complex than one would hope.



2017-02-14 09:38

developer   ~43008

Why not a new event (or 2 news events)

About EM : the danger is whole system goes in $_SESSION , then it already make a big SESSION part .....
About CoreReplacement : maybe there are better solution with twig : @LouisGac : do you think it can be more easy and clean with twig system ? In the twig replacement system ?



2017-02-15 00:25

reporter   ~43013

I can see how this might be very difficult.

As it is I am using javascript to recreate the original question which means the images need to be named in such a way that the correct image can be determined from the selected answer. It works OK and if I am honest its probably the lazy way to be able to reference the original question.

You also have the problem of if a question itself references a previous question and then you reference the dependent question, will the expression manager handle it correctly. As I do not know how the expression manager works (its magic isn't it) I do not know how complex this problem may be.



2019-07-24 20:37

developer   ~52992


Done by plugins :

If you activate expressionQuestionHelp you have too \o/



2019-07-25 09:51

updater   ~52996

@DenisChenu, I know you prefer adding functionality as plugins but isn't this some core feature to be able to properly get the question text by an EM placeholder?

@c_schmitz, what do you think? My suggestion would be adding this fix to the core code. Alternatively, add it as an activated core plugin.
Thing is that if this fix is available as a plugin the user has to install, nearly no one will make use of it.



2019-07-25 10:14

developer   ~52997

@Mazi : here one fix for 3 plugins (in core, distributed with core).
And this pull request allow more an more situation fix …

Thing is that if this fix is available as a plugin the user has to install, nearly no one will make use of it.
False : it's in distribution, just activate.

And more : Expression Manager SESSION is already big. Some user already have issue with big session, the this QCODE.question MUST be optional because it fill again the SESSION …
The usage of QCODE.question is exceptional. Current user use Condition editor + Placehoder field in HTML editor. They rarely use current .question.

I really think core must not add always something in SESSION (+ in PHP memory and time) if it's rarely used …
In fact : i think .question can be a plugin by himself (like expressionQuestionHelp )



2019-08-05 16:29

developer   ~53113

Issue History

Date Modified Username Field Change
2014-03-14 11:16 Mazi New Issue
2014-03-14 11:16 Mazi Status new => assigned
2014-03-14 11:16 Mazi Assigned To => mfaber
2014-03-14 11:45 DenisChenu Note Added: 29261
2014-03-14 11:46 DenisChenu Note Edited: 29261
2014-03-14 14:48 Mazi Relationship added related to 08859
2014-03-17 22:34 mfaber Note Added: 29306
2014-03-25 22:28 mfaber Note Added: 29532
2014-03-26 09:41 Mazi Issue Monitored: TMSWhite
2014-03-26 09:41 Mazi Note Added: 29533
2014-03-26 09:57 DenisChenu Note Added: 29534
2014-05-02 11:08 mfaber Assigned To mfaber => c_schmitz
2014-05-02 11:10 mfaber Note Added: 29925
2017-02-14 04:52 DeveloperChris Note Added: 43007
2017-02-14 09:38 DenisChenu Note Added: 43008
2017-02-15 00:25 DeveloperChris Note Added: 43013
2018-11-05 20:48 duvemyster Issue Monitored: duvemyster
2019-07-24 20:37 DenisChenu Note Added: 52992
2019-07-24 20:37 DenisChenu Assigned To c_schmitz => DenisChenu
2019-07-25 09:51 Mazi Note Added: 52996
2019-07-25 10:14 DenisChenu Note Added: 52997
2019-08-05 16:29 DenisChenu Status assigned => resolved
2019-08-05 16:29 DenisChenu Resolution open => fixed
2019-08-05 16:29 DenisChenu Note Added: 53113
2019-08-05 16:30 DenisChenu Status resolved => feedback
2019-08-05 16:30 DenisChenu Resolution fixed => reopened
2019-08-05 16:30 DenisChenu Fixed in Version => 4.0.0dev
2019-08-05 16:30 DenisChenu Status feedback => resolved
2019-08-14 09:01 Mazi Relationship added related to 14200
2021-03-07 21:55 c_schmitz Status resolved => closed