Multiple Choice questions
A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Multiple Choice questions

  1. #1
    Junior Member
    Join Date
    Jan 2002

    Multiple Choice questions

    I have created a multiple choice test for my students, but I am unable to figure out how to 'scramble' the questions (with the choices) so that students have adifferent order of questions.
    can anyone help me, please with this Flash 8 question?
    Thanks in advance

  2. #2
    Custom User Title
    Join Date
    Jul 2005
    It would be helpful to see your code, but the random function is what you want to use. If you had say, 10 questions you could write
    var nextQuestion:Number = random(10);
    This will generate a pseudo-random number between 0 and 9 and assign that value to nextQuestion. If you need all the questions displayed at once, or need to keep questions from repeating you could also set a property on the text object that would return true or false depending on whether or not that question had been placed in the list and then use if statements to select one that had not been.

  3. #3
    Junior Member
    Join Date
    Jan 2002

    Multiple Choice Questions

    Here is the code that I have for the students' questions. What I want to be able to do is create a test in which each student when accessing the test will start with a different multiple choice question: scramble the order of the multiple choice questions. Any assistance would be greatly appreciated. Thanks,

    Start of code*************

    QuoteAnswerArray = new Array(new Array(
    "1. '\Disposition\', \'energy level\', \'intelligence\' and \'interests\' were some of the items used in the _______________ .",

    "2. In the word \'bewildered\', the suffix is _____________ .",

    "44. Upon becoming a Seven, Lily received _________________ .",

    "45. Lily was __________ sister."

    ), new Array(
    "Ceremony of Naming", "Ceremony of Assignments", "Ceremony of Spouses", "Ceremony of Releasing", "C",

    "be-", "-ed", "-ered", "none of the above", "B",

    "a back-buttoned jacket", "a front-buttoned jacket", "a zippered jacket", "new hair ribbons", "B",

    "Jonas\'", "Jona's", "Jonas's", "none of the above", "C"


    SWFArray = new Array(

    score = 0;
    i = [0][0];
    k = [0][0];

    quotation = QuoteAnswerArray [0][i] ;

    currentURL = SWFArray[i];
    loadMovie (currentURL, "_root.SWFLoader");
    AnswerA = QuoteAnswerArray[1][k];
    AnswerB = QuoteAnswerArray [1][k+1];
    AnswerC = QuoteAnswerArray [1][k+2];
    AnswerD = QuoteAnswerArray [1][k+3];
    stop ();

    if (answer==QuoteAnswerArray [1][k+4]) {
    message ="YES! The Receiver is proud of you!";

    sfx = new Sound();

    score = ++score;
    } else {
    message = "Wrong answer! Ask Jonas for help NOW!";

    sfx = new Sound();
    k = k+5;
    i = ++i;
    if (i==4) {
    gotoAndPlay (4);
    } else {
    gotoAndPlay (2);

    if (score==45) {
    message = "Game over! You got " + score+ " / 45. CONGRATULATIONS! Are you the Reciever?"
    } else if (score<45 && score >=40) {
    message = "Game over! You got " + score+ " / 45 answers right. Are you working with the Giver?";
    } else if (score<40 && score>=35) {
    message = "Game over! You got " + score+ " / 45 answers right. Jonas is ready to help you.";
    } else if (score<35 && score>=23) {
    message = "Game over! You got " + score+ " / 45 answers right. Jonas wants you to study more.";
    } else {
    message = "Game over! You got " + score+ " / 45 answers right. You are about to be RELEASED!";
    stop ();

    Endo f code **************

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Click Here to Expand Forum to Full Width

HTML5 Development Center