Welcome, Guest
Username: Password: Remember me

TOPIC: Problems applying predefined set of labels to answers

Problems applying predefined set of labels to answers 8 months 5 days ago #105551

  • mbarrera
  • mbarrera's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 5
  • Thank you received: 1
  • Karma: 0
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?
upgradeoptions.jpg
The administrator has disabled public write access.

Problems applying predefined set of labels to answers 8 months 5 days ago #105576

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 6471
  • Thank you received: 854
  • Karma: 254
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.
Last Edit: 8 months 5 days ago by DenisChenu.
The administrator has disabled public write access.

Problems applying predefined set of labels to answers 8 months 5 days ago #105582

  • mbarrera
  • mbarrera's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 5
  • Thank you received: 1
  • Karma: 0
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: 8 months 5 days ago by mbarrera. Reason: color
The administrator has disabled public write access.
The following user(s) said Thank You: dglp

Problems applying predefined set of labels to answers 2 months 2 weeks ago #111562

  • dglp
  • dglp's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 18
  • Karma: 0
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 administrator has disabled public write access.

Problems applying predefined set of labels to answers 2 months 2 weeks ago #111566

  • holch
  • holch's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 2853
  • Thank you received: 360
  • Karma: 125
Every update could break your installation. If the file you are chaning is updated it will go back to the default length.
Have a look at the manual! It is a really valuable source for information. Here some helpful links:
Manual (EN) | Question Types | Question Attributes | Workarounds

If you found this answer helpful and it saved you some time please consider a donation to the project to keep Limesurvey going!
The administrator has disabled public write access.
The following user(s) said Thank You: dglp

Problems applying predefined set of labels to answers 2 months 2 weeks ago #111670

  • dglp
  • dglp's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 18
  • Karma: 0
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 administrator has disabled public write access.

Problems applying predefined set of labels to answers 2 months 2 weeks ago #111674

  • holch
  • holch's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 2853
  • Thank you received: 360
  • Karma: 125
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.
Have a look at the manual! It is a really valuable source for information. Here some helpful links:
Manual (EN) | Question Types | Question Attributes | Workarounds

If you found this answer helpful and it saved you some time please consider a donation to the project to keep Limesurvey going!
The administrator has disabled public write access.
The following user(s) said Thank You: dglp

Problems applying predefined set of labels to answers 2 months 2 weeks ago #111678

  • dglp
  • dglp's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 18
  • Karma: 0
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 months 2 weeks ago by dglp.
The administrator has disabled public write access.

Problems applying predefined set of labels to answers 2 months 1 week ago #111713

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5349
  • Thank you received: 299
  • Karma: 250
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)limesurvey.org'"
The administrator has disabled public write access.
The following user(s) said Thank You: dglp
Moderators: ITEd
Time to create page: 0.145 seconds
Donation Image