Skip to main content
June 17, 2008
Question

Creating Simple Quiz/test application.

  • June 17, 2008
  • 3 replies
  • 631 views
Greetings

I have attempted to develop an online quiz/test application using a simple form and CF to count the score (T/F, Mult-Choice & some Matching)- time started, time ended, etc output to a DB for later review by admins.

A test-taker logs in, they fill out their name, emp. num. & position on the form.

When they hit a "go to test" button, it launches the test/quiz and at the same time creates a their record which includes a hidden date and time field, in the DB.

Once they finish taking the quiz, they hit the complete button which, in theory, allows them to see their score (pass-fail) and sends the number correct and the time they finished to their record.

I tried this several months ago and got hung up on how to add up and store the score of 50-question tests in a field but also track which questions were answered incorrectly most often and other more granular data.

Also, keep the correct response to the questions out of the view of "view source" for the more astute test-takers.

Thanks for any advice.

newportri

This topic has been closed for replies.

3 replies

June 17, 2008
Sorry- just forgot to add that in the tests I began developing, the questions and answers were simply displayed on the form (irrelevant to the scoring mechanism) and it was the math functions used to add up the number of correctly answered to send to each persond record is what I was having a problem with.

Thanks again
Inspiring
June 17, 2008
quote:

Originally posted by: newportri
Sorry- just forgot to add that in the tests I began developing, the questions and answers were simply displayed on the form (irrelevant to the scoring mechanism) and it was the math functions used to add up the number of correctly answered to send to each persond record is what I was having a problem with.

Thanks again

Somewhere I had an is_correct field. If you make it numeric and assign it values of 1 for right and 0 for wrong the only math function you need is sum().
June 17, 2008
Dan:

This is very helpful- thanks- I don't think I would have arrived at this design by trial and error...

I think I understand how this would work.

If you could take a split sec to see:

http://www.testandlearn.net/newtest/relations_test.html

if the relationships are correct as you suggested?

As an example, I would create quiz_id #1- the fifty questions and all the the possible answers would populate the question and answer tables, the question_answer relates correct answers to each question, the quiz_question table dictates which questions go with which quiz(?), and the employee_quiz table collects the number correct(?).

Dawn will soon break on Marblehead- which is about 70 miles north of here.

Inspiring
June 17, 2008
I would do something like this.

table employee
employee_id (pk)
name
etc

table quiz
quiz_id (pk)
etc


table question
question_id (pk)
question_text

table answer
answer_id (pk)
answer_text

table question_answer (many to many)
question_id (pk, fk)
answer_id (pk, fk)
is_correct

table quiz_question (many to many)
quiz_id (pk, fk)
question_id (pk, fk)
question_number (pk)

table employee_quiz (many to many)
employee_id (pk, fk)
quiz_id (pk, fk)
attempt_number (pk)
start_dt
finish_dt

table employee_selected_answer (many to many)
employee_id (pk, fk)
quiz_id (pk, fk)
question_number (pk, fk)
answer_id (fk)