Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

How to Display Question Group Title in Expression Manager

More
5 years 4 months ago #178199 by dhel
Been browsing for hours through too many documents (both English and Dutch) now without finding any result...
What seems evident for displaying "questions" and documented al over, seems hard to find for "question groups"?

What I need?
Identical to {Question01} I simply want to display the title of a question group in a text display type of question. Can't be that difficult?
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 4 months ago #178200 by tpartner
Try this:

Code:
{GROUPNAME}

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
More
5 years 4 months ago #178212 by dhel
I found that option, but how can you define for which group? This probably works within the questions of same group, not ouside?
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 4 months ago - 5 years 4 months ago #178214 by holch
[strike]you need to replace "groupname" with the name you have given the group you want to show. GROUPNAME in Tpartner's example is just a placeholder, as he can't possibly know how you named your groups.[/strike]

[edit: wrong information!]

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

Last edit: 5 years 4 months ago by holch.
The topic has been locked.
More
5 years 4 months ago #178215 by dhel
Obviously! But what is being stored as a "groupname" actually? When creating a group, the TITLE of the group, in my case a whole sentence, is being diplayed as the "groupname"??? This possibly cannot be the the way to use? Alternatively, I notice a group ID and a sequence...
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 4 months ago #178216 by tpartner
You're welcome for the help.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: holch
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 4 months ago #178217 by holch
Have you even tried what happens???

Actually I was wrong. You can't replace the GROUPNAME with the given name of a group. I tested it and LS does show only an error.

But if you use Tpartners code as is it shows the given name of the group you are currently in.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
More
5 years 4 months ago #178218 by dhel
"Have you even tried what happens???" Yes, I'm trying various options for some days now. But, as you say, "But if you use Tpartners code as is it shows the given name of the group you are currently in. " So what for use in a separate group where I want to call that info?
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 4 months ago #178223 by holch
I don't think that the group text is available as a replacement field outside of the group.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The following user(s) said Thank You: DenisChenu
The topic has been locked.
More
5 years 4 months ago #178271 by dhel
Would it be an option to define a variable within the group using {GROUPNAME} and store that info in there?
This should make it available in other groups though?
What would be the syntax for that?
The following user(s) said Thank You: DenisChenu
The topic has been locked.
More
5 years 4 months ago #178273 by dhel
Alternative (but dirty solution) could perhaps be to define a hidden dummy question as first one in each group and repeat the same group info there... Could then be called.

Need SOME solution, since this survey I'm working on is in about 10 languages. You can figure out why I need it, to display at the end an overview of correct an erroneous answers on each subject / per group...
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 4 months ago - 5 years 4 months ago #178282 by DenisChenu
For alt solution (not really dirty)

I think you want to show correct result at end of survey ?
Then :

At each group, create a Text display question and hide it with settings
For this question code : set it to ReportGroupX (wher X is updated for each group)
Set question text to something like this
Code:
<h2>Your result to {GROUPNAME}</h2>
<ul>
<li>At question {G1Q1.question} you answer {G1Q1.shown}, the good response was The good response at Q1</li>
<li>At question {G1Q2.question} you answer {G1Q2.shown}, the good response was The good response at Q1</li>
</ul>

And finally for endpage :
Code:
<h1>Your result was :</h1>
{ReportGroup1.question}
{ReportGroup2.question}
{ReportGroup3.question}

Some advantage of this solution
- Have multiple short part is always better than a big part
- You can check validity of your report when previewing group (remove hidden settings) during development
- You can use anything else than {GROUPNAME}

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Last edit: 5 years 4 months ago by DenisChenu.
The following user(s) said Thank You: holch, dhel
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose