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

SAK-50613 Samigo issue with calculated questions using the pipe and comma operators #13059

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

st-manu
Copy link
Contributor

@st-manu st-manu commented Nov 25, 2024

https://sakaiproject.atlassian.net/browse/SAK-50613

The formulas for calculated questions are stored in the database by concatenating the formula with "|tol,dec". This causes two issues:

  1. The "|" symbol is also used as the OR operator.
  2. The comma is not only used as a decimal separator but is also used in formulas (such as if) to separate arguments.

When a formula is configured, for example, as: iff({numero}<2, {sub}|{numero}, {numero}=2, {sub}*3, {numero}>2, {sub}*6), the question breaks.

@ern ern changed the title SAK-50613 Tests & Quizzes: issue with calculated questions using the OR (|) operator and comma (,) SAK-50613 Samigo issue with calculated questions using the pipe and comma operators Nov 26, 2024
@ern
Copy link
Contributor

ern commented Dec 3, 2024

@st-manu can you add a unit test for this?

@st-manu
Copy link
Contributor Author

st-manu commented Dec 3, 2024

I have uploaded a new commit with the tests @ern

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants