Skip navigation
Currently Being Moderated

Is it possible to dynamically create a user variable at runtime from within a Widget?

Apr 17, 2012 7:19 AM

Tags: #widgets #user_variable #suspend_data

I'm trying to develop a custom Interactive Widget. This widget will allow the user to take multiple attempts, and needs to store information about previously completed attempts so they can (hopefully) see their improvements over time.

I'm trying to figure out the best way to store the data about the previously completed attempts across multiple sessions in a LMS. It seems that the data stored in user variables is automatically stored/restored in suspend_data, which would be perfect. The issue is that I can't find a way to dynamically create a new user variable from within a Widget. It looks like I can only access user variables that the author has explicitly defined in the Captivate interface. I'd rather not have to force the author to define an empty User Variable that they'll never knowingly use, just to give the Widget a bucket to store its data.

Does anyone have any ideas for what might be the best way to accomplish this? I'd like to stick to standard, "approved" APIs as much as possible, but I'd be willing to bend some rules if necessary.


  • Currently Being Moderated
    Apr 17, 2012 7:36 AM   in reply to rmeyer_tier1

    I'd love to know the answer to this as well.  From what I can gather, the variables created at design time in the Cp UI are dynamically injected into the swf using the file on swf publish.

    Mark as:
  • Currently Being Moderated
    Apr 17, 2012 11:58 AM   in reply to rmeyer_tier1



    I assume you've asked this question here:!topic/elearning-technolog y-and-development/e5vWZfJ6X8I


    I asked a similar question here:!searchin/elearning-techno logy-and-development/leichliter/elearning-technology-and-development/A u88bu7LB5o/TC7xlo8iBpQJ


    Philip gave you sound advice.  You'll have to hijack/re-purpose the comments or the suspend data.  I was successful in using SCORM comments in a Moodle system to store extra data I needed for a customer.  It's not ideal, but it gets the job done. Here's a thread about that:!topic/elearning-technolog y-and-development/YgYAMGfXQNw


    If you use suspend data, you have to watch out for a few things:

    1.  It's base 64 encoded... so any data you append to what Captivate outputs will need to be in base 64 (that's a good practice anyway since the data has to be serialized).

    2.  On course re-entry, you'll need to capture the suspend data before it hits Cp to strip off / read your needed data.  If the suspend data isn't in the format Cp expects, you'll get a nice white screen of death.


    Ideally, it would be nice to be able to dynamically create user variables for purposes like this... and it's been requested in Cp 6.... we'll see if it gets added (not holding my breath).  Until then, I'd use cmi.comments.


    Jim Leichliter

    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points