diff --git a/forms/qae_form_builder/question.rb b/forms/qae_form_builder/question.rb index 39d748719..0a92bb2aa 100644 --- a/forms/qae_form_builder/question.rb +++ b/forms/qae_form_builder/question.rb @@ -48,7 +48,7 @@ def skip_base_validation? def limit_with_buffer(limit) if limit > 15 - (limit + limit * 0.1).to_i + 1 + (limit + limit * 0.1).to_i else limit end diff --git a/forms/qae_form_builder/textarea_question.rb b/forms/qae_form_builder/textarea_question.rb index 30c57e766..f04397747 100644 --- a/forms/qae_form_builder/textarea_question.rb +++ b/forms/qae_form_builder/textarea_question.rb @@ -9,12 +9,12 @@ def errors limit = question.delegate_obj.words_max - if limit && limit_with_buffer(limit) && length && length > (limit_with_buffer(limit) - 1) + if limit && limit_with_buffer(limit) && length && length > (limit_with_buffer(limit)) result[question.hash_key] ||= "" error = if limit_with_buffer(limit) > 15 - " Question #{question.ref} has a word limit of #{limit}. Your answer has to be #{limit_with_buffer(limit) - 1} words or less (as we allow 10% leeway)." + " Question #{question.ref} has a word limit of #{limit}. Your answer has to be #{limit_with_buffer(limit)} words or less (as we allow 10% leeway)." else - " Question #{question.ref} has a word limit of #{limit}. Your answer has to be #{limit_with_buffer(limit) - 1} word or less." + " Question #{question.ref} has a word limit of #{limit}. Your answer has to be #{limit_with_buffer(limit)} words or less." end result[question.hash_key] << error end