Welcome to the LimeSurvey Community Forum

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

Problems applying predefined set of labels to answers

  • mbarrera
  • mbarrera's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
10 years 3 weeks ago #105551 by mbarrera
I´ve installed Limesurvey Versión 2.05+ Build 140125.

I have a set of labels with 8 characters of code like: 35000568. For importing this set of labels I needed to change the value of the field code in the table lime_labels to 8 characters.

My problem is when I need to apply this set of labels as response options to a question. When I try to do it, I can´t do it and appears the message: Failed upgrade options.

What do you think is my problem?
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
10 years 3 weeks ago - 10 years 3 weeks ago #105576 by DenisChenu
HI,

Because answer code max width are 5 characters : varchar(5).

Denis
PS:

I needed to change the value of the field code in the table lime_labels to 8 characters.

We don't support hacked LimeSUrvey version.

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Last edit: 10 years 3 weeks ago by DenisChenu.
The topic has been locked.
  • mbarrera
  • mbarrera's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
10 years 3 weeks ago - 10 years 3 weeks ago #105582 by mbarrera
I found it :)

In ../application/models/Answer.php I changed the value 5 for 8 in the followin function:

public function rules()
{
return array(
array('qid','numerical', 'integerOnly'=>true),
array('code','length', 'min' => 1, 'max'=>8),
array('answer','LSYii_Validators'),
array('sortorder','numerical', 'integerOnly'=>true,'allowEmpty'=>true),
array('assessment_value','numerical', 'integerOnly'=>true,'allowEmpty'=>true),
array('language','length', 'min' => 2, 'max'=>20),// in array languages ?
array('scale_id','numerical', 'integerOnly'=>true,'allowEmpty'=>true),
);
}
Last edit: 10 years 3 weeks ago by mbarrera. Reason: color
The following user(s) said Thank You: dglp
The topic has been locked.
More
9 years 7 months ago #111562 by dglp
This looks much like the question I want to ask, so I'm adding my query here instead of on a new post.

Am initially wondering why the Answer Code character length is limited to 5. I would like to use longer alphabetic strings to ease later identification.

Looking at Table: phu_answers in phpMyAdmin, am thinking that the character length of the code column could simply be changed from 5 to a higher number.

The line in Answer.php highlighted by mbarrera looks like it amounts to the same thing.

So the question still remains, would modifying that break something else? :blink:
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
9 years 7 months ago #111566 by holch
Every update could break your installation. If the file you are chaning is updated it will go back to the default length.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The following user(s) said Thank You: dglp
The topic has been locked.
More
9 years 7 months ago #111670 by dglp
Interestingly, changing that number had no effect on the code field.
I wonder if the control element I want is somewhere else.

Meanwhile, I'm also still wondering why the number is set to 5 in the the first place.
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
9 years 7 months ago #111674 by holch

Meanwhile, I'm also still wondering why the number is set to 5 in the the first place.


That would trigger another question: why would you need more than 5 digits in the first place? ;-)

The question code exists to give a unique code to the questions. 5 digits should be enough. That gives you quite a few combinations and probably your database engine runs into a limit before you run into the limit of a 5 digit code.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The following user(s) said Thank You: dglp
The topic has been locked.
More
9 years 7 months ago - 9 years 7 months ago #111678 by dglp
Having a longer string would make it possible to create aides-memoire for development/documentation purposes.

While I'm trying to figure out how to structure a survey, and how to write workable expressions, it's really helpful to have answers labeled in ways that are really easy to identify.

Even a short mnemonic like Q15Sq3A4 would help.

Of course, I still can't make meaningful changes; the way the GUI is set up also needs changing, as it is running some sort of check on the field, and disallows anything longer than 5 characters.

Looks like the only workable option is to print out the xml, and draw lots of pencil lines from one bit to another. :blink:
Last edit: 9 years 7 months ago by dglp.
The topic has been locked.
  • Mazi
  • Mazi's Avatar
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
9 years 7 months ago #111713 by Mazi
You can file a feature request at our bugtracker to support longer answer codes.

Note that this could involve quite some re-coding depending on how deep in the system and how often the codes are referenced. I assume that if this was a simple change, we would already have increased the number but I may be wrong.

Best regards/Beste Grüße,
Dr. Marcel Minke
Need Help? We offer professional Limesurvey support: survey-consulting.com
Contact: marcel.minke(at)survey-consulting.com
The following user(s) said Thank You: dglp
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose