Variable for question types

I found a way to get the number of choices, and thought I would share. I am using this for a template I created for a tests that allows the user one chance to answer correctly on questions that have just two choices, and two chances per question with more than two choices. Since the test is in template, it was important that any question could have one or two chances depending on the amount of choices. Previously we had are developer set how many chances each question would receive, but this lead to problems forgetting to set the variable or change it if the question type changed after a review.To do this takes a bit of JavaScript, and a variable to store the number of choices. On each page in the test, I have the following inherited in an External HTML object:On each question page is an action to set my variable "NumberOfTries":On: ShowAction: Modify VariableTarget: NumberOfTriesValue: javascript:getNumOfTries('qu215103')Here 'qu215103' is the HTML name of the question on the page. Variable "NumberOfTries" will now be either a 1 or 2, and I can run my other actions with condition for the variable value.

Discussions have been disabled for this post