Check out the LimeSurvey source code on GitHub!

Problems applying predefined set of labels to answers

More
3 years 1 day 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?
Attachments:

Please Log in to join the conversation.

More
3 years 1 day ago - 3 years 1 day 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 (or search sondages pro).
Last Edit: 3 years 1 day ago by DenisChenu.

Please Log in to join the conversation.

More
3 years 1 day ago - 3 years 1 day 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: 3 years 1 day ago by mbarrera. Reason: color
The following user(s) said Thank You: dglp

Please Log in to join the conversation.

More
2 years 6 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:

Please Log in to join the conversation.

More
2 years 6 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'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
The following user(s) said Thank You: dglp

Please Log in to join the conversation.

More
2 years 6 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.

Please Log in to join the conversation.

More
2 years 6 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'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
The following user(s) said Thank You: dglp

Please Log in to join the conversation.

More
2 years 6 months ago - 2 years 6 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: 2 years 6 months ago by dglp.

Please Log in to join the conversation.

More
2 years 6 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
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)survey-consulting.com'"
The following user(s) said Thank You: dglp

Please Log in to join the conversation.

Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form