!Need Help to capture %Results.ScorePoints% variable in JavaScript

I am trying to capture this quiz result variable in JavaScript as part of a user data export trigger.  I can't seem to get it work correctly.  I don't have any problem grabbing the text entry variables but the quiz results don't seem to work for me.   I have tried a number of different approaches, but I keep getting and "undefined" error every time I try to use the user's results points variable.

This is just a "CD published" module - not SCORM

>>  What's the secret to grabbing the user's score as a variable in the same way I do text entry variables?

Any help would be appreciated soooooo much.  Thanks!!

Ben

7 Replies
Ben  Delaney

Thanks to Steve Flowers!    He sent me a Story file which answered the question.  I was on the right track except I was making one critical error.    I had created a variable called "myScore" and was trying to make its value equal to the quiz results value Results.ScorePoints.  Only I couldn't find any of the Quiz variables as a choice when I was creating the trigger.  

Well, DUH!!!,   I noticed I had created "myScore" as a text variable and was trying to adjust its value by looking for a numerical variable >> which isn't possible.... Duh.     Once I realized what I had done and created a new variable as a number...  the whole thing came together.  Now I can export the quiz results in my JavaScript.     

Thanks Steve.

Ben  Delaney

Jacinta,

I am happy to share it all.   Here is a  THREAD which parallels this issue and has all the code.   You may not be interested in this level of a solution.  If you are looking for something a bit simpler let me know.

Also, here is a sample Story which Steve Flowers sent me,  STORY

Thanks

Ben

Jacinta Penn

Gosh yes that's far more complex than I need (or can understand)

I am just looking for a mailto that has the score and their name in it (from a data entry variable).  The Steve Flowers story shows how to set a variable, now I just need to work out how to use it in a mailto or javascript!  

I might have to get someone to do it for me and just copy and paste

Ashley Terwilliger

Hi Shivaprasad,

This discussion is quite a bit older, so I'm not sure if Ben is still subscribed here or if his Dropbox link is still active. You can try using the "contact me" button on an ELH users' profile to reach out to them directly or you can start a new discussion sharing more detail on what you'd like to accomplish. That way other folks in the ELH community can chime in and help.