Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Numerical Input Component Incorrectly Handles Formulas as numericalresponse #1680

Open
Tracked by #36261
mariajgrimaldi opened this issue Feb 21, 2025 · 0 comments
Open
Tracked by #36261
Labels
bug Report of or fix for something that isn't working as intended

Comments

@mariajgrimaldi
Copy link
Member

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 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

  1. Add a numerical input component in the course authoring MFE.
  2. Enter the example formula: m*c².
  3. Save and preview the component.
  4. Observe that the system registers it as a 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:

  • 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.
@mariajgrimaldi mariajgrimaldi changed the title Numerical Input Incorrectly Handles Formulas as Strings Numerical Input Incorrectly Handles Formulas as numericalresponse Feb 21, 2025
@mariajgrimaldi mariajgrimaldi changed the title Numerical Input Incorrectly Handles Formulas as numericalresponse Numerical Input Component Incorrectly Handles Formulas as numericalresponse Feb 21, 2025
@bradenmacdonald bradenmacdonald added the bug Report of or fix for something that isn't working as intended label Feb 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Report of or fix for something that isn't working as intended
Projects
Status: Backlog
Development

No branches or pull requests

2 participants