Welcome to the LimeSurvey Community Forum

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

LimeSurvey 2.65 Option Numbering

More
8 years 2 months ago - 8 years 2 months ago #156115 by Matadeleo
Hi, I recently upgraded to Version 2.65.1+170522 and now when adding answer options using quick add, LimeSurvey's default numbering has changed from "1, 2, 3" to "A1, A2, A3" which causes issues when exporting to SPSS (no longer a numeric variable type) which then presents issues in tabulating the data with other programs as many rely on the data being in a numeric type.

I believe SubQuestions are also automatically labelled "SQ001, SQ002, SQ003", however this is isn't really an issue as it doesn't change the data types.

Is there any setting or modification to the source code I can make to reverse this change?
Last edit: 8 years 2 months ago by Matadeleo.
The topic has been locked.
More
8 years 2 months ago #156129 by holch
I don't know if this is the same case, but I notices, if you change the first answer option (which usually is already prefilled to a number, and then do quick add, it uses numbers, if you leave A1 it goes on with A2, etc.

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.
The topic has been locked.
More
8 years 2 months ago - 8 years 2 months ago #156147 by Matadeleo
Yes Holch, that does appear to be the case - for the LimeSurvey data to be exported in the correct type for SPSS, I need to always use the numbering "1, 2, 3.."

Perhaps even just finding the file that sets the "pre-filled first option" for the answer options could solve the problem.

EDIT: This appears to be the issue file, located at: \application\controllers\admin\questions.php (Line 498)


Code:
// Check if there is at least one answer
        for ($i = 0; $i < $scalecount; $i++)
        {
            $ans = new CDbCriteria;
            $ans->addCondition("qid=$qid")->addCondition("scale_id=$i")->addCondition("language='$baselang'");
            $qresult = Answer::model()->count($ans);
 
            if ((int)$qresult==0)
            {
                $oAnswer= new Answer;
                $oAnswer->qid = $qid;
                $oAnswer->code = 'A1';
                $oAnswer->answer = "";
                $oAnswer->language = $baselang;
                $oAnswer->sortorder = 0;
                $oAnswer->scale_id = $i;
                $oAnswer->save();
            }
        }
Code:
$oAnswer->code = 'A1'; => $oAnswer->code = '1';
Last edit: 8 years 2 months ago by Matadeleo. Reason: Added code
The topic has been locked.
Moderators: holchtpartner

Lime-years ahead

Online-surveys for every purse and purpose