Welcome, Guest
Username: Password: Remember me

TOPIC: Multiple numerical input problem after upgrade

Multiple numerical input problem after upgrade 2 years 1 month ago #81323

  • aukevann
  • aukevann's Avatar
  • OFFLINE
  • Senior Lime
  • Posts: 51
  • Karma: 1
Today I upgraded my LimeSurvey installation to version Version 1.92+ Build 120530.
I use a lot of Multiple Numeric Input questions in the online surveys. The users give 12 points to 6 different statements.

Before the upgrade only the fields where points where assigned had to be filled out. I.e. if 6 points where given to 2 statements each then the remaining 4 statement-fields where left empty.

After the upgrade I need to fill out each field, even if no points are assigned to a statement the field needs to be 0. Otherwise we get an error message that not all fields have values.

This makes our surveys unusable :ohmy: . We run a lively life system, any help greatly appreciated.

Kind regards,
Auke
The administrator has disabled public write access.

Re: Multiple numerical input problem after upgrade 2 years 1 month ago #81327

  • TMSWhite
  • TMSWhite's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 759
  • Thank you received: 82
  • Karma: 36
Sounds like the multiple numerical input fields are mandatory. If you remove the mandatory requirement, it will behave as you have describe. When they are set to mandatory, users have to enter something in every field.

If that's not the case, please attach a sample survey so we can investigate further.
The administrator has disabled public write access.

Re: Multiple numerical input problem after upgrade 2 years 1 month ago #81329

  • aukevann
  • aukevann's Avatar
  • OFFLINE
  • Senior Lime
  • Posts: 51
  • Karma: 1
Thanks for the quick reply.
The questions are mandatory, is that what you refer to? (can't find any other parameter specific to the Multiple Numeric Input fields).

If I change the question to "not mandatory" it works but also the user can skip the whole question which is not what we want. In the previous version (sorry, don't know the version number, installed august last year) it worked correctly, as soon as enough point where added the user could go to the next question without filling in zero's in the fields that where not used.

If you need the survey file I can send it, rather do this via e-mail not post it publicly.

Kind regards,
Auke
The administrator has disabled public write access.

Re: Multiple numerical input problem after upgrade 2 years 1 month ago #81332

  • TMSWhite
  • TMSWhite's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 759
  • Thank you received: 82
  • Karma: 36
Setting a question as mandatory means that all relevant parts must be answered. The fact that it worked the way you wanted last August was actually a mistake in the code which has since been fixed

So, instead of mandatory, use the following advanced question options:
(1) min_answers = 1 (this will ensure that the person enters at least one answer)
(2) hide_tip = Yes (this will prevent the message "Please enter at least one answer" from showing.

Of course, keep the equals_sum_value option so that the values must sum to 12.
The administrator has disabled public write access.

Re: Multiple numerical input problem after upgrade 2 years 1 month ago #81335

  • aukevann
  • aukevann's Avatar
  • OFFLINE
  • Senior Lime
  • Posts: 51
  • Karma: 1
thanks, this works. It does not hide the "please enter at least one answer" option though, any advice?

I liked the error, now I have an enormous task to ajust hundreds of online question to this new setting. :( Any tip how to do this with an SQL query?
The administrator has disabled public write access.

Re: Multiple numerical input problem after upgrade 2 years 1 month ago #81338

  • TMSWhite
  • TMSWhite's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 759
  • Thank you received: 82
  • Karma: 36
If hide_tip isn't hiding "Please enter at least one answer", the most likely reason is that you are using a custom template that is missing some of the new CSS styles. If you look at template.css, you will see that these have been added to the default template:
 
/* Tips / Validation Messages */
/* If the question is invalid, but has not been submitted, give it a pleasant warning color */
div.em_num_answers.good {
 color: green;
}
 
div.em_num_answers.error {
  color: #FF00FF;
  display: block;
}
 
div.em_value_range.good {
  color: green;
}
div.em_value_range.error {
  color: #FF00FF;
  display: block;
}
 
div.em_sum_range.good {
  color: green;
}
div.em_sum_range.error {
  color: #FF00FF;
  display: block;
}
 
div.em_regex_validation {
  display: none;
}
div.em_regex_validation.good {
  color: green;
}
div.em_regex_validation.error {
  color: #FF00FF;
}
 
div.em_q_fn_validation.good {
  color: green;
}
div.em_q_fn_validation.error {
  color: #FF00FF;
}
 
div.em_sq_fn_validation.good {
  color: green;
}
div.em_sq_fn_validation.error {
  color: #FF00FF;
}
 
div.em_other_comment_mandatory.good {
  display: none;
}
div.em_other_comment_mandatory.error {
  color: #FF00FF;
  display: block;
}
 
input.em_sq_validation.good, textarea.em_sq_validation.good {
}
 
input.em_sq_validation.error, textarea.em_sq_validation.error {
  color: black;
  background-color:  pink;
}
 
span.dynamic_sum {
  font-weight: bold;
  background-color: #d3d3d3;
}
span.dynamic_sum.good {
  color: green;
}
span.dynamic_sum.error {
  color: red;
}
 
span.dynamic_remaining {
  font-weight: bold;
  background-color: #d3d3d3;
}
span.dyanamic_remaining.good {
  color: green;
}
span.dynamic_remaining.error {
  color: red;
}
 
/* If  it is still invalid after submit, flag it in red */
.input-error div.error {
  color: red;
  display: block;
}
 
span.hide-tip div.good {
    display: none;
}
 
span.hide-tip div.error {
    color: #FF00FF;
}
 
.input-error span.hide-tip div.error {
    color: red;
    display: block;
}

You may need to add some of that to your template
The administrator has disabled public write access.

Re: Multiple numerical input problem after upgrade 2 years 1 month ago #81349

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4062
  • Thank you received: 742
  • Karma: 341
TMSWhite, does this render all pre 1.92 templates obsolete? What happened to backwards compatibility?
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.

Re: Multiple numerical input problem after upgrade 2 years 1 month ago #81351

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4062
  • Thank you received: 742
  • Karma: 341
For those that have active surveys and can't change survey behaviour or appearance or have too many questions to modify, add this to the end of template.js.

The script will default empty multiple-numeric inputs to 0.
$(document).ready(function(){
   // Default all empty multiple-numeric inputs to 0
	$('.numeric-multi input.text').filter(function() { 
		return this.value == ""; 
	}).val(0);
 
});
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.

Re: Multiple numerical input problem after upgrade 2 years 1 month ago #81355

  • mdekker
  • mdekker's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 341
  • Thank you received: 68
  • Karma: 38
Are you sure this is intended? I would say when the question is relevant and thus showed, it should respect the equals_sum_value and not skip that if nothing was entered. No need to set extra parameters.
---
Menno Dekker
The administrator has disabled public write access.

Re: Multiple numerical input problem after upgrade 2 years 1 month ago #81356

  • TMSWhite
  • TMSWhite's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 759
  • Thank you received: 82
  • Karma: 36
mdekker wrote:
Are you sure this is intended? I would say when the question is relevant and thus showed, it should respect the equals_sum_value and not skip that if nothing was entered. No need to set extra parameters.

We can certainly make it work either way. There was debate about this several months ago, but I can't find the discussion log. However, the decision at that time was that even with equals_sum_value, uses should be allowed to skip the question entirely unless it was mandatory in some fashion (e.g. either using min_answers or mandatory).
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.215 seconds
Donation Image