# Display previous entered formula correctly

il y a 4 mois 3 semaines #182345 par 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:

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.

#### Fichier attaché :

Nom du fichier : limesurvey...5415.lss
Taille du ficher :44 ko

Kind regards

Maria
##### Pièces jointes :

Connexion ou Créer un compte pour participer à la conversation.

LimeSurvey Partners
il y a 4 mois 3 semaines #182354 par 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
Les utilisateur(s) suivant ont remercié: mariaa

Connexion ou Créer un compte pour participer à la conversation.

il y a 4 mois 3 semaines - il y a 4 mois 3 semaines #182359 par 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
##### Pièces jointes :
Dernière édition: il y a 4 mois 3 semaines par Joffm.
Les utilisateur(s) suivant ont remercié: DenisChenu, mariaa

Connexion ou Créer un compte pour participer à la conversation.

il y a 4 mois 3 semaines #182362 par 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

Les utilisateur(s) suivant ont remercié: mariaa

Connexion ou Créer un compte pour participer à la conversation.

il y a 4 mois 3 semaines #182364 par tpartner
You should also be able to use &lcub; and &rcub; - 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
Les utilisateur(s) suivant ont remercié: mariaa

Connexion ou Créer un compte pour participer à la conversation.

il y a 4 mois 3 semaines - il y a 4 mois 3 semaines #182369 par 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 .
An error happen ? Before make a new topic : remind the Debug mode .
Dernière édition: il y a 4 mois 3 semaines par DenisChenu. Raison: Edit : reported and assigned
Les utilisateur(s) suivant ont remercié: tpartner, mariaa

Connexion ou Créer un compte pour participer à la conversation.

il y a 4 mois 3 semaines #182385 par mariaa
Thanks a lot tpartner, I didn´t know this tip (inserting a space) before.

Connexion ou Créer un compte pour participer à la conversation.

il y a 4 mois 3 semaines #182386 par 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
Les utilisateur(s) suivant ont remercié: DenisChenu, cdorin

Connexion ou Créer un compte pour participer à la conversation.