LimesurveyRC: Can't retrieve answer options for dual-scale questions

More
1 month 1 week ago - 1 month 1 week ago #190795 by datamunger
When using Python API to retrieve answer options for dual-scale questions, I get "No available answer options".

My query looks like this (works for other question types):
method = "get_question_properties"
api.query(method=method, params=OrderedDict([
                        ("sSessionKey", api.session_key),
                        ("iQuestionID", '12345')
                    ]))
Last edit: 1 month 1 week ago by datamunger.

Please Log in or Create an account to join the conversation.

LimeSurvey Partners
More
1 month 1 week ago #190797 by holch
Not an expert on the Remote Control, but as the dual scale question is actually two questions, you probably need to address each scale separately, not sure how you access them, but probably the Question ID is not enough. Have a look in the Question Logic File, you might get some hints there on how to address the first "question" of the dual scale and how the second "question".

I'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds

Please Log in or Create an account to join the conversation.

More
1 month 1 week ago #190798 by datamunger
Thanks for the hint - the scaleID field always returns 0, for every question in the survey, so I can't use this either.

Please Log in or Create an account to join the conversation.

More
1 month 1 week ago #190799 by holch
manual.limesurvey.org/Expression_Manager...tion_with_two_scales

This is for the Expression Manager, but I assume something like this will be necessary also for the RC.

The dual scale question type has 3 dimensions:
1. Subquestions
2. Answer options
3. Scale (0 or 1)

I'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds

Please Log in or Create an account to join the conversation.

More
1 month 1 week ago #190802 by datamunger
You are correct about the subquestion dimension, this is specified via the iQuestionID. The answeroptions, however, should be returned by the query. There is no way to specify a scaleID with the query as far as I know, but I'd love to learn more. The documentation doesn't specify the available options for aQuestionSettings.

Please Log in or Create an account to join the conversation.

More
1 month 1 week ago - 1 month 1 week ago #190805 by holch
As I said, I have no idea about the RC, but I assume if you just specify the the question id and the subquestion, limesurvey won't know what scale you are referring to.

How do you specify the subquestion in the iQuestionID? How does it look like?

For Expression Manager I would access the answer options of a dual scale question the following way:
First scale
QuestionID_SubquestionID_0

So I am sure there is probably something similar for the RC. Let's see if someone with API experience comes here.

Wait, what is the LS version you are using?

bugs.limesurvey.org/view.php?id=13312

I'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds
Last edit: 1 month 1 week ago by holch.

Please Log in or Create an account to join the conversation.

More
1 month 1 week ago - 1 month 1 week ago #190816 by datamunger
I'm using version 3.17.7

The documentation for get_question_properties is pretty sparse, but it states the following:

/**
* Get properties of a question in a survey.
*
* @see \Question for available properties.
* Some more properties are available_answers, subquestions, attributes, attributes_lang, answeroptions, defaultvalue
*
* @access public
* @param string $sSessionKey Auth credentials
* @param int $iQuestionID ID of the question to get properties
* @param array $aQuestionSettings (optional) properties to get, default to all
* @param string $sLanguage (optional) parameter language for multilingual questions, default are \Survey->language
* @return array The requested values
*/


The aQuestionSettings allow me to specify 'scale_id', but this simply returns '0' as a JSON response. A full example looks like this:
api.query(method=method, params=OrderedDict([
                        ("sSessionKey", api.session_key),
                        ("iQuestionID", '36849'),
                        ("aQuestionSettings", ['answeroptions', 'scale_id'])
                    ]))
returns:
{'answeroptions': 'No available answer options', 'scale_id': '0'}
Last edit: 1 month 1 week ago by datamunger.

Please Log in or Create an account to join the conversation.

More
1 month 1 week ago #190817 by datamunger

holch wrote:
Wait, what is the LS version you are using?

bugs.limesurvey.org/view.php?id=13312


I've come across this as well, but at least that user got answeroptions for one of the scales, whereas I don't get any.

Please Log in or Create an account to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!