Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Nov 2005
    Posts
    750
    Thanks
    138
    Thanked 1 Time in 1 Post

    Adding question to quiz

    Hello

    I have a Flash quiz which I have downloaded (it was free) and eventually hope to post something like it online, but I need first to come to terms with what is going on in the Timeline.

    After answering a question the

    function answer (choice) {

    advances the user to the next question and at the end of the two questions (!), a total score is given.

    The Action Script looks like this:

    Code:
    var quizTimeline = this;     // Stores reference to the timeline that contains the quiz user interface.
    var numQuestions = 2;        // Number of questions in the quiz
    var q1answer;                // User's answer for question 1
    var q2answer;                // User's answer for question 2
    var correctAnswer1 = 3;      // The correct choice for question 1
    var correctAnswer2 = 2;      // The correct choice for question 2
    answer.currentQuestion = 0;  // Function property: the question being answered
    If I wished to add a third or fourth question, or any number of questions, I understand that I need to add to the AS as follows:

    Code:
    var numQuestions = 5;        // Number of questions in the quiz
    var q1answer;                // User's answer for question 1
    var q2answer;                // User's answer for question 2
    var q3answer;                // User's answer for question 3
    var q4answer;                // User's answer for question 4
    var q5answer;                // User's answer for question 5
    var correctAnswer1 = 3;      // The correct choice for question 1
    var correctAnswer2 = 3;      // The correct choice for question 2
    var correctAnswer3 = 1;      // The correct choice for question 3
    var correctAnswer4 = 2;      // The correct choice for question 4
    var correctAnswer5 = 1;      // The correct choice for question 5
    What I am unsure about is how to customise the Timeline. I have copied and pasted frames and tried to change the nature of the questions asked (and their numbers) graphically on the stage, but I cannot get it to work doing that. For example, under question 2 I can see question 1, etc after pressing Ctrl + Enter.

    What would be the best way of proceeding? I can post the file if it helps.

    Many thanks.

    Steve

  • #2
    New Coder
    Join Date
    Apr 2008
    Location
    Makati Philippines
    Posts
    34
    Thanks
    0
    Thanked 1 Time in 1 Post
    yeah better post the file. i am assuming it might be a same instance problem.
    Hope is a good thing, maybe the best of things. And no good thing ever dies. -Andy Dufresne

    Jairus Bondoc PHP Programmer Philippines

  • #3
    Regular Coder
    Join Date
    Nov 2005
    Posts
    750
    Thanks
    138
    Thanked 1 Time in 1 Post
    Hello jairusbondoc

    Many thanks for getting back to me.

    I have tried to add a couple of questions to the quiz since my post and have had some success, though it is not completely working.

    Confession: I have added them, but I'm not sure how. You mention instance names, but I think I have included them where necessary.

    The AS does not pose a problem as the main work to be done is in the timeline.

    To add a question, do I simply pull out all the layers by 10 frames and add another layer to introduce an additional question? I am unsure of the sequence of stages I need to go through in order to do it properly.

    Many thanks for taking the time to look at it.

    Steve
    Attached Files Attached Files

  • #4
    New to the CF scene
    Join Date
    Aug 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy Javascript help

    Sir

    I have a .js file in which i have placed Urdu text like

    function Urdutext()
    {
    innerHTML.right_column='HTML tags and Urdu text';}

    the .js file contains near about 80 lines of urdu text.

    When i try to run the .js file it displays only half of the file and where the rest of lines go i dnt know.

    And when i include the file in my web page and want to display the urdu text nothing displays becaus the file remains in a wrong syntax. AS i have said I cant understand y the file gets half uploaded and y not full.

    Plz help me.

    Thanks
    Sajad


  •  

    Posting Permissions

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