Skip to main content
daveemsley
Known Participant
March 10, 2021
Question

Using Javascript to update a Quiz score - Captivate 2019

  • March 10, 2021
  • 2 replies
  • 1099 views

Hi all, 

I hope someone can help with this - I've created a quick which has a quirky marking system so I've generated the mark in JavaScript as none of the built in ones do exactly what I need.  That bit is fine; I get the question marks in a variable called var_Quiz_Score which I can see or put on a slide with the usual $$var_Quiz_Score$$.

My question is how can I push this into the quiz score?    I believe I need to update cpQuizInfoPointsscored but I cannot work out how to do this.  I've read the page https://elearning.adobe.com/2017/02/custom-quiz-scoring-in-adobe-captivate/ from but this doesn't seem to do the job I need.

Any help gratefully received.

Cheers

Dave

    This topic has been closed for replies.

    2 replies

    Lilybiri
    Legend
    March 10, 2021

    Bit astonished that Steven's blog post is not what you want. Besides Tristan (widget king) and some others, I had great respect for his JS skills. Too bad that he has left our community. 

     

    That was off topic, but I strongly recommend Rod's proposal. Try out that fantastic widget!

    RodWard
    Community Expert
    Community Expert
    March 10, 2021

    The cpQuizInfoPointsscored System Variable is READ-ONLY.    You would need some advanced JavaScript skills to pull off what you want to do.

     

    Alternatively, it is possible to do this using the CpExtra HTML5 widget.  Check out the details here: 
    https://widgetking.github.io/cpextra/variables/command.html#xcmndscore

     
    daveemsley
    Known Participant
    March 10, 2021

    Thanks for the quick response @RodWard   - Trying that out now.

    @Lilybiri- generates an error "TypeError: quizObject is undefined"

    Which is weird. Just dipping my toe into the JavaScript aspects - I'm reasonably aufait with JS but the interface between the two is confusing. 
    Cheers

    Dave

    Lilybiri
    Legend
    March 10, 2021

    Understood, and I tried to explain that this expert is not accessible anymore.

    The widget may inspire you to look for an easy JS solution.  Personally I only use JS when Captivate's shared/advanced actions fail.  Transfer of the value of a user variable to a quiz variable is something I have wished for since eons.