View Issue Details

This issue affects 1 person(s).
 6
IDProjectCategoryView StatusLast Update
16888Bug reportsOtherpublic2026-10-21 15:40
Reporterf_funke Assigned Toc_schmitz  
PrioritylowSeveritypartial_block 
Status resolvedResolutionfixed 
Product Version4.3.30 
Summary16888: answer code with leading zero causes problems with data import in R
Description

This is about the automatically suggested question codes for closed-ended questions (e.g., radio buttons with list (radio) or arrays).

After changing the personal setting "Non-Numerical answer option prefix:" to blank/empty (so that no prefix should be used), the question codes are as follows:
Code Assessment Answeroption
01 0 my option A
02 0 my option B
03 0 my option C

The leading zero, however, leads to problems when importing data in R: The variables with question codes starting with a zero are recognized as a character variable, not a numeric variable.

The codes should start without the leading zero:
Code Assessment Answeroption
1 0 my option A
2 0 my option B
3 0 my option C

TagsNo tags attached.
Attached Files
Bug heat6
Complete LimeSurvey version number (& build)LS 4.3.29
I will donate to the project if issue is resolvedNo
Browser
Database type & versionLS Cloud
Server OS (if known)
Webserver software & version (if known)
PHP VersionLS Cloud
Git branch / Pull Request URL

Users monitoring this issue

There are no users monitoring this issue.

Activities

DenisChenu

DenisChenu

2020-12-09 17:14

developer   ~60882

Why not add a settings : «number of or 0»

2 by default ?

f_funke

f_funke

2020-12-10 15:51

developer   ~60915

The leading zero makes sense when you use a prefix like "XY" so that it results in

Code | Assessment | Answeroption
XY01 | 0 | my option A
XY02 | 0 | my option B
XY03 | 0 | my option C

which is still sortable when you have more than 10 answer options.

DenisChenu

DenisChenu

2020-12-10 16:13

developer   ~60916

Last edited: 2020-12-10 16:13

Yes, and sometimes you need A000 for format (3 leading 0).

You think nobody want ##000 for format ? only ####0 ? or A00 ?

I thoink it can be great to have a solution to allow

A00
A000
A0000
A0
####0
###00
##000
…

c_schmitz

c_schmitz

2026-10-21 15:40

administrator   ~86676

Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=40970

Related Changesets

LimeSurvey: master e8ef741a

2026-10-21 15:40

c_schmitz


Details Diff
Fixed issue 16888: Answer option and subquestion codes started with a leading zero (01, 001) when the code prefix in the personal settings was empty Affected Issues
16888
mod - application/models/Question.php Diff File

Issue History

Date Modified Username Field Change
2020-12-09 17:12 f_funke New Issue
2020-12-09 17:12 f_funke Status new => assigned
2020-12-09 17:12 f_funke Assigned To => cdorin
2020-12-09 17:12 f_funke File Added: 201209_answer_code_leading_zero.png
2020-12-09 17:14 DenisChenu Note Added: 60882
2020-12-10 15:51 f_funke Note Added: 60915
2020-12-10 16:13 DenisChenu Note Added: 60916
2020-12-10 16:13 DenisChenu Note Edited: 60916
2020-12-28 18:34 cdorin Assigned To cdorin =>
2020-12-28 18:34 cdorin Priority none => low
2020-12-28 18:34 cdorin Status assigned => confirmed
2026-10-21 15:40 c_schmitz Changeset attached => LimeSurvey master e8ef741a
2026-10-21 15:40 c_schmitz Note Added: 86676
2026-10-21 15:40 c_schmitz Assigned To => c_schmitz
2026-10-21 15:40 c_schmitz Status confirmed => resolved
2026-10-21 15:40 c_schmitz Resolution open => fixed
2026-10-21 15:40 c_schmitz Bug heat 4 => 6