You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The numerical input component in the course authoring MFE is incorrectly handling formulas as strings instead of numeric expressions, leading to errors when evaluating answers.
Specifically, when entering the formula m*c², the component (always) registers it as a numericalresponse rather than a stringresponse, preventing correct evaluation.
This issue does not occur in the Nutmeg release (pre-MFE) but does occur in Redwood (with MFE enabled). The problem is caused by how OLX templates are generated, as the MFE does not dynamically adjust response types based on the provided input.
How To Reproduce
Add a numerical input component in the course authoring MFE.
Enter the example formula: m*c².
Save and preview the component.
Observe that the system registers it as a numericalresponse, causing an error instead of evaluating it as a numeric formula.
In the legacy implementation, the system dynamically adjusted the response type based on the input.
The MFE always uses "numericalresponse", while the legacy version could switch between "stringresponse" and "numericalresponse" as needed.
The math expressions component (which uses "formularesponse") might be a more appropriate alternative for complex formulas.
It needs to be determined whether this behavior is an intended product decision or an implementation oversight.
Consider updating the OLX generation logic in MFE to match the expected behavior from pre-MFE versions.
The text was updated successfully, but these errors were encountered:
mariajgrimaldi
changed the title
Numerical Input Incorrectly Handles Formulas as Strings
Numerical Input Incorrectly Handles Formulas as numericalresponse
Feb 21, 2025
mariajgrimaldi
changed the title
Numerical Input Incorrectly Handles Formulas as numericalresponse
Numerical Input Component Incorrectly Handles Formulas as numericalresponse
Feb 21, 2025
Description
The numerical input component in the course authoring MFE is incorrectly handling formulas as strings instead of numeric expressions, leading to errors when evaluating answers.
Specifically, when entering the formula
m*c²
, the component (always) registers it as anumericalresponse
rather than astringresponse
, preventing correct evaluation.This issue does not occur in the Nutmeg release (pre-MFE) but does occur in Redwood (with MFE enabled). The problem is caused by how OLX templates are generated, as the MFE does not dynamically adjust response types based on the provided input.
How To Reproduce
m*c²
.numericalresponse
, causing an error instead of evaluating it as a numeric formula.Other Considerations
Original issue and discussion: openedx/wg-build-test-release#420. From the issue's thread:
The text was updated successfully, but these errors were encountered: