View Issue Details

This bug affects 1 person(s).
 4
IDProjectCategoryView StatusLast Update
05639Bug reportsSurvey takingpublic2012-01-20 13:08
ReporterTMSWhite Assigned ToTMSWhite  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version1.92RC1 
Fixed in Version1.92RC2 
Summary05639: 1.92 does not highlight unanswered or invalid sub-questions - it just flags the whole question
Description

If any part of a question fails the validation criteria, the entire question is flagged as invalid, but the specific sub-question which are invalid are not flagged

Similarly, if a mandatory sub-question is not answered, the entire question is flagged as not being answered (missing), but the specific sub-question that is unanswered is not flagged (e.g. turning the text of the sub-question red).

Steps To Reproduce

Try the "Validation Tests with Regular Expression Masks" page of the limesurvey2 sample survey

Additional Information

Solution:

Extend EM to generate sub-question-level validation equations. Currently, it pools all sub-question-level validations into a single question-level equation.
Modify LimeExpressionManager::GetQuestionStatus($qid) to return array of sub-question SGQA codes and their missing + validity status
*Use the sub-question-level validation JavaScript to dynamically flag missing or invalid questions:
(a) If missing or invalid, set background color of response box to red?
(b) separate color coding for missing vs. invalid?

TagsNo tags attached.
Bug heat4
Complete LimeSurvey version number (& build)11702
I will donate to the project if issue is resolvedNo
Browser
Database type & versionMysql 5.2
Server OS (if known)Windows XP
Webserver software & version (if known)XAMPP
PHP Version5.2

Users monitoring this issue

There are no users monitoring this issue.

Activities

c_schmitz

c_schmitz

2011-12-29 18:58

administrator   ~16759

It previously did that, so it is a regression that should be fixed for stable.

TMSWhite

TMSWhite

2012-01-08 04:59

reporter   ~16772

Notes to self:
(1) this only applies to preg-related validation. None of the other validation types are sub-question specific (e.g. although we can set the min/max sum value or number of answers, we don't set the min/max value for each item within a multiple-numerical question type

(2) Long-term, might want to refactor so that any questions with validation call a question-specific validation function rather than re-assessing all validation within the main EM javascript. However, since there are currently no major performance issues, this should wait.

(3) Long-term (short too?) should make LEMvarNameAttr include
(a) valid attribute, which is false if invalid. This should be read/write within a page to determine whether the question is valid. This doesn't need to be a hidden field, since EM will re-validate the question on submit
(b) validationMsg attribute - this would hold the validation message, like "the sum of the answers must be between 10 and 20". Having it available in JavaScript would let us more dynamically show/hide the validation message, and include that information within custom reports. For example, on any given page, if people started to enter information on question 5, but a question before #5 was invalid, we could make the validation message appear.
(c) mandatoryMsg attribute - like valdidationMsg, would hold the text of the mandatory message.
(d) subqValid array - this would show 1/0 (true/false) whether each sub-question is valid - could be used to customize how sub-question invalid responses are displayed (e.g. set the background color for a text entry field to red).

TMSWhite

TMSWhite

2012-01-08 06:41

reporter   ~16773

More notes to self:
(1) To show/hide background color as red use this, adapted to using the

$('#question902 :input').css("background-color","red")
$('#question902 :input').css("background-color","")

(2) for sub-questions:
(a) Types Q, K:
$('#answer82556X15X147p').css("background-color","red")
(b) Types N, S, T, U
$('#question902 :input').css("background-color","red")
(c) Types :, ;
$('#answer82556X15X151sq3_2').css("background-color","red")

TMSWhite

TMSWhite

2012-01-09 19:43

reporter   ~16777

Fixed in revision 11958

c_schmitz

c_schmitz

2012-01-20 13:08

administrator   ~16835

1.92RC2 released.

Issue History

Date Modified Username Field Change
2011-12-21 18:32 TMSWhite New Issue
2011-12-29 18:57 c_schmitz Assigned To => TMSWhite
2011-12-29 18:57 c_schmitz Status new => assigned
2011-12-29 18:58 c_schmitz Note Added: 16759
2012-01-08 04:59 TMSWhite Note Added: 16772
2012-01-08 06:41 TMSWhite Note Added: 16773
2012-01-09 19:43 TMSWhite Note Added: 16777
2012-01-09 19:43 TMSWhite Status assigned => resolved
2012-01-09 19:43 TMSWhite Resolution open => fixed
2012-01-20 13:07 c_schmitz Fixed in Version => 1.92RC2
2012-01-20 13:08 c_schmitz Note Added: 16835
2012-01-20 13:08 c_schmitz Status resolved => closed