Home
About Us
Contacts
Portfolio
Faq

Questionnaire

Compatible: AS3, flash 9 or greater

The Crifano Questionnaire component lets you create several questionnaire, with different look and feel.
You can personalize the schema of questions, you can add images for each question and/or for each answer.
You can personalize the results page, there are 4 models of result page and 3 models of question page.
The Questionnaire is able to show the questions on random order and/or randomize the answers.
You can have radio button (for single choice) or check box (for multiple choice) on the answers.
Download Demo: As3
View API

Api
The component can be used without any scripting. The code hereunder is only for advanced users that need specific actions.

setAnswerSelectedById
myComponent.setAnswerSelectedById(1);
This method let's you select an answer by code, the number is the progressive position of the answer in your xml (starting from 1).
You can use it with the "init" event.

getAnswer
myComponent.getAnswer();
var arr:Array = CrifanoQuestionary.getAnswer();
var arrAns:Array;
for(var i:uint=0; i < arr.length; i++){
  trace("id_question: " + arr[i].id_question )
  arrAns = arr[i].answers;
  for(var j:uint =0; j < arrAns.length;j++){
    trace(" id_answers: " + arrAns[j].id_answer + " isCorrect: " + arrAns[j].correct + " value: " + arrAns[j].value);
  }
}

This method return an array containing information about all the answer given.

on_Error
CrifanoQuestionary.addEventListener("on_Error", showAlert);
function showAlert(e:Event):void{
    trace("Error! No answer selected");
}

This event is called when an user clicks the next button before select an answer.

onComplete
CrifanoQuestionary.addEventListener("on_Complete", completeQuiz);
function completeQuiz(e:Event):void{
    trace("You finish the questionnaire");
}

This event is called before shows the results when the user replay all questions.

init
CrifanoQuestionary.addEventListener("init", setSelAnswer);
function setSelAnswer(e:Event):void{
    trace("this event is called after a question and his answers are drawn");
}

this event is called after a question and his answers are drawn.
It could be used to set a default answer, using the method "setAnswerSelectedById".

Crifano © All right reserved
FaceBook     Delicious     Digg     StumbleUpon     | ALL COMPONENTS | FAQ | CONTACT |