Problems applying predefined set of labels to answers

More
3 years 2 months ago #105551 by mbarrera
mbarrera created the topic: Problems applying predefined set of labels to answers
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 2 months ago - 3 years 2 months ago #105576 by DenisChenu
DenisChenu replied the topic: Problems applying predefined set of labels to answers
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).
An error happen ? Before make a new topic : remind the Debug mode .
Last Edit: 3 years 2 months ago by DenisChenu.

Please Log in to join the conversation.

More
3 years 2 months ago - 3 years 2 months ago #105582 by mbarrera
mbarrera replied the topic: Problems applying predefined set of labels to answers
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 2 months ago by mbarrera. Reason: color
The following user(s) said Thank You: dglp

Please Log in to join the conversation.

More
2 years 8 months ago #111562 by dglp
dglp replied the topic: Problems applying predefined set of labels to answers
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 8 months ago #111566 by holch
holch replied the topic: Problems applying predefined set of labels to answers
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 8 months ago #111670 by dglp
dglp replied the topic: Problems applying predefined set of labels to answers
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 8 months ago #111674 by holch
holch replied the topic: Problems applying predefined set of labels to answers

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 8 months ago - 2 years 8 months ago #111678 by dglp
dglp replied the topic: Problems applying predefined set of labels to answers
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 8 months ago by dglp.

Please Log in to join the conversation.

More
2 years 8 months ago #111713 by Mazi
Mazi replied the topic: Problems applying predefined set of labels to answers
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.

Start now!

Just create your account and start using Limesurvey today.

Register now