كامپوننت quiz

mohammad.sub7

کاربر فعال
سلام

چند تا از دوستان نمونه quiz مي خواستن. البته نمونه تو سايت چندتا موجود هستش. اما اين كامپوننت

هست. من خودم هميشه پيشنهاد در مورد quiz برنامه adobe captivate رو ميدم.خيلي قوي نيست اين

كامپوننت اما دست آدم توش باز هستش. در ضمن مخصوص اكشن 3 هستش نمونه مثال هم داره.

اين api هاش هستش:

PHP:
                               **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 lets 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".


اينم كامپوننت+ نمونه مثال:

مشاهده پیوست quiz.rar
 
آخرین ویرایش:

kodex2

کاربر فعال
ببخشید publisher. یه سوال. چجوری توی یه کامپوننت اونم مثلا quiz شما میاید انواع سوالات رو تعریف می کنید؟ خودش تنوع سوال داره یه فقط یه سبک سوال رو قبول می کنه؟
 

جدیدترین ارسال ها

بالا