[Ticket cloned from T5386: How to setup and use placeholders like {correctedAnswers}?]
Hi
is there a way to use "correctedAnswers / incorrectedanswers and questioncount" value in expression, like: "{correctedAnswers}*10+'%'".
Thanks.
[Ticket cloned from T5386: How to setup and use placeholders like {correctedAnswers}?]
Hi
is there a way to use "correctedAnswers / incorrectedanswers and questioncount" value in expression, like: "{correctedAnswers}*10+'%'".
Thanks.
Hello,
I assume, that you are asking about SurveyJS Library and not about our cloud.
You can create a custom function and then use it in expression.
In the custom function you have the access to survey as: this.survey
, survey has functions:
survey.getCorrectedAnswerCount(), survey.getInCorrectedAnswerCount() and survey.getAllQuestions() (survey.getAllQuestions().length
).
Thank you,
Andrew
SurveyJS Team
Hi,
Correct, I'm talking about SurveyJS.
Really?, I have to?, I though that maybe you had a global property in the survey or something like that…, well, thanks.
To use variables in expressions, we need to calculate them first and if it could be bad for performance. We could have pre-built functions and I believe we add them if more people will require this functionality.
It requires several lines of code to add the function you need and it is totally fine to create your own custom functions.
Thank you,
Andrew
SurveyJS Team