View Issue Details

IDProjectCategoryView StatusLast Update
11908Feature requests[All Projects] Survey takingpublic2018-04-06 11:48
ReporterDenisChenu Assigned ToDenisChenu  
PrioritynoneSeverityfeature 
Status closedResolutionfixed 
Product Version 
Target VersionFixed in Version3.0 
Summary11908: Remove the "has-error" when it's not needed anymore
Description

If a mandatory array question type is send with some unanswered :
put has-error in row
put error-mandatory (now) in th
-> this seems good

But when the row his answered : the class still here

Additional Information

Easy with radio only
Near easy with text/number/dropdown
Tricky with checkbox (array number/checkbox)
Tricky width double radio (array dual scale) (and broke the easy for radio)
don't know for array by column (but broke the easy for radio)

Must be in survey.js : core issue.

After template can try some with EM , but EM id broken for lines actually : https://github.com/LimeSurvey/LimeSurvey/blob/master/application/helpers/expressions/em_manager_helper.php#L6614

Tagsanswers_html

Activities

DenisChenu

DenisChenu

2016-11-15 01:24

developer   ~41948

I put this in Feature : it's a feature, but not a request. Needed feature

DenisChenu

DenisChenu

2016-11-26 11:10

developer   ~42243

@tammo : i start to work on it next week.

But there are some glitch here.

  1. using a boostrap class seems needed for "automatioc coloring generation" without need to update template.css
  2. with has-error : all line show red : see the screenshot. There are no way to reset the class for 'not empty' text. I must set the border-color manually in template.css
  3. currently has-error usage are only for "mandatory", think it's ok, then we can use has-waring for "Expression Manager error"

See http://getbootstrap.com/css/#forms-control-validation

Some possible solution
1

  • PHP stay like here
  • When a value is not empty : set has-success on the td
  • When all value are not empty : remove the has-success and the has-error
    => see second screenshot
    2
  • PHP do : add 'has-error' on the cell+answertext
  • Javascript do : if answer is not empty : remove the has-error on the cell, if all answers are OK : remove the has-error on the line.
    => near same than second screenshot, but no green : grey
DenisChenu

DenisChenu

2016-11-26 11:10

developer  

DenisChenu

DenisChenu

2016-11-26 11:10

developer  

tammo

tammo

2016-11-26 16:12

partner   ~42245

And also tricky for questions when minimal 2 and maximal 4 need to be answered. But that will be another challenge...

DenisChenu

DenisChenu

2016-11-27 00:52

developer   ~42246

It's another issue : must be done with Expression Manager + Expression Manager event.

Think :
. mandatory : use has-error
. validation issue : use has-warning , BUT em don't set error on line, only on whole answers. Since 1.92

DenisChenu

DenisChenu

2016-12-02 18:26

developer   ~42323

OK,
Reviewing html
ls-error-mandatory on the line : always
has-error on the answer-item, sometimes it's the line (radio array) sometimes not
has-error on answer-text (can be removed maybe)

DenisChenu

DenisChenu

2016-12-03 10:29

developer   ~42332

Tammo are not in "assigned possibility", just need an advice ...

Looking at system, maybe it's better to remove the 'has-error' from PHP.

Adding it to the new 'template-default' package for starting (or limesurvey-public) , doping it only in javascript.

https://github.com/LimeSurvey/LimeSurvey/commit/f1e783477051b1e97750dc386a0a5ce9a6324f1b

We have some issue :

  • We can set has-error/has-warning on all single choice question for mandatory and/or Expression.
  • We can set has-error for mandatory on all multiple question (sometimes hard, but can be done)
  • We can not set has-warning/has-error for expression on multiple question type : EM return only errors globally (This question have error, and not this sub-questions have error).

Then : not by core.

And then just add 'ls-mandatory-error' on the line + text-error and the 'answertext'.

OK ?

Mazi

Mazi

2016-12-05 11:22

partner   ~42361

Sounds like a reasonable suggestion to me.

A related question: Can we have different mandatory warning messages for different question types? E.g. for Array Texts it would be nice to tell the user something more specific. Instead of just "This error is mandatory..." we should add "...please enter text at every text field."

a) Is this possible?
b) Can it be implemented easily?
c) Do you think it's helpful to the user?

DenisChenu

DenisChenu

2016-12-05 11:53

developer   ~42364

Last edited: 2016-12-05 11:54

View 3 revisions

a + b : already done:

https://github.com/LimeSurvey/LimeSurvey/blob/master/application/helpers/expressions/em_manager_helper.php#L6398
https://github.com/LimeSurvey/LimeSurvey/blob/master/application/helpers/expressions/em_manager_helper.php#L6439
https://github.com/LimeSurvey/LimeSurvey/blob/master/application/helpers/expressions/em_manager_helper.php#L6471
https://github.com/LimeSurvey/LimeSurvey/blob/master/application/helpers/expressions/em_manager_helper.php#L6494

We don't use enter text, think we use 'Please fill ...'

PS : really helpfull : tank or checkbox is needed for example. BUT : my english is so poor : u just don't update language string if i can ;)

Related Changesets

LimeSurvey: develop 2ad7bb1c

2016-12-02 19:02:35

DenisChenu

Details Diff
Dev: start feature 11908: Remove the "has-error" when it's not needed anymore Affected Issues
11908
mod - application/core/packages/limesurvey/survey.js Diff File
mod - application/helpers/SurveyRuntimeHelper.php Diff File
mod - application/helpers/qanda_helper.php Diff File
mod - application/views/survey/questions/answer/arrays/10point/rows/answer_row.php Diff File
mod - application/views/survey/questions/answer/arrays/5point/rows/answer_row.php Diff File
mod - application/views/survey/questions/answer/arrays/array/dropdown/rows/answer_row.php Diff File
mod - application/views/survey/questions/answer/arrays/array/no_dropdown/rows/answer_row.php Diff File
mod - application/views/survey/questions/answer/arrays/column/answer.php Diff File
mod - application/views/survey/questions/answer/arrays/dualscale/answer.php Diff File
mod - application/views/survey/questions/answer/arrays/dualscale/answer_dropdown.php Diff File
mod - application/views/survey/questions/answer/arrays/increasesamedecrease/rows/answer_row.php Diff File
mod - application/views/survey/questions/answer/arrays/multiflexi/rows/answer_row.php Diff File
mod - application/views/survey/questions/answer/arrays/multiflexi/rows/cells/answer_td.php Diff File
mod - application/views/survey/questions/answer/arrays/texts/rows/answer_row.php Diff File
mod - application/views/survey/questions/answer/arrays/texts/rows/cells/answer_td.php Diff File
mod - application/views/survey/questions/answer/multiplenumeric/rows/input/answer_row.php Diff File
mod - application/views/survey/questions/answer/multiplenumeric/rows/sliders/answer_row.php Diff File
mod - application/views/survey/questions/answer/multipleshorttext/rows/answer_row_inputtext.php Diff File
mod - application/views/survey/questions/answer/multipleshorttext/rows/answer_row_textarea.php Diff File

LimeSurvey: develop e49aaf89

2016-12-07 09:43:30

DenisChenu

Details Diff
Dev: Feature 11908: Remove the "has-error" when it's not needed anymore
Dev: use text-danger for th.answertex, remove it when not needed
Dev: soing some test, but please : test it :)
Dev: for :text and select : we can use :empty class (nopt submitted)
Dev: but template related issue (color ...)
Affected Issues
11908
mod - application/core/packages/limesurvey/survey.js Diff File
mod - application/helpers/qanda_helper.php Diff File
mod - application/views/layouts/public.php Diff File
mod - application/views/survey/questions/answer/arrays/dualscale/answer_dropdown.php Diff File
mod - application/views/survey/questions/answer/arrays/multiflexi/rows/answer_row.php Diff File
mod - application/views/survey/questions/answer/arrays/texts/rows/answer_row.php Diff File
mod - scripts/dualscale.js Diff File

Issue History

Date Modified Username Field Change
2016-11-15 01:23 DenisChenu New Issue
2016-11-15 01:23 DenisChenu Status new => assigned
2016-11-15 01:23 DenisChenu Assigned To => DenisChenu
2016-11-15 01:24 DenisChenu Note Added: 41948
2016-11-26 10:56 DenisChenu Tag Attached: answers_html
2016-11-26 11:10 DenisChenu Note Added: 42243
2016-11-26 11:10 DenisChenu File Added: Capture du 2016-11-26 11-00-42.png
2016-11-26 11:10 DenisChenu File Added: Capture du 2016-11-26 11-07-40.png
2016-11-26 16:12 tammo Note Added: 42245
2016-11-27 00:52 DenisChenu Note Added: 42246
2016-12-02 18:26 DenisChenu Note Added: 42323
2016-12-02 19:04 DenisChenu Changeset attached => LimeSurvey develop 2ad7bb1c
2016-12-03 10:29 DenisChenu Assigned To DenisChenu => Mazi
2016-12-03 10:29 DenisChenu Status assigned => feedback
2016-12-03 10:29 DenisChenu Note Added: 42332
2016-12-05 11:22 Mazi Note Added: 42361
2016-12-05 11:53 DenisChenu Note Added: 42364
2016-12-05 11:53 DenisChenu Status feedback => assigned
2016-12-05 11:53 DenisChenu Assigned To Mazi => DenisChenu
2016-12-05 11:53 DenisChenu Note Edited: 42364 View Revisions
2016-12-05 11:54 DenisChenu Note Edited: 42364 View Revisions
2016-12-07 10:26 DenisChenu Changeset attached => LimeSurvey develop e49aaf89
2016-12-07 10:27 DenisChenu Status assigned => resolved
2016-12-07 10:27 DenisChenu Resolution open => fixed
2016-12-07 10:27 DenisChenu Fixed in Version => 3.0
2018-04-06 11:48 markusfluer Status resolved => closed