Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / designing quizzes

Author
Message
Scrooge
22
Years of Service
User Offline
Joined: 12th Dec 2002
Location: United Kingdom
Posted: 31st Jan 2003 16:17
Hi everyone
I am very new to programming. Would like to know if dbpro is capable of designing a simple quiz game whereby I can write a question and have multiple choice answers plus give the person using it the reward of perhaps shooting something if they get a right answer.

Also has anyone got the new book by harbour Smith - 800 pages? If so would it be worth getting for a complete beginner like me?

Cheers all
It's only humbug if you let it be so!
indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 31st Jan 2003 18:53
hi to help u answer some questions about a quiz.

I would store the questions and answer in a text file.
This way u can adapt the questions quite easily for any purpose.

I wrote one in Flash but not in DB and its the same principles.

I found that i stored my text file like this

Question1 : A1 : A2 : A3 : A4

Its broken down into 5 peices of data.


In order to know what Answer is right we always
place the correct answer into A1, but when we display
the questions we shuffle them around a bit.

they are all strings then u just need to compare the
users guess answer against the answer 1 location


the : symbols denotes a new data entry for the computer to know when its jumping to a new peice of data.
You may not need this in DB but I remember I needed this in the flash version

Ok now we have the question theory down also keep in mind that when your user makes a guess u should display a timer so there is a result from the time it took to guess.

U can trap the questions to either allow the user to make 4 guesses until he gets it or one guess per question then it moves onto the next question.

to make the question answering theory a bit more understandable you might want to make a function

this function would read in the next Question and Answers and display on the screen at the correct locations each time since its a repetitive process

eg: psuedo code in case i miss something

we denote a Card to be a Question with 4 answers
we also assume u have read the data in and its going to be fed into the function in this example but it is only one scenario.

function ShowCard(Q$,a1$,a2$,a3$,a4$)
text 10,10,Q$
text 10,30,a1$
text 10,50,a2$
text 10,70,a3$
text 10,90,a4$
endfunction

so in this mini example the function prints the information in a series of lines down the screen fromt he top left corner.



interaction

ok now your user could press a button via a mousepress or just press a key.

You should explore a trapping method so your keypress or mouseclick isnt rapid firing and therefore slowing down the whole thing and creating bugs in double click events etc..

explore the keystate command and look in the tutorials section or on the net for a scancodes graphic which shows the number that represents each key on the keyboard.

for example Right Alt key ( remember there are 2 keys of some and they require a number for each )
anyway the alt key on the right is 184

so we could use

if altkey()=1 then print "rapidfire"

or if keystate(184) = 1 then print "rapidfire"

I think its best u write down the theory and ideas like this then head over to www.dbheaven.com as it has many aspects talked about here like simple basics and a few neat tricks.
It will have some timer examples also and 2d display and interaction which is basically the shell of what u need.

good luck have fun !

indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 31st Jan 2003 18:56
i uploaded my flash prototype if u have the plugin in your browser click away

http://www.lunarpixel.com/temp/FQE_v1.swf

indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 31st Jan 2003 18:57
http://www.lunarpixel.com/temp/FQE_v1.swf

weird the link failed maybe its the swf extension

anyway cut n past this link if thats messy to read above

http://www.lunarpixel.com/temp/FQE_v1.swf

Scrooge
22
Years of Service
User Offline
Joined: 12th Dec 2002
Location: United Kingdom
Posted: 3rd Feb 2003 16:43
Thanks for the help Indi.

As I am a complete beginner didn't understand much of what you said. Gathered the gist I think. At least I know the program WILL design a quiz!

I will start to learn some of the tutorials. Have also ordered the new book from amazon. Hope I can follow it.

Cheers for the assistance. All thebest from England.

It's only humbug if you let it be so!
indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 3rd Feb 2003 21:12

Login to post a reply

Server time is: 2025-08-08 19:12:53
Your offset time is: 2025-08-08 19:12:53