Groups | Blog | Home
all groups > flash actionscript > march 2004 >

flash actionscript : Save Quiz scores on the users hard drive


dcort0
3/3/2004 8:42:18 PM
I have developed a whole series of quiz?s using the Flash Learning extensions.
These are part of our CBT refresher certification program for the Independent
Duty Technicians in the US Air Force. These service people are spread out all
over the world. They could be in remote areas without internet connections. So
we are required to have their scores go onto their hard drives in a text file
and then have them snail send a print out of this information to their central
station.

I found this variable in the listvariables as follows:
Variable _level0.QuizTrack = [object #179, class 'Object'] {
total_correct:0,
total_wrong:0,
percent_correct:0,
percent_display:undefined,


I need to save the QuizTrack variable value percent correct as well as the
medics social security number and the date and time that the save/quizTrack
value took place. That is the problem I am working on.

I would love to see how you did it . I am pretty new to this and need to be
spoon fed.

kglad
3/3/2004 10:16:55 PM
dpatters8
3/4/2004 5:43:17 AM
Check out screenweaver. It will convert your Flash application into an executable that will be able to write text files localy.

http://www.screenweaver.com

Thanks,
proconken
3/4/2004 5:51:16 AM
proconken
3/4/2004 5:57:05 AM
flash 2004 also has built in functions that can allow the user to print out
theirtest scores, jsut found that out today! like "bmovie" do a search for that
in the actionscript dictionary, some samples will pope up.

My AOL instant messenger name is "aimflash"
proconken
3/4/2004 4:38:33 PM
[q][i]Originally posted by: [b][b]kglad[/b][/b][/i]
if you want to save that info, it's easy to do using the flash shared object.
but if it has to be saved in a text file, you'll need to use some application
in addition to flash.[/q]

I would like a sample of this method to save a SS, name wiht the quiz., if you
could be so kind to point me to one on the net, or post one up here, I would
like to try to make it work with a built quiz. Please reply if you have a min
to help us out.

My aim name is "aimflash"
my msn messenger name is "Proconken"


kglad
3/4/2004 5:43:40 PM
of course you can only save data that are available to your flash movie. so,
to save a ss number, the user would need to enter their ss number of it would
need to be retreived by a flash call to an external script/data base. but
assuming the ss number is stored in ssVar and the quiz score is stored in
quizscoreVar you can use:

so = sharedobject.getlocal("quiz");
if (so.data.ssNum != undefined) {
so.data.ssNum=ssVar;
so.data.quizScore=quizscoreVar;
so.data.flush();
} else {
//this user already has the shared object quiz on their computer and you may
want to retreive their score and ss number and do something with them.
}

to save the current date and time can be a little more tricky. if you're
content to save the date and time as recorded on the users computer, then there
is no difficulty. but if you want to ensure you're recording a valid date and
time you'll need access to an application outside of flash like a php or perl
script.
proconken
3/4/2004 7:00:11 PM
Thats awesome, thanks for opening my eyes to that sharedobject, now i need to
figure out how to tie a login with a quiz,"The onlything needed to have the
user input their "name:" +"Social security #"
Then it will open a flash quiz, then after the user scores their quiz, last
thing it does is print out the username, and quiz scores. After that It can
just dump the memory, and the print
will serve as something that they can use to study at another time, or turn
into their manager. No need to store it in a database yet, just a hard copy for
the user, with their name on it. I can probably attatch a button
that will have a print var in it like "bmax" or "bframe" found them in the
action script lib of flash 2004.

Have you worked with Flash's quiz component? I hear its hard to change stuff
in it, like supply content on the same movieclip as your quiz. Looks like i
have some experimentation and reading to do about he sharedobject in flash.

Do you know if I can query the info from sharedobject "name+SS+testscore"
together in an output screen, so that i can have the user print it?

Sorry for the redundant questions.
AddThis Social Bookmark Button