Flash%20Quiz%20Results - PowerPoint PPT Presentation

About This Presentation
Title:

Flash%20Quiz%20Results

Description:

Storing quiz results is a four-step process. ... Second, you send this user to the page that administers the quiz. Third, you program the quiz to post the results. ... – PowerPoint PPT presentation

Number of Views:45
Avg rating:3.0/5.0
Slides: 9
Provided by: FredTHof
Learn more at: http://www1.udel.edu
Category:
Tags: 20quiz | 20results | flash | quiz

less

Transcript and Presenter's Notes

Title: Flash%20Quiz%20Results


1
Flash Quiz Results
  • Storing Flash Quiz Results in an Access Database

2
Storing Quiz Results
  • Storing quiz results is a four-step process.
  • First, you identify the user who owns the HTTP
    session.
  • Second, you send this user to the page that
    administers the quiz.
  • Third, you program the quiz to post the results.
  • Fourth, you receive the results and save them in
    the database.

3
Identifying the User
  • There are two ways to identify the user.
  • First, you can have users log on through the
    Dreamweaver login server behavior presented in
    Class 6.
  • Second, you can use a form to prompt an anonymous
    user for some kind of identification, such as an
    e-mail address, and save it in a session variable
    as you learned in Class 8.

4
Administering the Quiz
  • You administer the quiz by embedding it on an ASP
    page.
  • If you are using the Dreamweaver Login behavior,
    you secure the quiz by putting on this page the
    server behavior called User Authentication gt
    Restrict Access to Page.

5
Posting the Quiz Results
  • On the last screen of the quiz, you need to put a
    button which, when pressed, launches a script
    that posts the results to the ASP page to which
    you will take the user upon completion of the
    quiz.
  • The Action Script you add to the last frame of
    the quiz is as followsreport_btn.onRelease
    function() score QuizTrack.percent_format
    trace(score) getURL(my_quiz_results.asp",
    "_self", "POST")

6
Storing the Results in the DB
  • To store the results in the database, your Access
    database needs to contain a table in which you
    will store the quiz results.
  • On the page that will store the quiz results, you
    create a data binding to the Request object that
    contains the score, and to the Session object
    that contains the username.

7
Data Grab Script
  • You grab hold of the data through
    Request(score) and Session(MM_Username)
  • For example The result of the quiz was lt
    Request("score") gt for username lt
    Session("MM_Username") gt
  • This writes a message in the form ofThe result
    of the quiz was 33 for username Elvis.

8
Database Insertion Script
  • ltconnection Server.CreateObject("ADODB.Connect
    ion")connection.mode 3 //read-write
    modesConnectionString "ProviderMicrosoft.Jet.O
    LEDB.4.0Data SourceC\\TopSecret\\results.m
    dbPersist Security InfoFalse"connection.O
    pen(sConnectionString)//create the sql query to
    insert the datasQuery "INSERT INTO SecretQuiz
    (UserName, Score) "Values( "'"
    Session("MM_username") "', "'"
    Request("score") "')"connection.Execute(sQuery
    )if (connection.errors.count gt 0)
    Response.Write("ltbrgtThere was a connection
    error.")else Response.Write("ltbrgtThe score
    was recorded.")connection.Close()
  • gt
Write a Comment
User Comments (0)
About PowerShow.com