View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
05698 | Bug reports | Survey editing | public | 2012-01-26 18:15 | 2012-03-14 21:08 |
Reporter | DenisChenu | Assigned To | TMSWhite | ||
Priority | normal | Severity | minor | ||
Status | closed | Resolution | fixed | ||
Product Version | 1.92RC3 | ||||
Target Version | 1.92RC4 | Fixed in Version | 1.92RC4 | ||
Summary | 05698: All question block have input-error class | ||||
Description | With a normal survey , no specific validation, all question have input error-class. | ||||
Steps To Reproduce | Add a new survey Try the survey : question class {QUESTION_CLASS} | ||||
Additional Information | Seeing best with citronade, use input error to hide a div | ||||
Tags | No tags attached. | ||||
Bug heat | 16 | ||||
Complete LimeSurvey version number (& build) | 12213 | ||||
I will donate to the project if issue is resolved | No | ||||
Browser | Firefox | ||||
Database type & version | Mysql 5.1.49 | ||||
Server OS (if known) | debian/linux | ||||
Webserver software & version (if known) | apache | ||||
PHP Version | PHP Version 5.3.3-7 | ||||
We need a creative solution for this because it only affects Citronade. If I remove the input-error class, then in Citronade, no validation messages will ever appear. Try the ls2_validation_tests.lss survey (in /docs/demosurveys) to see the normal behavior in the default template. Citronade is the only packaged template that includes input-error. Can it's css be adjusted to not show red if there is no embedded content? Alternatively, input-error may be obsolete at the div level. The dynamic validations set the font color for errors to red (or green if it is OK). We could consider having a class that specifies the color of the <span> the contains the validation messages. Currently, the validation messages are put into a <span class="questionhelp"> block. |
|
It affect all survey who use input-error, and it's a misconception : if the input aren't in error, then it don't have input-eror class ( maybe an input-ok if you want). If you remove input-error class, it's a regression, i see survey with input-error put the border red for question block. For validation block red/green : it's a very bad idea ti put inline style. It's best to use a class="error" class="ok" I think best is to add a class to question block and the helptext. A quick modification: LimeExpressionManager line 4869 and next ANd in LimeExpression manager, we have the question id, the we can put: For another example: line 4899: Then the user can choose to put input in background:red, or another alert system. I think it's very important. I can make a patch for LimeExpressionManager to remove all inline style and put it in class, after it's the template who choose |
|
Shnoulle - in my haste, I didn't see the addClass/removeClass options - that makes it easy. I'm doing some other fixes, so I can patch and test this. Thanks for the offer, though. |
|
No prob Tom, I use jquery a lot ! A good think too is : .closest For example: i work on a empty class: I have to put .question on all question class AND on subquestion. ( and a lot more). See: http://bugs.limesurvey.org/view.php?id=4984 I think we can remove a lot of line and complexification on LSExpression_manager.js. What do you think of put function in em_javascript.js, and in LimeExpressionManager.php : only call the em_javascript function ( with question id ). I think we can remove too the : onclick="cancelBubbleThis(event);limitmaxansw_xxx(this);noop_checkconditions(this.value, this.name, this.type)" And put in external js file. $('input.cbox,input.radio').click(function(){ } But there are a lot of thing to verify ... Denis |
|
onclick="cancelBubbleThis(event);limitmaxansw_xxx(this);noop_checkconditions(this.value, this.name, this.type) That is already gone, or should be. The only thing that still does some of that in-line JavaScript in qanda is the Ranking question type. All the rest use EM to manage validation. All of the noop_checkconditions vs. checkconditions stuff doesn't apply anymore - EM is called with every onchange event. So, I'm not sure which sort of complexity within em_javascript.js you feel needs to be refactored (or are you referring to refactoring qanda.php further)? |
|
Sorry, Not em_javascript.js , just remove some inline javascript, put function call and not direct call LimeExpressionManager.php.
Then refactoring all Text error javascript is easy (and can be made in template.js too ;)) I think there are a possible way: ( and please : remove that < br /> and < b >, for br : put a display block on span, and b: < strong > ) Denis Denis |
|
Denis- I'm still not following completely. Are you suggesting removing in-line jQuery calls from LimeExpressionManager and instead having it call functions? Perhaps if you created a small patch file showing what you recommend for one question type? |
|
I like the idea of using styles, but I think we need to increase the granularity of our styles. I'm feeling very limited by just .input-error So, how about something like this? (1) Index: (2) Question Validation Those classes could apply to the whole question. That would give authors the ability to selectively format the different types of validation messages (3) Question Tips We've had some people say they don't want to see the regular expression validation messages - this might be a way to give them more control over that. We could use the .good and .problem or .error (I'm not clear on how problem and error differ) to color code the question tips. However, at present, EM just ANDS together all of the validation equations. So it can validate the whole question, but not selectively report on which parts of the validation pass/fail. If we want/need to do that, we'd need to refactor EM a bit. That wouldn't be too hard, but might take a couple of days. |
|
Like you: I think double/triple class is the best: I use hyphen on css class name : look at http://stackoverflow.com/questions/1686337/hyphens-or-underscores-in-css-and-html-identifiers for some reason (1) Index: (2) Question Validation: (3) Question Tips I look to put a patch but, i go to see my mother this week end , then not until monday. Denis :) |
|
Oups, something more: i look to put |
|
Although, personally I prefer camel case for visibility, ease of typing and cutting/pasting (just a double-click in most tools), I guess hyphens would be more consistent with the current styles. TMSWhite, when the final decisions are made on the classes, if you give a list of all of the new classes with their current inline styles, I would be happy to add the rules for the new classes to the shipped templates. |
|
There was related discussion on the listseve about this. I'm copying them as notes below for easier tracking. |
|
[[From Menno Dekker]] Didn't dive in deep, but I would prefer something like This way it is easy to use one style for all error messages and style the ones you want different. I don't see why people would want to hide a validation message but it can be done this way. So when there are errors, display all the messages in one container and have each message get it's own class, much like the question type classes. The question should get one class to show it is in error or not. The message should tell what kind of error. Ofcourse as much backward compatible as possible to help people who created custom templates. |
|
[[From Shnoulle]] Hello, then maybe something like that: <div class="answers-error"> The best semantic way can be: |
|
[[From TMSWhite]] I neglected to communicate a critical piece of this discussion. Unlike in 1.91, in 1.92, there is only one copy of each message. They are meant to serve as tips and/or validation. In 1.91, tips and validation messages were separate (so different wording) and managed separately. I don't want to have tips that say one thing, and then repeat the same messages if the validations fail. I'd rather give people the ability to show/hide the tips, and color-code (or otherwise stylize) the validation messages if they are a problem. So, if although we could put all of the messages in a <div class="tip">, we should not encapsulate them all in a <div class="answers-error"> or <div class="errormessages">, otherwise the tips might never be shown. Furthermore, if we were to encapsulate them all in a <div class="tip">, we need to override the "hide-tip" behavior. I'd like to give users the ability to initially hide the tips, but force them to be visible if the validation messages fail. Given this, how would you suggest supporting both the tip and validation aspects of these messages? |
|
[[From tpartner]] But, aren’t the tips and error/validation messages really two different animals? And therefore should be handled differently? In my mind, the tips should be to simply offer help on how to complete the question and be shown at all times unless explicitly disabled by the admin. Error/validation messages should only appear when the question is answered inappropriately and the admin should really only have control over their appearance via the template files. Can you use .append() and .remove() to add or remove the error/validation messages in a container div depending on how the question is answered? |
|
[[From TMSWhite]] Tony (and other developers)- I agree that it should be possible to manage them separately, but isn't the text always the same? Here are some sample messages (but putting the question attribute in curly braces for readability): (1) num_answers: "Please answer between {min_answers} and {max_answers} questions." You could have exactly the same text in the following locations: So, my questions are: Thoughts? |
|
[[From tpartner]] Yeah, or maybe use divs so they would be displayed block by default (as list items are) and could be given padding, etc. <div class="answer-errors"> |
|
[[From Menno Dekker]] I think there are two categories: validation error and tip. The tip would be for options 1, 3, 4 and 5 as they tell you what to do. The could be disabled on screen or data entry as validation should enforce it, but in print it is the only thing you have. I think the validation error is a different message. Example: It all depends on the validator and type of validation what the exact error message is. So I would show them both. I agree on the popups, but I am not sure that it is clear enough when you hit next and get returned to the same page that it is because there is an error. You would have to be pointed to the right question then that could be off the visible part of the screen for large surveys / groups. So I would say only 1 popup on next that says there are errors bot no more than one popup. Nice would be if that dialog could tell all questions and the error message, but that would be optional for me if they can be properly highlighted. |
|
[[From tpartner]] · Tips o (1) "Please answer between {min_answers} and {max_answers} questions." o (2) "Please enter values between {min_num_value_n} and {max_num_value_n}." o (3) "Please enter values so the sum of the answers is be between {min_num_value} and {max_num_value}." · Errors o (1) "You must answer between {min_answers} and {max_answers} questions." o (2) "The values must be between {min_num_value_n} and {max_num_value_n}." o (3) "The sum of the answers must be between {min_num_value} and {max_num_value}." I also agree with both of you that alerts can be just plain nasty but perhaps Menno’s idea of one alert to indicate a problem is valid. I don’t really see a problem with showing tips and error messages together. Presumably the error message is bold/red/in-your-face where the tip should blend with the question more. |
|
[[From Holger]] It would be great, if popups could be optional. I really don't like those Javascript-Popups. I'd rather prefer the error message on the page, just below the question, as a reload will bring you there anyway. |
|
[[From Shnoulle]] javascript alert function can be replaced with your own function easily. For confirm function it's more difficult, need to put directly own For alert: // Replace common alert with jquery-ui dialog $dialog.dialog('open'); It's the speedy way :). There are problem with title and OK for non |
|
[[Transcript of discussion on 1/27/2011]] [18:34] <TMSWhite> main question is whether this needs to be fixed before releasing 1.92stable |
|
[quote="Fred" post=73165] One minor thing is that the messages are using different CSS class ids. Using the example of the multi-numeric question where the amounts must not exceed 100: When I run the question in 1.93 it shows both messages, but using different styles <span class="questionhelp" id="442_vmsg">The sum must equal 100</span> In v. 1.91 both messages use the survey-question-answer style |
|
For Fred, I look to put In question.pstpl and remove the border ... form template.css, But i have a lot of problem with inline-style ;) |
|
Fixed in revision 12285 |
|
1.92RC4 released |
|
LimeSurvey: Yii 27483ff4 2012-02-01 10:43:21 Details Diff |
Fixed issue 05698: All question block have input-error class Dev input-error class is now added/removed dynamically git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/limesurvey_yii@12286 b72ed6b6-b9f8-46b5-92b4-906544132732 |
Affected Issues 05698 |
|
mod - application/helpers/expressions/em_manager_helper.php | Diff File | ||
mod - application/helpers/qanda_helper.php | Diff File |
Date Modified | Username | Field | Change |
---|---|---|---|
2012-01-26 18:15 | DenisChenu | New Issue | |
2012-01-26 19:20 | TMSWhite | Note Added: 16993 | |
2012-01-26 21:40 | DenisChenu | Note Added: 17000 | |
2012-01-26 22:18 | TMSWhite | Note Added: 17002 | |
2012-01-27 01:24 | DenisChenu | Note Added: 17004 | |
2012-01-27 01:25 | DenisChenu | Note Edited: 17004 | |
2012-01-27 02:02 | TMSWhite | Note Added: 17005 | |
2012-01-27 02:16 | DenisChenu | Note Added: 17006 | |
2012-01-27 02:16 | DenisChenu | Note Edited: 17006 | |
2012-01-27 02:31 | TMSWhite | Note Added: 17007 | |
2012-01-27 07:19 | TMSWhite | Note Added: 17008 | |
2012-01-27 07:20 | TMSWhite | Issue Monitored: c_schmitz | |
2012-01-27 09:24 | DenisChenu | Note Added: 17009 | |
2012-01-27 09:26 | DenisChenu | Note Added: 17010 | |
2012-01-27 13:36 | c_schmitz | Assigned To | => TMSWhite |
2012-01-27 13:36 | c_schmitz | Status | new => assigned |
2012-01-27 14:33 | tpartner | Note Added: 17014 | |
2012-01-27 16:12 | TMSWhite | Note Added: 17019 | |
2012-01-27 16:13 | TMSWhite | Note Added: 17020 | |
2012-01-27 16:14 | TMSWhite | Note Added: 17021 | |
2012-01-27 16:14 | TMSWhite | Note Added: 17022 | |
2012-01-27 16:15 | TMSWhite | Note Added: 17023 | |
2012-01-27 16:15 | TMSWhite | Note Added: 17024 | |
2012-01-27 16:16 | TMSWhite | Note Added: 17025 | |
2012-01-27 16:22 | TMSWhite | Note Added: 17026 | |
2012-01-27 16:24 | TMSWhite | Issue Monitored: tpartner | |
2012-01-27 16:24 | TMSWhite | Issue Monitored: Mazi | |
2012-01-27 16:25 | TMSWhite | Issue Monitored: mdekker | |
2012-01-27 16:27 | TMSWhite | Note Added: 17027 | |
2012-01-27 16:53 | TMSWhite | Note Added: 17029 | |
2012-01-27 19:13 | TMSWhite | Note Added: 17032 | |
2012-01-27 19:30 | TMSWhite | Note Added: 17034 | |
2012-01-27 19:31 | TMSWhite | Target Version | => 1.92RC4 |
2012-01-27 19:58 | TMSWhite | Note Added: 17037 | |
2012-01-31 20:32 | TMSWhite | Relationship added | has duplicate 05730 |
2012-01-31 20:33 | TMSWhite | Relationship deleted | has duplicate 05730 |
2012-01-31 20:33 | TMSWhite | Relationship added | related to 05730 |
2012-02-01 13:57 | DenisChenu | Note Added: 17137 | |
2012-02-01 19:39 | TMSWhite | Note Added: 17143 | |
2012-02-01 19:39 | TMSWhite | Status | assigned => resolved |
2012-02-01 19:39 | TMSWhite | Fixed in Version | => 1.92RC4 |
2012-02-01 19:39 | TMSWhite | Resolution | open => fixed |
2012-02-14 14:10 | c_schmitz | Note Added: 17432 | |
2012-02-14 14:10 | c_schmitz | Status | resolved => closed |
2012-03-14 21:08 | TMSWhite | Changeset attached | => Import 2012-03-09 13:30:34 Yii 27483ff4 |
2019-11-01 17:25 | c_schmitz | Category | Survey design => Survey editing |