View Issue Details

IDProjectCategoryView StatusLast Update
15615Bug reportsSurvey takingpublic2020-11-16 09:31
ReporterMazi Assigned Togabrieljenik  
PrioritylowSeverityminor 
Status closedResolutionfixed 
Product Version3.20.x 
Summary15615: Mandatory multiple choice questions are not assigned a red background if not being answered
Description

When not answering a mandatory array question and clicking next, the not answered question gets highligjted with a red border, see screenshots.
For multiple choice questions, this highlighting is missing, see screenshot. Only the default warning text is there.

Steps To Reproduce

Import the attached survey.
Click next at the first question page -> the array question gets a red border.
Answer the array question and click next.
At the following mukltiple choice question click next -> the default warning text appears but the red border is missing.

Additional Information

This seems to be a general issue since it shows up at fruity and vanilla template.

The multiple choice question is missing CSS class "input-error" which gets assigned to not answered mandatory questions and comes with the CSS for the red border.

TagsNo tags attached.
Complete LimeSurvey version number (& build)Version 3.20
I will donate to the project if issue is resolvedNo
Sync to Zoho Project
BrowserChrome
Database & DB-VersionMySQL 5
Server OS (if known)Ubuntu 18
Webserver software & version (if known)Apache 2
PHP Version7.2

Activities

Mazi

Mazi

2019-11-23 16:54

partner   ~54770

@cdorin, this was reported by a customer who would be happy about a quick fix for the next release. Shouldn't be too trickyy to fix.

cdorin

cdorin

2020-07-29 17:16

manager   ~59159

Deleted the SS and .lss file - ticket now public. Thx for report, Mazi

gabrieljenik

gabrieljenik

2020-07-29 21:35

developer   ~59164

Last edited: 2020-07-29 21:36

View 2 revisions

I see 2 problems here.

1) This is general, not ony for checkboxes.
If a certain question has a specific validation and also is mandatory, the shade will not appear.
This is because the shade related to the "mandatory" validation is cleared by the other valdation being satisfied.

2) This is not only for mandatory validation.
If a question has 2 validations. The shade will only appear if the last one is the one failing.

Suggestions:

  • Review JS for shade. It is triggered now on an event for a tip. Should be triggered at the end, after all validations are done. That should solve problem #2.

  • Still, it will not solve problem #1.

    • Shade show/hide is recalculated at client side.
    • Mandatory validation is recalculated at server side.
    • As to solve that, we should implement mandatory validation on client side.

Comments? @DenisChenu @ollehar

DenisChenu

DenisChenu

2020-07-30 09:13

developer   ~59191

My own opinion :

  1. I don't like the core system with same css class after and before submit … in 2.6 input-error are set ONLY when try to submit. In SkelVanilla : i use same system
  2. mandatory are not checked with javascript, then input-error are not removed when answer is done see inputerror-butOK picture
  3. You can't really compare mandatory in array and mandatory in multiple : we have a count(self) > 0 and count(self) == number of subquestion (see lss)

Then : my opinion

  1. Remove the input-error update by JS. It's awfull to have it when came at a page for the 1st time for user.
  2. The js update have other issue whe you disable hide-tip
  3. Move mandatory to Expression Manager systyem : then have it like the other validation (tip-mandatory etc ) : this one is a bigger step (and maybe for 5.X)

Yes moving mandatory to expression manager is a great thing to do BUT : it's not a little fix ;)

inputerror-butOK.png (44,904 bytes)   
inputerror-butOK.png (44,904 bytes)   
DenisChenu

DenisChenu

2020-07-30 09:14

developer   ~59192

Some other picture
The 1st one confirm the shade difference :)

gabrieljenik

gabrieljenik

2020-09-03 21:48

developer   ~59705

PR: https://github.com/LimeSurvey/LimeSurvey/pull/1577

Added new event handler for question-container, to evaluat status of its tips and then add/remove the error class

This will not prevent problem #1 said here.
https://bugs.limesurvey.org/view.php?id=15615#c59164

Neither it will prevent validations to be trigered at the ver begining when the form is still empty (clean).
If user hasn't inputed anything, why validations already appear?

I think both shuld be handled on separates stories.
@cdorin What do you think? @DenisChenu? @ollehar?

gabrieljenik

gabrieljenik

2020-10-20 01:51

developer   ~60280

Code reviewed. Travis should be in green.

DenisChenu

DenisChenu

2020-10-20 10:23

developer   ~60292

I think both shuld be handled on separates stories.

It's a template issue in my opinion. In fact : i leave validation BUT add the border only when submitted (PHP) …

gabrieljenik

gabrieljenik

2020-11-10 10:57

developer   ~60601

Fix committed to 3.x-LTS branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=30714

lime_release_bot

lime_release_bot

2020-11-16 09:31

administrator   ~60648

Fixed in Release 3.25.0+201117

Related Changesets

LimeSurvey: 3.x-LTS 952f8943

2020-11-10 10:46:52

gabrieljenik


Committer: GitHub Details Diff
Fixed issue 15615: Mandatory multiple choice questions are not assigned a red background if not being answered (#1577)

* Fixed issue 15615: Mandatory multiple choice questions are not assigned a red background if not being answered

Added new event handler for question-container, to evaluat status of its tips and then add/remove the error class

* Fixed issue 15615: Mandatory multiple choice questions are not assigned a red background if not being answered

Code review
Affected Issues
15615
mod - assets/packages/template-core/template-core.js Diff File

Issue History

Date Modified Username Field Change
2019-11-23 16:54 Mazi New Issue
2019-11-23 16:54 Mazi File Added: limesurvey_survey_417165.lss
2019-11-23 16:54 Mazi Note Added: 54770
2019-11-23 16:59 Mazi File Added: MC_mandatory.png
2019-11-23 16:59 Mazi File Added: array_madatory.png
2019-11-26 17:36 cdorin Assigned To => cdorin
2019-11-26 17:36 cdorin Status new => assigned
2020-07-10 00:31 cdorin Priority none => low
2020-07-10 00:31 cdorin Status assigned => confirmed
2020-07-10 00:31 cdorin Description Updated View Revisions
2020-07-10 00:31 cdorin Steps to Reproduce Updated View Revisions
2020-07-10 00:31 cdorin Additional Information Updated View Revisions
2020-07-10 00:31 cdorin Zoho Sprints => |Yes|
2020-07-10 00:31 swendrich Zoho Sprints ID => 14469000000166061
2020-07-10 00:31 cdorin Assigned To cdorin =>
2020-07-10 00:31 cdorin Zoho Sprints Yes => |Yes|
2020-07-29 17:15 cdorin File Deleted: limesurvey_survey_417165.lss
2020-07-29 17:15 cdorin File Deleted: MC_mandatory.png
2020-07-29 17:15 cdorin File Deleted: array_madatory.png
2020-07-29 17:16 cdorin View Status private => public
2020-07-29 17:16 cdorin Zoho Sprints Yes => |Yes|
2020-07-29 17:16 cdorin Note Added: 59159
2020-07-29 21:35 gabrieljenik Note Added: 59164
2020-07-29 21:36 gabrieljenik Note Edited: 59164 View Revisions
2020-07-30 09:13 DenisChenu Note Added: 59191
2020-07-30 09:13 DenisChenu File Added: inputerror-butOK.png
2020-07-30 09:13 DenisChenu File Added: limesurvey_survey_912299.lss
2020-07-30 09:14 DenisChenu Note Added: 59192
2020-07-30 09:14 DenisChenu File Added: Capture d’écran du 2020-07-30 09-06-25.png
2020-07-30 09:14 DenisChenu File Added: Capture d’écran du 2020-07-30 09-06-39.png
2020-09-03 21:48 gabrieljenik Note Added: 59705
2020-10-20 01:51 gabrieljenik Note Added: 60280
2020-10-20 10:23 DenisChenu Note Added: 60292
2020-11-10 10:57 gabrieljenik Changeset attached => LimeSurvey 3.x-LTS 952f8943
2020-11-10 10:57 gabrieljenik Note Added: 60601
2020-11-10 10:57 gabrieljenik Assigned To => gabrieljenik
2020-11-10 10:57 gabrieljenik Resolution open => fixed
2020-11-16 09:31 lime_release_bot Note Added: 60648
2020-11-16 09:31 lime_release_bot Status confirmed => closed