Skip to main content
saratogacoach
Inspiring
March 28, 2011
Question

Creating Questionnaire with 11 choices

  • March 28, 2011
  • 1 reply
  • 1152 views

Hi,

A retired social worker, beginner learning AS 3 scripting, I would like to try to use AS 3 to create a questionnaire for an eLearning lesson and am not  sure how to script it.

Each statement (questionnaire has 28 of these) to which the  user responds has 11 choices: 'how much does this apply to you'; 0%,  10%, 20%, 30%, 40%, 50%, 60%, 70%, 80%, 90%, 100%. The user selects one  of these (radio button?). Then, after completing all 28 items, the responses' values are totaled for the 28 items,  divided by 28 to get the overall "score." Would also need an if/else: if total score >= 30, show one message, else if =< 29, show a different message.

I've looked at some multiple choice quiz type example, but so far have been lost trying to apply these to 11 choices.

Any help on how to accomplish this for the questionnaire, a script example that I can build on, would be much appreciated.

Kind Regards,

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
March 28, 2011

you can use radiobuttons.  to learn about what properties, methods and events you can use with them open the help files to actionscript 3.0 classes and scroll to radiobutton.  read.

you'll find a label property, value property, selected property and change event that will probably be all things you'll want to use.  for example, for rb0:

var userChoice:int;

rb0.label="0%"
rb0.value = 0;
rb0.addEventListener(Event.CHANGE, changeF);

function changeF(e:Event):void{

if(e.target.selected){
userChoice = e.target.value;

}
}

saratogacoach
Inspiring
March 28, 2011

Thanks kglad, for this lead and sample script.

Kind Regards,

saratogacoach

kglad
Community Expert
Community Expert
March 28, 2011

you're welcome.