Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jan 10th, 2006, 9:53 PM   #1
PhilBon
Hobbyist Programmer
 
PhilBon's Avatar
 
Join Date: Nov 2005
Posts: 172
Rep Power: 3 PhilBon is on a distinguished road
Send a message via AIM to PhilBon Send a message via MSN to PhilBon
Test Questions:

Hello Everyone! I have this big @$$ problem. I'm supposed to create a testing application via PHP and MySQL. Alright I have an idea for the table that contains all the answers and the Questions:
TestID, Q/A, Ref#, CorrectAnswer, value, Points
1, Q, 1, 0, How do you spell blue? 50
1, A, 1, 0, blu 0
1, A, 2, 0, ble 0
1, A, 3, 0, blw 0
1, A, 4, 1, blue 50
On The Website:
#1 How do you spell Blue?
A: blu
B. ble
C. Blw
D. blue

After Event:
Coeect Answer is D

Then when you have this for the grading:
TestID, UserID, Q#, A#, Correct, Points
1 34 1 4 1 50
Where the Correct 1 is True

if you guys need any more information let me know. Here is my site for it: http://esit.philbon.com/
PhilBon is offline   Reply With Quote
Old Jan 11th, 2006, 4:18 AM   #2
InfoGeek
Professional Programmer
 
InfoGeek's Avatar
 
Join Date: Jun 2005
Location: India, The great.
Posts: 435
Rep Power: 4 InfoGeek is on a distinguished road
So, what's the problem?
__________________
PFO - My daily dose of technology.
InfoGeek is offline   Reply With Quote
Old Jan 11th, 2006, 6:39 AM   #3
OpenLoop
Expert Programmer
 
OpenLoop's Avatar
 
Join Date: May 2005
Location: East Lansing, MI
Posts: 663
Rep Power: 4 OpenLoop is on a distinguished road
How about this: Create three tables.

Table1:Questions: TestID,QID,Question PK: TestID,QID
1,1,'How To spell Blue'
1,2,'What's 1 + 1'

Table2:Choices: QID,AID,Answer PK:QID,AID
1,1,'Blue'
1,2,'Blu'
1,3,'Ble'
1,4,'Blew'
2,1,'2'
2,2,'10'
2,3,'11'
2,4,'0'

Table3(Bridge):Correct Answers: QID,AID,Points PK:QID,AID
1,1,20
2,2,30
This way, your database will be more dynamic, you don't have to check if this is a Q or A, and it will be easier to maintain or add an answer or question in the future.
OpenLoop is offline   Reply With Quote
Old Jan 11th, 2006, 8:08 AM   #4
PhilBon
Hobbyist Programmer
 
PhilBon's Avatar
 
Join Date: Nov 2005
Posts: 172
Rep Power: 3 PhilBon is on a distinguished road
Send a message via AIM to PhilBon Send a message via MSN to PhilBon
Thanks OpenLoop. I was thinking about that last night, and Based on what you said it looks like that'll be the best way to go. If anyone has anymore ideas, let me know. If I don't use it in V0.1 I could probably use it in V0.5 or V 1.0.
PhilBon is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 11:24 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC