View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
05762 | Bug reports | Survey taking | public | 2012-02-06 17:01 | 2012-05-28 15:12 |
Reporter | DenisChenu | Assigned To | DenisChenu | ||
Priority | low | Severity | minor | ||
Status | closed | Resolution | fixed | ||
Product Version | 1.92RC3 | ||||
Fixed in Version | 2.00RC2 | ||||
Summary | 05762: Difference betwwen good and not-applicable | ||||
Description |
But if you put 0 : error class. I think a not-mandatory with empty value don't have to have .good class but stay clean of class.
| ||||
Steps To Reproduce | Import joined survey and see in action. | ||||
Additional Information | With an empty class: .mandatory .empty{color:red} Actually, we can have differencation betwenn. Maybe all em_value hav to have a common class too ;). | ||||
Tags | No tags attached. | ||||
Attached Files | |||||
Bug heat | 14 | ||||
Complete LimeSurvey version number (& build) | 12363 | ||||
I will donate to the project if issue is resolved | No | ||||
Browser | FF | ||||
Database type & version | not relevant | ||||
Server OS (if known) | not relevant | ||||
Webserver software & version (if known) | not relevant | ||||
PHP Version | not relevant | ||||
has duplicate | 06080 | closed | DenisChenu | Wrong validation for multiple numeric questions |
That's a good idea, but there is one problem. The validation rules state that if you have min/max values, and the question is n on-mandatory, then a blank value is OK (good). This may seem non-intuitive, but that is the way the validations work in 1.91 too (they just don't show color-coding). I guess an alternate process would be to do a two step validation: if (empty) { / set to now class / } |
|
<q>The validation rules state that if you have min/max values, and the question is n on-mandatory, then a blank value is OK (good).</q> I think the best way is an .empty class: :) PS: in 1.91: all validation are made in PHP, and if validation don't work : input-error PS2: it's important to have good/error/empty for each em_validation because if we hav 2 the one can be red and another green ( can't use .input-error .good{color:red;} ) |
|
I like the idea of two-step validation, but it will require 4-8 hours worth of refactoring and re-validation, so not sure if can get to it before 1.92 RC4 I don't understand PS2. Currently, you can do the following for each em_validation type: (1) .error {color:purple} // errors when you first see them - before submitting with error Through inheritance (e.g. you don't need to explicitly put these), you get |
|
(7) .input-error .good { color:green } // so still green if OK even if input-error in rest of question. Yep, but actually , we have .good on error tip ( i think) Look at the second question of http://ls-dev.sondages.pro/index.php?sid=76597&newtest=Y&lang=fr the we can't take It's why i think a .empty class are the best. ( for 1.92 RC4, no problem even if it's for 1.92 release 2000, i know i can't make modification directly, maybe look for some patch ;), i put low on priority). |
|
Yes, there is .input-error .good there, since you can a whole question fail at least one validation rule (so gets .input-error), but not fail all of the rules. So, in your example, it fails the mandatory rule, but not the validation rules (which currently allow blank values). I think you've hit on a different issue. Right now, most validations let you keep the answer blank; and mandatory is handled separately. Perhaps they should be handled together, so only consider a blank value OK if the question is non-mandatory. We should probably discuss, as a team, the full set of different styles we'd want for +/- mandatory, +/- empty, +/- any em_validation +/- input-error +/- fails validation rule to be sure we've covered all the desired possibilities. All the more reason to hold off on this for now rather than rush it into RC4. |
|
Is this still a problem? |
|
I think there are a difference between NA/empty and error. Allowing blank value aren't a Validation succes, it's an Validation not-applicable :) I don't make test with different combination, but allways think best way are a good way. |
|
Note to self. To make this work: if (empty) { .removeClass('error good').addClass('empty'); } However, to do if(empty), need to refactor EM-generated validation JavaScript. Currently, validations are like if(empty(x) || x <= 5); and those are concatenated . Would need to split apart empty tests and validity tests for each question attribute, then do the same in GenerateRelevanceAndTailoringJavaScript() Also requires tweak of _ValidateQuestion to do same logic (to ensure that isempty() and regular validations are both done to confirm that submitted data is accurate). - so update of qstatus to add 'isemptyJS' |
|
I had 2 idea. Add 3 javascript function for em_validation: And make something like that: But you can put this "bug" in developpment and assign to me. Or maybe i had to put a new bug/developpment, test this one, and if class is good: close this one. For input.text, isempty is easy But #questionID aren't good for array for exemple. I have an idea for that : send it to mailing list: Put #questionSubQuestionID to all SubQuestion, i think after it's more easy to manage EM-validation by subQuesqtion: code is the same. Problem : actually we have some javaConditionsSubID: we have to replace with questionSubID in HTML AND in javascript. I think it can be cool to have: #questionQuestionID and in database surveyIDXgroupISXQuestionID, the we can allways split SESSION var to work on #questionQuestionID What do you think of this ? |
|
Denis- Thanks for the ideas. However, the hard part is refactoring EM to generate the if(empty) { } parts. Once they are in place, adding/removing classes is really easy. Also, there is so much interaction between relevance, hidden, validity, and mandatory status So, why don't you give me a few days to see if I can tackle this. If not, I can guide you as to what needs to be re-factored in EM to make it work. |
|
I'll work first on updating the in-line and wiki documentation for developers to clarify the architectural design and goals of EM. Although I know we are a community and should be allowed to do things our own way, EM was designed with a specific approach in mind that, if followed, should make it much easier to extend and maintain. |
|
I commit a fix for citronade:
} Seems to work . ( I like external JS function, more easy to fix and replace). |
|
Denis- That does seem like a reasonable solution. And, it doesn't require any EM changes. So, we could keep the EM logic intact (which does this): if (passes validation) { .removeClass('error').addClass('good'); } And your function would add/remote .empty And template.css could be updated to always show default text style if .empty is present. So, handing this one over to you... /Tom |
|
For 2.0 or 1.92 ? |
|
2.0 please. |
|
Put on a new feature For difference between good and not-applicable: better to use directly EM. |
|
Version 2.00RC2 released. |
|
Date Modified | Username | Field | Change |
---|---|---|---|
2012-02-06 17:01 | DenisChenu | New Issue | |
2012-02-06 17:01 | DenisChenu | File Added: limesurvey_survey_76597.lss | |
2012-02-06 17:12 | TMSWhite | Note Added: 17256 | |
2012-02-06 17:15 | DenisChenu | Note Added: 17257 | |
2012-02-06 17:20 | DenisChenu | Note Edited: 17257 | |
2012-02-06 17:46 | TMSWhite | Note Added: 17261 | |
2012-02-06 17:54 | DenisChenu | Note Added: 17262 | |
2012-02-06 17:55 | DenisChenu | Note Edited: 17262 | |
2012-02-06 18:03 | TMSWhite | Note Added: 17263 | |
2012-02-07 12:12 | c_schmitz | Assigned To | => TMSWhite |
2012-02-07 12:12 | c_schmitz | Status | new => assigned |
2012-02-17 18:53 | TMSWhite | Note Added: 17496 | |
2012-02-17 19:13 | DenisChenu | Note Added: 17498 | |
2012-02-17 23:53 | TMSWhite | Note Added: 17502 | |
2012-02-18 01:04 | DenisChenu | Note Added: 17503 | |
2012-02-18 02:53 | TMSWhite | Note Added: 17506 | |
2012-02-18 03:57 | TMSWhite | Note Added: 17507 | |
2012-03-06 04:21 | DenisChenu | Note Added: 17742 | |
2012-03-06 04:35 | TMSWhite | Note Added: 17743 | |
2012-03-06 04:35 | TMSWhite | Assigned To | TMSWhite => DenisChenu |
2012-03-06 11:38 | DenisChenu | Note Added: 17744 | |
2012-03-11 21:36 | c_schmitz | Note Added: 17884 | |
2012-05-10 20:12 | TMSWhite | Relationship added | has duplicate 06080 |
2012-05-11 11:48 | DenisChenu | Note Added: 18694 | |
2012-05-11 11:48 | DenisChenu | Status | assigned => resolved |
2012-05-11 11:48 | DenisChenu | Fixed in Version | => 2.00RC2 |
2012-05-11 11:48 | DenisChenu | Resolution | open => fixed |
2012-05-28 15:12 | c_schmitz | Note Added: 18961 | |
2012-05-28 15:12 | c_schmitz | Status | resolved => closed |