View Issue Details

This bug affects 1 person(s).
 6
IDProjectCategoryView StatusLast Update
14200Bug reportsExpression Managerpublic2021-02-08 07:56
ReporterTonisOrmisson Assigned To 
PrioritynoneSeverityminor 
Status acknowledgedResolutionopen 
Product Version3.16.x 
Summary14200: EM missing data for multiple choice questions
Description

Expression manager is missing question info for multiple-response questions

eg {Q1.qid}, {Q1.sgqa} are missing. Possibly some other data also

Steps To Reproduce

See attached survey example.

TagsNo tags attached.
Attached Files
Bug heat6
Complete LimeSurvey version number (& build)32aef4b01ae08f2364d82a8389d1e6dc025f4db5
I will donate to the project if issue is resolvedNo
Browser
Database type & versionn/a
Server OS (if known)n/a
Webserver software & version (if known)n/a
PHP Versionn/a

Relationships

related to 08858 closedDenisChenu Feature requests Extend EM so we can get the question text of multiple choice and array questions via questioncode.question 
related to 14206 closedDenisChenu Feature requests Allow plugin to update expression knowVars 

Users monitoring this issue

There are no users monitoring this issue.

Activities

TonisOrmisson

TonisOrmisson

2018-11-01 14:31

developer   ~49502

as far as I understand the $LEM->qcode2sgqa array does not contain multiple choice question codes
here:
https://github.com/LimeSurvey/LimeSurvey/blob/master/application/helpers/expressions/em_manager_helper.php#L8978

DenisChenu

DenisChenu

2018-11-02 11:24

developer   ~49512

Last edited: 2018-11-02 11:25

SGQA is : database name (or must be near). It's a related to an input inside HTML. Parent question didn't have input.

For expression manager : ONLY value save in DB exist.

For a single question Q1, for a multiple question : Q1_SQ01,Q1_SQ02, for a multiplexmultiple question (array number, array text) : Q1_SY1_SX1 etc …

For Q1 : maybe we can add something with "static" set to true with only .question, .relevance etc unsure about sgqa : since sgqa didn't exist for Q1.

TonisOrmisson

TonisOrmisson

2018-11-02 12:12

developer   ~49513

Last edited: 2018-11-02 12:14

ok nevermind the SGQA

the whole {Q1.*} is missing for multis. {Q1.gid}, {Q1.qcode}, {Q1.type} etc etc

DenisChenu

DenisChenu

2018-11-02 14:47

developer   ~49517

Yes, but explanation still valid :).

What to shown with Q1.NAOK ? that.Q1.NAOK ?

It really a complete new feature … i already think of adding a plugin event here https://github.com/LimeSurvey/LimeSurvey/blob/2d58085ced72e2bb471aa8b4493b3730aa9e4749/application/helpers/expressions/em_manager_helper.php#L4378

To allow plugin to update, create new knowVars … something like $event->set('knownVars',$this->knownVars); $this->knownVars = $event->get('knownVars'); (in fact : i think adding Q1.help, and some Q1.number, Q1.medium (see https://gitlab.com/SondagesPro/getStatInSurvey#documentation). Then more to update current knownVars, but adding can be done too.

What did you think of such feature ? This can broke survey with badly devel plugin, but it can does a lot.

DenisChenu

DenisChenu

2019-08-05 16:28

developer   ~53111

@TonisOrmisson : maybe we can add it in https://github.com/LimeSurvey/LimeSurvey/commit/011890d128084176074421cbe82cdd342706f729#diff-1a3bea26d4d8bfcd4a0422ab1b3b9864

Not complex

jelo

jelo

2019-08-13 15:12

partner   ~53171

Is that issue solved in LS4? What is the position of core devs?

DenisChenu

DenisChenu

2019-08-20 16:31

developer   ~53199

My personal opinion : it can be interesting BUT

  1. Take place in memory
  2. Take place in SESSION (currently)
  3. Can be done in plugin (eventually core plugin (new one or update the current)
DenisChenu

DenisChenu

2021-02-07 12:42

developer   ~61979

{Q1.question} : https://github.com/LimeSurvey/LimeSurvey/blob/master/application/core/plugins/expressionQuestionForAll/config.xml#L12
{Q1.qid} are in too : https://github.com/LimeSurvey/LimeSurvey/blob/77e966ffc4f0169fc66698180f1fca6510082f08/application/core/plugins/expressionQuestionForAll/expressionQuestionForAll.php#L76

I think we can close ?
OK @TonisOrmisson ?

Or maybe : gid + qcode + type in the plugin ?

TonisOrmisson

TonisOrmisson

2021-02-07 14:40

developer   ~61981

I say don't close.

It's not a question about getting one specific value. I see it as a general consistency issue. There is a number of values that one is expected to get for any question via EM.
https://manual.limesurvey.org/Expression_Manager?#What_are_some_other_benefits_of_using_EM.3F

The documentation defines a number of attributes that should be available for variables. I see there is 2 options:

1) ensure that all variables (including questions with sub-questions) act as documented and get the relevant attributes
2) fix the manual to state the exceptions when the attributes are not accessible. Eg clarify the distinction between questions/subquestions/variable etc and specify what attributes are available for what type.

There is very clear reason why Questions with multiple Variables (subquestions) can not have eg 'Q1.value' - since they have multiple Variables that each have values. But all Questions regardless of their type have some common attributes, that do have relevant values. Eg. all questions have a name, a code, a group, relevance etc. And this issue is about some of the attributes not being accessible while they should be as described in EM documentation here.

I would say this issue is not resolved as the application does not function as described in documentation. Getting the value of one specific attribute via some workaround is not fixing the gap in consistency and a inoperable feature described in documentation.

TonisOrmisson

TonisOrmisson

2021-02-07 14:52

developer   ~61982

pulled latest master, looks like that

image.png (29,853 bytes)   
image.png (29,853 bytes)   
DenisChenu

DenisChenu

2021-02-07 15:13

developer   ~61983

1) ensure that all variables (including questions with sub-questions) act as documented and get the relevant attributes

But question are not a variables : only column data are a variable. You don't have a Q1.naok : it's not a value , (or you say Q1.NAOK == that.Q1.NAOK ?

TonisOrmisson

TonisOrmisson

2021-02-07 19:50

developer   ~61984

and .relevance & .type are attributes of what then? They are exactly properties of a Question! .relevance .type is directly applied to Question model. It is perfectly logical to expect ANY question to have these attributes available (consitency).

If its only for Variables, then option 2: clearly distinguish Variables/Questions/subQuestions in the documentation.

Can you refer the documentation where its clearly said that Question is not a variable. Or that some questions kind of are and some are not. Consistency, please!

DenisChenu

DenisChenu

2021-02-08 07:56

developer   ~61987

If its only for Variables, then option 2: clearly distinguish Variables/Questions/subQuestions in the documentation.

Yes, OK with this. My opinion : Variable must be column database (answers).

Here : : what is QCode : https://manual.limesurvey.org/Expression_Manager#Qcode_Variable_Naming , must add some warning.

and .relevance & .type are attributes of what then?

Related to manual, but can be easily added to plugin. Can stay in plugin since it's not variables (on the updated manual)

Issue History

Date Modified Username Field Change
2018-11-01 14:29 TonisOrmisson New Issue
2018-11-01 14:29 TonisOrmisson File Added: limesurvey_survey_791116.lss
2018-11-01 14:29 TonisOrmisson File Added: Screenshot from 2018-11-01 15-24-07.png
2018-11-01 14:31 TonisOrmisson Note Added: 49502
2018-11-02 11:24 DenisChenu Note Added: 49512
2018-11-02 11:25 DenisChenu Note Edited: 49512
2018-11-02 12:12 TonisOrmisson Note Added: 49513
2018-11-02 12:14 TonisOrmisson Note Edited: 49513
2018-11-02 14:47 DenisChenu Note Added: 49517
2018-11-03 15:58 DenisChenu Relationship added related to 14206
2019-08-05 16:28 DenisChenu Note Added: 53111
2019-08-13 15:12 jelo Note Added: 53171
2019-08-13 15:15 cdorin Assigned To => cdorin
2019-08-13 15:15 cdorin Status new => assigned
2019-08-14 09:01 Mazi Relationship added related to 08858
2019-08-20 16:31 DenisChenu Note Added: 53199
2021-02-07 10:31 cdorin Assigned To cdorin =>
2021-02-07 10:31 cdorin Severity partial_block => minor
2021-02-07 10:31 cdorin Status assigned => acknowledged
2021-02-07 12:42 DenisChenu Note Added: 61979
2021-02-07 14:40 TonisOrmisson Note Added: 61981
2021-02-07 14:52 TonisOrmisson Note Added: 61982
2021-02-07 14:52 TonisOrmisson File Added: image.png
2021-02-07 14:52 TonisOrmisson File Added: Screenshot from 2021-02-07 15-52-11.png
2021-02-07 14:52 TonisOrmisson File Deleted: Screenshot from 2021-02-07 15-52-11.png
2021-02-07 15:13 DenisChenu Note Added: 61983
2021-02-07 19:50 TonisOrmisson Note Added: 61984
2021-02-08 07:56 DenisChenu Note Added: 61987