View Issue Details

This bug affects 1 person(s).
 6
IDProjectCategoryView StatusLast Update
09475Bug reportsConditionspublic2015-02-11 15:57
Reporterpvdemael Assigned ToDenisChenu  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version2.05+ 
Fixed in Version2.05+ 
Summary09475: question validation tip not evaluated dynamically when questions are answered
Description

The question validation tip in the array question type is not evaluated dynamically when the question is answered.

An example of an application:
A survey with 2 questions:

  • numerical question: qVal
  • array with 1 subquestion and codes 1 to 5: qList

Validation should be as follows:
if qVal=0 and qList option 4 or 5 are selected, the question is not validated and a tip should be shown

Question validation of the qList question:
!(intval(qVal.value)==0 and sum(self.NAOK)>3)

Question validation tip of the qList question:
{if(intval(qVal)==0 and sum(self.NAOK)>3, 'Invalid choice', 'Valid choice')}

The string 'Valid choice' is always displayed, but only in red when the question is not valid.
This means that the validation works, but that the tip is not evaluated when the qList question is answered despite using the identical code.
This means that constructs like 'self' are not useable in question validation tips.

Steps To Reproduce

Create survey with

  • numerical question: qVal
  • array with 1 subquestion SQ001 and 5 choices: qList (probably also works with 5 choice array)

In the question validation box, enter:
!(intval(qVal.value)==0 and sum(self.NAOK)>3)

In the question validation tip box, enter:
{if(intval(qVal)==0 and self.NAOK)>3, 'Invalid choice', 'Valid choice')}

Set the value of qVal to 0
Select the 4th or 5th option in qList: tip will turn pink (default theme) while text remains 'Valid'

TagsNo tags attached.
Attached Files
Bug heat6
Complete LimeSurvey version number (& build)Versie 2.05+ Build 141210
I will donate to the project if issue is resolvedNo
BrowserChrome 39.0.2171.99 m
Database type & versionMySQL 5.5.37-0ubuntu0.13.10.1
Server OS (if known)Ubuntu Linux 3.11.0-26-generic
Webserver software & version (if known)Apache/2.2.22 (Ubuntu)
PHP Version5.4.6-1ubuntu1.2

Users monitoring this issue

There are no users monitoring this issue.

Activities

c_schmitz

c_schmitz

2015-01-29 12:00

administrator   ~31536

Yes, question validations are currently static. To avoid problems you should place the particular question not on the same page as the question it is referring to.

pvdemael

pvdemael

2015-01-29 12:22

reporter   ~31538

Ok, thx for the information. The examples given in the manual (eg https://manual.limesurvey.org/Question_type_-_Numerical_input#Whole_question_validation_equation_.28em_validation_q.29) do tailored question validation tips, but there is no information on the static nature of the evaluation. It should say that this is only available WITHIN the question.
Will this feature appear in the next version of LS? If not, this should be added to the upcoming features.
Thx

DenisChenu

DenisChenu

2015-02-04 09:39

developer   ~31623

Can you export a lss file and not just a group. I already used EM in question validation tip and it work.

Maybe intval(qVal.NAOK)

pvdemael

pvdemael

2015-02-04 10:06

reporter   ~31625

Hi, I uploaded a lss file.
Thx for following this up.

DenisChenu

DenisChenu

2015-02-04 10:27

developer   ~31627

Deprecated issue here : it work with 2.00 (or 1.92) but not with 2.05
Upload a more simple lss to shown the issue

DenisChenu

DenisChenu

2015-02-04 17:28

developer   ~31633

Last edited: 2015-02-04 17:41

Working at
28d42568d7fc2994041b11a5ba70f36d77affc74
907b1e11fd23ab36c31a75612328efa845f61794
a3c2368a5f241fe155f8a5622a6cbde132ec7001
f3655a1f4762351bee1fd6565ddc5b5657aadfa3

... still continue

It's me :https://github.com/LimeSurvey/LimeSurvey/commit/3f5fbf78e1fc677f957a3b511a9dc6bd91276ffa

But ? Why ???? ?

DenisChenu

DenisChenu

2015-02-04 18:07

developer   ~31634

Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=14911

DenisChenu

DenisChenu

2015-02-04 18:12

developer   ~31635

Fix committed to 2.06 branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=14912

DenisChenu

DenisChenu

2015-02-04 18:13

developer   ~31636

Fixed, but attention : qVal.value mean assesment, not the value (use NAOK)

Build 141110 don't have this bug

c_schmitz

c_schmitz

2015-02-11 15:57

administrator   ~31655

Version 2.05 Build 150211 released

Related Changesets

LimeSurvey: master c988306e

2015-02-04 17:07:20

DenisChenu

Details Diff
Fixed issue 09475: question validation tip not evaluated dynamically when questions are answered
Dev: using GetLastMoveResult(true) remove (partially) javascript array. This not needed
Affected Issues
09475
mod - application/helpers/qanda_helper.php Diff File

LimeSurvey: 2.06 4bba2c4d

2015-02-04 17:11:51

DenisChenu

Details Diff
Fixed issue 09475: question validation tip not evaluated dynamically when questions are answered
Dev: using GetLastMoveResult(true) remove (partially) javascript array. This not needed
Affected Issues
09475
mod - application/helpers/qanda_helper.php Diff File

Issue History

Date Modified Username Field Change
2015-01-26 11:23 pvdemael New Issue
2015-01-26 11:23 pvdemael File Added: limesurvey_group_82.lsg
2015-01-28 16:36 c_schmitz Project Bug reports => Feature requests
2015-01-29 12:00 c_schmitz Note Added: 31536
2015-01-29 12:00 c_schmitz Severity minor => feature
2015-01-29 12:22 pvdemael Note Added: 31538
2015-02-04 09:39 DenisChenu Note Added: 31623
2015-02-04 09:39 DenisChenu Assigned To => DenisChenu
2015-02-04 09:39 DenisChenu Status new => assigned
2015-02-04 10:05 pvdemael File Added: limesurvey_survey_919735.lss
2015-02-04 10:06 pvdemael Note Added: 31625
2015-02-04 10:26 DenisChenu Project Feature requests => Bug reports
2015-02-04 10:27 DenisChenu Note Added: 31627
2015-02-04 10:27 DenisChenu Severity feature => minor
2015-02-04 10:27 DenisChenu File Added: limesurvey_survey_835918.lss
2015-02-04 17:28 DenisChenu Note Added: 31633
2015-02-04 17:41 DenisChenu Note Edited: 31633
2015-02-04 18:07 DenisChenu Changeset attached => LimeSurvey master c988306e
2015-02-04 18:07 DenisChenu Note Added: 31634
2015-02-04 18:07 DenisChenu Resolution open => fixed
2015-02-04 18:12 DenisChenu Changeset attached => LimeSurvey 2.06 4bba2c4d
2015-02-04 18:12 DenisChenu Note Added: 31635
2015-02-04 18:13 DenisChenu Note Added: 31636
2015-02-04 18:13 DenisChenu Status assigned => resolved
2015-02-04 18:13 DenisChenu Fixed in Version => 2.05+
2015-02-11 15:57 c_schmitz Note Added: 31655
2015-02-11 15:57 c_schmitz Status resolved => closed