- Posts: 7
- Thank you received: 2
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
- Topic Author
- Offline
- New Member
Less
More
10 years 2 months ago #105551
by mbarrera
Problems applying predefined set of labels to answers was created 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?
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:
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13648
- Thank you received: 2491
10 years 2 months ago - 10 years 2 months ago #105576
by DenisChenu
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.
Replied by DenisChenu on topic Problems applying predefined set of labels to answers
HI,
Because answer code max width are 5 characters : varchar(5).
Denis
PS:
Because answer code max width are 5 characters : varchar(5).
Denis
PS:
We don't support hacked LimeSUrvey version.I needed to change the value of the field code in the table lime_labels to 8 characters.
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 2 months ago by DenisChenu.
The topic has been locked.
- mbarrera
- Topic Author
- Offline
- New Member
Less
More
- Posts: 7
- Thank you received: 2
10 years 2 months ago - 10 years 2 months ago #105582
by mbarrera
Replied by mbarrera on 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'=>,
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),
);
}
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'=>,
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 2 months ago by mbarrera. Reason: color
The following user(s) said Thank You: dglp
The topic has been locked.
- dglp
- Offline
- New Member
Less
More
- Posts: 18
- Thank you received: 0
9 years 8 months ago #111562
by dglp
Replied by dglp on 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:
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
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 11660
- Thank you received: 2742
9 years 8 months ago #111566
by holch
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Replied by holch on 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 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.
- dglp
- Offline
- New Member
Less
More
- Posts: 18
- Thank you received: 0
9 years 8 months ago #111670
by dglp
Replied by dglp on 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.
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
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 11660
- Thank you received: 2742
9 years 8 months ago #111674
by holch
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.
Replied by holch on 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 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.
- dglp
- Offline
- New Member
Less
More
- Posts: 18
- Thank you received: 0
9 years 8 months ago - 9 years 8 months ago #111678
by dglp
Replied by dglp on 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:
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 8 months ago by dglp.
The topic has been locked.
- Mazi
- Offline
- Official LimeSurvey Partner
9 years 8 months ago #111713
by Mazi
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
Replied by Mazi on 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.
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.