A Flash Developer Resource Site

Results 1 to 20 of 35

Thread: external questions file

Hybrid View

  1. #1
    Junior Member
    Join Date
    Feb 2006
    Posts
    1

    Hi

    Hey Please can you send it to [email protected] ??..................am dieing to have that stuff.
    Thanks

  2. #2
    Senior Member jweeks123's Avatar
    Join Date
    Mar 2006
    Posts
    1,124
    To answer KMF's question about having 10 questions in the file, replace this code:
    maxscore = qList.length*10;
    // randomly shuffle list of questions
    qList.sort(function() { return random(3) - 1;});
    questionNbr = 0;

    with this code:
    qList.sort(function() { return random(3) - 1;});
    questionNbr = qList.length-5;
    // determine maximum score
    maxscore = (qList.length-questionNbr)*10;


    To answer flemming's question:
    on the "wrong" frame add a dynamic text field the the variable name of “right” then add another dynamic text box the the field name of choice. Then put some static text next to the boxes that reads “Your choice” next to the “choice” variable field, and “Correct Answer” next the “right” field.

    Then you can also add fields that display what the correct and incorrect answer text was if you would like, with this code on the wrong frame:

    if(choice=="a") {
    wtext=answera;
    }
    if(choice=="b") {
    wtext=answerb;
    }
    if(choice=="c") {
    wtext=answerc;
    }
    if(choice=="d") {
    wtext=answerd;
    }
    if(choice=="e") {
    wtext=answere;
    }
    if(choice=="f") {
    wtext=answerf;
    }
    if(right=="a") {
    ctext=answera;
    }
    if(right=="b") {
    ctext=answerb;
    }
    if(right=="c") {
    ctext=answerc;
    }
    if(right=="d") {
    ctext=answerd;
    }
    if(right=="e") {
    ctext=answere;
    }
    if(right=="f") {
    ctext=answerf;
    }
    stop();

    Then add a field under the choice field with the variable name of “wtext”, and another field under the right field with the variable name of “ctext”.

    As for the feedback option. You can do this by adding an extra tag into the XML file like so:

    <question q='Who was the First President?'
    ans_a='Ulysses S. Grant'
    ans_b='Harry Truman'
    ans_c='Abraham Lincoln'
    ans_d='Albert Einstein'
    ans_e='Barny Rubble'
    ans_f='George Washington'
    >>>>> ans_wrong='Incorrect Feedback would appear here if there was any.'
    right='f'>

    my choice for the tag was “ans_wrong” as shown above next to the arrows (be sure to remove these in the actual XML file). Then go to frame 2 of your FLA and enter this code under the last letter choice declaration.
    feed = qList[questionNbr].ans_wrong;

    Then add a another dynamic field on the wrong frame and give it the variable name of “feed”. Any questions, please feel free to ask.

  3. #3
    Junior Member
    Join Date
    Mar 2006
    Posts
    1
    Can you please email to me too? Please. Thank You

    email: [email protected]

  4. #4
    Junior Member
    Join Date
    Oct 2005
    Posts
    9
    Quote Originally Posted by jweeks123
    To answer KMF's question about having 10 questions in the file, replace this code:
    maxscore = qList.length*10;
    // randomly shuffle list of questions
    qList.sort(function() { return random(3) - 1;});
    questionNbr = 0;

    with this code:
    qList.sort(function() { return random(3) - 1;});
    questionNbr = qList.length-5;
    // determine maximum score
    maxscore = (qList.length-questionNbr)*10;


    To answer flemming's question:
    on the "wrong" frame add a dynamic text field the the variable name of “right” then add another dynamic text box the the field name of choice. Then put some static text next to the boxes that reads “Your choice” next to the “choice” variable field, and “Correct Answer” next the “right” field.

    Then you can also add fields that display what the correct and incorrect answer text was if you would like, with this code on the wrong frame:

    if(choice=="a") {
    wtext=answera;
    }
    if(choice=="b") {
    wtext=answerb;
    }
    if(choice=="c") {
    wtext=answerc;
    }
    if(choice=="d") {
    wtext=answerd;
    }
    if(choice=="e") {
    wtext=answere;
    }
    if(choice=="f") {
    wtext=answerf;
    }
    if(right=="a") {
    ctext=answera;
    }
    if(right=="b") {
    ctext=answerb;
    }
    if(right=="c") {
    ctext=answerc;
    }
    if(right=="d") {
    ctext=answerd;
    }
    if(right=="e") {
    ctext=answere;
    }
    if(right=="f") {
    ctext=answerf;
    }
    stop();

    Then add a field under the choice field with the variable name of “wtext”, and another field under the right field with the variable name of “ctext”.

    As for the feedback option. You can do this by adding an extra tag into the XML file like so:

    <question q='Who was the First President?'
    ans_a='Ulysses S. Grant'
    ans_b='Harry Truman'
    ans_c='Abraham Lincoln'
    ans_d='Albert Einstein'
    ans_e='Barny Rubble'
    ans_f='George Washington'
    >>>>> ans_wrong='Incorrect Feedback would appear here if there was any.'
    right='f'>

    my choice for the tag was “ans_wrong” as shown above next to the arrows (be sure to remove these in the actual XML file). Then go to frame 2 of your FLA and enter this code under the last letter choice declaration.
    feed = qList[questionNbr].ans_wrong;

    Then add a another dynamic field on the wrong frame and give it the variable name of “feed”. Any questions, please feel free to ask.
    How do you put a pause button to allow the user to see the feedback....I tried your code and it shows the feeback at lightning speed

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