Help with coding, it's for work

Started on the old forum in March 2009 · view the original in the archive · old links redirect here

#exams-database #help-please-database #learn-it-on-demand #mysql-database

19 replies · 1,196 views · started 17 years ago · 1 min read

8 participants
Quintin Junior · 20 posts #1

I need urgent help.

See what I'm working on is a webiste for the students of the collage that i work on.

Now, I need to store 100+ exams in a database, with questions and answers, the student writes the exam online, mostly true & fals questions, then a b c or d questions.

After the students has written theyr exams, theyr resaults should display.

Someone maybe has an idea how i should do it?

Please help would be aprisiated.

I thought of a few stuff, but i'd prefer the database to be very compact, now i just want to know how you guys think i must do it.

header("location: hell.php");
GumSlone Administrator Principal · 1,690 posts #2

are the answers for exam questions in multiple choise form?

because if they are not then youll need a human to check if the answer is correct.

i would use a different tables for questions and the possible answers, and you should take a look at some other existing online exam forms, how they were done.

Advertise your mobile site for FREE with AdTwirl

External image (may be gone)

rukiya Lead · 569 posts #3

Both for true false and a b c d multiple choice question input correct answer in the database then check student's answer comparing with the database. publish the match result. Use radio button for choosing only one correct answer and checkbox for choosing multiple correct ansers in html form.

database table is like this

CREATE TABLE `answers` (
  `questionid` int(10) NOT NULL PRIMARY KEY,
  `answer` char(1) NOT NULL default '',
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
GumSlone Administrator Principal · 1,690 posts #4

questionid int(10) NOT NULL PRIMARY KEY,

Bad idea to use a primary key, because a question id can have more answers and if you have the table like this you can have only one answer to every question id

i would create tables like this

questions:

id (integer primary key auto increment) question (question text)

answers id (integer primary key auto increment) question_id (integer index) answer (possible answer text) correct (if answer is correct true else it should be false) points (number of points to give/substract for correct/incorrect answer)

Advertise your mobile site for FREE with AdTwirl

External image (may be gone)

GumSlone Administrator Principal · 1,690 posts #6

rukiya wrote: Ok then

CREATE TABLE `answers` ( 
  `id` int(10) NOT NULL auto_increment PRIMARY KEY,
  `questionid` int(10) NOT NULL , 
  `answer` char(1) NOT NULL default '', 
) ENGINE=MyISAM   AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; 

and how will you know if the answer is correct? you need to add additional row, eg. correct = true or correct = false

Advertise your mobile site for FREE with AdTwirl

External image (may be gone)

subzero Super moderator Fellow · 3,954 posts #7

Gum dont brofther to tech rukiya how to do things right lol he a noob bro:D

Visit: Chat4u.mobi - The New Lay Of being a site of your dreams! Visit: WapMasterz Coming Back Soon!


SCRIPTS FOR SALE BY SUBZERO Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders. FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others... _______…

subzero Super moderator Fellow · 3,954 posts #9

he going around thinks a big shot lol

Yeah we all where a leaner once but when it comes to newbies like him always thinks big

lol i also found a error with his sql but i keep to my self with this lol😊

Visit: Chat4u.mobi - The New Lay Of being a site of your dreams! Visit: WapMasterz Coming Back Soon!


SCRIPTS FOR SALE BY SUBZERO Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders. FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others... _______…

GumSlone Administrator Principal · 1,690 posts #10

subzero wrote: he going around thinks a big shot lol

Yeah we all where a leaner once but when it comes to newbies like him always thinks big

lol i also found a error with his sql but i keep to my self with this lol😊

the answer char(1)? 🙂 ok it should be text or varchar(255)

Advertise your mobile site for FREE with AdTwirl

External image (may be gone)

subzero Super moderator Fellow · 3,954 posts #11

Any over 100 it comes to auto text file in sql 😉

Visit: Chat4u.mobi - The New Lay Of being a site of your dreams! Visit: WapMasterz Coming Back Soon!


SCRIPTS FOR SALE BY SUBZERO Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders. FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others... _______…

rukiya Lead · 569 posts #12

GumSlone wrote: and how will you know if the answer is correct? you need to add additional row, eg. correct = true or correct = false

Gumslone Its easy like this

INSERT INTO answers VALUES (1,1,'0'); INSERT INTO answers VALUES (2,2,'a'); INSERT INTO answers VALUES (3,2,'c');

I would insert the correct answers only in the table.

if its true false answe then for true value=1 and false=0 question 1 student answered true=1 but in the table its false=0

question 2 student answered a,d but in the table its a,c

Its really a easy sql thing.

And subzero I know what type of stupid coding you know, noob,you 1st learn how to write english correctly.

GumSlone Administrator Principal · 1,690 posts #14

rukiya wrote: Gumslone Its easy like this

INSERT INTO answers VALUES (1,1,'0'); INSERT INTO answers VALUES (2,2,'a'); INSERT INTO answers VALUES (3,2,'c');

I would insert the correct answers only in the table.

if its true false answe then for true value=1 and false=0 question 1 student answered true=1 but in the table its false=0

question 2 student answered a,d but in the table its a,c

Its really a easy sql thing.

ok if you would do this way its your choice, but i wouldnt do it like this

Advertise your mobile site for FREE with AdTwirl

External image (may be gone)

Quintin Junior · 20 posts #15

GumSlone wrote: are the answers for exam questions in multiple choise form?

because if they are not then youll need a human to check if the answer is correct.

i would use a different tables for questions and the possible answers, and you should take a look at some other existing online exam forms, how they were done.

Yes it is multiple choise form gums

header("location: hell.php");
morse Senior · 364 posts #16

Quintin wrote: Yes it is multiple choise form gums

my humble noobie suggestion . look into waptrivia script of wapdesire. edit it according to your needs and use it !

tinyurl.com/earnbymobile Easy earning for Indians

Alternative mobile advertising network .. Minimum 100 USD pay / NET15 pay cycle, Good Brand, Best targeting for Android goo.gl/6vub3

kenxyz Junior · 13 posts #17

hi all i downloaded the lavalair script and i dont know the files there that has to do wit the database Pls i need help. If any one can give me a little guide on how to go about the database in my control panel in http://freehostia.com . Thanks to all.

kenxyz Junior · 13 posts #18

please am waitin someone should help

manavworld Developer · 118 posts #19

i will try for avoid mistakes. Am realy very sorry for flooding here.

ranzit2 Developer · 187 posts #20

manavworld wrote: Hello friends can u help me.... I knw how to coding/editing xhtml page....i search all pages from file ligency,home directory/public_html/document etc.... but can u tell me hw i can search wml pages and where i can get that pages....if in file manager, hw i can search all pages

why flooding here.u had time topic for this i think.,

she is beautifull than php.and i love her more than php.

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close