View Issue Details

This bug affects 1 person(s).
 2
IDProjectCategoryView StatusLast Update
14958Bug reportsExpression Managerpublic2020-03-09 15:36
ReporterDenisChenu Assigned ToDenisChenu  
PrioritynoneSeverityminor 
Status closedResolutionfixed 
Product Version4.0.0-beta 
Fixed in Version4.0.0-beta2 
Summary14958: Javascript loop with equation
Description

Equation goes to javascript loop in EM

Steps To Reproduce

Import included survey : test, wait … entre value … wait … look at console

Additional Information

Event system seems the same : https://github.com/LimeSurvey/LimeSurvey/blob/49d87d5212a392a90c2b3255c20dbbec827e84b6/assets/packages/expressions/em_javascript.js#L237-L240

Then something broken at other place

TagsNo tags attached.
Attached Files
Bug heat2
Complete LimeSurvey version number (& build)4.0.0 github 49d87d5212a392a90c2b3255c20dbbec827e84b6
I will donate to the project if issue is resolvedNo
Browserff
Database type & versionnot relevant?
Server OS (if known)not relevant ?
Webserver software & version (if known)not relevant ?
PHP Versionnot relevant ?

Relationships

child of 14047 closedDenisChenu Equation didn't update previous text 

Users monitoring this issue

There are no users monitoring this issue.

Activities

DenisChenu

DenisChenu

2019-06-03 09:34

developer   ~52271

Last edited: 2019-06-03 09:35

The 2 EM generated functions seems same except the .trigger('updated');

master

function LEMrel10995(sgqa){
    var UsesVars = ' java758542X713X10995 java758542X713X10994  ';

    if (1)
    {
        jQuery('#LEMtailor_Q_10995_2').html(LEMfixnum(
            (LEMval('758542X713X10995.NAOK') )
        ));
        jQuery('#LEMtailor_Q_10995_2').trigger('html:updated');

        jQuery('#LEMtailor_Q_10995_3').html(LEMfixnum(
            (LEMval('Q00.NAOK') )
        ));
        jQuery('#LEMtailor_Q_10995_3').trigger('html:updated');
        // Write value from the question into the answer field
        $('#java758542X713X10995').val($.trim($('#question10995 .em_equation').text()));
        relChange10995=true;
        $('#relevance10995').val('1'); 
    }
    $('#relevance10995').val('1');  // always true
}

develop

function LEMrel9032(sgqa){
    var UsesVars = ' java758542X649X9031 java758542X649X9032  ';

    if (1)
    {
        jQuery('#LEMtailor_Q_9032_2').html(LEMfixnum(
            (LEMval('Q00.NAOK'))
        ));
        jQuery('#LEMtailor_Q_9032_2').trigger('html:updated');

        jQuery('#LEMtailor_Q_9032_3').html(LEMfixnum(
            (LEMval('758542X649X9032.NAOK') )
        ));
        jQuery('#LEMtailor_Q_9032_3').trigger('html:updated');
        // Write value from the question into the answer field
        $('#java758542X649X9032').val($.trim($('#question9032 .em_equation').text())).trigger('updated');
        relChange9032=true;
        $('#relevance9032').val('1');
    }
    $('#relevance9032').val('1');  // always true
}
DenisChenu

DenisChenu

2019-06-03 11:00

developer   ~52272

OK, got it : Enbale this part : https://github.com/LimeSurvey/LimeSurvey/blob/49d87d5212a392a90c2b3255c20dbbec827e84b6/application/helpers/expressions/em_manager_helper.php#L7895-L7906

For equation fix the issue : Checking if sgqa is in used var muts be done (always in fact …)

DenisChenu

DenisChenu

2019-06-04 11:44

developer   ~52287

https://github.com/LimeSurvey/LimeSurvey/commit/0f9a0d089338ad1a23b195bda3f506668c341524
And
https://github.com/LimeSurvey/LimeSurvey/commit/dcb5808b9eac9e6e4fb359512832a7a7276d9e5a

Issue History

Date Modified Username Field Change
2019-06-03 09:28 DenisChenu New Issue
2019-06-03 09:28 DenisChenu File Added: limesurvey_survey_JsLoop.lss
2019-06-03 09:34 DenisChenu Note Added: 52271
2019-06-03 09:34 DenisChenu Note Edited: 52271
2019-06-03 09:35 DenisChenu Note Edited: 52271
2019-06-03 11:00 DenisChenu Note Added: 52272
2019-06-04 09:50 DenisChenu Assigned To => DenisChenu
2019-06-04 09:50 DenisChenu Status new => assigned
2019-06-04 11:36 DenisChenu Relationship added child of 14047
2019-06-04 11:44 DenisChenu Status assigned => resolved
2019-06-04 11:44 DenisChenu Resolution open => fixed
2019-06-04 11:44 DenisChenu Fixed in Version => 4.0.0-beta2
2019-06-04 11:44 DenisChenu Note Added: 52287
2020-03-09 15:36 c_schmitz Status resolved => closed