Anyway to Capture All User Variables Using p.GetVar

Feb 05, 2014


I'm looking for some advanced help that I couldn't seem to find any solutions to in the support forums.

I'm creating some templates for other users to create courses in our company.

At the end of our courses I am executing Javascript to capture some user defined project variables that store the user's response to each question and whether they got the question right or wrong. I am then saving these to our database. This is working just great.

However the problem I'm facing is the courses will be a bit different from one to the next. Therefore the user defined variables will be changing.

I am coming up with some standards for our employees to use when naming their project variables.

They are:

  • Response01
  • Response02
  • Response03

Etc. Those will be used to capture the user response's to each question. The number represents the question number.

  • Result01
  • Result02
  • Result03

Etc. Those will be used to capture whether the user got the question right or wrong. The number represents the question number.

On the result slide I added Javascript to capture those variables using p.GetVar("UserVariable");

I have to do this for every user variable that needs to be captured. 

The problem is the number of questions will change based on the course.

So the Javascript has to be modified accordingly. I really don't want to have to have the employees that are creating the courses to edit the Javascript (or in my case actually remember to modify it)

What I really want to do is have a way to get all user variables using the p.GetVar function.

Then I could create some common Javascript code to cycle through the variables and save the ones that I need to the database.

So....Is there anyway to call p.GetVar and return all user defined project variables and their values?

Be the first to reply

This discussion is closed. You can start a new discussion or contact Articulate Support.