Welcome to the LimeSurvey Community Forum

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

Array Question With Radio - How Set Default Checked Value

  • cheeseburger
  • cheeseburger's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
1 year 9 months ago - 1 year 9 months ago #242705 by cheeseburger
 LS Version: 6.0.1+230411
Own server

Hello everyone. 
We have been using all of the array questions types with radio buttons as the options and have been able to succesfully check one of the radio buttons to a default value using an equation type question and the basic EM code that we all use (if blank then select a value else use the value that is selected). This is all good. 

The issue: When using the same code that works for all of the array type questions in the basic "ARRAY" type, it does not work. it never selects a default value. 

Before sending any of the EM code through, let me just show you a screen shot of the question of type "ARRAY"   
 



this is the type of ARRAY that is NOT working
 
 

DUAL ARRAY for example IS WORKING. 

We have tried various syntax, placing the EQ question with the EM code before and after the question it is referencing, etc, etc, etc. No luck. Before we send additional info, is there any known issues with this scenario (ARRAY QUESTION TYPE with RADIO buttons and being able to set a value via EM code)? 

Thank for any help. 
Last edit: 1 year 9 months ago by cheeseburger.

Please Log in to join the conversation.

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 9 months ago #242714 by tpartner
I would think the ExpressionScript should look something like this:

Code:
{qCode_sqCode = if(is_empty(qCode_sqCode), 'aCode', qCode_sqCode)}

Can you attach a small sample survey (.lss file) containing only the relevant questions and your ExpressionScript code.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

  • cheeseburger
  • cheeseburger's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
1 year 9 months ago #242736 by cheeseburger
Hi Tony, you are correct. That is the precise syntax with which we began and what has worked for other array types or even for simple multiple choice types using radio groups. It does not however work for the basic array type F question type. By "not work" we mean that when we load the page, our EM code does not select the answer we are instructing. We do not see any of the radio buttons checked in the display and in the code we do not see any checked properties. We do see both when using other array types though. It is just type F arrays that seem to be misbehaving. Reminder: We placed the EM code above and below the question and we have also tried other forms of syntax. We will attempt to attach an edited down version of the test survey in LSS format here. Thanks for your help. 

Please Log in to join the conversation.

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 9 months ago #242745 by tpartner
I can confirm the problem, it is a bug in version 6.x (works as expected in 5.x).

Please file a bug report - bugs.limesurvey.org/bug_report_page.php .

Include your test survey and give a link to the bug here.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

  • cheeseburger
  • cheeseburger's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
1 year 9 months ago #242749 by cheeseburger
Thanks for confirming Tony. I will try to file the bug report but we tried two weeks back and there was an issue that didn't allow us even though we were the official email associated with the account and it also wouldnt allow us to do it anonymously. We'll give it a try though. Thanks

Please Log in to join the conversation.

  • cheeseburger
  • cheeseburger's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
1 year 9 months ago #242757 by cheeseburger
Hi Tony, we tried to access the bug tracker but it continues to not allow us the access we used to have. If you were interested, you are welcome to post the bug. To help save you time you can use the LSS file previously attached in this thread and below this text, I will copy/paste the text I would've used for the bug tracker. Thank you for any help you can give.

BEGIN TEXT**********

Version of Limesurvey: 6.0.1+230411
Server License Type: Our own server

Description of bug:
When we make a question using the ARRAY type (type F) with radio buttons, we can not use EM code to set one of the answers manually.

We can do this with any other type of array question and also with multiple choice type questions that use radio buttons.

We have attempted using the standard syntax and tried many alternatives. We have also tried with the EQ question's EM code placed before or after the array (type f) question.

When the page loads, the radio button is never checked (by visible inspection with the eye and in the code under the properties of the input)

This was posted here:
forums.limesurvey.org/index.php/forum/ca...checked-value#242749

And Tony Partner confirmed that it is a bug and suggested that we post this to the bug tracker.

The sample LSS file is included with this text and can be used to replicate the issue in v6. Tony noted that it is not an issue when tested in v5.

Thanks

Please Log in to join the conversation.

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team & Official Partner
  • LimeSurvey Community Team & Official Partner
More
1 year 9 months ago #242760 by DenisChenu
Send a simple lss showing the issue please

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. - Professional support - Plugins, theme and development .
I don't answer to private message.

Please Log in to join the conversation.

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 9 months ago - 1 year 9 months ago #242761 by tpartner

If you were interested, you are welcome to post the bug.

Done - bugs.limesurvey.org/view.php?id=18785

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 1 year 9 months ago by tpartner.
The following user(s) said Thank You: holch

Please Log in to join the conversation.

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 9 months ago #242762 by tpartner
@DenisChenu, a .lss was provided above and I have attached one to the bug.

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: DenisChenu, cheeseburger

Please Log in to join the conversation.

  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 9 months ago #242773 by holch
We need to get this bug tracker login issue fixed...

I asked Carsten the other day and he said they are on it. We'll see.

Help us to help you!
  • Provide your LS version and where it is installed (own server, uni/employer, SaaS hosting, etc.).
  • Always provide a LSS file (not LSQ or LSG).
Note: I answer at this forum in my spare time, I'm not a LimeSurvey GmbH employee.

Please Log in to join the conversation.

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team & Official Partner
  • LimeSurvey Community Team & Official Partner
More
1 year 9 months ago #242776 by DenisChenu

@DenisChenu, a .lss was provided above and I have attached one to the bug.
 
Yes : ) Sorry, see it after

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. - Professional support - Plugins, theme and development .
I don't answer to private message.

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose