Question T1740
Visible to All Users

Multiple completedHTML

created 6 years ago

Hello,

I'm wondering whether there is a possibility to add multiple completedHtml variables(might not be the correct termin) in json variable.

If Quiz all answers are correct, display completedHtml: "Well done. You got it right!"
If Quiz all answers one or more is incorrect, display completedHtml: "Not bad, but should study more!"

Maybe it's possible to do that on survey complete but I lack the skills and would need some help. :)

Kind regards,
M

Answers

created 6 years ago (modified 6 years ago)

Hello Serge,

As my coding skills are not so great would it be possible for You to write the lines, which I should add to my code?

Or are there some examples where .onCompleteing is used.

I'm trying to implement the following logic:

if questionCount == getCorrectedAnswerCount
completedHtml = "Well done. You got it right!"
else
completedHtml = "Not bad, but should study more!"

Sorry for my incompetence.

Kind regards,
M

    created 6 years ago

    Hello,

    You can handle the onCompleting event, get the correct answers count using the getCorrectedAnswerCount method and update the completedHtml property programmatically.
    Is it a suitable solution for you?

    Thanks, Serge
    SurveyJS Team

      Comments (1)

        Hello Serge,

        I got it working.

        Thanks a lot! :)

        Kind regards,
        M