Upgrade hints for version 1.92

=Features acting different in 1.92=

Mathematical comparisons against empty/no responses
If you have any of the following conditions, they will not work as expected:
 * 1) (var == 0)
 * 2) (var != 0)
 * 3) (var <= 0)
 * 4) (var >= 0)
 * 5) (var < x)
 * 6) (var <= x)

The root problem is that JavaScript and PHP both treat a non-response ("") as 0 in mathematical comparisons, so although ("" == 0) should be false, JavaScript and PHP treat it as true. This is especially problematic for conditions like (AGE < 16), which should be false until AGE is answered.

How to fix this problem if you only use the Conditions Editor
As of Version 1.92+ release 120605, this has been fixed if you exclusively use the Conditions editor. However, you may need to upgrade the conditions in your database once. This can be done via the command:

You can also do this upgrade from the administration console:

Pick any survey so that you can access the EM test suite:



Click on Bulk Convert Conditions to Relevance:



If it is successful, you will see a page like this:



If you are testing out the 2.0 release candidate, it has also been patched. To upgrade existing conditions in a 2.0 installation, use this command:

How to fix this problem is you manually enter Relevance equations
In this case, you need to be aware of the unexpected behavior and adjust your equations appropriately. This table shows the needed conversions. If you want to accomplish the "Desired Comparison", you need to enter the equation in the "Needed Equation" column

This figure shows that those equations work as desired. Green fields show that the PHP and JavaScript versions of the equations generated the proper result. You can see a few red fields, which show that that variant of the equation did not generated the desired result.



To give you a sense of how significant the problem is, and why it is critical to pay attention to those equations, the following images show you how often you get the wrong value if you don't add the is_empty checks. Note that PHP and JavaScript aren't even consistently right or wrong.





Display of conditions
In earlier version the list of conditionally related questions is shown in the following. In 1.92, the new approach is shown after '=>' for each entry
 * Question view => now shows syntax-highligted relevance equation
 * Question re-order view => now shows syntax-highligted relevance equation
 * Group re-order view => now shows syntax-highligted relevance equation (but only at group-level)
 * Printable Survey => now shows relevance and validation equations
 * Data Entry => now shows relevance and validation equations

=Features present in earlier versions but missing now=

Advanced question settings that work different than in earlier versions

 * 1) Assessment value
 * The value is currently ignored for the Multiple choice question type

=Custom JavaScript usage=

You will need to check your custom JavaScript code for two things:
 * 1) All opening curly braces must have a whitespace (a space, tab, or newline) after them, and all closing curly braces must have whitespace before them (otherwise ExpressionScript will think that your JavaSript code should be parsed as an Expression, and it will say that your variables are not defined.
 * 2) If you do any regular expression parsing within JavaScript, and your regular expressions use curly braces (like us_phone.match(/\d{3}-\d{3}-\d{4}/)), you can not use the in-line regular expression syntax. You must create a a new RegExp object like this RegExp('/\d{3}-\d{3}-\d{4}/') and use it in the matching, otherwise expression manager will think that you are trying to evaluate {3}

=New CSS styles in templates.css=

In order to support dynamic display of warning and error messages, new CSS style were added to provide more granular control of the generated tip messages. These include separable control of tips for number of answers, value ranges, the the like. Existing templates may need to be modified to enable this granular control, otherwise the advanced option hide_tip may not work. Here is the new CSS code.