Friday, 1 October 2010

Producing a quiz and using it in the front end

To make my front end more interactive I created a quiz for the audience to use. This involved creating the quiz and encoding it into the front end. I had to use a special code for this and then paste the relevant code into the original code. The quiz was based on safe drivning. For example, "what is the maximum units of alcohol a person can consume when driving?" This linked in with my client breif because the quiz was aimed at the target audience. Including a quiz would relate to the target audience becasue they are young. Furthermore, a quiz makes the DVD more realistic and light-hearted and this could help get the message across. The quiz involved three driving related questions. For exmaple, "what is the speed limit on a normal street lit road?" Once the user has answered all of the questions the computer will give them a mark out of three and see if they have completed the quiz correctly. The quiz was hard to code into the appropriate form., The quiz is situated on the extras form and needed to be linked to the "play quiz button". I had to produce my own code to produce the quiz. This needed to be linked to the button in order for it to work once it was clicked. I need to make a declaration line of code to declare the quiz to open.

This is an example of one of the codes i used to create and code my quiz into my front end. This code counts the quiz answers and detects whether they are correct or not.





11. Example of a Subroutine that can be called by an Event, this particular subroutine counts quiz answers:

function endForNow(evt:Event)                                                                                                // final screen display
{
            if (frmQuestion.visible = true); frmQuestion.visible = false;                // make question invisible
            if (frmCorrect.visible = true); frmCorrect.visible = false;                          // make correct invisible
            if (frmWrong.visible = true); frmWrong.visible = false;                            // make wrong invisible
            var maxScore = answers.length;                                                                               // check number of questions
            var correctScore = 0;                                                                                            // set correct to zero
            for (var i:int = 0; i < answers.length; i++)                                                      // look for correct answers
            {
                        correctScore = correctScore + answers[i];                         // add 1 if correct
            }
            frmEndScreen.txtFinalScore.text = correctScore.toString();                // display score achieved
            frmEndScreen.txtMaxScore.text = maxScore.toString();                     // display max score
            frmEndScreen.visible = true;                                                                      // make screen invisible
            frmEndScreen.x=100;                                                                                    // position for appearing screen
            frmEndScreen.y=100;
}
Target audience - is mainly aimed at people who drive and regularly use car parks.
The quiz relates to the audience because it is based upon driving related questions. The audience are likely to get the questions correct becasue they are road users themselves and are aware of the certain rules and regualtions.

Message of the film - to indicate that dangerous driving in public car parks can be hazardous and it can cause dangers to others.
The quiz only demonstrates the do's and dont's based around driving on normal roads, not car parks and therefore does not apply to this section of the  client breif.

Technical elements - It will include different screens such as play movie, scenes, outtakes and subtitles.
The quiz has alot of technical elements just like the drag and drop puzzle. The quiz needed its own code to link up and play once the "play quiz" button had been clicked. I also needed to let the computer know what were the correct answers without showing this to the user. I did this by coding the answers to the questions, to the correct buttons on the quiz.

Impact of the film on the audience - slightly humorous so the audience do not get the impression that I am accusing them of being bad drivers.
I do not feel that this section relates to the client breif.


New skills reference: Skill 16

No comments:

Post a Comment