Display previous entered formula correctly

More
1 year 4 months ago #182345 by mariaa
Hi all,

I´ve created a mathematical quiz. In the end each participant gets displayed a summary of his anwers so that he can check if they are correct.

In the quiz there is a an open question.

On the picture below, the correct answer is entered. You can see that there are already some symbols underlined.



In the end of the survey the answer is displayed with errors.




This is my syntax for the summary of this question:

You answered: {A2.shown}

Please check if you answered correctly.


There doesn´t seem to be any problem about the syntax. When I insert eg. "apple" as answer for question no. 2 the same text is displayed in the question summary. So this problem just occurs for formulae like {∅, {a}, {{b}}, {a, {b}}}.


Do you know if there is any way to display the formula correctly in the summary? Does my syntax needs to be extended?

Thanks a lot for your support since I don´t have any starting point to solve this problem.

Below, please find the lss

File Attachment:

File Name: limesurvey...5415.lss
File Size:44 KB



Kind regards

Maria
Attachments:
The topic has been locked.
LimeSurvey Partners
More
1 year 4 months ago #182354 by tpartner
I don't see that equation anywhere in the attached survey.

If you want Expression Manager to ignore curly braces, insert a space after the opening brace and before the closing brace.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Official LimeSurvey Partner - partnersurveys.com
The following user(s) said Thank You: mariaa
The topic has been locked.
More
1 year 4 months ago - 1 year 4 months ago #182359 by Joffm
Hello, Maria,

well it's quite obvious.
To display the answer you have to use curly brackets. But your answer itself contains the mathematical symbols "{" and "}" to indicate the set.

There is a way to display:
Have a space after the "{" and before the "}

Then you get (just an example):


So with some equations and string functions replace "{" by "{ " and "}" by " }"

Like this:
After A2 insert a question of type equation (hidden) and enter
{A2=str_replace('{','{ ',A2)}
{A2=str_replace('}',' }',A2)}

Viel Erfolg
Joffm


Volunteers are not paid.
Not because they are worthless, but because they are priceless
Attachments:
Last edit: 1 year 4 months ago by Joffm.
The following user(s) said Thank You: DenisChenu, mariaa
The topic has been locked.
More
1 year 4 months ago #182362 by cdorin
+1 to the responses from above.

If you don't add the space, LimeSurvey interprets what is inside curly brackets as an expression. That is why you also get the respective error message:

manual.limesurvey.org/Expression_Manager...elopers#How_EM_Works
The following user(s) said Thank You: mariaa
The topic has been locked.
More
1 year 4 months ago #182364 by tpartner
You should also be able to use { and } - brajeshwar.github.io/entities/

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Official LimeSurvey Partner - partnersurveys.com
The following user(s) said Thank You: mariaa
The topic has been locked.
More
1 year 4 months ago - 1 year 4 months ago #182369 by DenisChenu
I really think it's an issue … Expression Manager must not replace value from user entered variable …
But must test if able to allow it in equation at the same time.

Edit : reported and assigned : bugs.limesurvey.org/view.php?id=14698

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development . I don't answer to private message.
Last edit: 1 year 4 months ago by DenisChenu. Reason: Edit : reported and assigned
The following user(s) said Thank You: tpartner, mariaa
The topic has been locked.
More
1 year 4 months ago #182385 by mariaa
Thanks a lot tpartner, I didn´t know this tip (inserting a space) before.
The topic has been locked.
More
1 year 4 months ago #182386 by mariaa
Hi Joffm,

thanks a lot for your helpful tip. I inserted two equations like proposed and now it´s working. The replace function might be very helpul for future surveys =)

Beste Grüße und einen schönen Abend

Maria
The following user(s) said Thank You: DenisChenu, cdorin
The topic has been locked.

Start now!

Just create your account and start using Limesurvey today.

Register now