View Revisions: Issue #15532

Summary 15532: Show warnings when implicit alphabetical compare is used in expressions
Revision 2019-11-05 13:00 by ollehar
Description

EM has no warning system. If an error is reported, the expression stops execution. We need warnings for alphabetical compare, which can be used by mistake by survey designers when they actually want numerical compare.

Problem: "2" < "18" is evaluated differently in PHP and JS. This feature will NOT fix evaluation, but instead show warnings when compare is used on strings.

Scenarios:

  1. User creates survey with two questions, Q1 and Q2
  2. Relevance equation for Q2 is Q1.NAOK < "10"
  3. A warning is shown in question summary AND survey logic file: "This expression uses alphabetical compare. Are you sure you didn't mean numerical compare? See this manual entry for more information."

  1. As above
  2. As above but with >, <= and >= operations
  3. As above

  1. User creates survey with two question groups G1 and G2
  2. User creates question Q1 in group G1
  3. Relevance equation for G2 is Q1.NAOK < "10"

  1. As above
  2. As above
  3. As above but with >, <= and >= operations

Should also work in the same way for subquestion relevance equations.

All scenarios above should also happen with "A10" or "qwerty" strings. It doesn't have to be a number inside the string. The manual entry should recommend users to use strcmp when comparing strings alphabetically, and to use intval/floatval with <, >, <=, >= when comparing numbers numerically.

The delivery should include functional and unit tests of the scenarios above.

Delivery should be done as a pull request on github.

Revision 2019-11-05 12:07 by ollehar
Description

EM has no warning system. If an error is reported, the expression stops execution. We need warnings for alphabetical compare, which can be used by mistake by survey designers when they actually want numerical compare.

Problem: "2" < "18" is evaluated differently in PHP and JS. This feature will NOT fix evaluation, but instead show warnings when compare is used on strings.

Scenarios:

  1. User creates survey with two questions, Q1 and Q2
  2. Relevance equation for Q2 is Q1.NAOK < "10"
  3. A warning is shown in question summary AND survey logic file: "This expression uses alphabetical compare. Are you sure you didn't mean numerical compare? See this manual entry for more information."

  1. As above
  2. As above but with >, <= and >= operations
  3. As above

  1. User creates survey with two question groups G1 and G2
  2. User creates question Q1 in group G1
  3. Relevance equation for G2 is Q1.NAOK < "10"

  1. As above
  2. As above
  3. As above but with >, <= and >= operations

Should also work in the same way for subquestion relevance equations.

All scenarios above should also happen with "A10" or "qwerty" strings. It doesn't have to be a number. The manual entry should recommend users to use strcmp when comparing strings alphabetically, and to use intval/floatval with <, >, <=, >= when comparing numbers numerically.

The delivery should include functional and unit tests of the scenarios above.

Delivery should be done as a pull request on github.

Revision 2019-11-05 11:59 by ollehar
Description

EM has no warning system. If an error is reported, the expression stops execution. We need warnings for alphabetical compare, which can be used by mistake by survey designers when they actually want numerical compare.

Problem: "2" < "18" is evaluated differently in PHP and JS. This feature will NOT fix evaluation, but instead show warnings when compare is used on strings.

Scenarios:

  1. User creates survey with two questions, Q1 and Q2
  2. Relevance equation for Q2 is Q1.NAOK < "10"
  3. A warning is shown in question summary AND survey logic file: "This expression uses alphabetical compare. Are you sure you didn't mean numerical compare? See this manual entry for more information."

  1. As above
  2. As above but with >, <= and >= operations
  3. As above

  1. User creates survey with two question groups G1 and G2
  2. User creates question Q1 in group G1
  3. Relevance equation for G2 is Q1.NAOK < "10"

  1. As above
  2. As above
  3. As above but with >, <= and >= operations

All scenarios above should also happen with "A10" or "qwerty" strings. It doesn't have to be a number. The manual entry should recommend users to use strcmp when comparing strings alphabetically, and to use intval/floatval with <, >, <=, >= when comparing numbers numerically.

The delivery should include functional and unit tests of the scenarios above.

Delivery should be done as a pull request on github.

Revision 2019-11-05 11:55 by ollehar
Description

EM has no warning system. If an error is reported, the expression stops execution. We need warnings for alphabetical compare, which can be used by mistake by survey designers when they actually want numerical compare.

Problem: "2" < "18" is evaluated differently in PHP and JS. This feature will NOT fix evaluation, but instead show warnings when compare is used on strings.

Scenarios:

  1. User creates survey with two questions, Q1 and Q2
  2. Relevance equation for Q2 is Q1.NAOK < "10"
  3. A warning is shown in question summary AND survey logic file: "This expression uses alphabetical compare. Are you sure you didn't mean numerical compare? See this manual entry for more information."

  1. As above
  2. As above but with >, <= and >= operations
  3. As above

  1. User creates survey with two question groups G1 and G2
  2. User creates question Q1 in group G1
  3. Relevance equation for G2 is Q1.NAOK < "10"

  1. As above
  2. As above
  3. As above but with >, <= and >= operations

All scenarios above should also happen with "A10" or "qwerty" strings. It doesn't have to be a number. The manual entry should recommend users to use strcmp when comparing strings alphabetically, and to use intval/floatval with <, >, <=, >= when comparing numbers numerically.

The delivery should include functional and unit tests of the scenarios above.

Revision 2019-11-05 11:54 by ollehar
Description

EM has no warning system. If an error is reported, the expression stops execution. We need warnings for alphabetical compare, which can be used by mistake by survey designers when they actually want numerical compare.

Problem: "2" < "18" is evaluated differently in PHP and JS. This feature will NOT fix evaluation, but instead show warnings when compare is used on strings.

Scenarios:

  1. User creates survey with two questions, Q1 and Q2
  2. Relevance equation for Q2 is Q1.NAOK < "10"
  3. A warning is shown in question summary AND survey logic file: "This expression uses alphabetical compare. Are you sure you didn't mean numerical compare? See this manual entry for more information."

  1. As above
  2. As above but with >, <= and >= operations
  3. As above

  1. User creates survey with two question groups G1 and G2
  2. User creates question Q1 in group G1
  3. Relevance equation for G2 is Q1.NAOK < "10"

  1. As above
  2. As above
  3. As above but with >, <= and >= operations

All scenarios above should also happen with "A10" or "qwerty" strings. It doesn't have to be a number. The manual entry should recommend users to use strcmp when comparing strings alphabetically, and to use intval/floatval with <, >, <=, >= when comparing numbers numerically.

Revision 2019-11-05 11:49 by ollehar
Description

EM has no warning system. If an error is reported, the expression stops execution. We need warnings for alphabetical compare, which can be used by mistake by survey designers when they actually want numerical compare.

Problem: "2" < "18" is evaluated differently in PHP and JS. This feature will NOT fix evaluation, but instead show warnings when compare is used on strings.

Scenarios:

  1. User creates survey with two questions, Q1 and Q2
  2. Relevance equation for Q2 is Q1.NAOK < "10"
  3. A warning is shown in question summary AND survey logic file: "This expression uses alphabetical compare. Are you sure you didn't mean numerical compare? See this manual entry for more information."

  1. As above
  2. As above but with >, <= and >= operations
  3. As above

  1. User creates survey with two question groups G1 and G2
  2. User creates question Q1 in group G1
  3. Relevance equation for G2 is Q1.NAOK < "10"

  1. As above
  2. As above
  3. As above but with >, <= and >= operations

All scenarios above should also happen with "A10" or "qwerty" strings. It doesn't have to be a number. The manual entry should recommend users to use strcomp when comparing strings.

Revision 2019-11-05 11:49 by ollehar
Description

EM has no warning system. If an error is reported, the expression stops execution. We need warnings for alphabetical compare, which can be used by mistake by survey designers when they actually want numerical compare.

Problem: "2" < "18" is evaluated differently in PHP and JS. This feature will NOT fix evaluation, but instead show warnings when compare is used on strings.

Scenarios:

  1. User creates survey with two questions, Q1 and Q2
  2. Relevance equation for Q2 is Q1.NAOK < "10"
  3. A warning is shown in question summary AND survey logic file: "This expression uses alphabetical compare. Are you sure you didn't mean numerical compare? See this manual entry for more information."

  1. As above

  2. As above but with >, <= and >= operations

  3. As above

  4. User creates survey with two question groups G1 and G2

  5. User creates question Q1 in group G1

  6. Relevance equation for G2 is Q1.NAOK < "10"

  7. As above

  8. As above

  9. As above but with >, <= and >= operations

All scenarios above should also happen with "A10" or "qwerty" strings. It doesn't have to be a number. The manual entry should recommend users to use strcomp when comparing strings.

Revision 2019-11-05 11:49 by ollehar
Description

EM has no warning system. If an error is reported, the expression stops execution. We need warnings for alphabetical compare, which can be used by mistake by survey designers when they actually want numerical compare.

Problem: "2" < "18" is evaluated differently in PHP and JS. This feature will NOT fix evaluation, but instead show warnings when compare is used on strings.

Scenarios:

  1. User creates survey with two questions, Q1 and Q2

  2. Relevance equation for Q2 is Q1.NAOK < "10"

  3. A warning is shown in question summary AND survey logic file: "This expression uses alphabetical compare. Are you sure you didn't mean numerical compare? See this manual entry for more information."

  4. As above

  5. As above but with >, <= and >= operations

  6. As above

  7. User creates survey with two question groups G1 and G2

  8. User creates question Q1 in group G1

  9. Relevance equation for G2 is Q1.NAOK < "10"

  10. As above

  11. As above

  12. As above but with >, <= and >= operations

All scenarios above should also happen with "A10" or "qwerty" strings. It doesn't have to be a number. The manual entry should recommend users to use strcomp when comparing strings.

Revision 2019-11-05 11:48 by ollehar
Description

EM has no warning system. If an error is reported, the expression stops execution. We need warnings for alphabetical compare, which can be used by mistake by survey designers when they actually want numerical compare.

Problem: "2" < "18" is evaluated differently in PHP and JS. This feature will NOT fix evaluation, but instead show warnings when compare is used on strings.

Scenarios:

  1. User creates survey with two questions, Q1 and Q2

  2. Relevance equation for Q2 is Q1.NAOK < "10"

  3. A warning is shown in question summary AND survey logic file: "This expression uses alphabetical compare. Are you sure you didn't mean numerical compare? See this manual entry for more information."

  4. As above

  5. As above but with >, <= and >= operations

  6. As above

  7. User creates survey with two question groups G1 and G2

  8. User creates question Q1 in group G1

  9. Relevance equation for G2 is Q1.NAOK < "10"

  10. As above

  11. As above

  12. As above but with >, <= and >= operations

All scenarios above should also happen with "A10" or "qwerty" strings. It doesn't have to be a number. The manual entry should recommend users to use strcomp when comparing strings.

Revision 2019-11-05 11:38 by ollehar
Description

EM has no warning system. If an error is reported, the expression stops execution. We need warnings for alphabetical compare, which can be used by mistake.