View Issue Details

This bug affects 1 person(s).
 10
IDProjectCategoryView StatusLast Update
07937Feature requestsExpression Managerpublic2021-11-02 14:47
Reporterjja Assigned Togalads  
PrioritynormalSeverity@50@ 
Status closedResolutionfixed 
Summary07937: Make question code accessible from EM
Description

There is currently no way to access the question code from within a question using the Expression Manager.
A possible solution would be to make the question code accessible through something like {self.qcode}, such that {age.qcode} would return the string "age".

Additional Information

Use cases might seem slim, so here's an example:
In a psychological perceptual experiment you have many questions which are usually the same but show different stimuli: the question might be "what word did you hear" if the stimulus is a sound; or "how do you think this person feels" if the stimulus is the image of a face.
A standard way to do set this up would be to have independent questions, each pointing to the specific stimulus (image, sound, etc). However, if the question code gave enough information to identify the stimulus, the appropriate filename (or other such identifier) could be parsed from the question code allowing the actual question text to be the same for all cases, greatly simplifying the process.

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

Users monitoring this issue

Mazi, TMSWhite

Activities

DenisChenu

DenisChenu

2013-06-19 16:25

developer   ~25593

If i understand : it's an automatic text according to qcode ?
Maybe there another way to do this ?

(but still : have a self.lemcode can be a good idea).

jja

jja

2013-06-19 16:50

reporter   ~25594

Hopefully there is, because otherwise I'm screwed. :)
More seriously, yes, there are workarounds, and maybe this case is unusual enough to ignore at this point.
But we seem to agree on the possible benefits of having access to the question code; and what is more, not having it seems a bit arbitrary, at least to me.

DenisChenu

DenisChenu

2013-06-19 17:00

developer   ~25595

When i say "automatic text" i think of another setting somewhere. Not a workaround :).

Maybe some GLOBAL em function ?

For example:
{GLOBAL:imagetext}
{GLOBAL:soundtext}

.

DenisChenu

DenisChenu

2021-11-02 13:05

developer   ~67057

See https://github.com/LimeSurvey/LimeSurvey/tree/master/application/core/plugins/expressionQuestionHelp
for a plugin solution

galads

galads

2021-11-02 14:47

reporter   ~67061

Oh!! I already see this plugin as the default plugin in the core LS5. I will close this ticket then. Thank you @DenisChenu , we do not need to implement this seperately.

Issue History

Date Modified Username Field Change
2013-06-19 16:10 jja New Issue
2013-06-19 16:15 Mazi Issue Monitored: TMSWhite
2013-06-19 16:15 Mazi Issue Monitored: sammousa
2013-06-19 16:16 Mazi Issue Monitored: Mazi
2013-06-19 16:25 DenisChenu Note Added: 25593
2013-06-19 16:50 jja Note Added: 25594
2013-06-19 17:00 DenisChenu Note Added: 25595
2021-11-02 11:37 galads Assigned To => galads
2021-11-02 11:37 galads Status new => acknowledged
2021-11-02 13:05 DenisChenu Note Added: 67057
2021-11-02 14:47 galads Note Added: 67061
2021-11-02 14:47 galads Bug heat 8 => 10
2021-11-02 14:47 galads Status acknowledged => closed
2021-11-02 14:47 galads Resolution open => fixed