- Posts: 7
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
How to show answer codes in survey
- fawwadhk
- Topic Author
- Offline
- New Member
Less
More
4 years 5 months ago #190654
by fawwadhk
How to show answer codes in survey was created by fawwadhk
Is it possible to show answer codes on survey
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10108
- Thank you received: 3593
4 years 5 months ago #190659
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic How to show answer codes in survey
Expression Manager {Qcode.code} -
manual.limesurvey.org/Expression_Manager...#Access_to_variables
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- fawwadhk
- Topic Author
- Offline
- New Member
Less
More
- Posts: 7
- Thank you received: 0
4 years 5 months ago #190661
by fawwadhk
Replied by fawwadhk on topic How to show answer codes in survey
Hi Tony, thanks for the update. I am talking about the time when we add the answers options to the question. For example, if a question has 4 options (radio button) with a code a,b,c,d. It did not show the codes(a,b,c,d) on the survey. It just shows the radio button with the text.
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10108
- Thank you received: 3593
4 years 5 months ago - 4 years 5 months ago #190662
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic How to show answer codes in survey
Ah, sorry, I misread answer codes.
In that case, you can either manually place them in the answer text or create a custom question theme.
In that case, you can either manually place them in the answer text or create a custom question theme.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 4 years 5 months ago by tpartner.
The topic has been locked.
- fawwadhk
- Topic Author
- Offline
- New Member
Less
More
- Posts: 7
- Thank you received: 0
4 years 5 months ago #190665
by fawwadhk
Replied by fawwadhk on topic How to show answer codes in survey
Thanks tony. How can i create a custom question theme?
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10108
- Thank you received: 3593
4 years 5 months ago - 4 years 5 months ago #190686
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic How to show answer codes in survey
There are basic instructions on how to create custom question themes here -
github.com/LimeSurvey/LimeSurvey/tree/master/themes/question
.
So, for example, if you want to show the answer codes in a list-radio custom theme, follow those instructions and place something like this in answer_row.twig:
This will result in this, where you see the answer codes in brackets:
So, for example, if you want to show the answer codes in a list-radio custom theme, follow those instructions and place something like this in answer_row.twig:
Code:
<!-- answer_row --> <li id='javatbd{{ myfname }}' class='answer-item radio-item' {{ sDisplayStyle }} > <input type="radio" value="{{ code }}" name="{{ name }}" id="answer{{ name }}{{ code }}" {{ checkedState }} onclick="if (document.getElementById('answer{{ name }}othertext') != null) document.getElementById('answer{{ name }}othertext').value='';checkconditions(this.value, this.name, this.type)" /> <label for="answer{{ name }}{{ code }}" class="control-label radio-label"> ({{ code }}) {{ answer }} </label> </li> <!-- end of answer_row -->
This will result in this, where you see the answer codes in brackets:
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 4 years 5 months ago by tpartner.
The following user(s) said Thank You: DenisChenu
The topic has been locked.